Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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")
- )
- ],
- )
- );
- },
- );
- }
- ),
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement