diff --git a/packages/flutter/lib/src/material/expansion_panel.dart b/packages/flutter/lib/src/material/expansion_panel.dart index cc46150c08..1a29208e48 100644 --- a/packages/flutter/lib/src/material/expansion_panel.dart +++ b/packages/flutter/lib/src/material/expansion_panel.dart @@ -143,8 +143,8 @@ class ExpansionPanelList extends StatelessWidget { duration: animationDuration, curve: Curves.fastOutSlowIn, margin: _isChildExpanded(index) ? kExpandedEdgeInsets : EdgeInsets.zero, - child: new SizedBox( - height: _kPanelHeaderCollapsedHeight, + child: new ConstrainedBox( + constraints: const BoxConstraints(minHeight: _kPanelHeaderCollapsedHeight), child: children[index].headerBuilder( context, children[index].isExpanded, diff --git a/packages/flutter/test/material/expansion_panel_test.dart b/packages/flutter/test/material/expansion_panel_test.dart index cc88bd6c4c..d65937d07b 100644 --- a/packages/flutter/test/material/expansion_panel_test.dart +++ b/packages/flutter/test/material/expansion_panel_test.dart @@ -126,17 +126,25 @@ void main() { animationDuration: kSizeAnimationDuration, children: [ new ExpansionPanel( - headerBuilder: (BuildContext context, bool isExpanded) => const Placeholder(), - body: const SizedBox(height: 100.0, child: const Placeholder()), + headerBuilder: (BuildContext context, bool isExpanded) => const Placeholder( + fallbackHeight: 12.0, + ), + body: const SizedBox(height: 100.0, child: const Placeholder( + fallbackHeight: 12.0, + )), isExpanded: a, ), 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()), isExpanded: b, ), 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()), isExpanded: c, ),