1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- import 'package:flutter/material.dart';
- class HomePage extends StatefulWidget {
- const HomePage({super.key});
- @override
- State<HomePage> createState() => _HomePageState();
- }
- class _HomePageState extends State<HomePage> {
- // bool _isVisible = true;
- final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
- @override
- void initState() {
- super.initState();
- WidgetsBinding.instance.addPostFrameCallback((_) {
- _scaffoldKey.currentState?.openDrawer();
- });
- }
- void _closeDrawer() {
- Navigator.of(context).pop();
- }
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- key: _scaffoldKey,
- appBar: AppBar(
- title: Text("utils"),
- // leading: IconButton(
- // icon: Icon(Icons.menu),
- // onPressed: () {
- // _scaffoldKey.currentState?.openDrawer();
- // },
- // ),
- ),
- drawer: Container(
- width: 70.0,
- child: Drawer(
- child: ListView(
- padding: EdgeInsets.zero,
- children: <Widget>[
- ListTile(
- leading: Image.asset('email.png', height: 24, width: 24),
- onTap: () {
- // Handle email tap
- // Navigator.of(context).pop(); // Close the drawer
- print("email");
- },
- ),
- ListTile(
- leading: Image.asset('contact-book.png', height: 24, width: 24),
- onTap: () {
- print("contact");
- // Handle contact tap
- // Navigator.of(context).pop(); // Close the drawer
- },
- ),
- ListTile(
- leading:
- Image.asset('communications.png', height: 24, width: 24),
- onTap: () {
- // Handle calendar tap
- // Navigator.of(context).pop(); // Close the drawer
- print("communications");
- },
- ),
- ListTile(
- leading: Image.asset('back.png', height: 24, width: 24),
- onTap: () {
- // Handle tasks tap
- // Navigator.of(context).pop(); // Close the drawer
- _closeDrawer();
- },
- ),
- ],
- ),
- ),
- ),
- );
- }
- }
|