From 57d5de8459a0d1ec9309a40431002dae8d004fba Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Wed, 30 Nov 2016 09:52:54 -0800 Subject: [PATCH] Fix label text wrapping in expansion panels gallery demo (#7103) --- .../lib/demo/expansion_panels_demo.dart | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/examples/flutter_gallery/lib/demo/expansion_panels_demo.dart b/examples/flutter_gallery/lib/demo/expansion_panels_demo.dart index c80536dc5d..7661fbd59b 100644 --- a/examples/flutter_gallery/lib/demo/expansion_panels_demo.dart +++ b/examples/flutter_gallery/lib/demo/expansion_panels_demo.dart @@ -49,8 +49,15 @@ class DualHeaderWithHint extends StatelessWidget { flex: 2, child: new Container( margin: const EdgeInsets.only(left: 24.0), - child: new Text(name, style: textTheme.body1.copyWith(fontSize: 15.0)) - ) + child: new FittedBox( + fit: ImageFit.scaleDown, + alignment: FractionalOffset.centerLeft, + child: new Text( + name, + style: textTheme.body1.copyWith(fontSize: 15.0), + ), + ), + ), ), new Expanded( flex: 3, @@ -178,7 +185,7 @@ class _ExpansionPanelsDemoState extends State { _demoItems = >[ new DemoItem( - name: 'Trip name', + name: 'Trip', value: 'Caribbean cruise', hint: 'Change trip name', valueToString: (String value) => value, @@ -282,9 +289,9 @@ class _ExpansionPanelsDemoState extends State { } ), new DemoItem( - name: 'Sun amount', + name: 'Sun', value: 80.0, - hint: 'Select amount of sun', + hint: 'Select sun level', valueToString: (double amount) => '${amount.round()}', builder: (DemoItem item) { // ignore: argument_type_not_assignable, https://github.com/flutter/flutter/issues/5771 void close() {