mirror of
https://github.com/flutter/samples.git
synced 2026-05-09 16:37:30 +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:
@@ -185,7 +185,6 @@ class _SettingsListItemState<T> extends State<SettingsListItem<T>>
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
_handleExpansion();
|
_handleExpansion();
|
||||||
final closed = !widget.isExpanded && _controller.isDismissed;
|
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
|
||||||
final optionsList = <Widget>[];
|
final optionsList = <Widget>[];
|
||||||
@@ -227,25 +226,23 @@ class _SettingsListItemState<T> extends State<SettingsListItem<T>>
|
|||||||
return AnimatedBuilder(
|
return AnimatedBuilder(
|
||||||
animation: _controller.view,
|
animation: _controller.view,
|
||||||
builder: _buildHeaderWithChildren,
|
builder: _buildHeaderWithChildren,
|
||||||
child: closed
|
child: Container(
|
||||||
? null
|
margin: const EdgeInsetsDirectional.only(start: 24, bottom: 40),
|
||||||
: Container(
|
decoration: BoxDecoration(
|
||||||
margin: const EdgeInsetsDirectional.only(start: 24, bottom: 40),
|
border: BorderDirectional(
|
||||||
decoration: BoxDecoration(
|
start: BorderSide(
|
||||||
border: BorderDirectional(
|
width: 2,
|
||||||
start: BorderSide(
|
color: theme.colorScheme.background,
|
||||||
width: 2,
|
|
||||||
color: theme.colorScheme.background,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: ListView.builder(
|
|
||||||
shrinkWrap: true,
|
|
||||||
physics: NeverScrollableScrollPhysics(),
|
|
||||||
itemBuilder: (context, index) => optionsList[index],
|
|
||||||
itemCount: optionsList.length,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: ListView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
itemBuilder: (context, index) => optionsList[index],
|
||||||
|
itemCount: optionsList.length,
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user