Created
December 17, 2019 18:10
-
-
Save ananevam/a05ff2174639b3d87e355096cc75e9c6 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
import 'package:flutter/cupertino.dart'; | |
main() => runApp(new CupertinoApp( | |
home: HomeScreen() | |
) | |
); | |
class HomeScreen extends StatelessWidget { | |
Widget get _list { | |
return GridView.count( | |
scrollDirection: Axis.horizontal, | |
physics: AlwaysScrollableScrollPhysics(), | |
shrinkWrap: true, | |
crossAxisCount: 2, | |
children: List<String>.generate(100, (i) => "Item $i") | |
.map((item) => Column(children: [ | |
Container( | |
width: 100, | |
height: 100, | |
color: CupertinoColors.destructiveRed), | |
Text(item), | |
])) | |
.toList(), | |
); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return CupertinoPageScaffold( | |
//navigationBar: CupertinoNavigationBar(middle: Text("Welcome")), | |
child: _list); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment