Commit 6034f06c authored by Meghana Mahadasyam's avatar Meghana Mahadasyam

Add new file

parent 8919a3a6
import 'package:flutter/material.dart';
class Category extends StatefulWidget {
@override
_CategoryState createState() => _CategoryState();
}
class _CategoryState extends State<Category> {
List<String> category = [
'First Floor',
'Second Floor',
'Third Floor',
'Fourth Floor',
'Dashboard',
'Fifth floor',
'Login',
'Sixth Floor',
'AddLater'
];
GlobalKey<ScaffoldState> _key = new GlobalKey();
int row = 2;
@override
Widget build(BuildContext context) {
return Scaffold(
key: _key,
appBar: new AppBar(
title: new Text('Category'),
),
body: new GridView.count(
crossAxisCount: row,
childAspectRatio: 3.0 / row,
children: new List<Widget>.generate(
category.length,
(index) {
return new GridTile(
child: InkWell(
child: new Card(
color: Colors.purple[700 - (100 * (index % 5))],
child: new Center(
child: new Text(
category[index],
style: TextStyle(fontSize: 18.0, color: Colors.white),
),
),
),
onTap: () {
Navigator.pushNamed(context, '/${category[index]}');
},
),
);
},
),
),
);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment