Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- class HomeScreen extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: "MaisSync",
- centerTitle: true,
- ),
- drawer: CustomDrawer(),
- body: Center(
- child: DetailsWidget(),
- ),
- );
- }
- }
- class CustomDrawer extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Drawer(
- child: Column(
- children: <Widget>[
- DrawerHeader(
- child: Image.asset(
- "images/logo.png",
- width: 180,
- ),
- ),
- DrawerItem(
- text: "Início",
- icon: Icons.home,
- onTap: () {
- Navigator.of(context).push(
- MaterialPageRoute(builder: (context) => HomeScreen()),
- );
- },
- ),
- DrawerItem(
- text: "Configurações",
- icon: Icons.settings,
- onTap: () {
- Navigator.of(context).push(
- MaterialPageRoute(builder: (context) => SetupScreen()),
- );
- },
- ),
- DrawerItem(
- text: "LOGs",
- icon: Icons.insert_drive_file,
- onTap: () {
- Navigator.of(context).push(
- MaterialPageRoute(builder: (context) => LogScreen()),
- );
- },
- ),
- ],
- ),
- );
- }
- }
- class DrawerItem extends StatelessWidget {
- final String text;
- final IconData icon;
- final Function onTap;
- const DrawerItem({
- Key key,
- this.text,
- this.icon,
- this.onTap,
- }) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return InkWell(
- onTap: onTap,
- child: ListTile(
- leading: Icon(icon, color: Colors.grey[800]),
- title: Text(
- text,
- style: TextStyle(
- color: Colors.grey[800],
- ),
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement