Last active
April 12, 2019 15:50
-
-
Save vizioners/10e6ae106ec38ecb1b6fd68a2bed2757 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text(widget.title), | |
), | |
body: new ListView.builder( | |
itemCount: 50, | |
itemBuilder: (BuildContext context, int index) { | |
return new GestureDetector( | |
child: new ListTile( | |
title: new Card( | |
elevation: 5.0, | |
child: new Container( | |
alignment: Alignment.center, | |
margin: new EdgeInsets.only(top: 10.0, bottom: 10.0), | |
child: new Text("ListItem $index"), | |
), | |
) | |
), | |
onTap: () { | |
showDialog( | |
context: context, | |
barrierDismissible: false, | |
child: new CupertinoAlertDialog( | |
title: new Column( | |
children: <Widget>[ | |
new Text("Listview"), | |
new Icon( | |
Icons.favorite, | |
color: Colors.green, | |
) | |
], | |
), | |
content: new Text("Selected Item $index"), | |
actions: <Widget>[ | |
new FlatButton(onPressed: () { | |
Navigator.of(context).pop(); | |
}, | |
child: new Text("OK") | |
) | |
], | |
) | |
); | |
}, | |
); | |
} | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment