From fbb029e320273e0dee31e6bc7bfd5c7f7b2e4579 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 16 Dec 2021 13:11:22 +0200 Subject: [PATCH] screen fixes --- lib/core/viewModel/dashboard_view_model.dart | 3 +- lib/screens/auth/login_screen.dart | 4 +- .../auth/verification_methods_screen.dart | 4 +- lib/screens/base/base_view.dart | 2 +- .../doctor_replay/all_doctor_questions.dart | 4 +- .../doctor_replay/doctor_reply_screen.dart | 4 +- .../doctor_replay/doctor_reply_widget.dart | 4 +- .../not_replaied_doctor_questions.dart | 4 +- .../doctor/patient_arrival_screen.dart | 2 +- .../home/dashboard_referral_patient.dart | 30 +- lib/screens/home/dashboard_swipe_widget.dart | 12 +- lib/screens/home/home_page_card.dart | 4 +- lib/screens/home/home_patient_card.dart | 10 +- lib/screens/home/home_screen.dart | 36 +- .../live-care_transfer_to_admin.dart | 32 +- .../live_care/live_care_patient_screen.dart | 14 +- lib/screens/live_care/panding_list.dart | 12 +- lib/screens/live_care/video_call.dart | 10 +- .../medical-file/health_summary_page.dart | 1 + .../medical-file/medical_file_details.dart | 1498 +++++++---------- .../medicine/medicine_search_screen.dart | 17 +- .../medicine/pharmacies_list_screen.dart | 2 +- .../patient_sick_leave_screen.dart | 8 +- lib/screens/patients/In_patient/NoData.dart | 2 +- .../In_patient/in_patient_screen.dart | 8 +- .../out_patient/filter_date_page.dart | 17 +- .../out_patient/out_patient_screen.dart | 39 +- .../patient_search/patient_search_header.dart | 2 +- .../patient_search_result_screen.dart | 47 +- .../patient_search/patient_search_screen.dart | 5 +- .../admission_orders_screen.dart | 19 +- .../admission-request-first-screen.dart | 25 +- .../admission-request-third-screen.dart | 16 +- .../admission-request_second-screen.dart | 44 +- .../diabetic_chart/diabetic_chart.dart | 28 +- ...iabetic_details_blood_pressurewideget.dart | 11 +- .../profile/diagnosis/diagnosis_screen.dart | 16 +- .../all_discharge_summary.dart | 7 +- .../profile/lab_result/labs_home_page.dart | 42 +- lib/util/helpers.dart | 152 +- lib/widgets/auth/sms-popup.dart | 4 +- .../auth/verification_methods_list.dart | 6 +- lib/widgets/charts/app_bar_chart.dart | 43 - .../dashboard_item_texts_widget.dart | 2 +- lib/widgets/dashboard/out_patient_stack.dart | 4 +- .../patients/clinic_list_dropdwon.dart | 99 -- lib/widgets/patients/dynamic_elements.dart | 163 -- .../patients/patient_card/PatientCard.dart | 1 + .../patients/patient_service_title.dart | 2 +- .../profile/Profile_general_info_Widget.dart | 45 - .../patients/profile/large_avatar.dart | 2 +- ...ent-profile-header-new-design-app-bar.dart | 2 +- .../profile_general_info_content_widget.dart | 45 - ...rofile_medical_info_widget_in_patient.dart | 176 -- 54 files changed, 1072 insertions(+), 1719 deletions(-) delete mode 100644 lib/widgets/charts/app_bar_chart.dart delete mode 100644 lib/widgets/patients/clinic_list_dropdwon.dart delete mode 100644 lib/widgets/patients/dynamic_elements.dart delete mode 100644 lib/widgets/patients/profile/Profile_general_info_Widget.dart delete mode 100644 lib/widgets/patients/profile/profile_general_info_content_widget.dart delete mode 100644 lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 75b4b020..2da6969b 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -82,8 +82,7 @@ List get specialClinicalCareList => // setState(ViewState.Idle); } - Future changeClinic( - int clinicId, AuthenticationViewModel authProvider) async { + Future changeClinic(var clinicId, AuthenticationViewModel authProvider) async { setState(ViewState.BusyLocal); await getDoctorProfile(); ClinicModel clinicModel = ClinicModel( diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 663f95db..6ae073c1 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -73,7 +73,7 @@ class _LoginScreenState extends State { height: 10, ), Text( - TranslationBase.of(context).welcomeTo, + TranslationBase.of(context).welcomeTo!, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, @@ -81,7 +81,7 @@ class _LoginScreenState extends State { ), Text( TranslationBase.of(context) - .drSulaimanAlHabib, + .drSulaimanAlHabib!, style: TextStyle( color: Color(0xFF2B353E), fontWeight: FontWeight.bold, diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index ce3f7a5d..08a6ac6c 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -150,7 +150,7 @@ class _VerificationMethodsScreenState extends State { children: [ Text( TranslationBase.of(context) - .lastLoginAt, + .lastLoginAt!, overflow: TextOverflow.ellipsis, style: TextStyle( fontFamily: 'Poppins', @@ -170,7 +170,7 @@ class _VerificationMethodsScreenState extends State { text: TextSpan( text: TranslationBase.of( context) - .verifyWith + + .verifyWith! + ':', style: TextStyle( color: diff --git a/lib/screens/base/base_view.dart b/lib/screens/base/base_view.dart index ceeae382..0cf174c7 100644 --- a/lib/screens/base/base_view.dart +++ b/lib/screens/base/base_view.dart @@ -34,7 +34,7 @@ class _BaseViewState extends State> { @override Widget build(BuildContext context) { return ChangeNotifierProvider.value( - value: model, + value: model!, child: Consumer(builder: widget.builder), ); } diff --git a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart index 1f16c8df..9510504e 100644 --- a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart @@ -30,10 +30,10 @@ class _AllDoctorQuestionsState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( children: [ Expanded( diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index 45dc50bf..3d72068b 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -71,7 +71,7 @@ class _DoctorReplyScreenState extends State return false; }, child: AppScaffold( - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: false, body: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -107,7 +107,7 @@ class _DoctorReplyScreenState extends State screenSize, _activeTab == 1, - TranslationBase.of(context).all, + TranslationBase.of(context)!.all!, isLast: true, context: context ), diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index 5207d701..fc73d6f3 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -191,7 +191,7 @@ class _DoctorReplyWidgetState extends State { isCopyable:false, ), CustomRow( - label: TranslationBase.of(context).age + " : ", + label: TranslationBase.of(context).age! + " : ", isCopyable:false, value: "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}", @@ -216,7 +216,7 @@ class _DoctorReplyWidgetState extends State { children: [ new TextSpan( text: - TranslationBase.of(context).requestType + + TranslationBase.of(context).requestType! + ": ", style: TextStyle( fontSize: SizeConfig diff --git a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart index 39dd1bf7..743240e2 100644 --- a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart @@ -32,10 +32,10 @@ class _NotRepliedDoctorQuestionsState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: false, body: model.listDoctorNotRepliedQuestions.isEmpty - ? ErrorMessage(error: TranslationBase.of(context).noItem) + ? ErrorMessage(error: TranslationBase.of(context).noItem!) : Column( children: [ Expanded( diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 04655ca2..55a01fd8 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -53,7 +53,7 @@ class _PatientArrivalScreen extends State with SingleTicke Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).arrivalpatient, + appBarTitle: TranslationBase.of(context).arrivalpatient ?? "", body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 58673ed6..d5e466c1 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -95,20 +95,20 @@ class DashboardReferralPatient extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ RowCounts( - dashboardItemList[2].summaryoptions[0].kPIParameter, - dashboardItemList[2].summaryoptions[0].value, + dashboardItemList![2].summaryoptions![0].kPIParameter, + dashboardItemList![2].summaryoptions![0].value!, AppGlobal.appTextColor, height: height, ), RowCounts( - dashboardItemList[2].summaryoptions[1].kPIParameter, - dashboardItemList[2].summaryoptions[1].value, + dashboardItemList![2].summaryoptions![1].kPIParameter!, + dashboardItemList![2].summaryoptions![1].value!, Color(0xFFC8D0DC), height: height, ), RowCounts( - dashboardItemList[2].summaryoptions[2].kPIParameter, - dashboardItemList[2].summaryoptions[2].value, + dashboardItemList![2].summaryoptions![2].kPIParameter!, + dashboardItemList![2].summaryoptions![2].value!, Color(0xFFEC6666), height: height, @@ -122,20 +122,20 @@ class DashboardReferralPatient extends StatelessWidget { Expanded( flex: 3, child: Stack(children: [ - Container(padding: EdgeInsets.all(0), child: GaugeChart(_createReferralData(dashboardItemList))), + Container(padding: EdgeInsets.all(0), child: GaugeChart(_createReferralData(dashboardItemList!))), Positioned( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ AppText( - model.getPatientCount(dashboardItemList[2]).toString(), + model?.getPatientCount(dashboardItemList![2]).toString(), fontSize: SizeConfig.textMultiplier * 3.2, color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, ) ], ), - top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.35), + top: height! * (SizeConfig.isHeightVeryShort ? 0.35 : 0.35), left: 0, right: 0) ]), @@ -148,12 +148,12 @@ class DashboardReferralPatient extends StatelessWidget { static List> _createReferralData(List dashboardItemList) { final data = [ - new GaugeSegment(dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), charts.ColorUtil.fromDartColor(AppGlobal.appTextColor)), - new GaugeSegment(dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), charts.ColorUtil.fromDartColor(Color(0xFFC6CEDA),),), - new GaugeSegment(dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), charts.ColorUtil.fromDartColor(Color(0xFFEC6666),),), + new GaugeSegment(dashboardItemList![2].summaryoptions![0].kPIParameter!, + getValue(dashboardItemList![1].summaryoptions![0].value), charts.ColorUtil.fromDartColor(AppGlobal.appTextColor)), + new GaugeSegment(dashboardItemList![2].summaryoptions![1].kPIParameter!, + getValue(dashboardItemList![1].summaryoptions![1].value), charts.ColorUtil.fromDartColor(Color(0xFFC6CEDA),),), + new GaugeSegment(dashboardItemList[2].summaryoptions![2].kPIParameter!, + getValue(dashboardItemList![1].summaryoptions![2].value), charts.ColorUtil.fromDartColor(Color(0xFFEC6666),),), ]; return [ diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index bcd7864c..7f071175 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -104,16 +104,16 @@ class _DashboardSwipeWidgetState extends State { List dashboardItemList) { final data = [ new GaugeSegment( - dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), + dashboardItemList![2].summaryoptions![0].kPIParameter!, + getValue(dashboardItemList![1].summaryoptions![0].value!), charts.MaterialPalette.black), new GaugeSegment( - dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), + dashboardItemList[2].summaryoptions![1].kPIParameter!, + getValue(dashboardItemList[1].summaryoptions![1].value), charts.MaterialPalette.gray.shadeDefault), new GaugeSegment( - dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), + dashboardItemList![2].summaryoptions![2].kPIParameter!, + getValue(dashboardItemList[1].summaryoptions![2].value), charts.MaterialPalette.red.shadeDefault), ]; diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 41737f25..b65d872a 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -11,7 +11,7 @@ class HomePageCard extends StatelessWidget { Key? key, required this.color, this.opacity = 0.4, - required this.margin, this.width}) + required this.margin, this.width, this.gradient}) : super(key: key); final bool hasBorder; final String? imageName; @@ -21,6 +21,8 @@ class HomePageCard extends StatelessWidget { final double opacity; final double? width; final EdgeInsets margin; + final LinearGradient? gradient; + @override Widget build(BuildContext context) { return InkWell( diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index f935977a..2ae9862f 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -4,10 +4,10 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class HomePatientCard extends StatelessWidget { - final Color backgroundColor; + final Color? backgroundColor; final IconData cardIcon; final String? cardIconImage; - final Color backgroundIconColor; + final Color? backgroundIconColor; final String text; final Color textColor; final VoidCallback onTap; @@ -15,7 +15,7 @@ class HomePatientCard extends StatelessWidget { final LinearGradient gradient; HomePatientCard({ - required this.backgroundColor, + this.backgroundColor, required this.backgroundIconColor, required this.cardIcon, this.cardIconImage, @@ -30,7 +30,7 @@ class HomePatientCard extends StatelessWidget { double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightLarge?15:13); return HomePageCard( - color: backgroundColor, + color: backgroundColor!, width: width, gradient: gradient, margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), @@ -77,7 +77,7 @@ class HomePatientCard extends StatelessWidget { color: textColor, ) : Image.asset( - cardIconImage, + cardIconImage!, height: iconSize, width: iconSize, ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 2303bbb2..97c88346 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -78,12 +78,12 @@ class _HomeScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBar: HomeScreenHeader( - model: model, - onOpenDrawer: () { - Scaffold.of(context).openDrawer(); - }, - ), + // appBar: HomeScreenHeader( + // model: model, + // onOpenDrawer: () { + // Scaffold.of(context).openDrawer(); + // }, + // ), body: ListView(children: [ Column(children: [ StickyHeader( @@ -182,7 +182,7 @@ class _HomeScreenState extends State { )), ], ), - AppText(Helpers.convertToTitleCase(item.clinicName), + AppText(Helpers.convertToTitleCase(item.clinicName!), fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, @@ -197,7 +197,7 @@ class _HomeScreenState extends State { clinicId = newValue; GifLoaderDialogUtils.showMyDialog( context); - await model.changeClinic(newValue, + await model.changeClinic(newValue??0, authenticationViewModel); GifLoaderDialogUtils.hideDialog( context); @@ -212,7 +212,7 @@ class _HomeScreenState extends State { .map((item) { return DropdownMenuItem( child: AppText( - Helpers.convertToTitleCase(item.clinicName), + Helpers.convertToTitleCase(item.clinicName??""), fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, @@ -339,7 +339,7 @@ class _HomeScreenState extends State { DashboardViewModel model, projectsProvider) { colorIndex = 0; - List backgroundColors = List(3); + List backgroundColors = []; backgroundColors[0] = LinearGradient( begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 2.0), @@ -358,11 +358,11 @@ class _HomeScreenState extends State { colors: [ Color(0xFF71787E),AppGlobal.appTextColor ]); - List backgroundIconColors = List(3); + List backgroundIconColors = []; backgroundIconColors[0] = Colors.white12; backgroundIconColors[1] = Colors.white38; backgroundIconColors[2] = Colors.white10; - List textColors = List(3); + List textColors = []; textColors[0] = Colors.white; textColors[1] = Color(0xFF353E47); textColors[2] = Colors.white; @@ -412,7 +412,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.inpatient, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myInPatient, + text: TranslationBase.of(context).myInPatient!, onTap: () { Navigator.push( context, @@ -433,7 +433,7 @@ class _HomeScreenState extends State { //TODO Elham* match the of the icon cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], - text: TranslationBase.of(context).registerNewPatient, + text: TranslationBase.of(context).registerNewPatient!, onTap: () { Navigator.push( context, @@ -450,7 +450,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myOutPatient_2lines, + text: TranslationBase.of(context).myOutPatient_2lines!, onTap: () { String date = AppDateUtils.convertDateToFormat( DateTime( @@ -477,7 +477,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.referral_1, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myPatientsReferral, + text: TranslationBase.of(context).myPatientsReferral!, onTap: () { Navigator.push( context, @@ -495,7 +495,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search, textColor: textColors[colorIndex], - text: TranslationBase.of(context).searchPatientDashBoard, + text: TranslationBase.of(context).searchPatientDashBoard!, onTap: () { Navigator.push( context, @@ -512,7 +512,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search_medicines, textColor: textColors[colorIndex], - text: TranslationBase.of(context).searchMedicineDashboard, + text: TranslationBase.of(context).searchMedicineDashboard!, onTap: () { Navigator.push( context, diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart index a62eee68..20af0514 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -110,27 +110,27 @@ class _LivaCareTransferToAdminState extends State { onPressed: () { setState(() { if (noteController.text.isEmpty) { - noteError = TranslationBase.of(context).emptyMessage; + noteError = TranslationBase.of(context).emptyMessage!; } else { - noteError = null; + noteError = null!; } if (noteController.text.isNotEmpty) { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?", - () async { - Navigator.of(context).pop(); - GifLoaderDialogUtils.showMyDialog(context); - await model.transferToAdmin(widget.patient.vcId, noteController.text); - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } else { - DrAppToastMsg.showSuccesToast("You successfully transfer to admin"); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - } - }); + () async { + Navigator.of(context).pop(); + GifLoaderDialogUtils.showMyDialog(context); + await model.transferToAdmin(widget.patient.vcId!, noteController.text); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast("You successfully transfer to admin"); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + }); } }); }, diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index 0de0d581..38a34a26 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -85,11 +85,13 @@ class _LiveCarePatientScreenState extends State { }, marginTop: 5, suffixIcon: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, + onPressed: () {}, + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + ), ), model.state == ViewState.Idle @@ -99,7 +101,7 @@ class _LiveCarePatientScreenState extends State { ? Center( child: ErrorMessage( error: TranslationBase.of(context) - .youDontHaveAnyPatient, + .youDontHaveAnyPatient!, ), ) : ListView.builder( diff --git a/lib/screens/live_care/panding_list.dart b/lib/screens/live_care/panding_list.dart index 5bc25e23..1a91c0e4 100644 --- a/lib/screens/live_care/panding_list.dart +++ b/lib/screens/live_care/panding_list.dart @@ -45,7 +45,7 @@ class _LiveCarePandingListState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).livecare, + appBarTitle: TranslationBase.of(context).livecare!, body: Container( child: ListView(scrollDirection: Axis.vertical, @@ -98,7 +98,7 @@ class _LiveCarePandingListState extends State { Colors.grey[ 100]!, Colors.grey[ - 200], + 200]!, ]), boxShadow: [ BoxShadow( @@ -154,7 +154,7 @@ class _LiveCarePandingListState extends State { AppText( TranslationBase.of( context) - .fileNo + + .fileNo! + item.patientID .toString(), fontSize: 2.0 * @@ -167,7 +167,7 @@ class _LiveCarePandingListState extends State { AppText( TranslationBase.of( context) - .age + + .age! + ' ' + item.age .toString(), @@ -255,9 +255,9 @@ class _LiveCarePandingListState extends State { MyGlobals myGlobals = new MyGlobals(); class MyGlobals { - GlobalKey _scaffoldKey; + GlobalKey? _scaffoldKey; MyGlobals() { _scaffoldKey = GlobalKey(); } - GlobalKey get scaffoldKey => _scaffoldKey; + GlobalKey get scaffoldKey => _scaffoldKey!; } diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index fd7ccbda..040cc682 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -238,7 +238,7 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {endCall()}, child: - Text(TranslationBase.of(context).endcall), + Text(TranslationBase.of(context).endcall!), color: Colors.red, textColor: Colors.white, )), @@ -247,8 +247,8 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {resumeCall()}, child: - Text(TranslationBase.of(context).resumecall), - color: AppGlobal.appGreenColor, + Text(TranslationBase.of(context).resumecall!), + color: Colors.green[900], textColor: Colors.white, ), ), @@ -257,7 +257,7 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {endCallWithCharge()}, child: Text(TranslationBase.of(context) - .endcallwithcharge), + .endcallwithcharge!), textColor: Colors.white, ), ), @@ -268,7 +268,7 @@ class _VideoCallPageState extends State { setState(() => {isTransfer = true}) }, child: Text( - TranslationBase.of(context).transfertoadmin), + TranslationBase.of(context).transfertoadmin!), color: Colors.yellow[900], ), ), diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index 56846d80..b11c3b01 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index b53284a9..4f70f3f5 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; @@ -21,41 +21,41 @@ class MedicalFileDetails extends StatefulWidget { int encounterNumber; int pp; PatiantInformtion patient; - String clinicName; + String? clinicName; String episode; - String doctorName; + String? doctorName; String vistDate; - String doctorImage; + String? doctorImage; MedicalFileDetails( - {this.age, - this.firstName, - this.lastName, - this.gender, - this.encounterNumber, - this.pp, - this.patient, - this.doctorName, - this.vistDate, - this.clinicName, - this.episode, - this.doctorImage}); + {required this.age, + required this.firstName, + required this.lastName, + required this.gender, + required this.encounterNumber, + required this.pp, + required this.patient, + this.doctorName, + required this.vistDate, + this.clinicName, + required this.episode, + this.doctorImage}); @override _MedicalFileDetailsState createState() => _MedicalFileDetailsState( - firstName: firstName, - age: age, - lastName: lastName, - gender: gender, - encounterNumber: encounterNumber, - pp: pp, - patient: patient, - clinicName: clinicName, - doctorName: doctorName, - episode: episode, - vistDate: vistDate, - doctorImage: doctorImage, - ); + firstName: firstName, + age: age, + lastName: lastName, + gender: gender, + encounterNumber: encounterNumber, + pp: pp, + patient: patient, + clinicName: clinicName!, + doctorName: doctorName!, + episode: episode, + vistDate: vistDate, + doctorImage: doctorImage!, + ); } class _MedicalFileDetailsState extends State { @@ -73,51 +73,64 @@ class _MedicalFileDetailsState extends State { String doctorImage; _MedicalFileDetailsState( - {this.age, - this.firstName, - this.lastName, - this.gender, - this.encounterNumber, - this.pp, - this.patient, - this.doctorName, - this.vistDate, - this.clinicName, - this.episode, - this.doctorImage}); + {required this.age, + required this.firstName, + required this.lastName, + required this.gender, + required this.encounterNumber, + required this.pp, + required this.patient, + required this.doctorName, + required this.vistDate, + required this.clinicName, + required this.episode, + required this.doctorImage}); bool isPhysicalExam = true; bool isProcedureExpand = true; bool isHistoryExpand = true; bool isAssessmentExpand = true; + PatientProfileAppBarModel? patientProfileAppBarModel; + ProjectViewModel? projectViewModel; + @override - Widget build(BuildContext context) { + void didChangeDependencies() { ProjectViewModel projectViewModel = Provider.of(context); + patientProfileAppBarModel = PatientProfileAppBarModel( + patient: patient, + doctorName: doctorName, + profileUrl: doctorImage, + clinic: clinicName, + isPrescriptions: true, + isMedicalFile: true, + episode: episode, + visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( + vistDate, + ), isArabic: projectViewModel.isArabic)}', + isAppointmentHeader: true, + ); + + // TODO: implement didChangeDependencies + super.didChangeDependencies(); + } + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { if (model.medicalFileList.length == 0) { model.getMedicalFile(mrn: pp); } }, - builder: - (BuildContext context, MedicalFileViewModel model, Widget child) => - AppScaffold( - appBar: PatientProfileAppBar( - patient, - doctorName: doctorName, - profileUrl: doctorImage, - clinic: clinicName, - isPrescriptions: true, - isMedicalFile: true, - episode: episode, - visitDate: - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( - vistDate, - ), isArabic: projectViewModel.isArabic)}', - isAppointmentHeader: true, - ), + builder: (BuildContext? context, MedicalFileViewModel? model, Widget? child) => AppScaffold( + patientProfileAppBarModel: patientProfileAppBarModel!, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), + appBarTitle: TranslationBase.of(context!).medicalReport!.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -125,826 +138,617 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0 + model!.medicalFileList.length != 0 && + model.medicalFileList[0].entityList![0].timelines![encounterNumber].timeLineEvents![0] + .consulations!.length != + 0 ? Padding( - padding: EdgeInsets.all(10.0), - child: Container( - child: Column( - children: [ - SizedBox(height: 25.0), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + padding: EdgeInsets.all(10.0), + child: Container( + child: Column( + children: [ + SizedBox(height: 25.0), + if (model.medicalFileList.length != 0 && + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != + 0) + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context) + .historyOfPresentIllness! + .toUpperCase(), + variant: isHistoryExpand ? "bodyText" : '', + bold: isHistoryExpand ? true : true, + color: Colors.black), + ], ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), - ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + InkWell( + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstCheifComplaint! + .length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - TranslationBase.of( - context) - .historyOfPresentIllness - .toUpperCase(), - variant: isHistoryExpand - ? "bodyText" - : '', - bold: isHistoryExpand - ? true - : true, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = - !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstCheifComplaint - .length, - itemBuilder: (BuildContext ctxt, - int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Row( - children: [ - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstCheifComplaint[ - index] - .hOPI - .trim(), - ), - ), - SizedBox( - width: 35.0), - ], + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstCheifComplaint![index] + .hOPI! + .trim(), ), - ], - ), + ), + SizedBox(width: 35.0), + ], ), - ); - }), - isExpand: isHistoryExpand, - ), - ), - ), - // SizedBox( - // height: 30, - // ), + ], + ), + ), + ); + }), + isExpand: isHistoryExpand, + ), + ), + ), + // SizedBox( + // height: 30, + // ), - SizedBox( - height: 30, + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0 && + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != + 0) + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText(TranslationBase.of(context).assessment!.toUpperCase(), + variant: isAssessmentExpand ? "bodyText" : '', + bold: isAssessmentExpand ? true : true, + color: Colors.black), + ], ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), - ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: + Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments! + .length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - TranslationBase.of( - context) - .assessment - .toUpperCase(), - variant: - isAssessmentExpand - ? "bodyText" - : '', - bold: isAssessmentExpand - ? true - : true, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = - !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments - .length, - itemBuilder: (BuildContext ctxt, - int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Row( - children: [ - AppText( - 'ICD: ', - fontSize: 13.0, - ), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .iCD10 - .trim(), - fontSize: 13.5, - fontWeight: - FontWeight - .w700, - ), - SizedBox( - width: 15.0), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .condition + - ": ", - fontSize: 12.5, - ), - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .condition - .trim(), - fontSize: 13.0, - fontWeight: - FontWeight - .w700, - ), - ), - ], - ), - Row( - children: [ - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .description, - fontWeight: - FontWeight - .w700, - fontSize: 15.0, - ), - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .type + - ": ", - fontSize: 15.5, - ), - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .type, - fontSize: 16.0, - fontWeight: - FontWeight - .w700, - ), - ), - ], - ), - SizedBox( - height: 15.0, - ), - AppText( + Row( + children: [ + AppText( + 'ICD: ', + fontSize: 13.0, + ), + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .iCD10! + .trim(), + fontSize: 13.5, + fontWeight: FontWeight.w700, + ), + SizedBox(width: 15.0), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).condition! + ": ", + fontSize: 12.5, + ), + Expanded( + child: AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .remarks + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .condition! .trim(), + fontSize: 13.0, + fontWeight: FontWeight.w700, ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, + ), + ], + ), + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .description, + fontWeight: FontWeight.w700, + fontSize: 15.0, ), - SizedBox( - height: 8.0, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).type! + ": ", + fontSize: 15.5, + ), + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .type, + fontSize: 16.0, + fontWeight: FontWeight.w700, ), - ], - ), + ), + ], ), - ); - }), - isExpand: isAssessmentExpand, - ), - ), - ), + SizedBox( + height: 15.0, + ), + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .remarks! + .trim(), + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), + ), + ); + }), + isExpand: isAssessmentExpand, + ), + ), + ), - SizedBox( - height: 30, + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0 && + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != + 0) + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText(TranslationBase.of(context).test!.toUpperCase(), + variant: isProcedureExpand ? "bodyText" : '', + bold: isProcedureExpand ? true : true, + color: Colors.black), + ], ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), - ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + InkWell( + onTap: () { + setState(() { + isProcedureExpand = !isProcedureExpand; + }); + }, + child: + Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure! + .length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - TranslationBase.of( - context) - .test - .toUpperCase(), - variant: isProcedureExpand - ? "bodyText" - : '', - bold: isProcedureExpand - ? true - : true, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isProcedureExpand = - !isProcedureExpand; - }); - }, - child: Icon(isProcedureExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure - .length, - itemBuilder: (BuildContext ctxt, - int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Row( - children: [ - Column( - children: [ - AppText( - 'Procedure ID: ', - ), - AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .procedureId - .trim(), - fontSize: - 13.5, - fontWeight: - FontWeight - .w700, - ), - ], - ), - SizedBox( - width: 35.0), - Column( - children: [ - AppText( - TranslationBase.of( - context) - .orderDate + - ": ", - ), - AppText( - AppDateUtils.getDateFormatted( - DateTime - .parse( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .orderDate - .trim(), - )), - fontSize: - 13.5, - fontWeight: - FontWeight - .w700, - ), - ], - ), - ], - ), - SizedBox( - height: 20.0, - ), - Row( - children: [ - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .procName, - fontWeight: - FontWeight - .w700, - ), - ) - ], - ), - Row( - children: [ - AppText( - 'CPT Code : ', - ), - AppText( + Row( + children: [ + Column( + children: [ + AppText( + 'Procedure ID: ', + ), + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] + .procedureId! + .trim(), + fontSize: 13.5, + fontWeight: FontWeight.w700, + ), + ], + ), + SizedBox(width: 35.0), + Column( + children: [ + AppText( + TranslationBase.of(context).orderDate! + ": ", + ), + AppText( + AppDateUtils.getDateFormatted(DateTime.parse( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .patientID - .toString(), - fontWeight: - FontWeight - .w700, - ), - ], - ), - SizedBox( - height: 15.0, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] + .orderDate! + .trim(), + )), + fontSize: 13.5, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + SizedBox( + height: 20.0, + ), + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] + .procName, + fontWeight: FontWeight.w700, ), - ], - ), + ) + ], ), - ); - }), - isExpand: isProcedureExpand, - ), - ), - ), + Row( + children: [ + AppText( + 'CPT Code : ', + ), + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] + .patientID + .toString(), + fontWeight: FontWeight.w700, + ), + ], + ), + SizedBox( + height: 15.0, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), + ), + ); + }), + isExpand: isProcedureExpand, + ), + ), + ), - SizedBox( - height: 30, + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0 && + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != + 0) + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context) + .physicalSystemExamination! + .toUpperCase(), + variant: isPhysicalExam ? "bodyText" : '', + bold: isPhysicalExam ? true : true, + color: Colors.black), + ], ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), - ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + InkWell( + onTap: () { + setState(() { + isPhysicalExam = !isPhysicalExam; + }); + }, + child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam! + .length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( children: [ + Row( + children: [ + AppText(TranslationBase.of(context).examType! + ": "), + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] + .examDesc, + fontWeight: FontWeight.w700, + ), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] + .examDesc, + fontWeight: FontWeight.w700, + ) + ], + ), + Row( + children: [ + AppText(TranslationBase.of(context).abnormal! + ": "), + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] + .abnormal, + fontWeight: FontWeight.w700, + ), + ], + ), + SizedBox( + height: 15.0, + ), AppText( - TranslationBase.of( - context) - .physicalSystemExamination - .toUpperCase(), - variant: isPhysicalExam - ? "bodyText" - : '', - bold: isPhysicalExam - ? true - : true, - color: Colors.black), + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] + .remarks, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), ], ), - InkWell( - onTap: () { - setState(() { - isPhysicalExam = - !isPhysicalExam; - }); - }, - child: Icon(isPhysicalExam - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam - .length, - itemBuilder: (BuildContext ctxt, - int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - children: [ - Row( - children: [ - AppText(TranslationBase.of( - context) - .examType + - ": "), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] - .examDesc, - fontWeight: - FontWeight - .w700, - ), - ], - ), - Row( - children: [ - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] - .examDesc, - fontWeight: - FontWeight - .w700, - ) - ], - ), - Row( - children: [ - AppText(TranslationBase.of( - context) - .abnormal + - ": "), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] - .abnormal, - fontWeight: - FontWeight - .w700, - ), - ], - ), - SizedBox( - height: 15.0, - ), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] - .remarks, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], - ), - ), - ); - }), - isExpand: isPhysicalExam, - ), - ), - ), - SizedBox( - height: 30, + ), + ); + }), + isExpand: isPhysicalExam, ), - ], + ), ), + SizedBox( + height: 30, ), - ) + ], + ), + ), + ) : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText('No Data For This Visit '), - ), - SizedBox( - height: 100, - ), - ], - ), - ) + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText('No Data For This Visit '), + ), + SizedBox( + height: 100, + ), + ], + ), + ) ], ), ), diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 8bee4f37..6713d1bc 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -89,9 +89,7 @@ class _MedicineSearchState extends State { }); } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -124,10 +122,7 @@ class _MedicineSearchState extends State { return AppScaffold( // baseViewModel: model, isShowAppBar: true, - appBar: PatientSearchHeader( - title: TranslationBase.of(context).searchMedicine, - ), - //appBarTitle: TranslationBase.of(context).searchMedicine + "6", + appBarTitle: TranslationBase.of(context).searchMedicine!, body: SingleChildScrollView( child: FractionallySizedBox( widthFactor: 0.97, @@ -179,12 +174,10 @@ class _MedicineSearchState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).youCanFind + - (myController.text != '' - ? model.pharmacyItemsList.length.toString() - : '0') + + TranslationBase.of(context).youCanFind! + + (myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') + " " + - TranslationBase.of(context).itemsInSearch, + TranslationBase.of(context).itemsInSearch!, fontWeight: FontWeight.bold, ), ], diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 5ed16cea..376ccdd9 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -40,7 +40,7 @@ class _PharmaciesListState extends State { onModelReady: (model) => model.getPharmaciesList(widget.itemID), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).pharmaciesList, + appBarTitle: TranslationBase.of(context).pharmaciesList!, body: Container( height: SizeConfig.screenHeight, child: ListView( diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index 19c1de87..70bff0cd 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -85,7 +85,7 @@ class PatientSickLeaveScreen extends StatelessWidget { ), ), AddNewOrder( - label: TranslationBase.of(context).noSickLeaveApplied, + label: TranslationBase.of(context).noSickLeaveApplied!, onTap: () async { await locator().logEvent( eventCategory: "Add Sick Leave Screen" @@ -194,7 +194,7 @@ class PatientSickLeaveScreen extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .startDate + + .startDate! + ' ' ?? "", labelSize: SizeConfig @@ -218,7 +218,7 @@ class PatientSickLeaveScreen extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .endDate + + .endDate! + ' ' ?? "", labelSize: SizeConfig @@ -270,7 +270,7 @@ class PatientSickLeaveScreen extends StatelessWidget { ) : patient.patientStatusType != 43 ? ErrorMessage( - error: TranslationBase.of(context).noSickLeave, + error: TranslationBase.of(context).noSickLeave!, ) : SizedBox(), SizedBox( diff --git a/lib/screens/patients/In_patient/NoData.dart b/lib/screens/patients/In_patient/NoData.dart index 4e187731..89f7c65e 100644 --- a/lib/screens/patients/In_patient/NoData.dart +++ b/lib/screens/patients/In_patient/NoData.dart @@ -13,7 +13,7 @@ class NoData extends StatelessWidget { child: SingleChildScrollView( child: Container( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable)), + error: TranslationBase.of(context).noDataAvailable!)), ), ); } diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index 37159611..d6e20254 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -141,13 +141,13 @@ class _InPatientScreenState extends State // unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, - TranslationBase.of(context).inPatientAll,context: context, + TranslationBase.of(context).inPatientAll!,context: context, counter: model.inPatientList.length, isFirst: true), tabWidget(screenSize, _activeTab == 1, - TranslationBase.of(context).myInPatientTitle, + TranslationBase.of(context).myInPatientTitle!, counter: model.myIinPatientList.length, isMiddle: true, context: context,), tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged, isLast:true, context: context,), + TranslationBase.of(context).discharged!, isLast:true, context: context,), ], ), ), @@ -200,7 +200,7 @@ class _InPatientScreenState extends State {int counter = -1, bool isFirst = false, bool isMiddle = false, - bool isLast = false,BuildContext context}) { + bool isLast = false,required BuildContext context}) { ProjectViewModel projectsProvider = Provider.of(context); diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 431a429b..7863eaf1 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -69,7 +69,7 @@ class _FilterDatePageState extends State { TranslationBase.of(context).fromDate!, widget.patientSearchViewModel.selectedFromDate != null ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" - : null, + : "", true, suffixIcon: Icon( Icons.calendar_today, @@ -94,7 +94,7 @@ class _FilterDatePageState extends State { TranslationBase.of(context).toDate!, widget.patientSearchViewModel.selectedToDate != null ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" - : null, + : "", true, suffixIcon: Icon( Icons.calendar_today, @@ -145,18 +145,18 @@ class _FilterDatePageState extends State { "Please Select All The date Fields "); } else { Duration difference = widget - .patientSearchViewModel.selectedToDate + .patientSearchViewModel.selectedToDate! .difference(widget - .patientSearchViewModel.selectedFromDate); + .patientSearchViewModel!.selectedFromDate!); if (difference.inDays > 90) { Helpers.showErrorToast( "The difference between from date and end date must be less than 3 months"); } else { String dateTo = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedToDate, + widget.patientSearchViewModel.selectedToDate!, 'yyyy-MM-dd'); String dateFrom = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedFromDate, + widget.patientSearchViewModel.selectedFromDate!, 'yyyy-MM-dd'); PatientSearchRequestModel currentModel = @@ -240,9 +240,8 @@ class _FilterDatePageState extends State { } } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String? hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index a43a4582..c5af8861 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -35,13 +35,13 @@ class OutPatientsScreen extends StatefulWidget { final isAppbar; final arrivalType; final isView; - final PatientType selectedPatientType; - final PatientSearchRequestModel patientSearchRequestModel; + final PatientType? selectedPatientType; + final PatientSearchRequestModel? patientSearchRequestModel; final bool isSearchWithKeyInfo; final bool isSearch; final bool isInpatient; final bool isSearchAndOut; - final String searchKey; + final String? searchKey; OutPatientsScreen( {this.patientSearchForm, @@ -62,21 +62,21 @@ class OutPatientsScreen extends StatefulWidget { } class _OutPatientsScreenState extends State { - int clinicId; - AuthenticationViewModel authenticationViewModel; + late int clinicId; + late AuthenticationViewModel authenticationViewModel; List _times = []; int _activeLocation = 1; - String patientType; - String patientTypeTitle; + String? patientType; + late String patientTypeTitle; var selectedFilter = 1; - String arrivalType; - ProjectViewModel projectsProvider; + late String arrivalType; + late ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - PatientModel patient; + late PatientModel patient; OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; bool isSortDes = true; @@ -85,15 +85,15 @@ class _OutPatientsScreenState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); _times = [ - TranslationBase.of(context).previous, - TranslationBase.of(context).today, - TranslationBase.of(context).nextWeek, + TranslationBase.of(context).previous!, + TranslationBase.of(context).today!, + TranslationBase.of(context).nextWeek!, ]; final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - await model.getOutPatient(widget.patientSearchRequestModel); + await model.getOutPatient(widget.patientSearchRequestModel!); }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", @@ -223,8 +223,7 @@ class _OutPatientsScreenState extends State { child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, + error: TranslationBase.of(context).youDontHaveAnyPatient ?? "", ), ) : ListView.builder( @@ -243,8 +242,8 @@ class _OutPatientsScreenState extends State { horizontal: 8, vertical: 0), child: PatientCard( patientInfo: model.filterData[index], - patientType: patientType, - arrivalType: arrivalType, + patientType: "1", + arrivalType: "1", isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, onTap: () { @@ -255,9 +254,9 @@ class _OutPatientsScreenState extends State { "patient": model.filterData[index], "patientType": "1", "from": widget - .patientSearchRequestModel.from, + .patientSearchRequestModel!.from, "to": widget - .patientSearchRequestModel.from, + .patientSearchRequestModel!.from!, "isSearch": false, "isInpatient": false, "arrivalType": "7", diff --git a/lib/screens/patients/patient_search/patient_search_header.dart b/lib/screens/patients/patient_search/patient_search_header.dart index 2dd01e1a..2f0a131c 100644 --- a/lib/screens/patients/patient_search/patient_search_header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { final String title; - const PatientSearchHeader({Key key, this.title}) : super(key: key); + const PatientSearchHeader({Key? key, required this.title}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/patient_search/patient_search_result_screen.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart index b0ec2943..7f11d32b 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -31,12 +31,12 @@ class PatientsSearchResultScreen extends StatefulWidget { final String searchKey; PatientsSearchResultScreen( - {this.selectedPatientType, - this.patientSearchRequestModel, + {required this.selectedPatientType, + required this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, this.isInpatient = false, - this.searchKey, + required this.searchKey, this.isSearchAndOut = false}); @override @@ -44,20 +44,19 @@ class PatientsSearchResultScreen extends StatefulWidget { _PatientsSearchResultScreenState(); } -class _PatientsSearchResultScreenState - extends State { - int clinicId; - AuthenticationViewModel authenticationViewModel; +class _PatientsSearchResultScreenState extends State { + late int clinicId; + late AuthenticationViewModel authenticationViewModel; - String patientType; - String patientTypeTitle; + String? patientType; + String? patientTypeTitle; var selectedFilter = 1; - String arrivalType; - ProjectViewModel projectsProvider; + String? arrivalType; + late ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - PatientModel patient; + late PatientModel patient; @override Widget build(BuildContext context) { @@ -89,14 +88,15 @@ class _PatientsSearchResultScreenState }, marginTop: 5, suffixIcon: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - // padding: EdgeInsets.only(bottom: 30), - ), - ), + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + // padding: EdgeInsets.only(bottom: 30), + onPressed: () {}, + ), + ), SizedBox( height: 10.0, ), @@ -105,8 +105,7 @@ class _PatientsSearchResultScreenState child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, + error: TranslationBase.of(context).youDontHaveAnyPatient ?? "", ), ) : ListView.builder( @@ -118,8 +117,8 @@ class _PatientsSearchResultScreenState padding: EdgeInsets.all(8.0), child: PatientCard( patientInfo: model.filterData[index], - patientType: patientType, - arrivalType: arrivalType, + patientType: patientType ?? "", + arrivalType: arrivalType ?? "", isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, onTap: () { diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index b3cfcada..9e9c4c37 100644 --- a/lib/screens/patients/patient_search/patient_search_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -30,7 +30,7 @@ class _PatientSearchScreenState extends State { TextEditingController middleNameInfoController = TextEditingController(); TextEditingController lastNameFileInfoController = TextEditingController(); PatientType selectedPatientType = PatientType.inPatient; - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -45,8 +45,7 @@ class _PatientSearchScreenState extends State { child: Center( child: Column( children: [ - BottomSheetTitle( - title: TranslationBase.of(context).searchPatient), + BottomSheetTitle(title: TranslationBase.of(context).searchPatient!), FractionallySizedBox( // widthFactor: 0.9, child: Container( diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index 6a20d0c0..9b42e444 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -16,7 +16,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class AdmissionOrdersScreen extends StatefulWidget { - const AdmissionOrdersScreen({Key key}) : super(key: key); + const AdmissionOrdersScreen({Key? key}) : super(key: key); @override _AdmissionOrdersScreenState createState() => _AdmissionOrdersScreenState(); @@ -25,23 +25,23 @@ class AdmissionOrdersScreen extends StatefulWidget { class _AdmissionOrdersScreenState extends State { bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => model.getAdmissionOrders( - admissionNo: int.parse(patient.admissionNo), - patientId: patient.patientMRN), + admissionNo: int.parse(patient!.admissionNo!), + patientId: patient!.patientMRN!), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -53,11 +53,8 @@ class _AdmissionOrdersScreenState extends State { isShowAppBar: true, body: model.admissionOrderList == null || model.admissionOrderList.length == 0 - ? Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, - ), - ) + ? DrAppEmbeddedError( + error: TranslationBase.of(context).noDataAvailable!) : Container( color: Colors.grey[200], child: Column( diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index 9fa78cef..3466fee2 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-view import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -41,16 +42,16 @@ class _AdmissionRequestThirdScreenState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileAppBar(patient), - appBarTitle: TranslationBase.of(context).admissionRequest, + patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), + appBarTitle: TranslationBase.of(context)!.admissionRequest!, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -217,7 +218,7 @@ class _AdmissionRequestThirdScreenState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileAppBar(patient), - appBarTitle: TranslationBase.of(context).admissionRequest, + patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), + + appBarTitle: TranslationBase.of(context).admissionRequest!, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -154,7 +156,7 @@ class _AdmissionRequestThirdScreenState extends State GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.Idle && model.icdCodes.length > 0) { openListDialogField('description', 'code', model.icdCodes, (selectedValue) { diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 0258d26f..06e8d828 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-view import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -40,28 +41,28 @@ class _AdmissionRequestSecondScreenState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileAppBar(patient), - appBarTitle: TranslationBase.of(context).admissionRequest, + patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), + appBarTitle: TranslationBase.of(context).admissionRequest!, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -187,15 +188,16 @@ class _AdmissionRequestSecondScreenState extends State { DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4) ]; - DiabeticType selectedDiabeticType; + late DiabeticType selectedDiabeticType; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; ProjectViewModel projectsProvider = Provider.of(context); return BaseView( onModelReady: (model) async { selectedDiabeticType = diabeticType[2]; - await model.getDiabeticChartValues(patient, selectedDiabeticType.value, isLocalBusy: false); + await model.getDiabeticChartValues(patient, selectedDiabeticType.value!, + isLocalBusy: false); generateData(model); }, builder: (_, model, w) => AppScaffold( @@ -164,7 +165,7 @@ class _DiabeticChartState extends State { color: Colors.white, borderRadius: BorderRadius.circular(12)), child: LineChartForDiabetic( - title: selectedDiabeticType.nameEn, + title: selectedDiabeticType.nameEn!, isOX: false, timeSeries1: timeSeriesData1, // timeSeries2: timeSeriesData2, @@ -201,7 +202,7 @@ class _DiabeticChartState extends State { ], ), ) - : Center(child: ErrorMessage(error: TranslationBase.of(context).noItem)), + : ErrorMessage(error: TranslationBase.of(context).noItem!), ], ), )), @@ -213,21 +214,21 @@ class _DiabeticChartState extends State { model.diabeticChartValuesList.toList().forEach( (element) { DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(element.dateChart); - if (element.resultValue.toInt() != 0) + AppDateUtils.getDateTimeFromServerFormat(element.dateChart!); + if (element.resultValue!.toInt() != 0) timeSeriesData1.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.resultValue.toDouble(), + element.resultValue!.toDouble(), ), ); - if (element.resultValue.toInt() != 0) + if (element.resultValue!.toInt() != 0) timeSeriesData2.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.resultValue.toDouble(), + element.resultValue!.toDouble(), ), ); }, @@ -243,8 +244,9 @@ class _DiabeticChartState extends State { timeSeriesData2.clear(); }); - await model.getDiabeticChartValues(patient, selectedDiabeticType.value,isLocalBusy:true); - if(model.state == ViewState.ErrorLocal){ + await model.getDiabeticChartValues(patient, selectedDiabeticType.value!, + isLocalBusy: true); + if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } generateData(model); diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart index b3b1b581..22c42db4 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart @@ -12,8 +12,10 @@ import 'package:provider/provider.dart'; class DiabeticDetails extends StatefulWidget { final List diabeticDetailsList; - DiabeticDetails( - {Key key, this.diabeticDetailsList,}); + DiabeticDetails({ + Key? key, + required this.diabeticDetailsList, + }); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -70,7 +72,8 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: + BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -85,7 +88,7 @@ class _VitalSignDetailsWidgetState extends State { widget.diabeticDetailsList.forEach((diabetic) { var data = diabetic.resultValue; DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart); + AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart!); if (data != 0) tableRow.add(TableRow(children: [ Container( diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index e2e2bd78..544723b7 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -33,7 +33,7 @@ import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class DiagnosisScreen extends StatefulWidget { - const DiagnosisScreen({Key ? key}) : super(key: key); + const DiagnosisScreen({Key? key}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); @@ -41,20 +41,20 @@ class DiagnosisScreen extends StatefulWidget { class _ProgressNoteState extends State { bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; getDiagnosisForInPatient(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); print(type); GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel = GetDiagnosisForInPatientRequestModel( - admissionNo: int.parse(patient.admissionNo), - patientTypeID: patient.patientType, + admissionNo: int.parse(patient!.admissionNo!), + patientTypeID: patient!.patientType!, patientID: patient.patientId, setupID: "010266"); model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); @@ -64,7 +64,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; @@ -82,7 +82,7 @@ class _ProgressNoteState extends State { model.diagnosisForInPatientList.length == 0 ? Center( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, + error: TranslationBase.of(context)!.noDataAvailable!, ), ) : Container( diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index 532d5e46..a20ead40 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -10,10 +10,9 @@ import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; class AllDischargeSummary extends StatefulWidget { - final Function changeCurrentTab; final PatiantInformtion patient; - const AllDischargeSummary({this.changeCurrentTab, this.patient}); + const AllDischargeSummary({ required this.patient}); @override _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); @@ -27,7 +26,7 @@ class _AllDischargeSummaryState extends State { onModelReady: (model) { model.getAllDischargeSummary( patientId: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), ); }, builder: (_, model, w) => AppScaffold( @@ -37,7 +36,7 @@ class _AllDischargeSummaryState extends State { model.allDisChargeSummaryList.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable), + error: TranslationBase.of(context).noDataAvailable!), ) : Column( children: [ diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 67303256..34bd650c 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -24,17 +24,17 @@ class LabsHomePage extends StatefulWidget { } class _LabsHomePageState extends State { - String patientType; + late String patientType; - String arrivalType; - PatiantInformtion patient; - bool isInpatient; - bool isFromLiveCare; + late String arrivalType; + late PatiantInformtion patient; + late bool isInpatient; + late bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -70,8 +70,8 @@ class _LabsHomePageState extends State { if (model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) ServiceTitle( - title: TranslationBase.of(context).lab, - subTitle: TranslationBase.of(context).result, + title: TranslationBase.of(context).lab!, + subTitle: TranslationBase.of(context).result!, ), if (patient.patientStatusType != null && patient.patientStatusType == 43) @@ -111,7 +111,7 @@ class _LabsHomePageState extends State { ), ); }, - label: TranslationBase.of(context).applyForNewLabOrder, + label: TranslationBase.of(context).applyForNewLabOrder!, ), ...List.generate( model.patientLabOrdersList.length, @@ -136,10 +136,10 @@ class _LabsHomePageState extends State { width: 20, decoration: BoxDecoration( color: model.patientLabOrdersList[index] - .isLiveCareAppointment + .isLiveCareAppointment! ? Colors.red[900] : !model.patientLabOrdersList[index] - .isInOutPatient + .isInOutPatient! ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -161,17 +161,17 @@ class _LabsHomePageState extends State { child: Center( child: Text( model.patientLabOrdersList[index] - .isLiveCareAppointment + .isLiveCareAppointment! ? TranslationBase.of(context) - .liveCare + .liveCare! .toUpperCase() : !model.patientLabOrdersList[index] - .isInOutPatient + .isInOutPatient! ? TranslationBase.of(context) - .inPatientLabel + .inPatientLabel! .toUpperCase() : TranslationBase.of(context) - .outpatient + .outpatient! .toUpperCase(), style: TextStyle(color: Colors.white), ), @@ -198,17 +198,17 @@ class _LabsHomePageState extends State { ), ), doctorName: - model.patientLabOrdersList[index].doctorName, + model.patientLabOrdersList[index].doctorName!, invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', profileUrl: model - .patientLabOrdersList[index].doctorImageURL, + .patientLabOrdersList[index].doctorImageURL!, branch: - model.patientLabOrdersList[index].projectName, + model.patientLabOrdersList[index].projectName!, clinic: model - .patientLabOrdersList[index].clinicDescription, + .patientLabOrdersList[index].clinicDescription!, appointmentDate: - model.patientLabOrdersList[index].orderDate, + model.patientLabOrdersList[index].orderDate!, orderNo: model.patientLabOrdersList[index].orderNo, isShowTime: false, ), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index a20d8228..90b4e572 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -298,23 +298,9 @@ class Helpers { return htmlRegex.hasMatch(text); } - static getNameFromKPI(String kpi) { - if (kpi.indexOf("(") > -1) - return kpi.substring(0, kpi.indexOf("(")); - else - return kpi; - } - - static getLabelFromKPI(String kpi) { - if (kpi.indexOf("(") > -1 && kpi.indexOf(")") > -1) - return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")")); - else - return ''; - } - - static String timeFrom({Duration? duration}) { + static String timeFrom({required Duration duration}) { String twoDigits(int n) => n.toString().padLeft(2, "0"); - String twoDigitMinutes = twoDigits(duration!.inMinutes.remainder(60)); + String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60)); String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); return "$twoDigitMinutes:$twoDigitSeconds"; } @@ -327,4 +313,138 @@ class Helpers { ? 8 : 6); } + + static getLabelFromKPI(String kpi) { + if (kpi.indexOf("(") > -1 && kpi.indexOf(")") > -1) + return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")")); + else + return ''; + } + + static getNameFromKPI(String kpi) { + if (kpi.indexOf("(") > -1) + return kpi.substring(0, kpi.indexOf("(")); + else + return kpi; + } + + static getBoxTabsBoxDecoration( + {bool isFirst = false, + bool isMiddle = false, + bool isLast = false, + bool isActive = false, + double radius = 6.0, required ProjectViewModel projectViewModel}) { + return BoxDecoration( + color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic?Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0):Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0), + + + topLeft: projectViewModel.isArabic? Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0):Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0), + bottomRight: projectViewModel.isArabic? Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0): Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0), + bottomLeft:projectViewModel.isArabic? Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0): Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0)), + ); + } + + static getBgTabColor() { + return Color(0xFFEAEAEA); + } + + static getTabText({ + required String title, + bool isActive = false, + }) { + return AppText( + title, + fontSize: SizeConfig.textMultiplier * 1.8, + color: isActive ? Colors.white : AppGlobal.appTextColor, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ); + } + + static getTabHeight(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return screenSize.height * 0.07; + } + + static getTabCounter({bool isActive: false, int? counter}) { + return Container( + margin: EdgeInsets.all(4), + width: 15, + height: 15, + decoration: BoxDecoration( + color: isActive ? Colors.white : AppGlobal.appRedColor, + shape: BoxShape.circle, + ), + child: Center( + child: FittedBox( + child: AppText( + "$counter", + fontSize: SizeConfig.textMultiplier * 1.5, + color: !isActive ? Colors.white : AppGlobal.appRedColor, + fontWeight: FontWeight.w700, + ), + ), + ), + ); + } + + static String convertToTitleCase(String text) { + + + if (text.length <= 1) { + return text.toUpperCase(); + } + + // Split string into multiple words + final List words = text.split(' '); + + // Capitalize first letter of each words + final capitalizedWords = words.map((word) { + if (word.trim().isNotEmpty) { + final String firstLetter = word.trim().substring(0, 1).toUpperCase(); + final String remainingLetters = word.trim().substring(1).toLowerCase(); + + return '$firstLetter$remainingLetters'; + } + return ''; + }); + + // Join/Merge all words back to one String + return capitalizedWords.join(' '); + } } diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 10707afc..cc28b2ea 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -126,7 +126,7 @@ class SMSOTP { padding: EdgeInsets.only(top: 5, right: 5), child: AppText( TranslationBase.of(context) - .verificationMessage + + .verificationMessage! + ' XXXXXX' + mobileNo.toString().substring( mobileNo.toString().length - 3), @@ -311,7 +311,7 @@ class SMSOTP { children: [ AppText( TranslationBase.of(context) - .validationMessage + + .validationMessage! + ' ', textAlign: TextAlign.start, fontWeight: FontWeight.w700, diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 6b877fae..737909f8 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -51,7 +51,7 @@ class _VerificationMethodsListState extends State { onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)}, label:TranslationBase .of(context) - .verifyWith+ TranslationBase.of(context)!.verifySMS, + .verifyWith!+ TranslationBase.of(context)!.verifySMS!, ); break; case AuthMethodTypes.Fingerprint: @@ -64,7 +64,7 @@ class _VerificationMethodsListState extends State { }, label: TranslationBase .of(context) - .verifyWith+TranslationBase.of(context).verifyFingerprint, + .verifyWith!+TranslationBase.of(context).verifyFingerprint!, ); break; case AuthMethodTypes.FaceID: @@ -77,7 +77,7 @@ class _VerificationMethodsListState extends State { }, label: TranslationBase .of(context) - .verifyWith+TranslationBase.of(context).verifyFaceID, + .verifyWith!+TranslationBase.of(context).verifyFaceID!, ); break; diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart deleted file mode 100644 index 67c44c3b..00000000 --- a/lib/widgets/charts/app_bar_chart.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/material.dart'; - -class AppBarChart extends StatelessWidget { - const AppBarChart({ - Key ? key, - @required this.seriesList, - }) : super(key: key); - - final List seriesList; - - @override - Widget build(BuildContext context) { - return Container( - height: 400, - margin: EdgeInsets.only(top: 60), - child: charts.BarChart( - seriesList, - // animate: animate, - - /// Customize the primary measure axis using a small tick renderer. - /// Use String instead of num for ordinal domain axis - /// (typically bar charts). - primaryMeasureAxis: new charts.NumericAxisSpec( - renderSpec: new charts.GridlineRendererSpec( - // Display the measure axis labels below the gridline. - // - // 'Before' & 'after' follow the axis value direction. - // Vertical axes draw 'before' below & 'after' above the tick. - // Horizontal axes draw 'before' left & 'after' right the tick. - labelAnchor: charts.TickLabelAnchor.before, - - // Left justify the text in the axis. - // - // Note: outside means that the secondary measure axis would right - // justify. - labelJustification: - charts.TickLabelJustification.outside, - )), - ), - ); - } -} diff --git a/lib/widgets/dashboard/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart index 659e4562..bf91fb09 100644 --- a/lib/widgets/dashboard/dashboard_item_texts_widget.dart +++ b/lib/widgets/dashboard/dashboard_item_texts_widget.dart @@ -26,7 +26,7 @@ class DashboardItemTexts extends StatefulWidget { } class _DashboardItemTextsState extends State { - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 1962549b..9ef4d83c 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -15,10 +15,10 @@ class GetOutPatientStack extends StatelessWidget { double barHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightLarge?20:17); - value.summaryoptions.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + value.summaryoptions.sort((Summaryoptions a, Summaryoptions b) => b.value! - a.value!); value.summaryoptions - .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + .sort((Summaryoptions a, Summaryoptions b) => b.value! - a.value!); var list = []; value.summaryoptions.forEach((result) => diff --git a/lib/widgets/patients/clinic_list_dropdwon.dart b/lib/widgets/patients/clinic_list_dropdwon.dart deleted file mode 100644 index f9795ee8..00000000 --- a/lib/widgets/patients/clinic_list_dropdwon.dart +++ /dev/null @@ -1,99 +0,0 @@ -// ignore: must_be_immutable -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class ClinicList extends StatelessWidget { - - ProjectViewModel projectsProvider; - final int clinicId; - final Function (int value) onClinicChange; - - ClinicList({Key ? key, this.clinicId, this.onClinicChange}) : super(key: key); - - @override - Widget build(BuildContext context) { - // authProvider = Provider.of(context); - - projectsProvider = Provider.of(context); - return Container( - child: - projectsProvider - .doctorClinicsList.length > - 0 - ? FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width *0.8, - child: Center( - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: - Colors.white, - iconEnabledColor: - Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[ - 0] - .clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item.clinicName, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors - .black, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue){ - onClinicChange(newValue); - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: - TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), - ), - ), - ], - ), - ) - : AppText( - TranslationBase - .of(context) - .noClinic), - ); - } -} \ No newline at end of file diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart deleted file mode 100644 index d2a68acd..00000000 --- a/lib/widgets/patients/dynamic_elements.dart +++ /dev/null @@ -1,163 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; - -class DynamicElements extends StatefulWidget { - final PatientModel _patientSearchFormValues; - final bool isFormSubmitted; - DynamicElements(this._patientSearchFormValues, this.isFormSubmitted); - @override - _DynamicElementsState createState() => _DynamicElementsState(); -} - -class _DynamicElementsState extends State { - TextEditingController _toDateController = new TextEditingController(); - TextEditingController _fromDateController = new TextEditingController(); - void _presentDatePicker(id) { - showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime(2019), - lastDate: DateTime.now(), - ).then((pickedDate) { - if (pickedDate == null) { - return; - } - setState(() { - print(id); - var selectedDate = DateFormat.yMd().format(pickedDate); - - if (id == '_selectedFromDate') { - // _fromDateController.text = selectedDate; - selectedDate = pickedDate.year.toString() + - "-" + - pickedDate.month.toString().padLeft(2, '0') + - "-" + - pickedDate.day.toString().padLeft(2, '0'); - - _fromDateController.text = selectedDate; - } else { - selectedDate = pickedDate.year.toString() + - "-" + - pickedDate.month.toString().padLeft(2, '0') + - "-" + - pickedDate.day.toString().padLeft(2, '0'); - - _toDateController.text = selectedDate; - // _toDateController.text = selectedDate; - } - }); - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - InputDecoration textFieldSelectorDecoration( - {String hintText, - String selectedText, - bool isDropDown, - IconData icon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - return LayoutBuilder( - builder: (ctx, constraints) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - borderColor: Colors.white, - onTap: () => _presentDatePicker('_selectedFromDate'), - hintText: TranslationBase.of(context).fromDate, - controller: _fromDateController, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_fromDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.From = "0"; - } else { - widget._patientSearchFormValues.From = - _fromDateController.text.replaceAll("/", "-"); - } - }, - readOnly: true, - )), - SizedBox( - height: 5, - ), - if (widget._patientSearchFormValues.From == "0" && - widget.isFormSubmitted) - CustomValidationError(), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), - borderRadius: BorderRadius.all(Radius.circular(6.0))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - readOnly: true, - borderColor: Colors.white, - hintText: TranslationBase.of(context).toDate, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_toDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.To = "0"; - } else { - widget._patientSearchFormValues.To = - _toDateController.text.replaceAll("/", "-"); - } - }, - )), - if (widget._patientSearchFormValues.To == "0" && - widget.isFormSubmitted) - CustomValidationError(), - SizedBox( - height: 10, - ), - ], - ); - }, - ); - } -} diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 30204dbf..d28297e6 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -51,6 +51,7 @@ class PatientCard extends StatelessWidget { ? patientInfo.nationalityId : ""; + ProjectViewModel projectViewModel = Provider.of(context); return Container( width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), diff --git a/lib/widgets/patients/patient_service_title.dart b/lib/widgets/patients/patient_service_title.dart index 9785319c..839d5ab7 100644 --- a/lib/widgets/patients/patient_service_title.dart +++ b/lib/widgets/patients/patient_service_title.dart @@ -6,7 +6,7 @@ class ServiceTitle extends StatefulWidget { final String title; final String subTitle; - const ServiceTitle({Key ? key, this.title, this.subTitle}) : super(key: key); + const ServiceTitle({Key ? key, required this.title, required this.subTitle}) : super(key: key); @override _ServiceTitleState createState() => _ServiceTitleState(); diff --git a/lib/widgets/patients/profile/Profile_general_info_Widget.dart b/lib/widgets/patients/profile/Profile_general_info_Widget.dart deleted file mode 100644 index b6e32c4f..00000000 --- a/lib/widgets/patients/profile/Profile_general_info_Widget.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:flutter/material.dart'; - -import './profile_general_info_content_widget.dart'; -import '../../../config/size_config.dart'; -import '../../shared/rounded_container_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:21/4/2020 - *@param: - *@return: ProfileGeneralInfoWidget - *@desc: Profile General Info Widget class - */ -class ProfileGeneralInfoWidget extends StatelessWidget { - ProfileGeneralInfoWidget({Key ? key, this.patient}) : super(key: key); - - PatiantInformtion patient; - - @override - Widget build(BuildContext context) { - // PatientsProvider patientsProv = Provider.of(context); - // patient = patientsProv.getSelectedPatient(); - return RoundedContainer( - child: ListView( - children: [ - ProfileGeneralInfoContentWidget( - title: "Age", - info: '${patient.age}', - ), - ProfileGeneralInfoContentWidget( - title: "Contact Number", - info: '${patient.mobileNumber}', - ), - ProfileGeneralInfoContentWidget( - title: "Email", - info: '${patient.emailAddress}', - ), - ], - ), - width: SizeConfig.screenWidth * 0.70, - height: SizeConfig.screenHeight * 0.25, - ); - } -} diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index 03ad1362..8af1c320 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -31,7 +31,7 @@ class LargeAvatar extends StatelessWidget { borderRadius:BorderRadius.circular(50), child: Image.network( - url, + url!, fit: BoxFit.fill, width: 700, ), diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 323e75b9..bb546bef 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -326,7 +326,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget } convertDateFormat2(String str) { - String newDate; + late String newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; diff --git a/lib/widgets/patients/profile/profile_general_info_content_widget.dart b/lib/widgets/patients/profile/profile_general_info_content_widget.dart deleted file mode 100644 index f5c70ae6..00000000 --- a/lib/widgets/patients/profile/profile_general_info_content_widget.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../config/size_config.dart'; -import '../../shared/app_texts_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:22/4/2020 - *@param: title, info - *@return:ProfileGeneralInfoContentWidget - *@desc: Profile General Info Content Widget - */ -class ProfileGeneralInfoContentWidget extends StatelessWidget { - String title; - String info; - - ProfileGeneralInfoContentWidget({this.title, this.info}); - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 14), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - AppText( - title, - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.w700, - color: HexColor('#58434F'), - ), - AppText( - info, - color: HexColor('#707070'), - fontSize: SizeConfig.textMultiplier * 2, - ) - ], - ), - ); - } -} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart deleted file mode 100644 index 35c08900..00000000 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ /dev/null @@ -1,176 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/routes.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { - final String from; - final String to; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final bool isInpatient; - final bool isDischargedPatient; - - ProfileMedicalInfoWidgetInPatient( - {Key ? key, - this.patient, - this.patientType, - this.arrivalType, - this.from, - this.to, - this.isInpatient, - this.isDischargedPatient = false}); - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'assets/images/svgs/profile_screen/vital signs.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'assets/images/svgs/profile_screen/lab results.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'assets/images/svgs/profile_screen/health summary.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'assets/images/svgs/profile_screen/order prescription.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: "Sheet", //TranslationBase.of(context).orders, - icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'assets/images/svgs/profile_screen/Order Procedures.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: HEALTH_SUMMARY, - nameLine1: "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'assets/images/svgs/profile_screen/health summary.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: HEALTH_SUMMARY, - nameLine1: "Medical", //Health - //TranslationBase.of(context).medicalReport, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'assets/images/svgs/profile_screen/health summary.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'assets/images/svgs/profile_screen/insurance approval.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), - ], - ), - ); - } -}