Last active
April 10, 2019 03:03
-
-
Save vizioners/9b4f6ebd1e7d1f44ab04da24fd8d915d to your computer and use it in GitHub Desktop.
gird view demo
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
new GridView.builder( | |
itemCount: 5, | |
gridDelegate: | |
new SliverGridDelegateWithFixedCrossAxisCount( | |
crossAxisCount: 3), | |
itemBuilder: (BuildContext context, int index) { | |
return new GestureDetector( | |
child: new Card( | |
elevation: 5.0, | |
child: new Container( | |
alignment: Alignment.center, | |
child: new Text('Item $index'), | |
), | |
), | |
onTap: () { | |
showDialog( | |
context: context, | |
barrierDismissible: false, | |
child: new CupertinoAlertDialog( | |
title: new Column( | |
children: <Widget>[ | |
new Text("Girdview"), | |
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