fixed small flags on phones

This commit is contained in:
Benni Heiss
2019-03-26 11:49:58 +01:00
parent 71ca7a0b34
commit e69dc5e912
2 changed files with 24 additions and 20 deletions

View File

@@ -26,7 +26,7 @@ class _MyAppState extends State<MyApp> {
onChanged: print, onChanged: print,
// Initial selection and favorite can be one of code ('IT') OR dial_code('+39') // Initial selection and favorite can be one of code ('IT') OR dial_code('+39')
initialSelection: 'IT', initialSelection: 'IT',
// showCountryOnly: true, showCountryOnly: true,
favorite: ['+39', 'FR']), favorite: ['+39', 'FR']),
))); )));
} }

View File

@@ -59,28 +59,32 @@ class _SelectionDialogState extends State<SelectionDialog> {
.toList())); .toList()));
Widget _buildOption(CountryCode e) { Widget _buildOption(CountryCode e) {
return Flex( return Container(
direction: Axis.horizontal, width: 400,
children: <Widget>[ child: Flex(
Flexible( direction: Axis.horizontal,
child: Padding( children: <Widget>[
padding: const EdgeInsets.only(right: 16.0), Flexible(
child: Image.asset( child: Padding(
e.flagUri, padding: const EdgeInsets.only(right: 16.0),
package: 'country_code_picker', child: Image.asset(
width: 32.0, e.flagUri,
package: 'country_code_picker',
width: 32.0,
),
), ),
), ),
), Expanded(
Flexible( flex: 4,
flex: 10, child: Text(
fit: FlexFit.tight, widget.showCountryOnly
child: Text( ? e.toCountryStringOnly()
widget.showCountryOnly ? e.toCountryStringOnly() : e.toLongString(), : e.toLongString(),
overflow: TextOverflow.fade, overflow: TextOverflow.fade,
),
), ),
), ],
], ),
); );
} }