From 5ca442493365f2d425c9eeff22b5d37759709259 Mon Sep 17 00:00:00 2001 From: Yegor Vialov Date: Tue, 16 Oct 2018 23:30:17 +0300 Subject: [PATCH] Fix dropdown width --- lib/entity_class/stateless_widgets.dart | 38 ++++++++++++++++--------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/lib/entity_class/stateless_widgets.dart b/lib/entity_class/stateless_widgets.dart index 21adbd4..55498d9 100644 --- a/lib/entity_class/stateless_widgets.dart +++ b/lib/entity_class/stateless_widgets.dart @@ -682,20 +682,30 @@ class ModeSelectorWidget extends StatelessWidget { Text("$caption", style: TextStyle( fontSize: captionFontSize ?? Entity.stateFontSize )), - DropdownButton( - value: "$value", - iconSize: 30.0, - style: TextStyle( - fontSize: valueFontSize ?? Entity.largeFontSize, - color: Colors.black, - ), - items: options.map((String value) { - return new DropdownMenuItem( - value: value, - child: new Text(value), - ); - }).toList(), - onChanged: (mode) => onChange(mode), + Row( + children: [ + Expanded( + child: ButtonTheme( + alignedDropdown: true, + child: DropdownButton( + value: "$value", + iconSize: 30.0, + isExpanded: true, + style: TextStyle( + fontSize: valueFontSize ?? Entity.largeFontSize, + color: Colors.black, + ), + items: options.map((String value) { + return new DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + onChanged: (mode) => onChange(mode), + ), + ), + ) + ], ), Container(height: bottomPadding ?? Entity.rowPadding,) ],