Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. Widget build(BuildContext context) {
  2. return Scaffold(
  3. appBar: AppBar(
  4. title: Text(widget.title),
  5. ),
  6. body: new ListView.builder(
  7. itemCount: 50,
  8. itemBuilder: (BuildContext context, int index) {
  9. return new GestureDetector(
  10. child: new ListTile(
  11. title: new Card(
  12. elevation: 5.0,
  13. child: new Container(
  14. alignment: Alignment.center,
  15. margin: new EdgeInsets.only(top: 10.0, bottom: 10.0),
  16. child: new Text("ListItem $index"),
  17. ),
  18. )
  19. ),
  20. onTap: () {
  21. showDialog(
  22. context: context,
  23. barrierDismissible: false,
  24. child: new CupertinoAlertDialog(
  25. title: new Column(
  26. children: <Widget>[
  27. new Text("Listview"),
  28. new Icon(
  29. Icons.favorite,
  30. color: Colors.green,
  31. )
  32. ],
  33. ),
  34. content: new Text("Selected Item $index"),
  35. actions: <Widget>[
  36. new FlatButton(onPressed: () {
  37. Navigator.of(context).pop();
  38. },
  39. child: new Text("OK")
  40. )
  41. ],
  42. )
  43. );
  44. },
  45. );
  46. }
  47. ),
  48. );
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement