import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '../../config/size_config.dart'; import '../../providers/schedule_provider.dart'; import '../../routes.dart'; import '../../screens/doctor/my_schedule_screen.dart'; import '../../widgets/shared/drawer_item_widget.dart'; import '../../widgets/shared/rounded_container_widget.dart'; import 'app_texts_widget.dart'; // OWNER : Ibrahim albitar // DATE : 06-04-2020 // DESCRIPTION : Custom App Drawer for app. class AppDrawer extends StatefulWidget { @override _AppDrawerState createState() => _AppDrawerState(); } class _AppDrawerState extends State { @override Widget build(BuildContext context) { return RoundedContainer( child: Container( margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 9), child: Drawer( child: ListView(padding: EdgeInsets.zero, children: [ Container( height: SizeConfig.heightMultiplier * 30, child: InkWell( child: DrawerHeader( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ CircleAvatar( radius: SizeConfig.imageSizeMultiplier * 12, backgroundImage: NetworkImage( "https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png"), backgroundColor: Colors.transparent, ), Padding( padding: EdgeInsets.only(top: 10), child: AppText( "Dr. Chris evans", fontWeight: FontWeight.bold, color: Colors.white, fontSize: SizeConfig.textMultiplier * 3, )), AppText("Director of medical records", fontWeight: FontWeight.normal, color: Colors.white) ], ), ), onTap: () { Navigator.of(context).pushNamed(PROFILE); }, ), ), InkWell( child: DrawerItem("My Schedule", Icons.table_chart), onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => ChangeNotifierProvider( create: (_) => ScheduleProvider(), child: MyScheduleScreen(), ), ), ); }, ), InkWell( child: DrawerItem("Settings", Icons.settings), onTap: () { Navigator.of(context).pushNamed(SETTINGS); }, ), InkWell( child: DrawerItem("QR Reader", Icons.search), onTap: () { Navigator.of(context).pushNamed(QR_READER); }, ), ])), ), width: SizeConfig.realScreenWidth * 0.55, margin: 0, customCornerRaduis: true, topRight: 30, bottomRight: 30, backgroundColor: Color(0xff58434F), ); } drawerNavigator(context, routeName) { Navigator.of(context).pushNamed(routeName); } }