Skip to content

Commit

Permalink
Don't remove SettingsListItem content from tree (flutter#259)
Browse files Browse the repository at this point in the history
* Don't remove SettingsListItem content from tree

* Remove unused variable


Former-commit-id: 8f32cdf
  • Loading branch information
guidezpl authored Jan 27, 2020
1 parent 7136c52 commit 6eeb800
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions gallery/lib/pages/settings_list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ class _SettingsListItemState<T> extends State<SettingsListItem<T>>
@override
Widget build(BuildContext context) {
_handleExpansion();
final closed = !widget.isExpanded && _controller.isDismissed;
final theme = Theme.of(context);

final optionsList = <Widget>[];
Expand Down Expand Up @@ -227,25 +226,23 @@ class _SettingsListItemState<T> extends State<SettingsListItem<T>>
return AnimatedBuilder(
animation: _controller.view,
builder: _buildHeaderWithChildren,
child: closed
? null
: Container(
margin: const EdgeInsetsDirectional.only(start: 24, bottom: 40),
decoration: BoxDecoration(
border: BorderDirectional(
start: BorderSide(
width: 2,
color: theme.colorScheme.background,
),
),
),
child: ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => optionsList[index],
itemCount: optionsList.length,
),
child: Container(
margin: const EdgeInsetsDirectional.only(start: 24, bottom: 40),
decoration: BoxDecoration(
border: BorderDirectional(
start: BorderSide(
width: 2,
color: theme.colorScheme.background,
),
),
),
child: ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => optionsList[index],
itemCount: optionsList.length,
),
),
);
}
}
Expand Down

0 comments on commit 6eeb800

Please sign in to comment.