Unverified Commit 97e58ecb authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Make expansion panel have a minHeight instead (#18623)

parent fb8cbf21
...@@ -143,8 +143,8 @@ class ExpansionPanelList extends StatelessWidget { ...@@ -143,8 +143,8 @@ class ExpansionPanelList extends StatelessWidget {
duration: animationDuration, duration: animationDuration,
curve: Curves.fastOutSlowIn, curve: Curves.fastOutSlowIn,
margin: _isChildExpanded(index) ? kExpandedEdgeInsets : EdgeInsets.zero, margin: _isChildExpanded(index) ? kExpandedEdgeInsets : EdgeInsets.zero,
child: new SizedBox( child: new ConstrainedBox(
height: _kPanelHeaderCollapsedHeight, constraints: const BoxConstraints(minHeight: _kPanelHeaderCollapsedHeight),
child: children[index].headerBuilder( child: children[index].headerBuilder(
context, context,
children[index].isExpanded, children[index].isExpanded,
......
...@@ -126,17 +126,25 @@ void main() { ...@@ -126,17 +126,25 @@ void main() {
animationDuration: kSizeAnimationDuration, animationDuration: kSizeAnimationDuration,
children: <ExpansionPanel>[ children: <ExpansionPanel>[
new ExpansionPanel( new ExpansionPanel(
headerBuilder: (BuildContext context, bool isExpanded) => const Placeholder(), headerBuilder: (BuildContext context, bool isExpanded) => const Placeholder(
body: const SizedBox(height: 100.0, child: const Placeholder()), fallbackHeight: 12.0,
),
body: const SizedBox(height: 100.0, child: const Placeholder(
fallbackHeight: 12.0,
)),
isExpanded: a, isExpanded: a,
), ),
new ExpansionPanel( new ExpansionPanel(
headerBuilder: (BuildContext context, bool isExpanded) => const Placeholder(), headerBuilder: (BuildContext context, bool isExpanded) => const Placeholder(
fallbackHeight: 12.0,
),
body: const SizedBox(height: 100.0, child: const Placeholder()), body: const SizedBox(height: 100.0, child: const Placeholder()),
isExpanded: b, isExpanded: b,
), ),
new ExpansionPanel( new ExpansionPanel(
headerBuilder: (BuildContext context, bool isExpanded) => const Placeholder(), headerBuilder: (BuildContext context, bool isExpanded) => const Placeholder(
fallbackHeight: 12.0,
),
body: const SizedBox(height: 100.0, child: const Placeholder()), body: const SizedBox(height: 100.0, child: const Placeholder()),
isExpanded: c, isExpanded: c,
), ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment