From 5861d159ac9e4df0a967e6f6bdc66669cf00c61a Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 21 Mar 2021 15:02:19 +0300 Subject: [PATCH] bug fixes --- lib/screens/dashboard_screen.dart | 32 ++- .../doctor/patient_arrival_screen.dart | 5 - .../add-rescheduleleave.dart | 2 +- lib/widgets/shared/app_drawer_widget.dart | 205 ++++++++++-------- 4 files changed, 138 insertions(+), 106 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 369f6a39..ac8119f0 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/doctor/patient_arrival_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patients_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; @@ -69,6 +70,26 @@ class _DashboardScreenState extends State { var clinicName = []; int sliderActiveIndex = 0; var clinicId; + var _patientSearchFormValues = PatientModel( + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + LanguageID: 2, + stamp: "2020-03-02T13:56:39.170Z", + IPAdress: "11.11.11.11", + VersionID: 1.2, + Channel: 9, + TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", + SessionID: "5G0yXn0Jnq", + IsLoginForDoctorApp: true, + PatientOutSA: false); void didChangeDependencies() async { super.didChangeDependencies(); if (_isInit) { @@ -961,12 +982,11 @@ class _DashboardScreenState extends State { ), hasBorder: false, onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PatientArrivalScreen(), - )); + Navigator.of(context) + .pushNamed(PATIENTS, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": "7" + }); }, ), DashboardItem( diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 367f1728..fa2bd11b 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -114,11 +114,6 @@ class _PatientArrivalScreen extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - PatientsScreen( - patientSearchForm: _patientSearchFormValues, - selectedType: "7", - isAppbar: false, - ), AddRescheduleLeavScreen(), ], ), diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index bb4e23ae..d5760cc0 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -28,7 +28,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { {model.getRescheduleLeave(), model.getCoveringDoctors()}, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, appBarTitle: TranslationBase.of(context).rescheduleLeaves, body: model.getReschduleLeave.length > 0 ? SingleChildScrollView( diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index a29d764e..7f4d0caf 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; @@ -49,46 +50,46 @@ class _AppDrawerState extends State { // margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2), child: Drawer( child: Column(children: [ - Expanded( - flex: 4, - child: ListView(padding: EdgeInsets.zero, children: [ - Container( - height: SizeConfig.heightMultiplier * 50, - child: InkWell( - child: DrawerHeader( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: Image.asset( + Expanded( + flex: 4, + child: ListView(padding: EdgeInsets.zero, children: [ + Container( + height: SizeConfig.heightMultiplier * 50, + child: InkWell( + child: DrawerHeader( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + child: Image.asset( 'assets/images/logo.png', ), margin: EdgeInsets.only(top: 10, bottom: 15), ), - SizedBox( - height: 1, - child: Container( - color: Colors.black26, - ), - ), - SizedBox(height: 15), - InkWell( - onTap: (){ - Navigator.of(context).pushNamed(PROFILE, arguments: { - 'title': authProvider.doctorProfile.doctorName, - "doctorProfileall": authProvider.doctorProfile - }); - }, - child: Column( - children: [ - authProvider.doctorProfile != null - ? CircleAvatar( + SizedBox( + height: 1, + child: Container( + color: Colors.black26, + ), + ), + SizedBox(height: 15), + InkWell( + onTap: () { + Navigator.of(context) + .pushNamed(PROFILE, arguments: { + 'title': authProvider.doctorProfile.doctorName, + "doctorProfileall": authProvider.doctorProfile + }); + }, + child: Column( + children: [ + authProvider.doctorProfile != null + ? CircleAvatar( radius: SizeConfig.imageSizeMultiplier * 12, - // radius: (52) + // radius: (52) child: ClipRRect( - borderRadius:BorderRadius.circular(50), - + borderRadius: BorderRadius.circular(50), child: Image.network( authProvider .doctorProfile.doctorImageURL, @@ -98,77 +99,93 @@ class _AppDrawerState extends State { ), backgroundColor: Colors.transparent, ) - : SizedBox(), - authProvider.doctorProfile != null - ? Padding( + : SizedBox(), + authProvider.doctorProfile != null + ? Padding( padding: EdgeInsets.only(top: 10), child: AppText( - TranslationBase.of(context).dr +authProvider.doctorProfile?.doctorName, + TranslationBase.of(context).dr + + authProvider + .doctorProfile?.doctorName, fontWeight: FontWeight.bold, color: Colors.black, fontSize: SizeConfig.textMultiplier * 2, )) - : SizedBox(), - ], - ), - ), - RaisedButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(18.0), - side: BorderSide(color: Colors.red)), - child: AppText( - TranslationBase.of(context).logout, - color: Colors.white, - ), - onPressed: () async { - Navigator.pop(context); - await helpers.logout(); - }, - ), - ], + : SizedBox(), + ], + ), + ), + RaisedButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(18.0), + side: BorderSide(color: Colors.red)), + child: AppText( + TranslationBase.of(context).logout, + color: Colors.white, + ), + onPressed: () async { + Navigator.pop(context); + await helpers.logout(); + }, ), - ), + ], ), ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).settings, Icons.settings), - onTap: () { - Navigator.pop(context); - Navigator.of(context).pushNamed(SETTINGS); - }, - ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).qr + - TranslationBase.of(context).reader, - DoctorApp.qr_code), - onTap: () { - Navigator.pop(context); - Navigator.of(context).pushNamed(QR_READER); - }, - ), - ]), + ), ), - Expanded( - flex: 1, - child: Column(children: [ - Container( - // This align moves the children to the bottom - child: Align( - alignment: FractionalOffset.bottomCenter, - child: Container( - child: Column( - children: [ - Text("Powered by"), - Image.asset( - 'assets/images/cs_logo_container.png', - width: SizeConfig.imageSizeMultiplier * 30, - ) - ], - )))) - ])) - ])), + InkWell( + child: DrawerItem( + TranslationBase.of(context).settings, Icons.settings), + onTap: () { + Navigator.pop(context); + Navigator.of(context).pushNamed(SETTINGS); + }, + ), + InkWell( + child: DrawerItem(TranslationBase.of(context).rescheduleLeaves, + DoctorApp.leaves), + onTap: () { + Navigator.pop(context); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddRescheduleLeavScreen(), + // MyReferredPatient(), + )); + }, + ), + InkWell( + child: DrawerItem( + TranslationBase.of(context).qr + + TranslationBase.of(context).reader, + DoctorApp.qr_code), + onTap: () { + Navigator.pop(context); + Navigator.of(context).pushNamed(QR_READER); + }, + ), + ]), + ), + Expanded( + flex: 1, + child: Column(children: [ + Container( + // This align moves the children to the bottom + child: Align( + alignment: FractionalOffset.bottomCenter, + child: Container( + child: Column( + children: [ + Text("Powered by"), + Image.asset( + 'assets/images/cs_logo_container.png', + width: SizeConfig.imageSizeMultiplier * 30, + ) + ], + )))) + ])) + ])), ), width: SizeConfig.realScreenWidth * 0.60, margin: 0,