Skip to content

Instantly share code, notes, and snippets.

@alamsyahh15
Created September 23, 2019 14:50
Show Gist options
  • Save alamsyahh15/e5b2f591047a20de9ffbf2d0f59eb418 to your computer and use it in GitHub Desktop.
Save alamsyahh15/e5b2f591047a20de9ffbf2d0f59eb418 to your computer and use it in GitHub Desktop.
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