Skip to content

Commit

Permalink
DRYing up the expand collapse prompt code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Iiro Krankka committed Jun 10, 2018
1 parent 4d7f13b commit 4e09b2d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/ui/event_details/storyline_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ class _StorylineWidgetState extends State<StorylineWidget> {
];

if (_isExpandable) {
content.add(_buildExpandCollapsePrompt());
content.add(Padding(
padding: const EdgeInsets.only(left: 4.0),
child: _buildExpandCollapsePrompt(),
));
}

return Row(
Expand All @@ -55,16 +58,10 @@ class _StorylineWidgetState extends State<StorylineWidget> {
);

if (_isExpanded) {
return const Padding(
padding: const EdgeInsets.only(left: 4.0),
child: const Text('[touch to collapse]', style: captionStyle),
);
return const Text('[touch to collapse]', style: captionStyle);
}

return const Padding(
padding: const EdgeInsets.only(left: 4.0),
child: const Text('[touch to expand]', style: captionStyle),
);
return const Text('[touch to expand]', style: captionStyle);
}

Widget _buildContent() {
Expand Down

0 comments on commit 4e09b2d

Please sign in to comment.