Skip to content

Instantly share code, notes, and snippets.

@vizioners
Last active April 12, 2019 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vizioners/10e6ae106ec38ecb1b6fd68a2bed2757 to your computer and use it in GitHub Desktop.
Save vizioners/10e6ae106ec38ecb1b6fd68a2bed2757 to your computer and use it in GitHub Desktop.
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