|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/config/routes.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/ui/dialogs/id/employee_digital_id_dialog.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/ui/landing/widget/drawer_item.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:mohem_flutter_app/widgets/dialogs/dialogs.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/ui/dialogs/id/business_card_dialog.dart';
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/generated/locale_keys.g.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: new DrawerItem(
|
|
|
|
|
//'My Profile',
|
|
|
|
|
LocaleKeys.myProfile.tr(),
|
|
|
|
|
icon: Icons.person,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
drawerNavigator(context, AppRoutes.profile);
|
|
|
|
|
}),
|
|
|
|
|
const Divider(),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
// 'Mowadhafhi',
|
|
|
|
|
LocaleKeys.mowadhafhi.tr(),
|
|
|
|
|
icon: Icons.person,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
drawerNavigator(context, AppRoutes.mowadhafhi);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
LocaleKeys.pendingTransactions.tr(),
|
|
|
|
|
icon: Icons.person,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
drawerNavigator(context, AppRoutes.pendingTransactions);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
"My Team",
|
|
|
|
|
icon: Icons.person,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
drawerNavigator(context, AppRoutes.myTeam);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
LocaleKeys.employeeDigitalID.tr(),
|
|
|
|
|
icon: Icons.insert_drive_file_outlined,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
showMDialog(context, child: EmployeeDigitialIdDialog());
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
Divider(),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
LocaleKeys.businessCard.tr(),
|
|
|
|
|
icon: Icons.insert_drive_file_outlined,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
showMDialog(context, child: BusinessCardDialog());
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawerNavigator(context, routeName) {
|
|
|
|
|
Navigator.of(context).pushNamed(routeName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String capitalizeOnlyFirstLater(String text) {
|
|
|
|
|
if (text.trim().isEmpty) return "";
|
|
|
|
|
|
|
|
|
|
return "${text[0].toUpperCase()}${text.substring(1)}";
|
|
|
|
|
}
|