Make expansion panel have a minHeight instead (#18623)

This commit is contained in:
Jonah Williams 2018-06-20 15:15:03 -07:00 committed by GitHub
parent fb8cbf216b
commit 97e58ecb2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View File

@ -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,

View File

@ -126,17 +126,25 @@ void main() {
animationDuration: kSizeAnimationDuration,
children: <ExpansionPanel>[
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,
),