diff --git a/lib/routes.dart b/lib/routes.dart index 1842d9aa..1804f17d 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,4 +1,6 @@ +import 'package:doctor_app_flutter/screens/profile_screen.dart'; + import './screens/QR_reader_screen.dart'; import './screens/auth/change_password_screen.dart'; import './screens/auth/login_screen.dart'; @@ -13,10 +15,13 @@ import './screens/patients/patient_profile_screen.dart'; import './screens/patients/patient_search_screen.dart'; import './screens/patients/patients_screen.dart'; import './screens/settings/settings_screen.dart'; +import './screens/profile_screen.dart'; + const String INIT_ROUTE = LOGIN; const String HOME = '/'; const String LOGIN = 'login'; +const String PROFILE = 'profile'; const String CHANGE_PASSWORD = 'change-password'; const String VERIFY_ACCOUNT = 'verify-account'; const String VERIFICATION_METHODS ='verification-methods'; @@ -33,6 +38,7 @@ const String SETTINGS = 'settings'; var routes = { HOME: (_) => DashboardScreen(), LOGIN: (_) => Loginsreen(), + PROFILE: (_) => ProfileScreen(), MY_SCHEDULE: (_) => MyScheduleScreen(), PATIENT_SEARCH: (_) => PatientSearchScreen(), PATIENTS: (_) => PatientsScreen(), diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 475a7e68..b6502760 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import '../routes.dart'; import '../widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; @@ -183,12 +184,18 @@ class _DashboardScreenState extends State { children: [ Expanded( flex: 2, - child: new DashboardItemIconText( - DoctorApp.home_icon, - "", - "Search Patient", - showBorder: false, - backgroundColor: Colors.green[200], + child: InkWell( child: DashboardItemIconText( + DoctorApp.home_icon, + "", + "Search Patient", + showBorder: false, + backgroundColor: Colors.green[200], + ), + + onTap: () { + Navigator.of(context).pushNamed(PATIENT_SEARCH); + }, + )), Expanded( flex: 2, diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart index 9fb26219..e446b9d0 100644 --- a/lib/widgets/patients/dynamic_elements.dart +++ b/lib/widgets/patients/dynamic_elements.dart @@ -52,7 +52,7 @@ class _DynamicElementsState extends State { hintText: 'From', controller: _fromDateController, validator: (value) { - return TextValidator().validateDate(value); + return TextValidator().validateDate(_fromDateController.text); }, onTap: () { _presentDatePicker('_selectedFromDate'); @@ -73,7 +73,7 @@ class _DynamicElementsState extends State { _presentDatePicker('_selectedToDate'); }, validator: (value) { - return TextValidator().validateDate(value); + return TextValidator().validateDate(_toDateController.text); }, onSaved: (value) { widget._patientSearchFormValues.To = value; diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index e6a0b5fd..4651684c 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/screens/profile_screen.dart'; import 'package:flutter/material.dart'; import '../../config/size_config.dart'; @@ -25,29 +26,33 @@ class _AppDrawerState extends State { child: ListView(padding: EdgeInsets.zero, children: [ Container( height: SizeConfig.heightMultiplier * 30, - 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) - ], + 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),