Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- import 'package:google_fonts/google_fonts.dart';
- class GridDashboard extends StatelessWidget {
- Items item1 = new Items(
- title: "App update checker",
- subtitle: "",
- event: "",
- img: "assets/update.ico");
- Items item2 = new Items(
- title: "Update Forms",
- subtitle: "",
- event: "",
- img: "assets/food.png",
- );
- Items item3 = new Items(
- title: "Forms",
- subtitle: "",
- event: "",
- img: "assets/todo.png",
- );
- Items item4 = new Items(
- title: "Supervisor",
- subtitle: "",
- event: "",
- img: "assets/festival.png",
- );
- Items item5 = new Items(
- title: "Settings",
- subtitle: "",
- event: "",
- img: "assets/setting.png",
- );
- Items item6 = new Items(
- title: "Logout",
- subtitle: "",
- event: "",
- img: "assets/logout.png",
- );
- @override
- Widget build(BuildContext context) {
- List<Items> myList = [item1, item2, item3, item4, item5, item6];
- var color = 0xff453658;
- return Flexible(
- child: GridView.count(
- childAspectRatio: 1.0,
- padding: EdgeInsets.only(left: 16, right: 12),
- crossAxisCount: 2,
- crossAxisSpacing: 18,
- mainAxisSpacing: 18,
- children: myList.map((data) {
- return Container(
- decoration: BoxDecoration(
- color: Color(color), borderRadius: BorderRadius.circular(10)),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- Image.asset(
- data.img,
- width: 42,
- ),
- SizedBox(
- height: 14,
- ),
- Text(
- data.title,
- style: GoogleFonts.openSans(
- textStyle: TextStyle(
- color: Colors.white,
- fontSize: 16,
- fontWeight: FontWeight.w600)),
- ),
- SizedBox(
- height: 8,
- ),
- Text(
- data.subtitle,
- style: GoogleFonts.openSans(
- textStyle: TextStyle(
- color: Colors.white38,
- fontSize: 10,
- fontWeight: FontWeight.w600)),
- ),
- SizedBox(
- height: 14,
- ),
- Text(
- data.event,
- style: GoogleFonts.openSans(
- textStyle: TextStyle(
- color: Colors.white70,
- fontSize: 11,
- fontWeight: FontWeight.w600)),
- ),
- ],
- ),
- );
- }).toList()),
- );
- }
- }
- class Items {
- String title;
- String subtitle;
- String event;
- String img;
- Items({this.title, this.subtitle, this.event, this.img});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement