hym_ui/lib/home_page.dart
2024-07-24 22:12:20 -04:00

87 lines
2.3 KiB
Dart

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();
},
),
],
),
),
),
);
}
}