From 3f7961b50c1e9f8b9d671eaefeb9710bef4576a0 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 14 Mar 2021 15:21:25 +0300 Subject: [PATCH 1/2] dashboard sreen updated --- lib/landing_page.dart | 8 +- lib/screens/QR_reader_screen.dart | 221 ++++++++++---------- lib/screens/dashboard_screen.dart | 160 +++++++------- lib/screens/doctor/doctor_reply_screen.dart | 40 ++-- lib/widgets/shared/bottom_nav_bar.dart | 32 +-- pubspec.lock | 21 ++ 6 files changed, 253 insertions(+), 229 deletions(-) diff --git a/lib/landing_page.dart b/lib/landing_page.dart index c5494acf..4d949827 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -1,4 +1,6 @@ +import 'package:doctor_app_flutter/screens/QR_reader_screen.dart'; import 'package:doctor_app_flutter/screens/dashboard_screen.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/message_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/services_screen.dart'; @@ -64,9 +66,9 @@ class _LandingPageState extends State { ShowCaseWidget( builder: Builder(builder: (context) => DashboardScreen()), ), - // MessagesScreen(), + DoctorReplyScreen(), MyScheduleScreen(), - // ServicesScreen() + QrReaderScreen() ], ), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), @@ -82,7 +84,7 @@ class _LandingPageState extends State { case 2: return TranslationBase.of(context).mySchedule; case 3: - return TranslationBase.of(context).services; + return TranslationBase.of(context).qr; } } } diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index 43492149..2ddb4049 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -17,6 +17,7 @@ import 'package:flutter/material.dart'; import '../routes.dart'; import 'base/base_view.dart'; + Helpers helpers = Helpers(); class QrReaderScreen extends StatefulWidget { @@ -59,6 +60,7 @@ class _QrReaderScreenState extends State { onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).qr + TranslationBase.of(context).reader, body: Center( @@ -71,63 +73,63 @@ class _QrReaderScreenState extends State { AppText( TranslationBase.of(context).startScanning, fontSize: 18, - fontWeight: FontWeight.bold, - textAlign: TextAlign.center, - ), - SizedBox( - height: 7, - ), - AppText(TranslationBase.of(context).scanQrCode, - fontSize: 14, - fontWeight: FontWeight.w400, - textAlign: TextAlign.center), - SizedBox( - height: 15, - ), - Container( - height: 150, - child: Image.asset('assets/images/qr_code.png'), - ), - SizedBox( - height: 35, - ), - Button( - onTap: () { - _scanQrAndGetPatient(context, model); - }, - title: TranslationBase.of(context).scanQr, - loading: isLoading, - icon: Image.asset('assets/images/qr_code_white.png'), - ), - isError - ? Container( - margin: EdgeInsets.only(top: 8), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Theme.of(context).errorColor.withOpacity(0.06), - ), - padding: EdgeInsets.symmetric( - vertical: 8.0, horizontal: 12.0), - child: Row( - children: [ - Expanded( - child: AppText( - error ?? - TranslationBase.of(context) - .errorMessage, - color: Theme - .of(context) - .errorColor)), - ], - ), - ) - : Container(), - ], + fontWeight: FontWeight.bold, + textAlign: TextAlign.center, + ), + SizedBox( + height: 7, + ), + AppText(TranslationBase.of(context).scanQrCode, + fontSize: 14, + fontWeight: FontWeight.w400, + textAlign: TextAlign.center), + SizedBox( + height: 15, + ), + Container( + height: 150, + child: Image.asset('assets/images/qr_code.png'), ), - ), + SizedBox( + height: 35, + ), + Button( + onTap: () { + _scanQrAndGetPatient(context, model); + }, + title: TranslationBase.of(context).scanQr, + loading: isLoading, + icon: Image.asset('assets/images/qr_code_white.png'), + ), + isError + ? Container( + margin: EdgeInsets.only(top: 8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: + Theme.of(context).errorColor.withOpacity(0.06), + ), + padding: EdgeInsets.symmetric( + vertical: 8.0, horizontal: 12.0), + child: Row( + children: [ + Expanded( + child: AppText( + error ?? + TranslationBase.of(context) + .errorMessage, + color: Theme.of(context).errorColor)), + ], + ), + ) + : Container(), + ], ), ), - ),); + ), + ), + ), + ); } _scanQrAndGetPatient(BuildContext context, PatientViewModel model) async { @@ -135,7 +137,7 @@ class _QrReaderScreenState extends State { /// var result = await BarcodeScanner.scan(); /// int patientID = get from qr result var result = await BarcodeScanner.scan(); - if (result.rawContent != "") { + if (result.rawContent != "") { List listOfParams = result.rawContent.split(','); String patientType = "1"; setState(() { @@ -152,66 +154,65 @@ class _QrReaderScreenState extends State { // patient.setClinicID = doctorProfile.clinicID; // patient.setProjectID = doctorProfile.projectID; // Provider.of(context, listen: false); - patient.PatientID = 8808; - patient.TokenID = token; - model - .getPatientList(patient, "1", isBusyLocal: true) - .then((response) { - if (response['MessageStatus'] == 1) { - switch (patientType) { - case "0": - if (response['List_MyOutPatient'] != null) { - setState(() { - patientList = - ModelResponse.fromJson(response['List_MyOutPatient']).list; - isLoading = false; - }); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": patientList[0], - }); - } else { - setState(() { - isError = true; - isLoading = false; - }); - DrAppToastMsg.showErrorToast('No patient'); - } - break; - case "1": - if (response['List_MyInPatient'] != null) { - setState(() { - patientList = - ModelResponse.fromJson(response['List_MyInPatient']).list; - isLoading = false; - error = ""; - }); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": patientList[0], - }); - } else { - setState(() { - isError = true; - isLoading = false; - }); - DrAppToastMsg.showErrorToast('No patient'); + patient.PatientID = 8808; + patient.TokenID = token; + model.getPatientList(patient, "1", isBusyLocal: true).then((response) { + if (response['MessageStatus'] == 1) { + switch (patientType) { + case "0": + if (response['List_MyOutPatient'] != null) { + setState(() { + patientList = + ModelResponse.fromJson(response['List_MyOutPatient']) + .list; + isLoading = false; + }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patientList[0], + }); + } else { + setState(() { + isError = true; + isLoading = false; + }); + DrAppToastMsg.showErrorToast('No patient'); + } break; - } + case "1": + if (response['List_MyInPatient'] != null) { + setState(() { + patientList = + ModelResponse.fromJson(response['List_MyInPatient']).list; + isLoading = false; + error = ""; + }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patientList[0], + }); + } else { + setState(() { + isError = true; + isLoading = false; + }); + DrAppToastMsg.showErrorToast('No patient'); + break; + } + } + } else { + setState(() { + isLoading = false; + isError = true; + }); + DrAppToastMsg.showErrorToast( + response['ErrorEndUserMessage'] ?? response['ErrorMessage']); } - } else { + }).catchError((error) { setState(() { isLoading = false; - isError = true; }); - DrAppToastMsg.showErrorToast( - response['ErrorEndUserMessage'] ?? response['ErrorMessage']); - } - }).catchError((error) { - setState(() { - isLoading = false; + helpers.showErrorToast(error.message); + //DrAppToastMsg.showErrorToast(error); }); - helpers.showErrorToast(error.message); - //DrAppToastMsg.showErrorToast(error); - }); - } + } } } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 5797b0c1..fbe39980 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -989,50 +989,6 @@ class _DashboardScreenState extends State { ); }, ), - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Icon( - DoctorApp.qr_code, - size: 50, - color: Colors.black, - ), - Column( - children: [ - AppText( - projectsProvider.isArabic - ? TranslationBase.of(context).reader - : TranslationBase.of(context).qr, - color: Colors.black, - textAlign: TextAlign.center, - ), - AppText( - projectsProvider.isArabic - ? TranslationBase.of(context).qr - : TranslationBase.of(context).reader, - color: Colors.black, - textAlign: TextAlign.center, - ), - ], - ) - ], - ), -// imageName: '1.png', - hasBorder: true, - onTap: () { - Navigator.of(context).pushNamed(QR_READER); - }, - ), - ], - ), - SizedBox( - height: 20, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ DashboardItem( child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -1060,44 +1016,88 @@ class _DashboardScreenState extends State { ); }, ), +// DashboardItem( +// child: Column( +// mainAxisAlignment: MainAxisAlignment.spaceAround, +// children: [ +// Icon( +// DoctorApp.qr_code, +// size: 50, +// color: Colors.black, +// ), +// Column( +// children: [ +// AppText( +// projectsProvider.isArabic +// ? TranslationBase.of(context).reader +// : TranslationBase.of(context).qr, +// color: Colors.black, +// textAlign: TextAlign.center, +// ), +// AppText( +// projectsProvider.isArabic +// ? TranslationBase.of(context).qr +// : TranslationBase.of(context).reader, +// color: Colors.black, +// textAlign: TextAlign.center, +// ), +// ], +// ) +// ], +// ), +// // imageName: '1.png', +// hasBorder: true, +// onTap: () { +// Navigator.of(context).pushNamed(QR_READER); +// }, +// ), + ], + ), + SizedBox( + height: 20, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ SizedBox( width: 8, ), - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Icon( - DoctorApp.mail, - size: 50, - color: Colors.black, - ), - Column( - children: [ - AppText( - TranslationBase.of(context).theDoctor, - textAlign: TextAlign.center, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).reply, - textAlign: TextAlign.center, - color: Colors.black, - ), - ], - ) - ], - ), - hasBorder: true, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => DoctorReplyScreen(), - ), - ); - }, - ) + // DashboardItem( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Icon( + // DoctorApp.mail, + // size: 50, + // color: Colors.black, + // ), + // Column( + // children: [ + // AppText( + // TranslationBase.of(context).theDoctor, + // textAlign: TextAlign.center, + // color: Colors.black, + // ), + // AppText( + // TranslationBase.of(context).reply, + // textAlign: TextAlign.center, + // color: Colors.black, + // ), + // ], + // ) + // ], + // ), + // hasBorder: true, + // onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => DoctorReplyScreen(), + // ), + // ); + // }, + // ) ], ), SizedBox( @@ -1275,7 +1275,7 @@ class _DashboardScreenState extends State { authProvider.getDocProfiles(docInfo.toJson()).then((res) async { changeIsLoading(false); sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); - model.getDashboard(); + // model.getDashboard(); }).catchError((err) { changeIsLoading(false); helpers.showErrorToast(err); diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index dc6de602..b57bd1a2 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -15,32 +15,32 @@ import 'package:flutter/material.dart'; *@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service */ class DoctorReplyScreen extends StatelessWidget { - @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getDoctorReply(), builder: (_, model, w) => AppScaffold( - baseViewModel: model, + baseViewModel: model, appBarTitle: TranslationBase.of(context).replay2, - body: model - .listDoctorWorkingHoursTable.isEmpty ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem):Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: ListView( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: model - .listDoctorWorkingHoursTable - .map((reply) { - return DoctorReplyWidget(reply: reply); - }).toList(), - ) - ], - ), - ), + isShowAppBar: false, + body: model.listDoctorWorkingHoursTable.isEmpty + ? DrAppEmbeddedError( + error: TranslationBase.of(context).noItem) + : Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: ListView( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: + model.listDoctorWorkingHoursTable.map((reply) { + return DoctorReplyWidget(reply: reply); + }).toList(), + ) + ], + ), + ), )); } } diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index 6a791627..c30b1540 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -44,14 +44,14 @@ class _BottomNavBarState extends State { currentIndex: 0, name: TranslationBase.of(context).home, ), - // BottomNavigationItem( - // icon: DoctorApp.message_icon, - // activeIcon: DoctorApp.message_icon_active, - // changeIndex: _changeIndex, - // index: _index, - // currentIndex: 1, - // name: TranslationBase.of(context).replay2, - // ), + BottomNavigationItem( + icon: DoctorApp.message_icon, + activeIcon: DoctorApp.message_icon_active, + changeIndex: _changeIndex, + index: _index, + currentIndex: 1, + name: TranslationBase.of(context).replay2, + ), BottomNavigationItem( icon: DoctorApp.schedule_icon, activeIcon: DoctorApp.scdedule_icon_active, @@ -60,14 +60,14 @@ class _BottomNavBarState extends State { currentIndex: 2, name: TranslationBase.of(context).mySchedule, ), - // BottomNavigationItem( - // icon: DoctorApp.menu_icon, - // activeIcon: DoctorApp.menu_icon_active, - // changeIndex: _changeIndex, - // index: _index, - // currentIndex: 3, - // name: TranslationBase.of(context).services, - // ) + BottomNavigationItem( + icon: DoctorApp.qr_code, + activeIcon: DoctorApp.qr_code, + changeIndex: _changeIndex, + index: _index, + currentIndex: 3, + name: TranslationBase.of(context).qr, + ) ], ), ), diff --git a/pubspec.lock b/pubspec.lock index 94f07eea..d044f1fb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -403,6 +403,13 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_page_indicator: + dependency: transitive + description: + name: flutter_page_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.3" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -410,6 +417,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.11" + flutter_swiper: + dependency: "direct main" + description: + name: flutter_swiper + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" flutter_test: dependency: "direct dev" description: flutter @@ -873,6 +887,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.1+3" + transformer_page_view: + dependency: transitive + description: + name: transformer_page_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.6" typed_data: dependency: transitive description: From bcf25d7b9559161b2a7d5e1d8d2cacc15125e4cc Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 14 Mar 2021 14:28:10 +0200 Subject: [PATCH 2/2] Medical Report & update Prescription form update --- .../medical-file/medical_file_details.dart | 16 ++++++++-------- .../prescription/prescription_screen.dart | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 431342eb..35705d12 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -303,8 +303,8 @@ class _MedicalFileDetailsState extends State { }); }, child: Icon(isHistoryExpand - ? EvaIcons.minus - : EvaIcons.plus)) + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( @@ -404,8 +404,8 @@ class _MedicalFileDetailsState extends State { }); }, child: Icon(isAssessmentExpand - ? EvaIcons.minus - : EvaIcons.plus)) + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( @@ -584,8 +584,8 @@ class _MedicalFileDetailsState extends State { }); }, child: Icon(isProcedureExpand - ? EvaIcons.minus - : EvaIcons.plus)) + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( @@ -758,8 +758,8 @@ class _MedicalFileDetailsState extends State { }); }, child: Icon(isPhysicalExam - ? EvaIcons.minus - : EvaIcons.plus)) + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 6e9f0676..f09c99bb 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -630,7 +630,7 @@ class _NewPrescriptionScreenState extends State { .toString(), patient: patient, drugId: model.prescriptionList[0].entityList[index].medicineCode, - drugName: model.prescriptionList[0].entityList[index].doseDetail, + drugName: model.prescriptionList[0].entityList[index].medicationName, remarks: model.prescriptionList[0].entityList[index].remarks, model: model, enteredRemarks: model.prescriptionList[0].entityList[index].remarks,