Skip to content

Instantly share code, notes, and snippets.

@Geeky-star
Created July 6, 2020 15:16
Show Gist options
  • Save Geeky-star/2310c00b809807fa0bf5bb0efdb29f5c to your computer and use it in GitHub Desktop.
Save Geeky-star/2310c00b809807fa0bf5bb0efdb29f5c to your computer and use it in GitHub Desktop.
Button_and_Menubar
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: MyWidget(),
),
);
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: NavDrawer(),
appBar: AppBar(
title: Text("First Application")),
body: Center(
child: RaisedButton(
color: Colors.blue[700],
child: Text("Click Me", style: TextStyle(color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold)),
onPressed: (){}),
),
);
}
}
class NavDrawer extends StatelessWidget{
@override
Widget build(BuildContext context){
return Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
child: Text("My Account", style: TextStyle(color: Colors.white, fontSize: 25)),
decoration: BoxDecoration(
color: Colors.blue[800],
),
),
ListTile(
leading: Icon(Icons.input),
title: Text('Welcome'),
onTap:()=>{}
),
ListTile(
leading: Icon(Icons.verified_user),
title: Text("Profile"),
onTap: ()=>{Navigator.of(context).pop()},
),
ListTile(
leading: Icon(Icons.settings),
title: Text("Settings"),
),
ListTile(
leading: Icon(Icons.border_color),
title: Text("Feedback"),
),
ListTile(
leading: Icon(Icons.exit_to_app),
title: Text("Exit"),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment