Created
September 23, 2019 14:50
-
-
Save alamsyahh15/e5b2f591047a20de9ffbf2d0f59eb418 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/material.dart'; | |
class PageSimpleGrid extends StatelessWidget { | |
const PageSimpleGrid({Key key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Simple Grid View'), | |
backgroundColor: Colors.amber, | |
), | |
body: GridView.count(crossAxisCount: 3, | |
children: List.generate(15, (index){ | |
int nIndex = index+1; | |
String dataIndex = "$nIndex"; | |
return Center( | |
child:Container( | |
margin: EdgeInsets.all(10), | |
color: Colors.amber, | |
height: 100.0, | |
width: 100.0, | |
child: Text( | |
'Data Ke - $dataIndex', style: Theme.of(context).textTheme.headline, | |
), | |
), | |
); | |
}), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment