You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
2.4 KiB
Dart
77 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:mohem_flutter_app/config/routes.dart';
|
|
import 'package:mohem_flutter_app/ui/landing/widget/drawer_item.dart';
|
|
|
|
class AppDrawer extends StatefulWidget {
|
|
@override
|
|
_AppDrawerState createState() => _AppDrawerState();
|
|
}
|
|
|
|
class _AppDrawerState extends State<AppDrawer> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
color: Colors.white,
|
|
child: Drawer(
|
|
child: Column(children: <Widget>[
|
|
const SizedBox(
|
|
height: 200,
|
|
),
|
|
Expanded(
|
|
child: ListView(padding: const EdgeInsets.all(21), physics: const BouncingScrollPhysics(), children: [
|
|
const Divider(),
|
|
InkWell(
|
|
child: const DrawerItem(
|
|
'My Profile',
|
|
icon: Icons.person,
|
|
color: Colors.grey,
|
|
),
|
|
onTap: () {
|
|
drawerNavigator(context, AppRoutes.profile);
|
|
}),
|
|
const Divider(),
|
|
InkWell(
|
|
child: const DrawerItem(
|
|
'Mowadhafhi',
|
|
icon: Icons.person,
|
|
color: Colors.grey,
|
|
),
|
|
onTap: () {
|
|
drawerNavigator(context, AppRoutes.mowadhafhi);
|
|
}),
|
|
const Divider(),
|
|
InkWell(
|
|
child: const DrawerItem(
|
|
'Pending Transactions',
|
|
icon: Icons.person,
|
|
color: Colors.grey,
|
|
),
|
|
onTap: () {
|
|
drawerNavigator(context, AppRoutes.pendingTransactions);
|
|
}),
|
|
const Divider(),
|
|
InkWell(
|
|
child: const DrawerItem(
|
|
'My Requests',
|
|
icon: Icons.person,
|
|
color: Colors.grey,
|
|
),
|
|
onTap: () {
|
|
drawerNavigator(context, AppRoutes.myRequests);
|
|
})
|
|
]))
|
|
])));
|
|
}
|
|
|
|
drawerNavigator(context, routeName) {
|
|
Navigator.of(context).pushNamed(routeName);
|
|
}
|
|
}
|
|
|
|
String capitalizeOnlyFirstLater(String text) {
|
|
if (text.trim().isEmpty) return "";
|
|
|
|
return "${text[0].toUpperCase()}${text.substring(1)}";
|
|
}
|