1
0
mirror of https://github.com/flutter/samples.git synced 2026-03-24 13:22:01 +00:00

Don't remove SettingsListItem content from tree (#259)

* Don't remove SettingsListItem content from tree

* Remove unused variable
This commit is contained in:
Pierre-Louis
2020-01-27 14:29:28 +01:00
committed by GitHub
parent b04fbf7292
commit 82aad81c34

View File

@@ -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>[];
@@ -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,
),
),
);
}
}