Refs #6: use flag library
This commit is contained in:
@@ -36,7 +36,28 @@ class _SelectionDialogState extends State<SelectionDialog> {
|
||||
children: <Widget>[]
|
||||
..addAll(widget.favoriteElements.map((f) {
|
||||
return new SimpleDialogOption(
|
||||
child: new Text(f.toLongString()),
|
||||
child: Flex(
|
||||
direction: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 16.0),
|
||||
child: Image.asset(
|
||||
f.flagUri,
|
||||
package: 'country_icons',
|
||||
width: 32.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
fit: FlexFit.tight,
|
||||
child: new Text(
|
||||
f.toLongString(),
|
||||
overflow: TextOverflow.fade,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
onPressed: () {
|
||||
_selectItem(f);
|
||||
});
|
||||
@@ -44,7 +65,28 @@ class _SelectionDialogState extends State<SelectionDialog> {
|
||||
..add(new Divider())),
|
||||
]..addAll(showedElements
|
||||
.map((e) => new SimpleDialogOption(
|
||||
child: new Text(e.toLongString()),
|
||||
child: Flex(
|
||||
direction: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 16.0),
|
||||
child: Image.asset(
|
||||
e.flagUri,
|
||||
package: 'country_icons',
|
||||
width: 32.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
fit: FlexFit.tight,
|
||||
child: Text(
|
||||
e.toLongString(),
|
||||
overflow: TextOverflow.fade,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
onPressed: () {
|
||||
_selectItem(e);
|
||||
}))
|
||||
@@ -60,10 +102,7 @@ class _SelectionDialogState extends State<SelectionDialog> {
|
||||
s = s.toUpperCase();
|
||||
setState(() {
|
||||
showedElements = widget.elements
|
||||
.where((e) =>
|
||||
e.code.contains(s) ||
|
||||
e.dialCode.contains(s) ||
|
||||
e.name.toUpperCase().contains(s))
|
||||
.where((e) => e.code.contains(s) || e.dialCode.contains(s) || e.name.toUpperCase().contains(s))
|
||||
.toList();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user