import 'package:flutter/material.dart'; class HomePage extends StatefulWidget { const HomePage({super.key}); @override State createState() => _HomePageState(); } class _HomePageState extends State { // bool _isVisible = true; final GlobalKey _scaffoldKey = GlobalKey(); @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: [ 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(); }, ), ], ), ), ), ); } }