From daf125b995331725258f05efb756293e1e7ad2e5 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 17 Jun 2021 09:30:09 +0300 Subject: [PATCH] flutter 2 migration --- .../profile/note/progress_note_screen.dart | 20 +++++++++---------- .../refer-patient-screen-in-patient.dart | 12 +++++------ .../profile/add-order/addNewOrder.dart | 4 ++-- ..._header_with_appointment_card_app_bar.dart | 10 +++++----- .../shared/text_fields/text_fields_utils.dart | 2 +- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index cb454172..939b6bf3 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -40,8 +40,8 @@ class _ProgressNoteState extends State { late List notesList; var filteredNotesList; bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + AuthenticationViewModel? authenticationViewModel; + ProjectViewModel? projectViewModel; getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; @@ -65,8 +65,8 @@ class _ProgressNoteState extends State { @override Widget build(BuildContext context) { - authenticationViewModel = Provider.of(context); - projectViewModel = Provider.of(context); + // authenticationViewModel = Provider.of(context); + // projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; @@ -117,7 +117,7 @@ class _ProgressNoteState extends State { child: CardWithBgWidget( hasBorder: false, bgColor: model.patientProgressNoteList[index].status == 1 && - authenticationViewModel.doctorProfile!.doctorID != + authenticationViewModel!.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy ? Color(0xFFCC9B14) : model.patientProgressNoteList[index].status == 4 @@ -131,7 +131,7 @@ class _ProgressNoteState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ if (model.patientProgressNoteList[index].status == 1 && - authenticationViewModel.doctorProfile!.doctorID != + authenticationViewModel!.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy) AppText( TranslationBase.of(context).notePending, @@ -155,7 +155,7 @@ class _ProgressNoteState extends State { ), if (model.patientProgressNoteList[index].status != 2 && model.patientProgressNoteList[index].status != 4 && - authenticationViewModel.doctorProfile!.doctorID == + authenticationViewModel!.doctorProfile!.doctorID == model.patientProgressNoteList[index].createdBy) Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -350,9 +350,9 @@ class _ProgressNoteState extends State { ? AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDateTimeFromServerFormat( model.patientProgressNoteList[index].createdOn ?? ""), - isArabic: projectViewModel.isArabic) + isArabic: projectViewModel!.isArabic) : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), - isArabic: projectViewModel.isArabic), + isArabic: projectViewModel!.isArabic), fontWeight: FontWeight.w600, fontSize: 14, ), @@ -442,7 +442,7 @@ class _ProgressNoteState extends State { padding: EdgeInsets.all(20), color: Colors.white, child: AppText( - projectViewModel.isArabic + projectViewModel!.isArabic ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" : 'Are you sure you want $actionName this order?', fontSize: 15, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index dc7da44d..348c611a 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -41,11 +41,11 @@ class _PatientMakeInPatientReferralScreenState extends State