@override
Widget build(BuildContext context){
return new Scaffold(
appBar: _isSearching ? buildSearchBar() : buildAppBar(),//new AppBar(title: new Text('Choose a country')),
body: new ListView.builder(
padding: new EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 20.0),
itemCount: Countries.length,
itemBuilder: (BuildContext context, int index) {
return new Container(
child: new Material(
child: new InkWell(
onTap: (){
// print(new Text('${Countries[index].dialCode}'));
Navigator.of(context).pop('${Countries[index].name},${Countries[index].dialCode}');
},
child: new Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Expanded(
flex: 10,
child: new Padding(
padding: new EdgeInsets.fromLTRB(20.0, 12.0, 0.0, 12.0),
child: new Text(
'${Countries[index].name}',
style: new TextStyle(
fontSize: 14.9,
color: Colors.grey[800]
),
),
),
),
//
new Expanded(
flex: 3,
child: new Padding(
padding: new EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0),
child: new Text(
'${Countries[index].dialCode}',
style: new TextStyle(
fontSize: 14.9,
color: Colors.pink[700]
),
),
),
),
],
),
),
),
);
},
),
backgroundColor: Colors.white,
);
}