From 1bc355b2c42cb91cbac91e78e9bb5effc6085477 Mon Sep 17 00:00:00 2001 From: "Aamir.Muhammad" Date: Sun, 3 Dec 2023 15:35:04 +0300 Subject: [PATCH] Null Safety Updates 3.16 --- lib/main.dart | 4 +- .../patient_search/patient_search_header.dart | 2 +- .../procedures/add_procedure_page.dart | 61 +- .../base_add_procedure_tab_page.dart | 34 +- .../entity_list_checkbox_search_widget.dart | 44 +- .../procedures/expansion_procedure.dart | 46 +- .../add_favourite_procedure.dart | 16 +- .../entity_list_fav_procedure.dart | 52 +- .../procedure_checkout_screen.dart | 50 +- lib/screens/procedures/procedure_card.dart | 59 +- lib/screens/procedures/procedure_screen.dart | 69 +- lib/screens/procedures/procedure_type.dart | 8 +- lib/screens/procedures/update_procedure.dart | 248 +-- lib/screens/qr_reader/QR_reader_screen.dart | 14 +- .../add_reschedule_leave.dart | 16 +- .../reschedule_leaves/reschedule_leave.dart | 277 +-- lib/utils/date-utils.dart | 4 +- lib/utils/dr_app_shared_pref.dart | 2 +- lib/utils/extenstions_utils.dart | 6 +- lib/utils/notification_permission_utils.dart | 10 +- lib/utils/tab_utils.dart | 86 +- .../translations_delegate_base_utils.dart | 1565 +++++++++-------- lib/utils/utils.dart | 14 +- lib/utils/video_channel_utils.dart | 24 +- lib/widgets/auth/method_type_card.dart | 8 +- lib/widgets/auth/sms-popup.dart | 17 +- .../auth/verification_methods_list.dart | 26 +- .../bottom_sheet/bottom_sheet_container.dart | 32 +- .../custom_bottom_sheet_container.dart | 4 +- .../dashboard/dashboard_item_icons_texts.dart | 2 +- .../dashboard_item_texts_widget.dart | 2 +- lib/widgets/dashboard/guage_chart.dart | 6 +- lib/widgets/dashboard/out_patient_stack.dart | 10 +- lib/widgets/dashboard/row_count.dart | 2 +- .../data_display/list/custom_Item.dart | 24 +- .../data_display/list/flexible_container.dart | 6 +- lib/widgets/dialog/AskPermissionDialog.dart | 4 +- lib/widgets/doctor/lab_result_widget.dart | 10 +- .../doctor/my_referral_patient_widget.dart | 76 +- lib/widgets/doctor/my_schedule_widget.dart | 46 +- .../medicine/medicine_item_widget.dart | 33 +- .../patients/clinic_list_dropdwon.dart | 24 +- .../patient-referral-item-widget.dart | 77 +- .../patients/patient_card/PatientCard.dart | 145 +- .../patients/patient_card/ShowTimer.dart | 6 +- .../patients/patient_service_title.dart | 10 +- .../profile/PatientProfileButton.dart | 38 +- .../profile/Profile_general_info_Widget.dart | 6 +- .../profile/add-order/addNewOrder.dart | 16 +- .../patients/profile/app_bar/header_row.dart | 2 +- .../app_bar/patient-profile-app-bar.dart | 65 +- ...ent-profile-header-new-design-app-bar.dart | 40 +- .../patients/profile/large_avatar.dart | 20 +- .../prescription_in_patinets_widget.dart | 8 +- .../prescription_out_patinets_widget.dart | 8 +- .../profile/profile-welcome-widget.dart | 2 +- .../profile_general_info_content_widget.dart | 12 +- .../profile/profile_medical_info_widget.dart | 28 +- ...rofile_medical_info_widget_in_patient.dart | 14 +- .../profile_medical_info_widget_search.dart | 175 +- .../patients/vital_sign_details_wideget.dart | 20 +- lib/widgets/shared/app_drawer_widget.dart | 9 +- .../shared/app_expandable_notifier.dart | 8 +- lib/widgets/shared/app_loader_widget.dart | 7 +- lib/widgets/shared/app_scaffold_widget.dart | 106 +- lib/widgets/shared/app_texts_widget.dart | 70 +- lib/widgets/shared/bottom_nav_bar.dart | 3 +- .../shared/bottom_navigation_item.dart | 38 +- .../shared/buttons/app_buttons_widget.dart | 33 +- .../shared/buttons/button_bottom_sheet.dart | 12 +- .../shared/card_with_bgNew_widget.dart | 2 +- lib/widgets/shared/card_with_bg_widget.dart | 4 +- .../shared/dialogs/ShowImageDialog.dart | 2 +- .../shared/dialogs/dailog-list-select.dart | 27 +- .../shared/dialogs/master_key_dailog.dart | 24 +- .../dialogs/search-drugs-dailog-list.dart | 16 +- .../shared/divider_with_spaces_around.dart | 2 +- lib/widgets/shared/doctor_card.dart | 34 +- lib/widgets/shared/doctor_card_insurance.dart | 38 +- .../dr_app_circular_progress_Indeicator.dart | 2 +- lib/widgets/shared/drawer_item_widget.dart | 10 +- lib/widgets/shared/errors/error_message.dart | 4 +- .../shared/expandable-widget-header-body.dart | 10 +- .../shared/loader/gif_loader_container.dart | 6 +- .../master_key_checkbox_search_widget.dart | 62 +- lib/widgets/shared/network_base_view.dart | 4 +- lib/widgets/shared/profile_image_widget.dart | 28 +- .../shared/rounded_container_widget.dart | 8 +- lib/widgets/shared/speech-text-popup.dart | 8 +- .../shared/text_fields/TextFields.dart | 74 +- .../text_fields/app-textfield-custom.dart | 77 +- .../app_text_field_custom_serach.dart | 38 +- .../text_fields/app_text_form_field.dart | 32 +- .../text_fields/auto_complete_text_field.dart | 6 +- .../text_fields/country_textfield_custom.dart | 32 +- .../shared/text_fields/html_rich_editor.dart | 18 +- .../shared/text_fields/text_field_error.dart | 6 +- .../shared/text_fields/text_fields_utils.dart | 2 +- lib/widgets/shared/user-guid/CusomRow.dart | 16 +- .../app_anchored_overlay_widget.dart | 14 +- .../shared/user-guid/app_get_position.dart | 110 +- .../shared/user-guid/app_shape_painter.dart | 10 +- .../shared/user-guid/app_showcase.dart | 80 +- .../shared/user-guid/app_showcase_widget.dart | 209 ++- .../shared/user-guid/app_tool_tip_widget.dart | 110 +- .../user-guid/custom_validation_error.dart | 4 +- .../user-guid/in_patient_doctor_card.dart | 32 +- lib/widgets/transitions/fade_page.dart | 2 +- lib/widgets/transitions/slide_up_page.dart | 4 +- pubspec.yaml | 16 +- 110 files changed, 2810 insertions(+), 2394 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 9a5ca8b5..8d0cf8c4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,7 +8,6 @@ import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; - import './config/size_config.dart'; import './routes.dart'; import 'config/config.dart'; @@ -16,6 +15,7 @@ import 'core/service/AnalyticsService.dart'; import 'core/service/NavigationService.dart'; import 'core/viewModel/authentication_view_model.dart'; import 'locator.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -52,7 +52,7 @@ class MyApp extends StatelessWidget { showSemanticsDebugger: false, title: 'Doctors App', locale: projectProvider.appLocal, - localizationsDelegates: [ + localizationsDelegates: [ TranslationBaseDelegate(), GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, diff --git a/lib/screens/patients/patient_search/patient_search_header.dart b/lib/screens/patients/patient_search/patient_search_header.dart index b8fee5df..de46f69b 100644 --- a/lib/screens/patients/patient_search/patient_search_header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -class PatientSearchHeader extends StatelessWidget { +class PatientSearchHeader extends StatelessWidget { final String? title; const PatientSearchHeader({Key? key, this.title}) : super(key: key); diff --git a/lib/screens/procedures/add_procedure_page.dart b/lib/screens/procedures/add_procedure_page.dart index 7fbb620a..83fb05eb 100644 --- a/lib/screens/procedures/add_procedure_page.dart +++ b/lib/screens/procedures/add_procedure_page.dart @@ -17,12 +17,12 @@ import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; class AddProcedurePage extends StatefulWidget { - final ProcedureViewModel model; - final PatiantInformtion patient; + final ProcedureViewModel? model; + final PatiantInformtion? patient; final ProcedureType procedureType; const AddProcedurePage( - {Key key, this.model, this.patient, @required this.procedureType}) + {Key? key, this.model, this.patient, required this.procedureType}) : super(key: key); @override @@ -31,10 +31,10 @@ class AddProcedurePage extends StatefulWidget { } class _AddProcedurePageState extends State { - int selectedType; - ProcedureViewModel model; - PatiantInformtion patient; - ProcedureType procedureType; + int? selectedType; + ProcedureViewModel? model; + PatiantInformtion? patient; + ProcedureType? procedureType; _AddProcedurePageState({this.patient, this.model, this.procedureType}); @@ -57,12 +57,13 @@ class _AddProcedurePageState extends State { return BaseView( onModelReady: (model) { model.getProcedureCategory( - categoryName: procedureType.getCategoryName(), - categoryID: procedureType.getCategoryId(), - patientId: patient.patientId); + categoryName: procedureType!.getCategoryName(), + categoryID: procedureType!.getCategoryId(), + patientId: patient!.patientId); }, - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: + (BuildContext context, ProcedureViewModel model, Widget? child) => + AppScaffold( isShowAppBar: false, body: SingleChildScrollView( child: FractionallySizedBox( @@ -97,14 +98,15 @@ class _AddProcedurePageState extends State { ], ), SizedBox( - height: - MediaQuery.of(context).size.height * 0.02, + height: MediaQuery.of(context).size.height * + 0.02, ), Row( children: [ Container( - width: MediaQuery.of(context).size.width * - 0.79, + width: + MediaQuery.of(context).size.width * + 0.79, child: AppTextFieldCustom( hintText: TranslationBase.of(context) .searchProcedureHere, @@ -116,19 +118,22 @@ class _AddProcedurePageState extends State { ), ), SizedBox( - width: MediaQuery.of(context).size.width * - 0.02, + width: + MediaQuery.of(context).size.width * + 0.02, ), Expanded( child: InkWell( onTap: () async { if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) { + procedureName.text.length >= + 3) { GifLoaderDialogUtils.showMyDialog( context); await model.getProcedureCategory( - patientId: patient.patientId, - categoryName: procedureName.text, + patientId: patient!.patientId, + categoryName: + procedureName.text, isLocalBusy: true); if (model.state == ViewState.ErrorLocal) { @@ -161,8 +166,9 @@ class _AddProcedurePageState extends State { NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: model.categoriesList[0].entityList, + model: widget.model!, + masterList: + model.categoriesList[0].entityList!, removeProcedure: (item) { setState(() { entityList.remove(item); @@ -174,8 +180,9 @@ class _AddProcedurePageState extends State { }); }, addSelectedHistories: () {}, - isEntityListSelected: (master) => widget.model - .isEntityListSelected(master, entityList), + isEntityListSelected: (master) => + widget.model!.isEntityListSelected( + master, entityList), )), SizedBox( height: 10, @@ -195,7 +202,7 @@ class _AddProcedurePageState extends State { height: 0, ) : CustomBottomSheetContainer( - label: procedureType.getAddButtonTitle(context), + label: procedureType!.getAddButtonTitle(context), onTap: () async { { GifLoaderDialogUtils.showMyDialog(context); @@ -208,7 +215,7 @@ class _AddProcedurePageState extends State { return; } GifLoaderDialogUtils.showMyDialog(context); - await widget.model.preparePostProcedure( + await widget.model!.preparePostProcedure( orderType: selectedType.toString(), entityList: entityList, patient: patient, diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index 2b730381..2e358751 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -13,17 +13,17 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; class BaseAddProcedureTabPage extends StatefulWidget { - final ProcedureViewModel previousProcedureViewModel; - final PrescriptionViewModel prescriptionModel; - final PatiantInformtion patient; + final ProcedureViewModel? previousProcedureViewModel; + final PrescriptionViewModel? prescriptionModel; + final PatiantInformtion? patient; final ProcedureType procedureType; const BaseAddProcedureTabPage( - {Key key, + {Key? key, this.previousProcedureViewModel, this.prescriptionModel, this.patient, - @required this.procedureType}) + required this.procedureType}) : super(key: key); @override @@ -33,12 +33,12 @@ class BaseAddProcedureTabPage extends StatefulWidget { class _BaseAddProcedureTabPageState extends State with SingleTickerProviderStateMixin { - final PatiantInformtion patient; - final ProcedureType procedureType; + final PatiantInformtion? patient; + final ProcedureType? procedureType; _BaseAddProcedureTabPageState({this.patient, this.procedureType}); - TabController _tabController; + late TabController _tabController; int _activeTab = 0; @override @@ -71,12 +71,12 @@ class _BaseAddProcedureTabPageState extends State categoryID: widget.procedureType.getCategoryId()); } }, - builder: (BuildContext context, ProcedureViewModel model, Widget child) => + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( baseViewModel: model, isShowAppBar: true, appBar: BottomSheetTitle( - title: procedureType.getToolbarLabel(context), + title: procedureType!.getToolbarLabel(context), ), body: NetworkBaseView( baseViewModel: model, @@ -97,10 +97,10 @@ class _BaseAddProcedureTabPageState extends State unselectedLabelColor: Colors.grey[800], tabs: [ TabWidget.tabWidget(screenSize, _activeTab == 0, - procedureType.getFavouriteTabName(context), + procedureType!.getFavouriteTabName(context), isFirst: true, context: context), TabWidget.tabWidget(screenSize, _activeTab == 1, - procedureType.getAllLabelName(context), + procedureType!.getAllLabelName(context), isLast: true, context: context), ], ), @@ -121,15 +121,15 @@ class _BaseAddProcedureTabPageState extends State ), if (widget.procedureType == ProcedureType.PRESCRIPTION) AddPrescription( - widget.prescriptionModel, - widget.patient, - widget.prescriptionModel.prescriptionList, + widget.prescriptionModel!, + widget.patient!, + widget.prescriptionModel!.prescriptionList, ) else AddProcedurePage( - model: widget.previousProcedureViewModel?? model, + model: widget.previousProcedureViewModel ?? model, patient: patient, - procedureType: procedureType, + procedureType: procedureType!, ), ], ), diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 8088373b..c68389c5 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -13,15 +13,15 @@ import 'package:flutter/material.dart'; import '../../config/config.dart'; class EntityListCheckboxSearchWidget extends StatefulWidget { - final ProcedureViewModel model; - final Function addSelectedHistories; - final Function(EntityList) removeProcedure; - final Function(EntityList) addProcedure; - final bool Function(EntityList) isEntityListSelected; - final List masterList; + final ProcedureViewModel? model; + final Function? addSelectedHistories; + final Function(EntityList)? removeProcedure; + final Function(EntityList)? addProcedure; + final bool Function(EntityList)? isEntityListSelected; + final List? masterList; EntityListCheckboxSearchWidget({ - Key key, + Key? key, this.model, this.addSelectedHistories, this.removeProcedure, @@ -38,8 +38,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { class _EntityListCheckboxSearchWidgetState extends State { int selectedType = 0; - int typeUrgent; - int typeRegular; + int typeUrgent = 0; + int typeRegular = 0; setSelectedType(int val) { setState(() { @@ -53,7 +53,7 @@ class _EntityListCheckboxSearchWidgetState @override void initState() { - items.addAll(widget.masterList); + items.addAll(widget.masterList!); super.initState(); } @@ -65,7 +65,7 @@ class _EntityListCheckboxSearchWidgetState child: Column( children: [ NetworkBaseView( - baseViewModel: widget.model, + baseViewModel: widget.model!, child: Container( height: MediaQuery.of(context).size.height * 0.75, child: Center( @@ -81,8 +81,8 @@ class _EntityListCheckboxSearchWidgetState suffixIcon: EvaIcons.search, suffixIconColor: Color(0xff2B353E), onChanged: (value) { - widget.model.filterSearchResults( - value, widget.masterList, items); + widget.model!.filterSearchResults( + value, widget.masterList!, items); }, hasBorder: false, ), @@ -98,17 +98,17 @@ class _EntityListCheckboxSearchWidgetState title: Row( children: [ Checkbox( - value: widget.isEntityListSelected( + value: widget.isEntityListSelected!( historyInfo), activeColor: Color(0xffD02127), - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isEntityListSelected( + if (widget.isEntityListSelected!( historyInfo)) { - widget.removeProcedure( + widget.removeProcedure!( historyInfo); } else { - widget.addProcedure( + widget.addProcedure!( historyInfo); } }); @@ -118,7 +118,7 @@ class _EntityListCheckboxSearchWidgetState padding: const EdgeInsets.symmetric( horizontal: 10, vertical: 0), child: AppText( - Utils.convertToTitleCase( historyInfo.procedureName), + Utils.convertToTitleCase( historyInfo.procedureName!), fontSize: 14.0, variant: "bodyText", bold: true, @@ -162,7 +162,7 @@ class _EntityListCheckboxSearchWidgetState groupValue: selectedType, onChanged: (value) { historyInfo.type = - setSelectedType(value) + setSelectedType(value!) .toString(); historyInfo.type = @@ -181,7 +181,7 @@ class _EntityListCheckboxSearchWidgetState value: 1, onChanged: (value) { historyInfo.type = - setSelectedType(value) + setSelectedType(value!) .toString(); historyInfo.type = @@ -216,7 +216,7 @@ class _EntityListCheckboxSearchWidgetState minLines: 3, maxLines: 5, borderWidth: 0.5, - borderColor: Colors.grey[500], + borderColor: Colors.grey[500]!, ), ), DividerWithSpacesAround(), diff --git a/lib/screens/procedures/expansion_procedure.dart b/lib/screens/procedures/expansion_procedure.dart index d48ab586..2658c1c9 100644 --- a/lib/screens/procedures/expansion_procedure.dart +++ b/lib/screens/procedures/expansion_procedure.dart @@ -9,18 +9,18 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ExpansionProcedure extends StatefulWidget { - final ProcedureTempleteDetailsModelList procedureTempleteModel; - final ProcedureViewModel model; - final Function(ProcedureTempleteDetailsModel) removeFavProcedure; - final Function(ProcedureTempleteDetailsModel) addFavProcedure; - final Function(ProcedureTempleteDetailsModel) selectProcedures; - final bool Function(ProcedureTempleteModel) isEntityListSelected; - final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected; + final ProcedureTempleteDetailsModelList? procedureTempleteModel; + final ProcedureViewModel? model; + final Function(ProcedureTempleteDetailsModel)? removeFavProcedure; + final Function(ProcedureTempleteDetailsModel)? addFavProcedure; + final Function(ProcedureTempleteDetailsModel) ?selectProcedures; + final bool Function(ProcedureTempleteModel)? isEntityListSelected; + final bool Function(ProcedureTempleteDetailsModel)? isEntityFavListSelected; final bool isProcedure; - final ProcedureTempleteDetailsModel groupProcedures; + final ProcedureTempleteDetailsModel? groupProcedures; const ExpansionProcedure( - {Key key, + {Key? key, this.procedureTempleteModel, this.model, this.removeFavProcedure, @@ -78,9 +78,9 @@ class _ExpansionProcedureState extends State { child: AppText( widget.isProcedure == true ? "Procedures for " + - widget.procedureTempleteModel.templateName + widget.procedureTempleteModel!.templateName! : "Prescription for " + - widget.procedureTempleteModel.templateName, + widget.procedureTempleteModel!.templateName!, letterSpacing: -0.72, fontSize: 16.0, color: AppGlobal.appTextColor, @@ -118,20 +118,20 @@ class _ExpansionProcedureState extends State { )), duration: Duration(milliseconds: 7000), child: Column( - children: widget.procedureTempleteModel.procedureTemplate + children: widget.procedureTempleteModel!.procedureTemplate .map((itemProcedure) { return InkWell( onTap: () { if (widget.isProcedure) { setState(() { - if (widget.isEntityFavListSelected(itemProcedure)) { - widget.removeFavProcedure(itemProcedure); + if (widget.isEntityFavListSelected!(itemProcedure)) { + widget.removeFavProcedure!(itemProcedure); } else { - widget.addFavProcedure(itemProcedure); + widget.addFavProcedure!(itemProcedure); } }); } else { - widget.selectProcedures(itemProcedure); + widget.selectProcedures!(itemProcedure); } }, child: Container( @@ -147,18 +147,18 @@ class _ExpansionProcedureState extends State { horizontal: 11), child: widget.isProcedure ? Checkbox( - value: widget.isEntityFavListSelected( + value: widget.isEntityFavListSelected!( itemProcedure), activeColor: Color(0xffD02127), - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { if (widget - .isEntityFavListSelected( + .isEntityFavListSelected!( itemProcedure)) { - widget.removeFavProcedure( + widget.removeFavProcedure!( itemProcedure); } else { - widget.addFavProcedure( + widget.addFavProcedure!( itemProcedure); } }); @@ -168,7 +168,7 @@ class _ExpansionProcedureState extends State { groupValue: widget.groupProcedures, activeColor: Color(0xffD02127), onChanged: (newValue) { - widget.selectProcedures(newValue); + widget.selectProcedures!(newValue!); })), Expanded( child: Padding( @@ -176,7 +176,7 @@ class _ExpansionProcedureState extends State { horizontal: 10, vertical: 0), child: AppText( Utils.convertToTitleCase( - itemProcedure.procedureName), + itemProcedure.procedureName!), fontSize: 14.0, variant: "bodyText", bold: true, diff --git a/lib/screens/procedures/favorite_procedure/add_favourite_procedure.dart b/lib/screens/procedures/favorite_procedure/add_favourite_procedure.dart index 5cbcaa1b..c2b173d4 100644 --- a/lib/screens/procedures/favorite_procedure/add_favourite_procedure.dart +++ b/lib/screens/procedures/favorite_procedure/add_favourite_procedure.dart @@ -47,11 +47,11 @@ class _AddFavouriteProcedureState extends State { builder: (BuildContext context, ProcedureViewModel procedureViewModel, Widget? child) => AppScaffold( isShowAppBar: false, body: Column(children: [ - (widget.previousProcedureViewModel.templateList.length != 0) + (widget.previousProcedureViewModel!.templateList.length != 0) ? Expanded( child: EntityListCheckboxSearchFavProceduresWidget( isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), - model: widget.previousProcedureViewModel, + model: widget.previousProcedureViewModel!, removeFavProcedure: (item) { setState(() { entityList.remove(item); @@ -75,12 +75,12 @@ class _AddFavouriteProcedureState extends State { error: TranslationBase.of(context).youDoNotHaveFavoriteTemplate, ), ]), - bottomSheet: widget.previousProcedureViewModel.templateList.length == 0 + bottomSheet: widget.previousProcedureViewModel!.templateList.length == 0 ? Container( height: 0, ) : CustomBottomSheetContainer( - label: widget.procedureType.getAddButtonTitle(context) ?? TranslationBase.of(context).addSelectedProcedures, + label: widget.procedureType!.getAddButtonTitle(context) ?? TranslationBase.of(context).addSelectedProcedures, onTap: () async { if (widget.procedureType == ProcedureType.PRESCRIPTION) { if (groupProcedures == null) { @@ -112,10 +112,10 @@ class _AddFavouriteProcedureState extends State { MaterialPageRoute( builder: (context) => ProcedureCheckOutScreen( items: entityList, - previousProcedureViewModel: widget.previousProcedureViewModel, - patient: widget.patient, - addButtonTitle: widget.procedureType.getAddButtonTitle(context), - toolbarTitle: widget.procedureType.getToolbarLabel(context), + previousProcedureViewModel: widget.previousProcedureViewModel!, + patient: widget.patient!, + addButtonTitle: widget.procedureType!.getAddButtonTitle(context), + toolbarTitle: widget.procedureType!.getToolbarLabel(context), ), settings: RouteSettings(name: 'ProcedureCheckOutScreen')), ); diff --git a/lib/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart b/lib/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart index 632ec2e2..256d9a16 100644 --- a/lib/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart @@ -13,25 +13,25 @@ import '../../../config/config.dart'; import '../../../widgets/shared/text_fields/app_text_field_custom_serach.dart'; class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { - final ProcedureViewModel model; - final Function addSelectedHistories; - final Function(ProcedureTempleteModel) removeHistory; - final Function(ProcedureTempleteModel) addHistory; - final Function(ProcedureTempleteModel) addRemarks; + final ProcedureViewModel? model; + final Function? addSelectedHistories; + final Function(ProcedureTempleteModel)? removeHistory; + final Function(ProcedureTempleteModel)? addHistory; + final Function(ProcedureTempleteModel)? addRemarks; - final Function(ProcedureTempleteDetailsModel) removeFavProcedure; - final Function(ProcedureTempleteDetailsModel) addFavProcedure; - final Function(ProcedureTempleteDetailsModel) selectProcedures; - final ProcedureTempleteDetailsModel groupProcedures; + final Function(ProcedureTempleteDetailsModel)? removeFavProcedure; + final Function(ProcedureTempleteDetailsModel)? addFavProcedure; + final Function(ProcedureTempleteDetailsModel)? selectProcedures; + final ProcedureTempleteDetailsModel? groupProcedures; - final bool Function(ProcedureTempleteModel) isEntityListSelected; - final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected; - final List masterList; + final bool Function(ProcedureTempleteModel)? isEntityListSelected; + final bool Function(ProcedureTempleteDetailsModel)? isEntityFavListSelected; + final List? masterList; final bool isProcedure; EntityListCheckboxSearchFavProceduresWidget( - {Key key, + {Key? key, this.model, this.addSelectedHistories, this.removeHistory, @@ -55,8 +55,8 @@ class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { class _EntityListCheckboxSearchFavProceduresWidgetState extends State { int selectedType = 0; - int typeUrgent; - int typeRegular; + int typeUrgent = 0; + int typeRegular = 0; setSelectedType(int val) { setState(() { @@ -81,7 +81,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState Widget build(BuildContext context) { return SingleChildScrollView( child: NetworkBaseView( - baseViewModel: widget.model, + baseViewModel: widget.model!, child: Container( height: MediaQuery.of(context).size.height * 0.90, child: Center( @@ -94,7 +94,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState AppTextFieldCustomSearch( searchController: patientFileInfoController, onChangeFun: (value) { - widget.model.filterProcedureSearchResults( + widget.model!.filterProcedureSearchResults( value, widget.masterList, items); }, marginTop: 5, @@ -107,20 +107,20 @@ class _EntityListCheckboxSearchFavProceduresWidgetState SizedBox( height: 15, ), - widget.model.templateList.length != 0 + widget.model!.templateList.length != 0 ? Column( - children: widget.model.templateList.map((historyInfo) { + children: widget.model!.templateList.map((historyInfo) { return ExpansionProcedure( procedureTempleteModel: historyInfo, - model: widget.model, - removeFavProcedure: widget.removeFavProcedure, - addFavProcedure: widget.addFavProcedure, - selectProcedures: widget.selectProcedures, - isEntityListSelected: widget.isEntityListSelected, + model: widget.model!, + removeFavProcedure: widget.removeFavProcedure!, + addFavProcedure: widget.addFavProcedure!, + selectProcedures: widget.selectProcedures!, + isEntityListSelected: widget.isEntityListSelected!, isEntityFavListSelected: - widget.isEntityFavListSelected, + widget.isEntityFavListSelected!, isProcedure: widget.isProcedure, - groupProcedures: widget.groupProcedures); + groupProcedures: widget.groupProcedures!); }).toList(), ) : Center( diff --git a/lib/screens/procedures/favorite_procedure/procedure_checkout_screen.dart b/lib/screens/procedures/favorite_procedure/procedure_checkout_screen.dart index 38d748cc..3ce2af78 100644 --- a/lib/screens/procedures/favorite_procedure/procedure_checkout_screen.dart +++ b/lib/screens/procedures/favorite_procedure/procedure_checkout_screen.dart @@ -17,9 +17,9 @@ import 'package:flutter/material.dart'; import '../../../config/config.dart'; class ProcedureCheckOutScreen extends StatefulWidget { - final List items; - final ProcedureViewModel previousProcedureViewModel; - final PatiantInformtion patient; + final List? items; + final ProcedureViewModel? previousProcedureViewModel; + final PatiantInformtion? patient; final String addButtonTitle; final String toolbarTitle; @@ -27,8 +27,8 @@ class ProcedureCheckOutScreen extends StatefulWidget { {this.items, this.previousProcedureViewModel, this.patient, - @required this.addButtonTitle, - @required this.toolbarTitle}); + required this.addButtonTitle, + required this.toolbarTitle}); @override _ProcedureCheckOutScreenState createState() => @@ -43,8 +43,9 @@ class _ProcedureCheckOutScreenState extends State { @override Widget build(BuildContext context) { return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: + (BuildContext context, ProcedureViewModel model, Widget? child) => + AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), isShowAppBar: true, appBar: PatientSearchHeader( @@ -61,13 +62,13 @@ class _ProcedureCheckOutScreenState extends State { ), ListView.builder( scrollDirection: Axis.vertical, - itemCount: widget.items.length, + itemCount: widget.items!.length, physics: BouncingScrollPhysics(), shrinkWrap: true, itemBuilder: (BuildContext ctxt, int index) { final TextEditingController remarksControllerNew = TextEditingController( - text: widget.items[index].remarks); + text: widget.items![index].remarks); return Container( margin: EdgeInsets.only(bottom: 15.0), @@ -82,7 +83,7 @@ class _ProcedureCheckOutScreenState extends State { Expanded( child: AppText( Utils.convertToTitleCase( - widget.items[index].procedureName), + widget.items![index].procedureName!), fontWeight: FontWeight.w700, color: AppGlobal.appTextColor, )), @@ -116,12 +117,12 @@ class _ProcedureCheckOutScreenState extends State { activeColor: Color(0xFFD02127), value: 0, groupValue: widget - .items[index].selectedType, + .items![index].selectedType, onChanged: (value) { - widget.items[index].selectedType = - 0; + widget.items![index] + .selectedType = 0; setState(() { - widget.items[index].type = + widget.items![index].type = value.toString(); }); }, @@ -134,13 +135,13 @@ class _ProcedureCheckOutScreenState extends State { Radio( activeColor: Color(0xFFD02127), groupValue: widget - .items[index].selectedType, + .items![index].selectedType, value: 1, onChanged: (value) { - widget.items[index].selectedType = - 1; + widget.items![index] + .selectedType = 1; setState(() { - widget.items[index].type = + widget.items![index].type = value.toString(); }); }, @@ -166,12 +167,12 @@ class _ProcedureCheckOutScreenState extends State { hintText: TranslationBase.of(context).remarks, controller: remarksControllerNew, onChanged: (value) { - widget.items[index].remarks = value; + widget.items![index].remarks = value; }, minLines: 3, maxLines: 5, borderWidth: 0.5, - borderColor: Colors.grey[500], + borderColor: Colors.grey[500]!, ), ), SizedBox( @@ -190,6 +191,7 @@ class _ProcedureCheckOutScreenState extends State { ), ), ), + ///TODO Elham* use our custom bottomsheet bottomSheet: Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), @@ -203,10 +205,10 @@ class _ProcedureCheckOutScreenState extends State { fontWeight: FontWeight.w700, onPressed: () async { GifLoaderDialogUtils.showMyDialog(context); - await widget.previousProcedureViewModel.addProcedures( - widget.previousProcedureViewModel, - widget.items, - widget.patient, + await widget.previousProcedureViewModel!.addProcedures( + widget.previousProcedureViewModel!, + widget.items!, + widget.patient!, remarksController, isLocalBusy: true); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/screens/procedures/procedure_card.dart b/lib/screens/procedures/procedure_card.dart index 9f61d556..d9ceb305 100644 --- a/lib/screens/procedures/procedure_card.dart +++ b/lib/screens/procedures/procedure_card.dart @@ -16,16 +16,16 @@ import 'package:provider/provider.dart'; /// TODO Roaa Add translation and make sure it working fine class ProcedureCard extends StatelessWidget { - final Function onTap; - final EntityList entityList; - final String categoryName; - final int categoryID; - final PatiantInformtion patient; - final int doctorID; - final bool isInpatient; + final Function? onTap; + final EntityList? entityList; + final String? categoryName; + final int? categoryID; + final PatiantInformtion? patient; + final int? doctorID; + final bool? isInpatient; const ProcedureCard({ - Key key, + Key? key, this.onTap, this.entityList, this.categoryID, @@ -60,7 +60,7 @@ class ProcedureCard extends StatelessWidget { bottomLeft: Radius.circular(10), ), color: - entityList.orderType == 0 ? Colors.black : Colors.red[500], + entityList!.orderType == 0 ? Colors.black : Colors.red[500], ), ), Expanded( @@ -80,10 +80,10 @@ class ProcedureCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - entityList.orderType == 0 + entityList!.orderType == 0 ? 'Routine' : 'Urgent', - color: entityList.orderType == 0 + color: entityList!.orderType == 0 ? Colors.black : AppGlobal.appRedColor, fontWeight: FontWeight.w600, @@ -93,7 +93,7 @@ class ProcedureCard extends StatelessWidget { ), AppText( Utils.convertToTitleCase( - entityList.procedureName), + entityList!.procedureName!), bold: true, fontSize: 14, ), @@ -110,7 +110,7 @@ class ProcedureCard extends StatelessWidget { AppText( '${AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.convertISOStringToDateTime( - entityList.createdOn), + entityList!.createdOn!), isMonthShort: true, isArabic: projectViewModel.isArabic, )}', @@ -119,9 +119,9 @@ class ProcedureCard extends StatelessWidget { fontSize: 14, ), AppText( - '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.createdOn))}', + '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList!.createdOn!))}', fontWeight: FontWeight.w600, - color: Colors.grey[700], + color: Colors.grey[700]!, fontSize: 14, ), ], @@ -130,7 +130,7 @@ class ProcedureCard extends StatelessWidget { ), CustomRow( label: TranslationBase.of(context).orderNo + ": ", - value: entityList.orderNo.toString() ?? "".toString(), + value: entityList!.orderNo.toString() ?? "".toString(), isCopyable: false, ), Row( @@ -159,7 +159,7 @@ class ProcedureCard extends StatelessWidget { width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, ))), @@ -174,19 +174,20 @@ class ProcedureCard extends StatelessWidget { children: [ AppText( Utils.convertToTitleCase( - entityList.doctorName), + entityList!.doctorName!), fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Colors.black, ), - if (entityList.clinicDescription != null) + if (entityList!.clinicDescription != null) AppText( Utils.convertToTitleCase( - entityList.clinicDescription), + entityList!.clinicDescription!), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.4 * SizeConfig.textMultiplier, + fontSize: + 1.4 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), ), ], @@ -202,20 +203,20 @@ class ProcedureCard extends StatelessWidget { children: [ Expanded( child: AppText( - entityList.remarks != null + entityList!.remarks != null ? Utils.convertToTitleCase( - entityList.remarks.toString()) + entityList!.remarks.toString()) : '', fontSize: 12, ), ), - if ((entityList.categoryID == 2 || - entityList.categoryID == 4) && - doctorID == entityList.doctorID && - !isInpatient) + if ((entityList!.categoryID == 2 || + entityList!.categoryID == 4) && + doctorID == entityList!.doctorID && + !isInpatient!) InkWell( child: Icon(DoctorApp.edit), - onTap: onTap, + onTap: onTap!(), ) ], ), diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 23424463..b48c211b 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -21,17 +21,17 @@ import '../../widgets/shared/errors/error_message.dart'; import 'base_add_procedure_tab_page.dart'; class ProcedureScreen extends StatelessWidget { - int doctorNameP; + int? doctorNameP; void initState() async { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); doctorNameP = doctorProfile.doctorID; } @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']; String patientType = routeArgs['patientType']; bool isFromLiveCare = routeArgs['isFromLiveCare']; @@ -41,10 +41,11 @@ class ProcedureScreen extends StatelessWidget { mrn: patient.patientId, patientType: patientType, appointmentNo: patient.appointmentNo), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: + (BuildContext context, ProcedureViewModel model, Widget? child) => + AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100], + backgroundColor: Colors.grey[100]!, baseViewModel: model, appBar: PatientProfileAppBar( patient, @@ -99,42 +100,44 @@ class ProcedureScreen extends StatelessWidget { itemBuilder: (BuildContext ctxt, int index) { return ProcedureCard( categoryID: model - .procedureList[0].entityList[index].categoryID, - entityList: model.procedureList[0].entityList[index], + .procedureList[0].entityList![index].categoryID, + entityList: model.procedureList[0].entityList![index], onTap: () { - if (model.procedureList[0].entityList[index].categoryID == + if (model.procedureList[0].entityList![index] + .categoryID == 2 || - model.procedureList[0].entityList[index].categoryID == 4) - updateProcedureForm(context, - model: model, - patient: patient, - remarks: model.procedureList[0] - .entityList[index].remarks, - orderType: model.procedureList[0] - .entityList[index].orderType - .toString(), - orderNo: model.procedureList[0] - .entityList[index].orderNo, - procedureName: model.procedureList[0] - .entityList[index].procedureName, - categoreId: model.procedureList[0] - .entityList[index].categoryID - .toString(), - procedureId: model.procedureList[0] - .entityList[index].procedureId, - limetNo: model.procedureList[0] - .entityList[index].lineItemNo, - + model.procedureList[0].entityList![index] + .categoryID == + 4) + updateProcedureForm( + context, + model: model, + patient: patient, + remarks: model.procedureList[0] + .entityList![index].remarks!, + orderType: model.procedureList[0] + .entityList![index].orderType + .toString(), + orderNo: model.procedureList[0] + .entityList![index].orderNo!, + procedureName: model.procedureList[0] + .entityList![index].procedureName!, + categoreId: model.procedureList[0] + .entityList![index].categoryID + .toString(), + procedureId: model.procedureList[0] + .entityList![index].procedureId!, + limetNo: model.procedureList[0] + .entityList![index].lineItemNo!, ); }, patient: patient, - - doctorID: model?.doctorProfile?.doctorID, + doctorID: model.doctorProfile?.doctorID, ); }), if (model.state == ViewState.ErrorLocal || (model.procedureList.isNotEmpty && - model.procedureList[0].entityList.isEmpty)) + model.procedureList[0].entityList!.isEmpty)) Center( child: ErrorMessage( error: TranslationBase.of(context).noDataAvailable, diff --git a/lib/screens/procedures/procedure_type.dart b/lib/screens/procedures/procedure_type.dart index 2b8794c4..5e3650e9 100644 --- a/lib/screens/procedures/procedure_type.dart +++ b/lib/screens/procedures/procedure_type.dart @@ -61,7 +61,7 @@ extension procedureType on ProcedureType { String getCategoryId() { switch (this) { case ProcedureType.PROCEDURE: - return null; + return ""; case ProcedureType.LAB_RESULT: return "02"; case ProcedureType.RADIOLOGY: @@ -69,20 +69,20 @@ extension procedureType on ProcedureType { case ProcedureType.PRESCRIPTION: return "55"; default: - return null; + return ""; } } String getCategoryName() { switch (this) { case ProcedureType.PROCEDURE: - return null; + return ""; case ProcedureType.LAB_RESULT: return "Laboratory"; case ProcedureType.RADIOLOGY: return "Radiology"; default: - return null; + return ""; } } } diff --git a/lib/screens/procedures/update_procedure.dart b/lib/screens/procedures/update_procedure.dart index d2610d87..54ab3be2 100644 --- a/lib/screens/procedures/update_procedure.dart +++ b/lib/screens/procedures/update_procedure.dart @@ -19,15 +19,15 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; void updateProcedureForm(context, - {String procedureName, - int orderNo, - int limetNo, - PatiantInformtion patient, - String orderType, - String procedureId, - String remarks, - ProcedureViewModel model, - String categoreId}) { + {required String procedureName, + required int orderNo, + required int limetNo, + required PatiantInformtion patient, + required String orderType, + required String procedureId, + required String remarks, + required ProcedureViewModel model, + required String categoreId}) { TextEditingController remarksController = TextEditingController(); showModalBottomSheet( context: context, @@ -49,17 +49,16 @@ void updateProcedureForm(context, } class UpdateProcedureWidget extends StatefulWidget { - final PatiantInformtion patient; - final ProcedureViewModel previousModel; - final String procedureName; - final String remarks; - final TextEditingController remarksController; - final String procedureId; - final String categoryId; - final int orderNo; - final int limetNo; - int selectedType; - + final PatiantInformtion? patient; + final ProcedureViewModel? previousModel; + final String? procedureName; + final String? remarks; + final TextEditingController? remarksController; + final String? procedureId; + final String? categoryId; + final int? orderNo; + final int? limetNo; + int? selectedType; UpdateProcedureWidget( {this.previousModel, @@ -70,14 +69,14 @@ class UpdateProcedureWidget extends StatefulWidget { this.procedureId, this.categoryId, this.orderNo, - this.limetNo, this.selectedType}); + this.limetNo, + this.selectedType}); @override _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); } class _UpdateProcedureWidgetState extends State { - setSelectedType(int val) { setState(() { widget.selectedType = val; @@ -86,7 +85,7 @@ class _UpdateProcedureWidgetState extends State { void initState() { super.initState(); - widget.remarksController.text = widget.remarks; + widget.remarksController!.text = widget.remarks!; } List entityList = []; @@ -98,114 +97,114 @@ class _UpdateProcedureWidgetState extends State { return BaseView( onModelReady: (model) => model.getCategory(), builder: - (BuildContext context, ProcedureViewModel _model, Widget child) => - AppScaffold( - baseViewModel: widget.previousModel, - isShowAppBar: true, - appBar: BottomSheetTitle(title: "Update Procedure"), - body: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 0.9, - child: Form( - child: Padding( - padding: + (BuildContext context, ProcedureViewModel _model, Widget? child) => + AppScaffold( + baseViewModel: widget.previousModel!, + isShowAppBar: true, + appBar: BottomSheetTitle(title: "Update Procedure"), + body: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.9, + child: Form( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - Utils.convertToTitleCase(widget.procedureName), - fontWeight: FontWeight.w700, - ), - SizedBox( - height: 30.0, - ), - Container( - child: Row( - children: [ - AppText(TranslationBase.of(context).orderType), - Radio( - activeColor: AppGlobal.appRedColor, - value: 0, - groupValue: widget.selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text('routine'), - Radio( - activeColor: AppGlobal.appRedColor, - groupValue: widget.selectedType, - value: 1, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context).urgent), - ], + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + Utils.convertToTitleCase(widget.procedureName!), + fontWeight: FontWeight.w700, + ), + SizedBox( + height: 30.0, + ), + Container( + child: Row( + children: [ + AppText(TranslationBase.of(context).orderType), + Radio( + activeColor: AppGlobal.appRedColor, + value: 0, + groupValue: widget.selectedType, + onChanged: (value) { + setSelectedType(value!); + }, ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - fontSize: 15.0, - controller: widget.remarksController, - hintText: widget.remarksController.text.isEmpty - ? 'No Remarks Added' - : '', - maxLines: 3, - minLines: 2, - onChanged: (value) {}, + Text('routine'), + Radio( + activeColor: AppGlobal.appRedColor, + groupValue: widget.selectedType, + value: 1, + onChanged: (value) { + setSelectedType(value!); + }, ), - ), - SizedBox( - height: 70.0, - ), - ], + Text(TranslationBase.of(context).urgent), + ], + ), ), - ), - )), - ), - bottomSheet: CustomBottomSheetContainer( - label: TranslationBase.of(context).updateProcedure, - onTap: () => updateProcedure( - lineItemNo: widget.limetNo, - orderNo: widget.orderNo, - orderType: widget.selectedType.toString(), - categoryId: widget.categoryId, - procedureId: widget.procedureId, - entityList: entityList, - patient: widget.patient, - model: widget.previousModel, - remarks: widget.remarksController.text), - ), - ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + fontSize: 15.0, + controller: widget.remarksController!, + hintText: widget.remarksController!.text.isEmpty + ? 'No Remarks Added' + : '', + maxLines: 3, + minLines: 2, + onChanged: (value) {}, + ), + ), + SizedBox( + height: 70.0, + ), + ], + ), + ), + )), + ), + bottomSheet: CustomBottomSheetContainer( + label: TranslationBase.of(context).updateProcedure, + onTap: () => updateProcedure( + lineItemNo: widget.limetNo!, + orderNo: widget.orderNo!, + orderType: widget.selectedType.toString(), + categoryId: widget.categoryId!, + procedureId: widget.procedureId!, + entityList: entityList, + patient: widget.patient!, + model: widget.previousModel!, + remarks: widget.remarksController!.text), + ), + ), ); } updateProcedure( - {ProcedureViewModel model, - String remarks, - int lineItemNo, - int orderNo, - String newProcedureId, - String newCategoryId, - List entityList, - String orderType, - String procedureId, - PatiantInformtion patient, - String categoryId}) async { + {required ProcedureViewModel model, + required String remarks, + required int lineItemNo, + required int orderNo, + String? newProcedureId, + String? newCategoryId, + required List entityList, + required String orderType, + required String procedureId, + required PatiantInformtion patient, + required String categoryId}) async { UpdateProcedureRequestModel updateProcedureReqModel = new UpdateProcedureRequestModel(); List controls = []; - ProcedureDetail controlsProcedure = new ProcedureDetail(); + ProcedureDetail controlsProcedure = ProcedureDetail(); updateProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -230,17 +229,18 @@ class _UpdateProcedureWidgetState extends State { } updateProcedureReqModel.procedureDetail = controlsProcedure; GifLoaderDialogUtils.showMyDialog(context); - await widget.previousModel.updateProcedure( + await widget.previousModel!.updateProcedure( updateProcedureRequestModel: updateProcedureReqModel, - mrn: patient.patientMRN, isLocalBusy: true); + mrn: patient.patientMRN, + isLocalBusy: true); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been updated'); - await widget.previousModel.getProcedure(mrn: patient.patientMRN, isLocalBusy: true); + await widget.previousModel! + .getProcedure(mrn: patient.patientMRN, isLocalBusy: true); Navigator.of(context).pop(); - } GifLoaderDialogUtils.hideDialog(context); } diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index 9b363fb3..9e33f11e 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -88,8 +88,9 @@ class _QrReaderScreenState extends State { _scanQrAndGetPatient(BuildContext context, ScanQrViewModel model) async { var result = (await BarcodeScanner.scan()).rawContent; if (result != "") { - DoctorProfileModel doctorProfile =await getDoctorProfile(isGetProfile: true); - List listOfParams = result.split(','); + DoctorProfileModel doctorProfile = + await getDoctorProfile(isGetProfile: true); + List listOfParams = result.split(','); int patientID = 0; if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]); PatientSearchRequestModel patientSearchRequestModel = @@ -123,10 +124,9 @@ class _QrReaderScreenState extends State { Future getDoctorProfile( {bool isGetProfile = false}) async { - - DoctorProfileModel doctorProfile; + DoctorProfileModel? doctorProfile; if (isGetProfile) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map? profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { doctorProfile = DoctorProfileModel.fromJson(profile); if (doctorProfile != null) { @@ -135,14 +135,14 @@ class _QrReaderScreenState extends State { } } if (doctorProfile == null) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map? profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { doctorProfile = DoctorProfileModel.fromJson(profile); if (doctorProfile != null) { return doctorProfile; } } - return null; + return DoctorProfileModel(); } else { return doctorProfile; } diff --git a/lib/screens/reschedule_leaves/add_reschedule_leave.dart b/lib/screens/reschedule_leaves/add_reschedule_leave.dart index 029f60a1..20dd05a6 100644 --- a/lib/screens/reschedule_leaves/add_reschedule_leave.dart +++ b/lib/screens/reschedule_leaves/add_reschedule_leave.dart @@ -18,7 +18,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class AddRescheduleLeaveScreen extends StatelessWidget { - ProjectViewModel projectsProvider; + ProjectViewModel? projectsProvider; @override Widget build(BuildContext context) { @@ -62,7 +62,7 @@ class AddRescheduleLeaveScreen extends StatelessWidget { border: Border( left: BorderSide( color: item.status == 10 - ? Colors.red[800] + ? Colors.red[800]! : item.status == 2 ? HexColor('#CC9B14') : item.status == 9 @@ -92,10 +92,10 @@ class AddRescheduleLeaveScreen extends StatelessWidget { margin: EdgeInsets.only(top: 10), child: AppText( - item.statusDescription, + item.statusDescription!, fontWeight: FontWeight.bold, color: item.status == 10 - ? Colors.red[800] + ? Colors.red[800]! : item.status == 2 ? HexColor( '#CC9B14') @@ -112,7 +112,7 @@ class AddRescheduleLeaveScreen extends StatelessWidget { child: AppText( AppDateUtils .convertStringToDateFormat( - item.createdOn, + item.createdOn!, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, @@ -148,7 +148,7 @@ class AddRescheduleLeaveScreen extends StatelessWidget { AppText( AppDateUtils .convertStringToDateFormat( - item.dateTimeFrom, + item.dateTimeFrom!, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) @@ -171,7 +171,7 @@ class AddRescheduleLeaveScreen extends StatelessWidget { AppText( AppDateUtils .convertStringToDateFormat( - item.dateTimeTo, + item.dateTimeTo!, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) @@ -267,7 +267,7 @@ class AddRescheduleLeaveScreen extends StatelessWidget { //print(obj); return obj.length > 0 - ? projectsProvider.isArabic == true + ? projectsProvider!.isArabic == true ? obj[0]['nameAr'] : obj[0]['nameEn'] : ""; diff --git a/lib/screens/reschedule_leaves/reschedule_leave.dart b/lib/screens/reschedule_leaves/reschedule_leave.dart index 3cafc621..c4e1925c 100644 --- a/lib/screens/reschedule_leaves/reschedule_leave.dart +++ b/lib/screens/reschedule_leaves/reschedule_leave.dart @@ -1,4 +1,3 @@ -import 'package:date_time_picker/date_time_picker.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; @@ -39,8 +38,8 @@ class _RescheduleLeaveScreen extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController(); - ProjectViewModel projectsProvider; - SickLeaveViewModel sickLeaveViewModel; + ProjectViewModel? projectsProvider; + SickLeaveViewModel? sickLeaveViewModel; Map profile = {}; var offTime = '1'; var date; @@ -49,8 +48,8 @@ class _RescheduleLeaveScreen extends State { dynamic fromDate; dynamic toDate; var clinicID; - String fromTime; - String toTime; + String? fromTime; + String? toTime; TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController(); @@ -177,7 +176,7 @@ class _RescheduleLeaveScreen extends State { 'description'], fontSize: SizeConfig - .textMultiplier * + .textMultiplier! * 2.1, // color: // Colors.grey, @@ -188,7 +187,8 @@ class _RescheduleLeaveScreen extends State { }, onChanged: (newValue) { setState(() { - offTime = newValue; + offTime = newValue + as String; }); if (offTime == '1') { model2.getReasons(18); @@ -201,7 +201,8 @@ class _RescheduleLeaveScreen extends State { model2 .getReasons(102); setState(() { - offTime = newValue; + offTime = newValue + as String; }); } }, @@ -249,8 +250,10 @@ class _RescheduleLeaveScreen extends State { .fromDate, borderColor: Colors.white, prefix: IconButton( - icon: Icon(Icons - .calendar_today)), + icon: Icon( + Icons.calendar_today), + onPressed: () {}, + ), textInputType: TextInputType.number, controller: _toDateController, @@ -285,25 +288,26 @@ class _RescheduleLeaveScreen extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - DateTimePicker( - timeHintText: - TranslationBase.of( - context) - .fromTime, - type: DateTimePickerType - .time, - controller: _controller4, - onChanged: (val) => - fromTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => - fromTime = val, - ) + // Need Fix + // DateTimePicker( + // timeHintText: + // TranslationBase.of( + // context) + // .fromTime, + // type: DateTimePickerType + // .time, + // controller: _controller4, + // onChanged: (val) => + // fromTime = val, + // validator: (val) { + // print(val); + // // setState( + // // () => _valueToValidate4 = val); + // return null; + // }, + // onSaved: (val) => + // fromTime = val, + // ) ], ), ), @@ -325,25 +329,26 @@ class _RescheduleLeaveScreen extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - DateTimePicker( - timeHintText: - TranslationBase.of( - context) - .toTime, - type: DateTimePickerType - .time, - controller: _controller5, - onChanged: (val) => - toTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => - toTime = val, - ) + // Need Fix + // DateTimePicker( + // timeHintText: + // TranslationBase.of( + // context) + // .toTime, + // type: DateTimePickerType + // .time, + // controller: _controller5, + // onChanged: (val) => + // toTime = val, + // validator: (val) { + // print(val); + // // setState( + // // () => _valueToValidate4 = val); + // return null; + // }, + // onSaved: (val) => + // toTime = val, + // ) ], ), ), @@ -375,8 +380,10 @@ class _RescheduleLeaveScreen extends State { .fromDate, borderColor: Colors.white, prefix: IconButton( - icon: Icon(Icons - .calendar_today)), + icon: Icon( + Icons.calendar_today), + onPressed: () {}, + ), textInputType: TextInputType.number, readOnly: true, @@ -410,14 +417,16 @@ class _RescheduleLeaveScreen extends State { children: [ AppTextFormField( hintText: - TranslationBase - .of(context) + TranslationBase.of( + context) .toDate, readOnly: true, borderColor: Colors.white, prefix: IconButton( - icon: Icon(Icons - .calendar_today)), + icon: Icon( + Icons.calendar_today), + onPressed: () {}, + ), textInputType: TextInputType.number, controller: @@ -486,14 +495,14 @@ class _RescheduleLeaveScreen extends State { .max, children: [ AppText( - projectsProvider + projectsProvider! .isArabic ? item[ 'nameAr'] : item[ 'nameEn'], fontSize: SizeConfig - .textMultiplier * + .textMultiplier! * 2.1, // color: // Colors.grey, @@ -514,7 +523,7 @@ class _RescheduleLeaveScreen extends State { value: item['id'] .toString(), child: Text( - projectsProvider + projectsProvider! .isArabic ? item['nameAr'] : item[ @@ -560,21 +569,78 @@ class _RescheduleLeaveScreen extends State { ? Expanded( // add Expanded to have your dropdown button fill remaining space child: DropdownSearch( - mode: Mode.BOTTOM_SHEET, + dropdownDecoratorProps: + DropDownDecoratorProps( + dropdownSearchDecoration: + InputDecoration( + contentPadding: + EdgeInsets + .all(0), + border: + InputBorder + .none), + ), + popupProps: PopupProps + .bottomSheet( + showSearchBox: + true, + title: Container( + height: 50, + decoration: + BoxDecoration( + color: Theme.of( + context) + .primaryColorDark, + borderRadius: + BorderRadius + .only( + topLeft: Radius + .circular( + 20), + topRight: Radius + .circular( + 20), + ), + ), + child: Center( + child: Text( + '', + style: + TextStyle( + fontSize: + 24, + fontWeight: + FontWeight + .bold, + color: Colors + .white, + ), + ), + ), + ), + bottomSheetProps: + BottomSheetProps( + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .only( + topLeft: Radius + .circular( + 24), + topRight: Radius + .circular( + 24), + ), + ), + )), + // mode: Mode.BOTTOM_SHEET, - dropdownSearchDecoration: - InputDecoration( - contentPadding: - EdgeInsets - .all(0), - border: - InputBorder - .none), //maxHeight: 300, items: model2 .coveringDoctors .map((item) { - return projectsProvider + return projectsProvider! .isArabic ? item[ 'doctorNameN'] @@ -596,50 +662,19 @@ class _RescheduleLeaveScreen extends State { selectedItem: getSelectedDoctor( model2), - showSearchBox: true, - popupTitle: Container( - height: 50, - decoration: - BoxDecoration( - color: Theme.of( - context) - .primaryColorDark, - borderRadius: - BorderRadius.only( - topLeft: - Radius.circular( - 20), - topRight: - Radius.circular( - 20), - ), - ), - child: Center( - child: Text( - '', - style: TextStyle( - fontSize: 24, - fontWeight: - FontWeight - .bold, - color: - Colors.white, - ), - ), - ), - ), - popupShape: - RoundedRectangleBorder( - borderRadius: - BorderRadius.only( - topLeft: - Radius.circular( - 24), - topRight: - Radius.circular( - 24), - ), - ), + // showSearchBox: true, + // popupShape: + // RoundedRectangleBorder( + // borderRadius: + // BorderRadius.only( + // topLeft: + // Radius.circular( + // 24), + // topRight: + // Radius.circular( + // 24), + // ), + // ), ), ) : SizedBox(), @@ -648,7 +683,7 @@ class _RescheduleLeaveScreen extends State { ], ), )), - SizedBox(height: SizeConfig.screenHeight * .3), + SizedBox(height: SizeConfig.screenHeight! * .3), Container( margin: EdgeInsets.all( SizeConfig.widthMultiplier! * 5), @@ -710,13 +745,13 @@ class _RescheduleLeaveScreen extends State { //df.format(DateTime.parse(widget.updateData.dateTimeFrom)); this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom)); - this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); + this.fromTime = this.fromTime!.substring(0, this.fromTime!.length - 3); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); - this.toTime = this.toTime.substring(0, this.toTime.length - 3); + this.toTime = this.toTime!.substring(0, this.toTime!.length - 3); _toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); - _controller5.text = toTime; - _controller4.text = fromTime; + _controller5.text = toTime!; + _controller4.text = fromTime!; toDate = _toDateController2.text; fromDate = _toDateController.text; this.reason = widget.updateData.reasonId.toString(); @@ -740,12 +775,12 @@ class _RescheduleLeaveScreen extends State { if (offTime == '1') { fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + - fromTime + + fromTime! + ':' + DateTime.now().second.toString())); toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + - toTime + + toTime! + ':' + DateTime.now().second.toString())); } else { @@ -804,12 +839,12 @@ class _RescheduleLeaveScreen extends State { if (offTime == '1') { fromDate = df.format(DateTime.parse(_toDateController.text)) + 'T' + - fromTime + + fromTime! + ':' + DateTime.now().second.toString(); toDate = df.format(DateTime.parse(_toDateController2.text)) + 'T' + - toTime + + toTime! + ':' + DateTime.now().second.toString(); } else { @@ -863,7 +898,7 @@ class _RescheduleLeaveScreen extends State { getSelectedDoctor(model2) { var doctorName; if (doctorID == null) - return projectsProvider.isArabic + return projectsProvider!.isArabic ? model2.coveringDoctors[0]['doctorNameN'] : model2.coveringDoctors[0]['doctorName']; else { diff --git a/lib/utils/date-utils.dart b/lib/utils/date-utils.dart index fa9928ee..ed237e79 100644 --- a/lib/utils/date-utils.dart +++ b/lib/utils/date-utils.dart @@ -435,7 +435,7 @@ class AppDateUtils { } static convertDateFormatImproved(String str) { - String newDate; + String newDate = ''; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -452,6 +452,6 @@ class AppDateUtils { date.day.toString().padLeft(2, '0'); } - return newDate ?? ''; + return newDate; } } diff --git a/lib/utils/dr_app_shared_pref.dart b/lib/utils/dr_app_shared_pref.dart index decbe080..6d5e7a0a 100644 --- a/lib/utils/dr_app_shared_pref.dart +++ b/lib/utils/dr_app_shared_pref.dart @@ -40,7 +40,7 @@ class DrAppSharedPreferances { /// Get String [key] the key was saved getStringWithDefaultValue(String key, String defaultVal) async { final SharedPreferences prefs = await _prefs; - String value = prefs.getString(key); + String value = prefs.getString(key) ?? ""; return value == null ? defaultVal : value; } diff --git a/lib/utils/extenstions_utils.dart b/lib/utils/extenstions_utils.dart index 0d170be7..d3a69620 100644 --- a/lib/utils/extenstions_utils.dart +++ b/lib/utils/extenstions_utils.dart @@ -1,10 +1,10 @@ extension Extension on Object { - bool isNullOrEmpty() => this == null || this == ''; + bool isNullOrEmpty() => this == '' || this == null; - bool isNullEmptyOrFalse() => this == null || this == '' || !this; + bool isNullEmptyOrFalse() => this == null || this == '' || this == false; bool isNullEmptyZeroOrFalse() => - this == null || this == '' || !this || this == 0; + this == null || this == '' || this == 0 || this == false; } /// truncate the [String] without cutting words. The length is calculated with the suffix. diff --git a/lib/utils/notification_permission_utils.dart b/lib/utils/notification_permission_utils.dart index aec7b0aa..48623d34 100644 --- a/lib/utils/notification_permission_utils.dart +++ b/lib/utils/notification_permission_utils.dart @@ -6,7 +6,9 @@ import 'package:permission_handler/permission_handler.dart'; class AppPermissionsUtils { static requestVideoCallPermission( - {BuildContext context, String type, Function onTapGrant}) async { + {required BuildContext context, + String? type, + required Function onTapGrant}) async { var cameraPermission = Permission.camera; var microphonePermission = Permission.microphone; PermissionStatus permissionCameraStatus = await cameraPermission.status; @@ -15,19 +17,19 @@ class AppPermissionsUtils { if (permissionCameraStatus.isPermanentlyDenied || permissionMicrophoneStatus.isPermanentlyDenied) { - await _showPermissionDialog(context, type, onTapGrant); + await _showPermissionDialog(context, type ?? "", onTapGrant); } else if (!permissionCameraStatus.isGranted || !permissionMicrophoneStatus.isGranted) { permissionCameraStatus = await cameraPermission.request(); permissionMicrophoneStatus = await microphonePermission.request(); if (permissionCameraStatus.isDenied || permissionMicrophoneStatus.isDenied) - await _showPermissionDialog(context, type, onTapGrant); + await _showPermissionDialog(context, type ?? "", onTapGrant); else onTapGrant(); } else if (permissionCameraStatus.isDenied || permissionMicrophoneStatus.isDenied) - await _showPermissionDialog(context, type, onTapGrant); + await _showPermissionDialog(context, type ?? "", onTapGrant); else onTapGrant(); } diff --git a/lib/utils/tab_utils.dart b/lib/utils/tab_utils.dart index 8593425a..283ff73f 100644 --- a/lib/utils/tab_utils.dart +++ b/lib/utils/tab_utils.dart @@ -6,63 +6,61 @@ import '../core/viewModel/project_view_model.dart'; import '../widgets/shared/app_texts_widget.dart'; class TabUtils { - static getBoxTabsBoxDecoration( {bool isFirst = false, - bool isMiddle = false, - bool isLast = false, - bool isActive = false, - double radius = 6.0, - ProjectViewModel projectViewModel}) { - + 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) + ? isLast || isMiddle + ? radius + : 0 + : 0) : Radius.circular(isActive - ? isFirst || isMiddle - ? radius - : 0 - : 0), + ? isFirst || isMiddle + ? radius + : 0 + : 0), topLeft: projectViewModel.isArabic ? Radius.circular(isActive - ? isFirst || isMiddle - ? radius - : 0 - : 0) + ? isFirst || isMiddle + ? radius + : 0 + : 0) : Radius.circular(isActive - ? isLast || isMiddle - ? radius - : 0 - : 0), + ? isLast || isMiddle + ? radius + : 0 + : 0), bottomRight: projectViewModel.isArabic ? Radius.circular(isActive - ? isLast || isMiddle - ? radius - : 0 - : 0) + ? isLast || isMiddle + ? radius + : 0 + : 0) : Radius.circular(isActive - ? isFirst || isMiddle - ? radius - : 0 - : 0), + ? isFirst || isMiddle + ? radius + : 0 + : 0), bottomLeft: projectViewModel.isArabic ? Radius.circular(isActive - ? isFirst || isMiddle - ? radius - : 0 - : 0) + ? isFirst || isMiddle + ? radius + : 0 + : 0) : Radius.circular(isActive - ? isLast || isMiddle - ? radius - : 0 - : 0)), + ? isLast || isMiddle + ? radius + : 0 + : 0)), ); } @@ -71,12 +69,12 @@ class TabUtils { } static getTabText({ - String title, + required String title, bool isActive = false, }) { return AppText( title, - fontSize: SizeConfig.textMultiplier * 1.8, + fontSize: SizeConfig.textMultiplier! * 1.8, color: isActive ? Colors.white : AppGlobal.appTextColor, letterSpacing: -0.48, fontWeight: FontWeight.w600, @@ -88,7 +86,7 @@ class TabUtils { return screenSize.height * 0.07; } - static getTabCounter({bool isActive: false, int counter}) { + static getTabCounter({bool isActive = false, int counter = 0}) { return Container( margin: EdgeInsets.all(4), width: 15, @@ -101,7 +99,7 @@ class TabUtils { child: FittedBox( child: AppText( "$counter", - fontSize: SizeConfig.textMultiplier * 1.5, + fontSize: SizeConfig.textMultiplier! * 1.5, color: !isActive ? Colors.white : AppGlobal.appRedColor, fontWeight: FontWeight.w700, ), @@ -109,4 +107,4 @@ class TabUtils { ), ); } -} \ No newline at end of file +} diff --git a/lib/utils/translations_delegate_base_utils.dart b/lib/utils/translations_delegate_base_utils.dart index ae709ba2..dc8d7f0e 100644 --- a/lib/utils/translations_delegate_base_utils.dart +++ b/lib/utils/translations_delegate_base_utils.dart @@ -10,1722 +10,1841 @@ class TranslationBase { final Locale locale; static TranslationBase of(BuildContext context) { - return Localizations.of(context, TranslationBase); + return Localizations.of(context, TranslationBase)!; } - String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String get dashboardScreenToolbarTitle => + localizedValues['dashboardScreenToolbarTitle']![locale.languageCode]!; - String get settings => localizedValues['settings'][locale.languageCode]; + String get settings => localizedValues['settings']![locale.languageCode]!; - String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; + String get areYouSureYouWantTo => + localizedValues['areYouSureYouWantTo']![locale.languageCode]!; - String get language => localizedValues['language'][locale.languageCode]; + String get language => localizedValues['language']![locale.languageCode]!; - String get lanEnglish => localizedValues['lanEnglish'][locale.languageCode]; + String get lanEnglish => localizedValues['lanEnglish']![locale.languageCode]!; - String get lanArabic => localizedValues['lanArabic'][locale.languageCode]; + String get lanArabic => localizedValues['lanArabic']![locale.languageCode]!; - String get theDoctor => localizedValues['theDoctor'][locale.languageCode]; + String get theDoctor => localizedValues['theDoctor']![locale.languageCode]!; - String get reply => localizedValues['reply'][locale.languageCode]; + String get reply => localizedValues['reply']![locale.languageCode]!; - String get time => localizedValues['time'][locale.languageCode]; + String get time => localizedValues['time']![locale.languageCode]!; - String get fileNo => localizedValues['fileNo'][locale.languageCode]; + String get fileNo => localizedValues['fileNo']![locale.languageCode]!; - String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; + String get mobileNo => localizedValues['mobileNo']![locale.languageCode]!; - String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; + String get replySuccessfully => + localizedValues['replySuccessfully']![locale.languageCode]!; - String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; + String get messagesScreenToolbarTitle => + localizedValues['messagesScreenToolbarTitle']![locale.languageCode]!; - String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; + String get mySchedule => localizedValues['mySchedule']![locale.languageCode]!; - String get errorNoSchedule => localizedValues['errorNoSchedule'][locale.languageCode]; + String get errorNoSchedule => + localizedValues['errorNoSchedule']![locale.languageCode]!; - String get verify => localizedValues['verify'][locale.languageCode]; + String get verify => localizedValues['verify']![locale.languageCode]!; - String get referralDoctor => localizedValues['referralDoctor'][locale.languageCode]; + String get referralDoctor => + localizedValues['referralDoctor']![locale.languageCode]!; - String get referringClinic => localizedValues['referringClinic'][locale.languageCode]; + String get referringClinic => + localizedValues['referringClinic']![locale.languageCode]!; - String get frequency => localizedValues['frequency'][locale.languageCode]; + String get frequency => localizedValues['frequency']![locale.languageCode]!; - String get priority => localizedValues['priority'][locale.languageCode]; + String get priority => localizedValues['priority']![locale.languageCode]!; - String get maxResponseTime => localizedValues['maxResponseTime'][locale.languageCode]; + String get maxResponseTime => + localizedValues['maxResponseTime']![locale.languageCode]!; - String get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks'][locale.languageCode]; + String get clinicDetailsandRemarks => + localizedValues['clinicDetailsandRemarks']![locale.languageCode]!; - String get answerSuggestions => localizedValues['answerSuggestions'][locale.languageCode]; + String get answerSuggestions => + localizedValues['answerSuggestions']![locale.languageCode]!; - String get outPatients => localizedValues['outPatients'][locale.languageCode]; + String get outPatients => + localizedValues['outPatients']![locale.languageCode]!; - String get searchPatient => localizedValues['searchPatient'][locale.languageCode]; + String get searchPatient => + localizedValues['searchPatient']![locale.languageCode]!; - String get searchPatientDashBoard => localizedValues['searchPatientDashBoard'][locale.languageCode]; + String get searchPatientDashBoard => + localizedValues['searchPatientDashBoard']![locale.languageCode]!; - String get searchPatientName => localizedValues['searchPatient-name'][locale.languageCode]; + String get searchPatientName => + localizedValues['searchPatient-name']![locale.languageCode]!; - String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; + String get searchAbout => + localizedValues['searchAbout']![locale.languageCode]!; - String get patient => localizedValues['patient'][locale.languageCode]; + String get patient => localizedValues['patient']![locale.languageCode]!; - String get patients => localizedValues['patients'][locale.languageCode]; + String get patients => localizedValues['patients']![locale.languageCode]!; - String get labResult => localizedValues['labResult'][locale.languageCode]; + String get labResult => localizedValues['labResult']![locale.languageCode]!; - String get todayStatistics => localizedValues['todayStatistics'][locale.languageCode]; + String get todayStatistics => + localizedValues['todayStatistics']![locale.languageCode]!; - String get familyMedicine => localizedValues['familyMedicine'][locale.languageCode]; + String get familyMedicine => + localizedValues['familyMedicine']![locale.languageCode]!; - String get arrived => localizedValues['arrived'][locale.languageCode]; + String get arrived => localizedValues['arrived']![locale.languageCode]!; - String get er => localizedValues['er'][locale.languageCode]; + String get er => localizedValues['er']![locale.languageCode]!; - String get walkIn => localizedValues['walkIn'][locale.languageCode]; + String get walkIn => localizedValues['walkIn']![locale.languageCode]!; - String get notArrived => localizedValues['notArrived'][locale.languageCode]; + String get notArrived => localizedValues['notArrived']![locale.languageCode]!; - String get radiology => localizedValues['radiology'][locale.languageCode]; + String get radiology => localizedValues['radiology']![locale.languageCode]!; - String get service => localizedValues['service'][locale.languageCode]; + String get service => localizedValues['service']![locale.languageCode]!; - String get referral => localizedValues['referral'][locale.languageCode]; + String get referral => localizedValues['referral']![locale.languageCode]!; - String get inPatient => localizedValues['inPatient'][locale.languageCode]; + String get inPatient => localizedValues['inPatient']![locale.languageCode]!; - String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; + String get myInPatient => + localizedValues['myInPatient']![locale.languageCode]!; - String get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode]; + String get myInPatientTitle => + localizedValues['myInPatientTitle']![locale.languageCode]!; - String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; + String get inPatientLabel => + localizedValues['inPatientLabel']![locale.languageCode]!; - String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; + String get inPatientAll => + localizedValues['inPatientAll']![locale.languageCode]!; - String get operations => localizedValues['operations'][locale.languageCode]; + String get operations => localizedValues['operations']![locale.languageCode]!; - String get patientServices => localizedValues['patientServices'][locale.languageCode]; + String get patientServices => + localizedValues['patientServices']![locale.languageCode]!; - String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; + String get searchMedicine => + localizedValues['searchMedicine']![locale.languageCode]!; - String get searchMedicineDashboard => localizedValues['searchMedicineDashboard'][locale.languageCode]; + String get searchMedicineDashboard => + localizedValues['searchMedicineDashboard']![locale.languageCode]!; - String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; + String get myReferralPatient => + localizedValues['myReferralPatient']![locale.languageCode]!; - String get referPatient => localizedValues['referPatient'][locale.languageCode]; + String get referPatient => + localizedValues['referPatient']![locale.languageCode]!; - String get myReferral => localizedValues['myReferral'][locale.languageCode]; + String get myReferral => localizedValues['myReferral']![locale.languageCode]!; - String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; + String get myReferredPatient => + localizedValues['myReferredPatient']![locale.languageCode]!; String get referredPatient => - localizedValues['referredPatient'][locale.languageCode]; + localizedValues['referredPatient']![locale.languageCode]!; - String get referredOn => localizedValues['referredOn'][locale.languageCode]; + String get referredOn => localizedValues['referredOn']![locale.languageCode]!; - String get firstName => localizedValues['firstName'][locale.languageCode]; + String get firstName => localizedValues['firstName']![locale.languageCode]!; - String get firstNameInAr => localizedValues['firstNameInAr'][locale.languageCode]; + String get firstNameInAr => + localizedValues['firstNameInAr']![locale.languageCode]!; - String get middleName => localizedValues['middleName'][locale.languageCode]; + String get middleName => localizedValues['middleName']![locale.languageCode]!; - String get middleNameInAr => localizedValues['middleNameInAr'][locale.languageCode]; + String get middleNameInAr => + localizedValues['middleNameInAr']![locale.languageCode]!; - String get lastName => localizedValues['lastName'][locale.languageCode]; + String get lastName => localizedValues['lastName']![locale.languageCode]!; - String get lastNameInAr => localizedValues['lastNameInAr'][locale.languageCode]; + String get lastNameInAr => + localizedValues['lastNameInAr']![locale.languageCode]!; - String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; + String get phoneNumber => + localizedValues['phoneNumber']![locale.languageCode]!; - String get patientID => localizedValues['patientID'][locale.languageCode]; + String get patientID => localizedValues['patientID']![locale.languageCode]!; - String get patientFile => localizedValues['patientFile'][locale.languageCode]; + String get patientFile => + localizedValues['patientFile']![locale.languageCode]!; - String get search => localizedValues['search'][locale.languageCode]; + String get search => localizedValues['search']![locale.languageCode]!; - String get onlyArrivedPatient => localizedValues['onlyArrivedPatient'][locale.languageCode]; + String get onlyArrivedPatient => + localizedValues['onlyArrivedPatient']![locale.languageCode]!; - String get searchMedicineNameHere => localizedValues['searchMedicineNameHere'][locale.languageCode]; + String get searchMedicineNameHere => + localizedValues['searchMedicineNameHere']![locale.languageCode]!; - String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; + String get youCanFind => localizedValues['youCanFind']![locale.languageCode]!; - String get medicineSearchResult => localizedValues['medicineSearchResult'][locale.languageCode]; + String get medicineSearchResult => + localizedValues['medicineSearchResult']![locale.languageCode]!; - String get qr => localizedValues['qr'][locale.languageCode]; + String get qr => localizedValues['qr']![locale.languageCode]!; - String get reader => localizedValues['reader'][locale.languageCode]; + String get reader => localizedValues['reader']![locale.languageCode]!; - String get startScanning => localizedValues['startScanning'][locale.languageCode]; + String get startScanning => + localizedValues['startScanning']![locale.languageCode]!; - String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; - String get scanERQrCode => localizedValues['scanERQrCode'][locale.languageCode]; + String get scanQrCode => localizedValues['scanQrCode']![locale.languageCode]!; - String get scanQr => localizedValues['scanQr'][locale.languageCode]; + String get scanERQrCode => + localizedValues['scanERQrCode']![locale.languageCode]!; - String get profile => localizedValues['profile'][locale.languageCode]; + String get scanQr => localizedValues['scanQr']![locale.languageCode]!; - String get gender => localizedValues['gender'][locale.languageCode]; + String get profile => localizedValues['profile']![locale.languageCode]!; - String get clinic => localizedValues['clinic'][locale.languageCode]; + String get gender => localizedValues['gender']![locale.languageCode]!; - String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; + String get clinic => localizedValues['clinic']![locale.languageCode]!; - String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; + String get clinicSelect => + localizedValues['clinicSelect']![locale.languageCode]!; - String get hospital => localizedValues['hospital'][locale.languageCode]; + String get doctorSelect => + localizedValues['doctorSelect']![locale.languageCode]!; - String get speciality => localizedValues['speciality'][locale.languageCode]; + String get hospital => localizedValues['hospital']![locale.languageCode]!; - String get errorMessage => localizedValues['errorMessage'][locale.languageCode]; + String get speciality => localizedValues['speciality']![locale.languageCode]!; - String get patientProfile => localizedValues['patientProfile'][locale.languageCode]; + String get errorMessage => + localizedValues['errorMessage']![locale.languageCode]!; - String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; + String get patientProfile => + localizedValues['patientProfile']![locale.languageCode]!; - String get vital => localizedValues['vital'][locale.languageCode]; + String get vitalSign => localizedValues['vitalSign']![locale.languageCode]!; - String get signs => localizedValues['signs'][locale.languageCode]; + String get vital => localizedValues['vital']![locale.languageCode]!; - String get labOrder => localizedValues['labOrder'][locale.languageCode]; + String get signs => localizedValues['signs']![locale.languageCode]!; - String get lab => localizedValues['lab'][locale.languageCode]; + String get labOrder => localizedValues['labOrder']![locale.languageCode]!; - String get result => localizedValues['result'][locale.languageCode]; + String get lab => localizedValues['lab']![locale.languageCode]!; - String get medicines => localizedValues['medicines'][locale.languageCode]; + String get result => localizedValues['result']![locale.languageCode]!; - String get prescription => localizedValues['prescription'][locale.languageCode]; + String get medicines => localizedValues['medicines']![locale.languageCode]!; - String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; + String get prescription => + localizedValues['prescription']![locale.languageCode]!; - String get insurance => localizedValues['insurance'][locale.languageCode]; + String get insuranceApprovals => + localizedValues['insuranceApprovals']![locale.languageCode]!; - String get approvals => localizedValues['approvals'][locale.languageCode]; + String get insurance => localizedValues['insurance']![locale.languageCode]!; - String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; + String get approvals => localizedValues['approvals']![locale.languageCode]!; - String get temperature => localizedValues['temperature'][locale.languageCode]; + String get bodyMeasurements => + localizedValues['bodyMeasurements']![locale.languageCode]!; - String get pulse => localizedValues['pulse'][locale.languageCode]; + String get temperature => + localizedValues['temperature']![locale.languageCode]!; - String get respiration => localizedValues['respiration'][locale.languageCode]; + String get pulse => localizedValues['pulse']![locale.languageCode]!; - String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; + String get respiration => + localizedValues['respiration']![locale.languageCode]!; - String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; + String get bloodPressure => + localizedValues['bloodPressure']![locale.languageCode]!; - String get painScale => localizedValues['painScale'][locale.languageCode]; + String get oxygenation => + localizedValues['oxygenation']![locale.languageCode]!; - String get errorNoVitalSign => localizedValues['errorNoVitalSign'][locale.languageCode]; + String get painScale => localizedValues['painScale']![locale.languageCode]!; - String get labOrders => localizedValues['labOrders'][locale.languageCode]; + String get errorNoVitalSign => + localizedValues['errorNoVitalSign']![locale.languageCode]!; - String get errorNoLabOrders => localizedValues['errorNoLabOrders'][locale.languageCode]; + String get labOrders => localizedValues['labOrders']![locale.languageCode]!; - String get answerThePatient => localizedValues['answerThePatient'][locale.languageCode]; + String get errorNoLabOrders => + localizedValues['errorNoLabOrders']![locale.languageCode]!; - String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String get answerThePatient => + localizedValues['answerThePatient']![locale.languageCode]!; - String get replay => localizedValues['replay'][locale.languageCode]; + String get pleaseEnterAnswer => + localizedValues['pleaseEnterAnswer']![locale.languageCode]!; - String get progressNote => localizedValues['progressNote'][locale.languageCode]; + String get replay => localizedValues['replay']![locale.languageCode]!; - String get operationReports => localizedValues['operationReports'][locale.languageCode]; + String get progressNote => + localizedValues['progressNote']![locale.languageCode]!; - String get reports => localizedValues['reports'][locale.languageCode]; + String get operationReports => + localizedValues['operationReports']![locale.languageCode]!; - String get operation => localizedValues['operation'][locale.languageCode]; + String get reports => localizedValues['reports']![locale.languageCode]!; - String get progress => localizedValues['progress'][locale.languageCode]; + String get operation => localizedValues['operation']![locale.languageCode]!; - String get note => localizedValues['note'][locale.languageCode]; + String get progress => localizedValues['progress']![locale.languageCode]!; - String get searchNote => localizedValues['searchNote'][locale.languageCode]; + String get note => localizedValues['note']![locale.languageCode]!; - String get errorNoProgressNote => localizedValues['errorNoProgressNote'][locale.languageCode]; + String get searchNote => localizedValues['searchNote']![locale.languageCode]!; - String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; + String get errorNoProgressNote => + localizedValues['errorNoProgressNote']![locale.languageCode]!; - String get orderNo => localizedValues['orderNo'][locale.languageCode]; + String get invoiceNo => localizedValues['invoiceNo:']![locale.languageCode]!; - String get generalResult => localizedValues['generalResult'][locale.languageCode]; + String get orderNo => localizedValues['orderNo']![locale.languageCode]!; - String get description => localizedValues['description'][locale.languageCode]; + String get generalResult => + localizedValues['generalResult']![locale.languageCode]!; - String get value => localizedValues['value'][locale.languageCode]; + String get description => + localizedValues['description']![locale.languageCode]!; - String get range => localizedValues['range'][locale.languageCode]; + String get value => localizedValues['value']![locale.languageCode]!; - String get enterId => localizedValues['enterId'][locale.languageCode]; + String get range => localizedValues['range']![locale.languageCode]!; - String get pleaseEnterYourID => localizedValues['pleaseEnterYourID'][locale.languageCode]; + String get enterId => localizedValues['enterId']![locale.languageCode]!; - String get enterPassword => localizedValues['enterPassword'][locale.languageCode]; + String get pleaseEnterYourID => + localizedValues['pleaseEnterYourID']![locale.languageCode]!; - String get pleaseEnterPassword => localizedValues['pleaseEnterPassword'][locale.languageCode]; + String get enterPassword => + localizedValues['enterPassword']![locale.languageCode]!; - String get selectYourProject => localizedValues['selectYourProject'][locale.languageCode]; + String get pleaseEnterPassword => + localizedValues['pleaseEnterPassword']![locale.languageCode]!; - String get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject'][locale.languageCode]; + String get selectYourProject => + localizedValues['selectYourProject']![locale.languageCode]!; - String get login => localizedValues['login'][locale.languageCode]; + String get pleaseEnterYourProject => + localizedValues['pleaseEnterYourProject']![locale.languageCode]!; - String get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib'][locale.languageCode]; + String get login => localizedValues['login']![locale.languageCode]!; - String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; + String get drSulaimanAlHabib => + localizedValues['drSulaimanAlHabib']![locale.languageCode]!; - String get welcomeBackTo => localizedValues['welcomeBackTo'][locale.languageCode]; + String get welcomeTo => localizedValues['welcomeTo']![locale.languageCode]!; - String get home => localizedValues['home'][locale.languageCode]; + String get welcomeBackTo => + localizedValues['welcomeBackTo']![locale.languageCode]!; - String get services => localizedValues['services'][locale.languageCode]; + String get home => localizedValues['home']![locale.languageCode]!; - String get sms => localizedValues['sms'][locale.languageCode]; + String get services => localizedValues['services']![locale.languageCode]!; - String get fingerprint => localizedValues['fingerprint'][locale.languageCode]; + String get sms => localizedValues['sms']![locale.languageCode]!; - String get faceId => localizedValues['faceId'][locale.languageCode]; + String get fingerprint => + localizedValues['fingerprint']![locale.languageCode]!; - String get whatsApp => localizedValues['whatsApp'][locale.languageCode]; + String get faceId => localizedValues['faceId']![locale.languageCode]!; - String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; + String get whatsApp => localizedValues['whatsApp']![locale.languageCode]!; - String get pleaseChoose => localizedValues['pleaseChoose'][locale.languageCode]; + String get whatsAppBy => localizedValues['whatsAppBy']![locale.languageCode]!; - String get choose => localizedValues['choose'][locale.languageCode]; + String get pleaseChoose => + localizedValues['pleaseChoose']![locale.languageCode]!; - String get verification => localizedValues['verification'][locale.languageCode]; + String get choose => localizedValues['choose']![locale.languageCode]!; - String get firstStep => localizedValues['firstStep'][locale.languageCode]; + String get verification => + localizedValues['verification']![locale.languageCode]!; - String get yourAccount => localizedValues['yourAccount!'][locale.languageCode]; + String get firstStep => localizedValues['firstStep']![locale.languageCode]!; - String get verify1 => localizedValues['verify1'][locale.languageCode]; + String get yourAccount => + localizedValues['yourAccount!']![locale.languageCode]!; - String get youWillReceiveA => localizedValues['youWillReceiveA'][locale.languageCode]; + String get verify1 => localizedValues['verify1']![locale.languageCode]!; - String get loginCode => localizedValues['loginCode'][locale.languageCode]; + String get youWillReceiveA => + localizedValues['youWillReceiveA']![locale.languageCode]!; - String get smsBy => localizedValues['smsBy'][locale.languageCode]; + String get loginCode => localizedValues['loginCode']![locale.languageCode]!; + + String get smsBy => localizedValues['smsBy']![locale.languageCode]!; String get pleaseEnterTheCode => - localizedValues['pleaseEnterTheCode'][locale.languageCode]; + localizedValues['pleaseEnterTheCode']![locale.languageCode]!; String get youDontHaveAnyPatient => - localizedValues['youDontHaveAnyPatient'][locale.languageCode]; + localizedValues['youDontHaveAnyPatient']![locale.languageCode]!; String get youDoNotHaveAnyItem => - localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; + localizedValues['youDoNotHaveAnyItem']![locale.languageCode]!; - String get age => localizedValues['age'][locale.languageCode]; + String get age => localizedValues['age']![locale.languageCode]!; - String get nationality => localizedValues['nationality'][locale.languageCode]; + String get nationality => + localizedValues['nationality']![locale.languageCode]!; - String get occupation => localizedValues['occupation'][locale.languageCode]; + String get occupation => localizedValues['occupation']![locale.languageCode]!; - String get healthID => localizedValues['healthID'][locale.languageCode]; + String get healthID => localizedValues['healthID']![locale.languageCode]!; String get identityNumber => - localizedValues['identityNumber'][locale.languageCode]; + localizedValues['identityNumber']![locale.languageCode]!; String get maritalStatus => - localizedValues['maritalStatus'][locale.languageCode]; + localizedValues['maritalStatus']![locale.languageCode]!; - String get today => localizedValues['today'][locale.languageCode]; + String get today => localizedValues['today']![locale.languageCode]!; - String get tomorrow => localizedValues['tomorrow'][locale.languageCode]; + String get tomorrow => localizedValues['tomorrow']![locale.languageCode]!; - String get all => localizedValues['all'][locale.languageCode]; + String get all => localizedValues['all']![locale.languageCode]!; - String get nextWeek => localizedValues['nextWeek'][locale.languageCode]; + String get nextWeek => localizedValues['nextWeek']![locale.languageCode]!; - String get yesterday => localizedValues['yesterday'][locale.languageCode]; + String get yesterday => localizedValues['yesterday']![locale.languageCode]!; String get errorNoInsuranceApprovals => - localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; + localizedValues['errorNoInsuranceApprovals']![locale.languageCode]!; String get searchInsuranceApprovals => - localizedValues['searchInsuranceApprovals'][locale.languageCode]; + localizedValues['searchInsuranceApprovals']![locale.languageCode]!; - String get status => localizedValues['status'][locale.languageCode]; + String get status => localizedValues['status']![locale.languageCode]!; - String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; + String get expiryDate => localizedValues['expiryDate']![locale.languageCode]!; String get producerName => - localizedValues['producerName'][locale.languageCode]; + localizedValues['producerName']![locale.languageCode]!; - String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; + String get receiptOn => localizedValues['receiptOn']![locale.languageCode]!; - String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; + String get approvalNo => localizedValues['approvalNo']![locale.languageCode]!; - String get doctor => localizedValues['doctor'][locale.languageCode]; + String get doctor => localizedValues['doctor']![locale.languageCode]!; - String get ext => localizedValues['ext'][locale.languageCode]; + String get ext => localizedValues['ext']![locale.languageCode]!; - String get veryUrgent => localizedValues['veryUrgent'][locale.languageCode]; + String get veryUrgent => localizedValues['veryUrgent']![locale.languageCode]!; - String get urgent => localizedValues['urgent'][locale.languageCode]; + String get urgent => localizedValues['urgent']![locale.languageCode]!; - String get routine => localizedValues['routine'][locale.languageCode]; + String get routine => localizedValues['routine']![locale.languageCode]!; - String get send => localizedValues['send'][locale.languageCode]; + String get send => localizedValues['send']![locale.languageCode]!; String get referralFrequency => - localizedValues['referralFrequency'][locale.languageCode]; + localizedValues['referralFrequency']![locale.languageCode]!; String get selectReferralFrequency => - localizedValues['selectReferralFrequency'][locale.languageCode]; + localizedValues['selectReferralFrequency']![locale.languageCode]!; String get clinicalDetailsAndRemarks => - localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; + localizedValues['clinicalDetailsAndRemarks']![locale.languageCode]!; - String get remarks => localizedValues['remarks'][locale.languageCode]; + String get remarks => localizedValues['remarks']![locale.languageCode]!; - String get pleaseFill => localizedValues['pleaseFill'][locale.languageCode]; + String get pleaseFill => localizedValues['pleaseFill']![locale.languageCode]!; - String get replay2 => localizedValues['replay2'][locale.languageCode]; + String get replay2 => localizedValues['replay2']![locale.languageCode]!; - String get outPatient => localizedValues['outPatients'][locale.languageCode]; + String get outPatient => + localizedValues['outPatients']![locale.languageCode]!; String get myOutPatient => - localizedValues['myOutPatient'][locale.languageCode]; + localizedValues['myOutPatient']![locale.languageCode]!; String get myOutPatient_2lines => - localizedValues['myOutPatient_2lines'][locale.languageCode]; + localizedValues['myOutPatient_2lines']![locale.languageCode]!; - String get logout => localizedValues['logout'][locale.languageCode]; + String get logout => localizedValues['logout']![locale.languageCode]!; String get pharmaciesList => - localizedValues['pharmaciesList'][locale.languageCode]; + localizedValues['pharmaciesList']![locale.languageCode]!; - String get price => localizedValues['price'][locale.languageCode]; + String get price => localizedValues['price']![locale.languageCode]!; String get youCanFindItIn => - localizedValues['youCanFindItIn'][locale.languageCode]; + localizedValues['youCanFindItIn']![locale.languageCode]!; String get radiologyReport => - localizedValues['radiologyReport'][locale.languageCode]; + localizedValues['radiologyReport']![locale.languageCode]!; - String get orders => localizedValues['orders'][locale.languageCode]; + String get orders => localizedValues['orders']![locale.languageCode]!; - String get list => localizedValues['list'][locale.languageCode]; + String get list => localizedValues['list']![locale.languageCode]!; String get searchOrders => - localizedValues['searchOrders'][locale.languageCode]; + localizedValues['searchOrders']![locale.languageCode]!; String get prescriptionDetails => - localizedValues['prescriptionDetails'][locale.languageCode]; + localizedValues['prescriptionDetails']![locale.languageCode]!; String get prescriptionInfo => - localizedValues['prescriptionInfo'][locale.languageCode]; + localizedValues['prescriptionInfo']![locale.languageCode]!; String get errorNoOrders => - localizedValues['errorNoOrders'][locale.languageCode]; + localizedValues['errorNoOrders']![locale.languageCode]!; - String get livecare => localizedValues['livecare'][locale.languageCode]; + String get livecare => localizedValues['livecare']![locale.languageCode]!; - String get beingBad => localizedValues['beingBad'][locale.languageCode]; + String get beingBad => localizedValues['beingBad']![locale.languageCode]!; - String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; + String get beingGreat => localizedValues['beingGreat']![locale.languageCode]!; - String get cancel => localizedValues['cancel'][locale.languageCode]; + String get cancel => localizedValues['cancel']![locale.languageCode]!; - String get ok => localizedValues['ok'][locale.languageCode]; + String get ok => localizedValues['ok']![locale.languageCode]!; - String get done => localizedValues['done'][locale.languageCode]; + String get done => localizedValues['done']![locale.languageCode]!; String get searchMedicineImageCaption => - localizedValues['searchMedicineImageCaption'][locale.languageCode]; + localizedValues['searchMedicineImageCaption']![locale.languageCode]!; - String get type => localizedValues['type'][locale.languageCode]; + String get type => localizedValues['type']![locale.languageCode]!; - String get resumecall => localizedValues['resumecall'][locale.languageCode]; + String get resumecall => localizedValues['resumecall']![locale.languageCode]!; String get endcallwithcharge => - localizedValues['endcallwithcharge'][locale.languageCode]; + localizedValues['endcallwithcharge']![locale.languageCode]!; - String get endcall => localizedValues['endcall'][locale.languageCode]; + String get endcall => localizedValues['endcall']![locale.languageCode]!; String get transfertoadmin => - localizedValues['transfertoadmin'][locale.languageCode]; + localizedValues['transfertoadmin']![locale.languageCode]!; - String get fromDate => localizedValues['fromDate'][locale.languageCode]; + String get fromDate => localizedValues['fromDate']![locale.languageCode]!; - String get toDate => localizedValues['toDate'][locale.languageCode]; + String get toDate => localizedValues['toDate']![locale.languageCode]!; - String get fromTime => localizedValues['fromTime'][locale.languageCode]; + String get fromTime => localizedValues['fromTime']![locale.languageCode]!; - String get toTime => localizedValues['toTime'][locale.languageCode]; + String get toTime => localizedValues['toTime']![locale.languageCode]!; String get searchPatientImageCaptionTitle => - localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; + localizedValues['searchPatientImageCaptionTitle']![locale.languageCode]!; String get searchPatientImageCaptionBody => - localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; + localizedValues['searchPatientImageCaptionBody']![locale.languageCode]!; - String get welcome => localizedValues['welcome'][locale.languageCode]; + String get welcome => localizedValues['welcome']![locale.languageCode]!; String get typeMedicineName => - localizedValues['typeMedicineName'][locale.languageCode]; + localizedValues['typeMedicineName']![locale.languageCode]!; String get moreThan3Letter => - localizedValues['moreThan3Letter'][locale.languageCode]; + localizedValues['moreThan3Letter']![locale.languageCode]!; - String get gender2 => localizedValues['gender2'][locale.languageCode]; + String get gender2 => localizedValues['gender2']![locale.languageCode]!; - String get age2 => localizedValues['age2'][locale.languageCode]; + String get age2 => localizedValues['age2']![locale.languageCode]!; - String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; + String get sickleave => localizedValues['sick-leaves']![locale.languageCode]!; String get patientSick => - localizedValues['patient-sick'][locale.languageCode]; + localizedValues['patient-sick']![locale.languageCode]!; - String get leave => localizedValues['leave'][locale.languageCode]; + String get leave => localizedValues['leave']![locale.languageCode]!; - String get submit => localizedValues['submit'][locale.languageCode]; + String get submit => localizedValues['submit']![locale.languageCode]!; - String get doctorName => localizedValues['doc-name'][locale.languageCode]; + String get doctorName => localizedValues['doc-name']![locale.languageCode]!; - String get clinicName => localizedValues['clinicname'][locale.languageCode]; + String get clinicName => localizedValues['clinicname']![locale.languageCode]!; String get sickLeaveDate => - localizedValues['sick-leave-date'][locale.languageCode]; + localizedValues['sick-leave-date']![locale.languageCode]!; String get sickLeaveDays => - localizedValues['sick-leave-days'][locale.languageCode]; + localizedValues['sick-leave-days']![locale.languageCode]!; String get admissionDetail => - localizedValues['admissionDetail'][locale.languageCode]; + localizedValues['admissionDetail']![locale.languageCode]!; - String get dateTime => localizedValues['dateTime'][locale.languageCode]; + String get dateTime => localizedValues['dateTime']![locale.languageCode]!; - String get date => localizedValues['date'][locale.languageCode]; + String get date => localizedValues['date']![locale.languageCode]!; - String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; + String get admissionNo => + localizedValues['admissionNo']![locale.languageCode]!; - String get losNo => localizedValues['losNo'][locale.languageCode]; + String get losNo => localizedValues['losNo']![locale.languageCode]!; - String get area => localizedValues['area'][locale.languageCode]; + String get area => localizedValues['area']![locale.languageCode]!; - String get room => localizedValues['room'][locale.languageCode]; + String get room => localizedValues['room']![locale.languageCode]!; - String get bed => localizedValues['bed'][locale.languageCode]; + String get bed => localizedValues['bed']![locale.languageCode]!; String get previousSickLeaveIssue => - localizedValues['prevoius-sickleave-issed'][locale.languageCode]; + localizedValues['prevoius-sickleave-issed']![locale.languageCode]!; String get noSickLeaveApplied => - localizedValues['no-sickleve-applied'][locale.languageCode]; + localizedValues['no-sickleve-applied']![locale.languageCode]!; - String get applyNow => localizedValues['applynow'][locale.languageCode]; + String get applyNow => localizedValues['applynow']![locale.languageCode]!; String get addSickLeave => - localizedValues['add-sickleave'][locale.languageCode]; + localizedValues['add-sickleave']![locale.languageCode]!; String get pharmacyIntervention => - localizedValues['pharmacy-intervention'][locale.languageCode]; + localizedValues['pharmacy-intervention']![locale.languageCode]!; - String get add => localizedValues['add'][locale.languageCode]; + String get add => localizedValues['add']![locale.languageCode]!; String get addSickLeaverequest => - localizedValues['addSickLeaveRequest'][locale.languageCode]; + localizedValues['addSickLeaveRequest']![locale.languageCode]!; String get extendSickLeaverequest => - localizedValues['extendSickLeaveRequest'][locale.languageCode]; + localizedValues['extendSickLeaveRequest']![locale.languageCode]!; - String get approved => localizedValues['approved'][locale.languageCode]; + String get approved => localizedValues['approved']![locale.languageCode]!; - String get extended => localizedValues['extended'][locale.languageCode]; + String get extended => localizedValues['extended']![locale.languageCode]!; - String get pending => localizedValues['pending'][locale.languageCode]; + String get pending => localizedValues['pending']![locale.languageCode]!; String get leaveStartDate => - localizedValues['leave-start-date'][locale.languageCode]; + localizedValues['leave-start-date']![locale.languageCode]!; String get daysSickleave => - localizedValues['days-sick-leave'][locale.languageCode]; + localizedValues['days-sick-leave']![locale.languageCode]!; - String get extend => localizedValues['extend'][locale.languageCode]; + String get extend => localizedValues['extend']![locale.languageCode]!; String get extendSickLeave => - localizedValues['extend-sickleave'][locale.languageCode]; + localizedValues['extend-sickleave']![locale.languageCode]!; String get targetPatient => - localizedValues['patient-target'][locale.languageCode]; + localizedValues['patient-target']![locale.languageCode]!; String get noPrescription => - localizedValues['no-priscription-listed'][locale.languageCode]; + localizedValues['no-priscription-listed']![locale.languageCode]!; - String get next => localizedValues['next'][locale.languageCode]; + String get next => localizedValues['next']![locale.languageCode]!; - String get finish => localizedValues['finish'][locale.languageCode]; + String get finish => localizedValues['finish']![locale.languageCode]!; - String get previous => localizedValues['previous'][locale.languageCode]; + String get previous => localizedValues['previous']![locale.languageCode]!; String get emptyMessage => - localizedValues['empty-message'][locale.languageCode]; + localizedValues['empty-message']![locale.languageCode]!; String get healthRecordInformation => - localizedValues['healthRecordInformation'][locale.languageCode]; + localizedValues['healthRecordInformation']![locale.languageCode]!; String get chiefComplaintLength => - localizedValues['chiefComplaintLength'][locale.languageCode]; + localizedValues['chiefComplaintLength']![locale.languageCode]!; - String get referTo => localizedValues['referTo'][locale.languageCode]; + String get referTo => localizedValues['referTo']![locale.languageCode]!; String get referredFrom => - localizedValues['referredFrom'][locale.languageCode]; + localizedValues['referredFrom']![locale.languageCode]!; - String get refClinic => localizedValues['refClinic'][locale.languageCode]; + String get refClinic => localizedValues['refClinic']![locale.languageCode]!; - String get branch => localizedValues['branch'][locale.languageCode]; + String get branch => localizedValues['branch']![locale.languageCode]!; String get chooseAppointment => - localizedValues['chooseAppointment'][locale.languageCode]; + localizedValues['chooseAppointment']![locale.languageCode]!; String get appointmentNo => - localizedValues['appointmentNo'][locale.languageCode]; + localizedValues['appointmentNo']![locale.languageCode]!; - String get refer => localizedValues['refer'][locale.languageCode]; + String get refer => localizedValues['refer']![locale.languageCode]!; - String get rejected => localizedValues['rejected'][locale.languageCode]; + String get rejected => localizedValues['rejected']![locale.languageCode]!; - String get sameBranch => localizedValues['sameBranch'][locale.languageCode]; + String get sameBranch => localizedValues['sameBranch']![locale.languageCode]!; - String get otherBranch => localizedValues['otherBranch'][locale.languageCode]; + String get otherBranch => + localizedValues['otherBranch']![locale.languageCode]!; - String get dr => localizedValues['dr'][locale.languageCode]; + String get dr => localizedValues['dr']![locale.languageCode]!; String get previewHealth => - localizedValues['previewHealth'][locale.languageCode]; + localizedValues['previewHealth']![locale.languageCode]!; String get summaryReport => - localizedValues['summaryReport'][locale.languageCode]; + localizedValues['summaryReport']![locale.languageCode]!; - String get accept => localizedValues['accept'][locale.languageCode]; + String get accept => localizedValues['accept']![locale.languageCode]!; - String get reject => localizedValues['reject'][locale.languageCode]; + String get reject => localizedValues['reject']![locale.languageCode]!; String get noAppointmentsErrorMsg => - localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; + localizedValues['noAppointmentsErrorMsg']![locale.languageCode]!; String get referralPatient => - localizedValues['referralPatient'][locale.languageCode]; + localizedValues['referralPatient']![locale.languageCode]!; String get noPrescriptionListed => - localizedValues['noPrescriptionListed'][locale.languageCode]; + localizedValues['noPrescriptionListed']![locale.languageCode]!; - String get addNow => localizedValues['addNow'][locale.languageCode]; + String get addNow => localizedValues['addNow']![locale.languageCode]!; - String get orderType => localizedValues['orderType'][locale.languageCode]; + String get orderType => localizedValues['orderType']![locale.languageCode]!; - String get strength => localizedValues['strength'][locale.languageCode]; + String get strength => localizedValues['strength']![locale.languageCode]!; - String get doseTime => localizedValues['doseTime'][locale.languageCode]; + String get doseTime => localizedValues['doseTime']![locale.languageCode]!; - String get indication => localizedValues['indication'][locale.languageCode]; + String get indication => localizedValues['indication']![locale.languageCode]!; - String get duration => localizedValues['duration'][locale.languageCode]; + String get duration => localizedValues['duration']![locale.languageCode]!; - String get instruction => localizedValues['instruction'][locale.languageCode]; + String get instruction => + localizedValues['instruction']![locale.languageCode]!; String get rescheduleLeaves => - localizedValues['reschedule-leave'][locale.languageCode]; + localizedValues['reschedule-leave']![locale.languageCode]!; String get applyOrRescheduleLeave => - localizedValues['applyOrRescheduleLeave'][locale.languageCode]; + localizedValues['applyOrRescheduleLeave']![locale.languageCode]!; - String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; + String get myQRCode => localizedValues['myQRCode']![locale.languageCode]!; String get addMedication => - localizedValues['addMedication'][locale.languageCode]; + localizedValues['addMedication']![locale.languageCode]!; - String get route => localizedValues['route'][locale.languageCode]; + String get route => localizedValues['route']![locale.languageCode]!; String get noReScheduleLeave => - localizedValues['no-reschedule-leave'][locale.languageCode]; + localizedValues['no-reschedule-leave']![locale.languageCode]!; - String get weight => localizedValues['weight'][locale.languageCode]; + String get weight => localizedValues['weight']![locale.languageCode]!; - String get kg => localizedValues['kg'][locale.languageCode]; + String get kg => localizedValues['kg']![locale.languageCode]!; - String get height => localizedValues['height'][locale.languageCode]; + String get height => localizedValues['height']![locale.languageCode]!; - String get cm => localizedValues['cm'][locale.languageCode]; + String get cm => localizedValues['cm']![locale.languageCode]!; String get idealBodyWeight => - localizedValues['idealBodyWeight'][locale.languageCode]; + localizedValues['idealBodyWeight']![locale.languageCode]!; - String get waistSize => localizedValues['waistSize'][locale.languageCode]; + String get waistSize => localizedValues['waistSize']![locale.languageCode]!; - String get inch => localizedValues['inch'][locale.languageCode]; + String get inch => localizedValues['inch']![locale.languageCode]!; - String get headCircum => localizedValues['headCircum'][locale.languageCode]; + String get headCircum => localizedValues['headCircum']![locale.languageCode]!; String get leanBodyWeight => - localizedValues['leanBodyWeight'][locale.languageCode]; + localizedValues['leanBodyWeight']![locale.languageCode]!; String get bodyMassIndex => - localizedValues['bodyMassIndex'][locale.languageCode]; + localizedValues['bodyMassIndex']![locale.languageCode]!; String get yourBodyMassIndex => - localizedValues['yourBodyMassIndex'][locale.languageCode]; + localizedValues['yourBodyMassIndex']![locale.languageCode]!; String get bmiUnderWeight => - localizedValues['bmiUnderWeight'][locale.languageCode]; + localizedValues['bmiUnderWeight']![locale.languageCode]!; - String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; + String get bmiHealthy => localizedValues['bmiHealthy']![locale.languageCode]!; String get bmiOverWeight => - localizedValues['bmiOverWeight'][locale.languageCode]; + localizedValues['bmiOverWeight']![locale.languageCode]!; - String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; + String get bmiObese => localizedValues['bmiObese']![locale.languageCode]!; String get bmiObeseExtreme => - localizedValues['bmiObeseExtreme'][locale.languageCode]; + localizedValues['bmiObeseExtreme']![locale.languageCode]!; - String get method => localizedValues['method'][locale.languageCode]; + String get method => localizedValues['method']![locale.languageCode]!; - String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode]; + String get pulseBeats => localizedValues['pulseBeats']![locale.languageCode]!; - String get rhythm => localizedValues['rhythm'][locale.languageCode]; + String get rhythm => localizedValues['rhythm']![locale.languageCode]!; - String get respBeats => localizedValues['respBeats'][locale.languageCode]; + String get respBeats => localizedValues['respBeats']![locale.languageCode]!; String get patternOfRespiration => - localizedValues['patternOfRespiration'][locale.languageCode]; + localizedValues['patternOfRespiration']![locale.languageCode]!; String get bloodPressureDiastoleAndSystole => - localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; + localizedValues['bloodPressureDiastoleAndSystole']![locale.languageCode]!; String get cuffLocation => - localizedValues['cuffLocation'][locale.languageCode]; + localizedValues['cuffLocation']![locale.languageCode]!; - String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; + String get cuffSize => localizedValues['cuffSize']![locale.languageCode]!; String get patientPosition => - localizedValues['patientPosition'][locale.languageCode]; + localizedValues['patientPosition']![locale.languageCode]!; - String get fio2 => localizedValues['fio2'][locale.languageCode]; + String get fio2 => localizedValues['fio2']![locale.languageCode]!; - String get sao2 => localizedValues['sao2'][locale.languageCode]; + String get sao2 => localizedValues['sao2']![locale.languageCode]!; String get painManagement => - localizedValues['painManagement'][locale.languageCode]; + localizedValues['painManagement']![locale.languageCode]!; - String get holiday => localizedValues['holiday'][locale.languageCode]; + String get holiday => localizedValues['holiday']![locale.languageCode]!; - String get to => localizedValues['to'][locale.languageCode]; + String get to => localizedValues['to']![locale.languageCode]!; String get coveringDoctor => - localizedValues['coveringDoctor'][locale.languageCode]; + localizedValues['coveringDoctor']![locale.languageCode]!; String get requestLeave => - localizedValues['requestLeave'][locale.languageCode]; + localizedValues['requestLeave']![locale.languageCode]!; String get pleaseEnterDate => - localizedValues['pleaseEnterDate'][locale.languageCode]; + localizedValues['pleaseEnterDate']![locale.languageCode]!; String get pleaseEnterNoOfDays => - localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; + localizedValues['pleaseEnterNoOfDays']![locale.languageCode]!; String get pleaseEnterRemarks => - localizedValues['pleaseEnterRemarks'][locale.languageCode]; + localizedValues['pleaseEnterRemarks']![locale.languageCode]!; - String get update => localizedValues['update'][locale.languageCode]; + String get update => localizedValues['update']![locale.languageCode]!; - String get admission => localizedValues['admission'][locale.languageCode]; + String get admission => localizedValues['admission']![locale.languageCode]!; - String get request => localizedValues['request'][locale.languageCode]; + String get request => localizedValues['request']![locale.languageCode]!; String get admissionRequest => - localizedValues['admissionRequest'][locale.languageCode]; + localizedValues['admissionRequest']![locale.languageCode]!; String get patientDetails => - localizedValues['patientDetails'][locale.languageCode]; + localizedValues['patientDetails']![locale.languageCode]!; String get specialityAndDoctorDetail => - localizedValues['specialityAndDoctorDetail'][locale.languageCode]; + localizedValues['specialityAndDoctorDetail']![locale.languageCode]!; String get referringDate => - localizedValues['referringDate'][locale.languageCode]; + localizedValues['referringDate']![locale.languageCode]!; String get referringDoctor => - localizedValues['referringDoctor'][locale.languageCode]; + localizedValues['referringDoctor']![locale.languageCode]!; String get otherInformation => - localizedValues['otherInformation'][locale.languageCode]; + localizedValues['otherInformation']![locale.languageCode]!; String get expectedDays => - localizedValues['expectedDays'][locale.languageCode]; + localizedValues['expectedDays']![locale.languageCode]!; String get expectedAdmissionDate => - localizedValues['expectedAdmissionDate'][locale.languageCode]; + localizedValues['expectedAdmissionDate']![locale.languageCode]!; String get emergencyAdmission => - localizedValues['emergencyAdmission'][locale.languageCode]; + localizedValues['emergencyAdmission']![locale.languageCode]!; String get isSickLeaveRequired => - localizedValues['isSickLeaveRequired'][locale.languageCode]; + localizedValues['isSickLeaveRequired']![locale.languageCode]!; String get patientPregnant => - localizedValues['patientPregnant'][locale.languageCode]; + localizedValues['patientPregnant']![locale.languageCode]!; String get treatmentLine => - localizedValues['treatmentLine'][locale.languageCode]; + localizedValues['treatmentLine']![locale.languageCode]!; - String get ward => localizedValues['ward'][locale.languageCode]; + String get ward => localizedValues['ward']![locale.languageCode]!; String get preAnesthesiaReferred => - localizedValues['preAnesthesiaReferred'][locale.languageCode]; + localizedValues['preAnesthesiaReferred']![locale.languageCode]!; String get admissionType => - localizedValues['admissionType'][locale.languageCode]; + localizedValues['admissionType']![locale.languageCode]!; - String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; + String get diagnosis => localizedValues['diagnosis']![locale.languageCode]!; - String get allergies => localizedValues['allergies'][locale.languageCode]; + String get allergies => localizedValues['allergies']![locale.languageCode]!; String get preOperativeOrders => - localizedValues['preOperativeOrders'][locale.languageCode]; + localizedValues['preOperativeOrders']![locale.languageCode]!; String get elementForImprovement => - localizedValues['elementForImprovement'][locale.languageCode]; + localizedValues['elementForImprovement']![locale.languageCode]!; String get dischargeDate => - localizedValues['dischargeDate'][locale.languageCode]; + localizedValues['dischargeDate']![locale.languageCode]!; - String get dietType => localizedValues['dietType'][locale.languageCode]; + String get dietType => localizedValues['dietType']![locale.languageCode]!; String get dietTypeRemarks => - localizedValues['dietTypeRemarks'][locale.languageCode]; + localizedValues['dietTypeRemarks']![locale.languageCode]!; - String get save => localizedValues['save'][locale.languageCode]; + String get save => localizedValues['save']![locale.languageCode]!; String get postPlansEstimatedCost => - localizedValues['postPlansEstimatedCost'][locale.languageCode]; + localizedValues['postPlansEstimatedCost']![locale.languageCode]!; - String get postPlans => localizedValues['postPlans'][locale.languageCode]; + String get postPlans => localizedValues['postPlans']![locale.languageCode]!; - String get ucaf => localizedValues['ucaf'][locale.languageCode]; + String get ucaf => localizedValues['ucaf']![locale.languageCode]!; String get emergencyCase => - localizedValues['emergencyCase'][locale.languageCode]; + localizedValues['emergencyCase']![locale.languageCode]!; String get durationOfIllness => - localizedValues['durationOfIllness'][locale.languageCode]; + localizedValues['durationOfIllness']![locale.languageCode]!; String get chiefComplaintsAndSymptoms => - localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; + localizedValues['chiefComplaintsAndSymptoms']![locale.languageCode]!; - String get patientFeelsPainInHisBackAndCough => - localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; + String get patientFeelsPainInHisBackAndCough => localizedValues[ + 'patientFeelsPainInHisBackAndCough']![locale.languageCode]!; String get additionalTextComplaints => - localizedValues['additionalTextComplaints'][locale.languageCode]; + localizedValues['additionalTextComplaints']![locale.languageCode]!; String get otherConditions => - localizedValues['otherConditions'][locale.languageCode]; + localizedValues['otherConditions']![locale.languageCode]!; - String get other => localizedValues['other'][locale.languageCode]; + String get other => localizedValues['other']![locale.languageCode]!; - String get how => localizedValues['how'][locale.languageCode]; + String get how => localizedValues['how']![locale.languageCode]!; - String get when => localizedValues['when'][locale.languageCode]; + String get when => localizedValues['when']![locale.languageCode]!; - String get where => localizedValues['where'][locale.languageCode]; + String get where => localizedValues['where']![locale.languageCode]!; String get specifyPossibleLineManagement => - localizedValues['specifyPossibleLineManagement'][locale.languageCode]; + localizedValues['specifyPossibleLineManagement']![locale.languageCode]!; String get significantSigns => - localizedValues['significantSigns'][locale.languageCode]; + localizedValues['significantSigns']![locale.languageCode]!; - String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; + String get backAbdomen => + localizedValues['backAbdomen']![locale.languageCode]!; - String get reasons => localizedValues['reasons'][locale.languageCode]; + String get reasons => localizedValues['reasons']![locale.languageCode]!; - String get createNew => localizedValues['createNew'][locale.languageCode]; + String get createNew => localizedValues['createNew']![locale.languageCode]!; - String get episode => localizedValues['episode'][locale.languageCode]; + String get episode => localizedValues['episode']![locale.languageCode]!; - String get medications => localizedValues['medications'][locale.languageCode]; + String get medications => + localizedValues['medications']![locale.languageCode]!; - String get medication => localizedValues['medication'][locale.languageCode]; + String get medication => localizedValues['medication']![locale.languageCode]!; - String get doctorComments => localizedValues['doctorComments'][locale.languageCode]; + String get doctorComments => + localizedValues['doctorComments']![locale.languageCode]!; - String get statusDescription => localizedValues['statusDescription'][locale.languageCode]; + String get statusDescription => + localizedValues['statusDescription']![locale.languageCode]!; - String get createdByName => localizedValues['createdByName'][locale.languageCode]; + String get createdByName => + localizedValues['createdByName']![locale.languageCode]!; - String get procedures => localizedValues['procedures'][locale.languageCode]; + String get procedures => localizedValues['procedures']![locale.languageCode]!; String get chiefComplaints => - localizedValues['chiefComplaints'][locale.languageCode]; + localizedValues['chiefComplaints']![locale.languageCode]!; - String get histories => localizedValues['histories'][locale.languageCode]; + String get histories => localizedValues['histories']![locale.languageCode]!; String get allergiesSoap => - localizedValues['allergiesSoap'][locale.languageCode]; + localizedValues['allergiesSoap']![locale.languageCode]!; String get addChiefComplaints => - localizedValues['addChiefComplaints'][locale.languageCode]; + localizedValues['addChiefComplaints']![locale.languageCode]!; String get historyOfPresentIllness => - localizedValues['historyOfPresentIllness'][locale.languageCode]; + localizedValues['historyOfPresentIllness']![locale.languageCode]!; - String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; + String get requiredMsg => + localizedValues['requiredMsg']![locale.languageCode]!; - String get addHistory => localizedValues['addHistory'][locale.languageCode]; + String get addHistory => localizedValues['addHistory']![locale.languageCode]!; String get searchHistory => - localizedValues['searchHistory'][locale.languageCode]; + localizedValues['searchHistory']![locale.languageCode]!; String get addSelectedHistories => - localizedValues['addSelectedHistories'][locale.languageCode]; + localizedValues['addSelectedHistories']![locale.languageCode]!; String get addAllergies => - localizedValues['addAllergies'][locale.languageCode]; + localizedValues['addAllergies']![locale.languageCode]!; - String get itemExist => localizedValues['itemExist'][locale.languageCode]; + String get itemExist => localizedValues['itemExist']![locale.languageCode]!; String get selectAllergy => - localizedValues['selectAllergy'][locale.languageCode]; + localizedValues['selectAllergy']![locale.languageCode]!; String get selectSeverity => - localizedValues['selectSeverity'][locale.languageCode]; + localizedValues['selectSeverity']![locale.languageCode]!; String get leaveCreated => - localizedValues['leaveCreated'][locale.languageCode]; + localizedValues['leaveCreated']![locale.languageCode]!; String get vitalSignEmptyMsg => - localizedValues['vitalSignEmptyMsg'][locale.languageCode]; + localizedValues['vitalSignEmptyMsg']![locale.languageCode]!; String get referralEmptyMsg => - localizedValues['referralEmptyMsg'][locale.languageCode]; + localizedValues['referralEmptyMsg']![locale.languageCode]!; String get referralSuccessMsg => - localizedValues['referralSuccessMsg'][locale.languageCode]; + localizedValues['referralSuccessMsg']![locale.languageCode]!; String get diagnoseType => - localizedValues['diagnoseType'][locale.languageCode]; + localizedValues['diagnoseType']![locale.languageCode]!; - String get condition => localizedValues['condition'][locale.languageCode]; + String get condition => localizedValues['condition']![locale.languageCode]!; - String get id => localizedValues['id'][locale.languageCode]; + String get id => localizedValues['id']![locale.languageCode]!; - String get quantity => localizedValues['quantity'][locale.languageCode]; + String get quantity => localizedValues['quantity']![locale.languageCode]!; - String get durDays => localizedValues['durDays'][locale.languageCode]; + String get durDays => localizedValues['durDays']![locale.languageCode]!; - String get codeNo => localizedValues['codeNo'][locale.languageCode]; + String get codeNo => localizedValues['codeNo']![locale.languageCode]!; - String get covered => localizedValues['covered'][locale.languageCode]; + String get covered => localizedValues['covered']![locale.languageCode]!; String get approvalRequired => - localizedValues['approvalRequired'][locale.languageCode]; + localizedValues['approvalRequired']![locale.languageCode]!; String get uncoveredByDoctor => - localizedValues['uncoveredByDoctor'][locale.languageCode]; + localizedValues['uncoveredByDoctor']![locale.languageCode]!; String get chiefComplaintEmptyMsg => - localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + localizedValues['chiefComplaintEmptyMsg']![locale.languageCode]!; String get moreVerification => - localizedValues['more-verify'][locale.languageCode]; + localizedValues['more-verify']![locale.languageCode]!; String get welcomeBack => - localizedValues['welcome-back'][locale.languageCode]; + localizedValues['welcome-back']![locale.languageCode]!; String get accountInfo => - localizedValues['account-info'][locale.languageCode]; + localizedValues['account-info']![locale.languageCode]!; String get useAnotherAccount => - localizedValues['another-acc'][locale.languageCode]; + localizedValues['another-acc']![locale.languageCode]!; String get verifyLoginWith => - localizedValues['verify-login-with'][locale.languageCode]; + localizedValues['verify-login-with']![locale.languageCode]!; - String get register => localizedValues['register-user'][locale.languageCode]; + String get register => + localizedValues['register-user']![locale.languageCode]!; String get verifyFingerprint => - localizedValues['verify-with-fingerprint'][locale.languageCode]; + localizedValues['verify-with-fingerprint']![locale.languageCode]!; String get verifyFaceID => - localizedValues['verify-with-faceid'][locale.languageCode]; + localizedValues['verify-with-faceid']![locale.languageCode]!; String get verifySMS => - localizedValues['verify-with-sms'][locale.languageCode]; + localizedValues['verify-with-sms']![locale.languageCode]!; - String get verifyWith => localizedValues['verify-with'][locale.languageCode]; + String get verifyWith => + localizedValues['verify-with']![locale.languageCode]!; String get verifyWhatsApp => - localizedValues['verify-with-whatsapp'][locale.languageCode]; + localizedValues['verify-with-whatsapp']![locale.languageCode]!; - String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; + String get lastLoginAt => + localizedValues['last-login']![locale.languageCode]!; String get lastLoginWith => - localizedValues['last-login-with'][locale.languageCode]; + localizedValues['last-login-with']![locale.languageCode]!; String get verifyFingerprint2 => - localizedValues['verify-fingerprint'][locale.languageCode]; + localizedValues['verify-fingerprint']![locale.languageCode]!; String get verificationMessage => - localizedValues['verification_message'][locale.languageCode]; + localizedValues['verification_message']![locale.languageCode]!; String get validationMessage => - localizedValues['validation_message'][locale.languageCode]; + localizedValues['validation_message']![locale.languageCode]!; String get addAssessment => - localizedValues['addAssessment'][locale.languageCode]; + localizedValues['addAssessment']![locale.languageCode]!; - String get assessment => localizedValues['assessment'][locale.languageCode]; + String get assessment => localizedValues['assessment']![locale.languageCode]!; String get physicalSystemExamination => - localizedValues['physicalSystemExamination'][locale.languageCode]; + localizedValues['physicalSystemExamination']![locale.languageCode]!; String get searchExamination => - localizedValues['searchExamination'][locale.languageCode]; + localizedValues['searchExamination']![locale.languageCode]!; String get addExamination => - localizedValues['addExamination'][locale.languageCode]; + localizedValues['addExamination']![locale.languageCode]!; - String get doc => localizedValues['doc'][locale.languageCode]; + String get doc => localizedValues['doc']![locale.languageCode]!; - String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; + String get allergicTO => localizedValues['allergicTO']![locale.languageCode]!; - String get normal => localizedValues['normal'][locale.languageCode]; + String get normal => localizedValues['normal']![locale.languageCode]!; - String get notExamined => localizedValues['notExamined'][locale.languageCode]; + String get notExamined => + localizedValues['notExamined']![locale.languageCode]!; - String get abnormal => localizedValues['abnormal'][locale.languageCode]; + String get abnormal => localizedValues['abnormal']![locale.languageCode]!; String get patientNoDetailErrMsg => - localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + localizedValues['patientNoDetailErrMsg']![locale.languageCode]!; String get systolicLng => - localizedValues['systolic-lng'][locale.languageCode]; + localizedValues['systolic-lng']![locale.languageCode]!; String get diastolicLng => - localizedValues['diastolic-lng'][locale.languageCode]; + localizedValues['diastolic-lng']![locale.languageCode]!; - String get mass => localizedValues['mass'][locale.languageCode]; + String get mass => localizedValues['mass']![locale.languageCode]!; - String get tempC => localizedValues['temp-c'][locale.languageCode]; + String get tempC => localizedValues['temp-c']![locale.languageCode]!; - String get bpm => localizedValues['bpm'][locale.languageCode]; + String get bpm => localizedValues['bpm']![locale.languageCode]!; String get respirationSigns => - localizedValues['respiration-signs'][locale.languageCode]; + localizedValues['respiration-signs']![locale.languageCode]!; - String get sysDias => localizedValues['sys-dias'][locale.languageCode]; + String get sysDias => localizedValues['sys-dias']![locale.languageCode]!; - String get body => localizedValues['body'][locale.languageCode]; + String get body => localizedValues['body']![locale.languageCode]!; String get respirationRate => - localizedValues['respirationRate'][locale.languageCode]; + localizedValues['respirationRate']![locale.languageCode]!; - String get heart => localizedValues['heart'][locale.languageCode]; + String get heart => localizedValues['heart']![locale.languageCode]!; String get medicalReport => - localizedValues['medicalReport'][locale.languageCode]; + localizedValues['medicalReport']![locale.languageCode]!; - String get visitDate => localizedValues['visitDate'][locale.languageCode]; + String get visitDate => localizedValues['visitDate']![locale.languageCode]!; - String get test => localizedValues['test'][locale.languageCode]; + String get test => localizedValues['test']![locale.languageCode]!; String get addMoreProcedure => - localizedValues['addMoreProcedure'][locale.languageCode]; + localizedValues['addMoreProcedure']![locale.languageCode]!; - String get regular => localizedValues['regular'][locale.languageCode]; + String get regular => localizedValues['regular']![locale.languageCode]!; String get searchProcedures => - localizedValues['searchProcedures'][locale.languageCode]; + localizedValues['searchProcedures']![locale.languageCode]!; String get procedureCategorise => - localizedValues['procedureCategorise'][locale.languageCode]; + localizedValues['procedureCategorise']![locale.languageCode]!; String get selectProcedures => - localizedValues['selectProcedures'][locale.languageCode]; + localizedValues['selectProcedures']![locale.languageCode]!; String get addSelectedProcedures => - localizedValues['addSelectedProcedures'][locale.languageCode]; + localizedValues['addSelectedProcedures']![locale.languageCode]!; String get addProcedures => - localizedValues['addProcedures'][locale.languageCode]; + localizedValues['addProcedures']![locale.languageCode]!; String get updateProcedure => - localizedValues['updateProcedure'][locale.languageCode]; + localizedValues['updateProcedure']![locale.languageCode]!; String get orderProcedure => - localizedValues['orderProcedure'][locale.languageCode]; + localizedValues['orderProcedure']![locale.languageCode]!; - String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; + String get nameOrICD => localizedValues['nameOrICD']![locale.languageCode]!; - String get dType => localizedValues['dType'][locale.languageCode]; + String get dType => localizedValues['dType']![locale.languageCode]!; String get addAssessmentDetails => - localizedValues['addAssessmentDetails'][locale.languageCode]; + localizedValues['addAssessmentDetails']![locale.languageCode]!; String get progressNoteSOAP => - localizedValues['progressNoteSOAP'][locale.languageCode]; + localizedValues['progressNoteSOAP']![locale.languageCode]!; String get addProgressNote => - localizedValues['addProgressNote'][locale.languageCode]; + localizedValues['addProgressNote']![locale.languageCode]!; - String get createdBy => localizedValues['createdBy'][locale.languageCode]; + String get createdBy => localizedValues['createdBy']![locale.languageCode]!; - String get riskScore => localizedValues['riskScore'][locale.languageCode]; + String get riskScore => localizedValues['riskScore']![locale.languageCode]!; - String get editedBy => localizedValues['editedBy'][locale.languageCode]; + String get editedBy => localizedValues['editedBy']![locale.languageCode]!; String get currentMedications => - localizedValues['currentMedications'][locale.languageCode]; + localizedValues['currentMedications']![locale.languageCode]!; - String get noItem => localizedValues['noItem'][locale.languageCode]; + String get noItem => localizedValues['noItem']![locale.languageCode]!; String get postUcafSuccessMsg => - localizedValues['postUcafSuccessMsg'][locale.languageCode]; + localizedValues['postUcafSuccessMsg']![locale.languageCode]!; String get vitalSignDetailEmpty => - localizedValues['vitalSignDetailEmpty'][locale.languageCode]; + localizedValues['vitalSignDetailEmpty']![locale.languageCode]!; String get onlyOfftimeHoliday => - localizedValues['onlyOfftimeHoliday'][locale.languageCode]; + localizedValues['onlyOfftimeHoliday']![locale.languageCode]!; - String get active => localizedValues['active'][locale.languageCode]; + String get active => localizedValues['active']![locale.languageCode]!; - String get hold => localizedValues['hold'][locale.languageCode]; + String get hold => localizedValues['hold']![locale.languageCode]!; - String get loading => localizedValues['loading'][locale.languageCode]; + String get loading => localizedValues['loading']![locale.languageCode]!; String get assessmentErrorMsg => - localizedValues['assessmentErrorMsg'][locale.languageCode]; + localizedValues['assessmentErrorMsg']![locale.languageCode]!; String get examinationErrorMsg => - localizedValues['examinationErrorMsg'][locale.languageCode]; + localizedValues['examinationErrorMsg']![locale.languageCode]!; String get progressNoteErrorMsg => - localizedValues['progressNoteErrorMsg'][locale.languageCode]; + localizedValues['progressNoteErrorMsg']![locale.languageCode]!; String get chiefComplaintErrorMsg => - localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; + localizedValues['chiefComplaintErrorMsg']![locale.languageCode]!; - String get ICDName => localizedValues['ICDName'][locale.languageCode]; + String get ICDName => localizedValues['ICDName']![locale.languageCode]!; String get referralStatus => - localizedValues['referralStatus'][locale.languageCode]; + localizedValues['referralStatus']![locale.languageCode]!; String get referralRemark => - localizedValues['referralRemark'][locale.languageCode]; + localizedValues['referralRemark']![locale.languageCode]!; - String get offTime => localizedValues['offTime'][locale.languageCode]; + String get offTime => localizedValues['offTime']![locale.languageCode]!; - String get icd => localizedValues['icd'][locale.languageCode]; + String get icd => localizedValues['icd']![locale.languageCode]!; - String get days => localizedValues['days'][locale.languageCode]; + String get days => localizedValues['days']![locale.languageCode]!; - String get hr => localizedValues['hr'][locale.languageCode]; + String get hr => localizedValues['hr']![locale.languageCode]!; - String get min => localizedValues['min'][locale.languageCode]; + String get min => localizedValues['min']![locale.languageCode]!; - String get months => localizedValues['months'][locale.languageCode]; + String get months => localizedValues['months']![locale.languageCode]!; - String get years => localizedValues['years'][locale.languageCode]; + String get years => localizedValues['years']![locale.languageCode]!; String get referralStatusHold => - localizedValues['referralStatusHold'][locale.languageCode]; + localizedValues['referralStatusHold']![locale.languageCode]!; String get referralStatusActive => - localizedValues['referralStatusActive'][locale.languageCode]; + localizedValues['referralStatusActive']![locale.languageCode]!; String get referralStatusCancelled => - localizedValues['referralStatusCancelled'][locale.languageCode]; + localizedValues['referralStatusCancelled']![locale.languageCode]!; String get referralStatusCompleted => - localizedValues['referralStatusCompleted'][locale.languageCode]; + localizedValues['referralStatusCompleted']![locale.languageCode]!; String get referralStatusNotSeen => - localizedValues['referralStatusNotSeen'][locale.languageCode]; + localizedValues['referralStatusNotSeen']![locale.languageCode]!; String get clinicSearch => - localizedValues['clinicSearch'][locale.languageCode]; + localizedValues['clinicSearch']![locale.languageCode]!; String get doctorSearch => - localizedValues['doctorSearch'][locale.languageCode]; + localizedValues['doctorSearch']![locale.languageCode]!; String get referralResponse => - localizedValues['referralResponse'][locale.languageCode]; + localizedValues['referralResponse']![locale.languageCode]!; String get estimatedCost => - localizedValues['estimatedCost'][locale.languageCode]; + localizedValues['estimatedCost']![locale.languageCode]!; String get diagnosisDetail => - localizedValues['diagnosisDetail'][locale.languageCode]; + localizedValues['diagnosisDetail']![locale.languageCode]!; String get referralSuccessMsgAccept => - localizedValues['referralSuccessMsgAccept'][locale.languageCode]; + localizedValues['referralSuccessMsgAccept']![locale.languageCode]!; String get referralSuccessMsgReject => - localizedValues['referralSuccessMsgReject'][locale.languageCode]; + localizedValues['referralSuccessMsgReject']![locale.languageCode]!; String get patientName => - localizedValues['patient-name'][locale.languageCode]; + localizedValues['patient-name']![locale.languageCode]!; String get appointmentNumber => - localizedValues['appointmentNumber'][locale.languageCode]; + localizedValues['appointmentNumber']![locale.languageCode]!; String get sickLeaveComments => - localizedValues['sickLeaveComments'][locale.languageCode]; + localizedValues['sickLeaveComments']![locale.languageCode]!; String get pastMedicalHistory => - localizedValues['pastMedicalHistory'][locale.languageCode]; + localizedValues['pastMedicalHistory']![locale.languageCode]!; String get pastSurgicalHistory => - localizedValues['pastSurgicalHistory'][locale.languageCode]; + localizedValues['pastSurgicalHistory']![locale.languageCode]!; String get complications => - localizedValues['complications'][locale.languageCode]; + localizedValues['complications']![locale.languageCode]!; - String get floor => localizedValues['floor'][locale.languageCode]; + String get floor => localizedValues['floor']![locale.languageCode]!; String get roomCategory => - localizedValues['roomCategory'][locale.languageCode]; + localizedValues['roomCategory']![locale.languageCode]!; String get otherDepartmentsInterventions => - localizedValues['otherDepartmentsInterventions'][locale.languageCode]; + localizedValues['otherDepartmentsInterventions']![locale.languageCode]!; String get otherProcedure => - localizedValues['otherProcedure'][locale.languageCode]; + localizedValues['otherProcedure']![locale.languageCode]!; String get admissionRequestSuccessMsg => - localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; + localizedValues['admissionRequestSuccessMsg']![locale.languageCode]!; - String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; + String get infoStatus => localizedValues['infoStatus']![locale.languageCode]!; String get doctorResponse => - localizedValues['doctorResponse'][locale.languageCode]; + localizedValues['doctorResponse']![locale.languageCode]!; String get sickleaveonhold => - localizedValues['sickleaveonhold'][locale.languageCode]; + localizedValues['sickleaveonhold']![locale.languageCode]!; - String get noClinic => localizedValues['no-clinic'][locale.languageCode]; + String get noClinic => localizedValues['no-clinic']![locale.languageCode]!; String get otherStatistic => - localizedValues['otherStatistic'][locale.languageCode]; + localizedValues['otherStatistic']![locale.languageCode]!; String get patientsreferral => - localizedValues['ptientsreferral'][locale.languageCode]; + localizedValues['ptientsreferral']![locale.languageCode]!; String get myPatientsReferral => - localizedValues['myPatientsReferral'][locale.languageCode]; + localizedValues['myPatientsReferral']![locale.languageCode]!; String get arrivalpatient => - localizedValues['arrivalpatient'][locale.languageCode]; + localizedValues['arrivalpatient']![locale.languageCode]!; String get searchmedicinepatient => - localizedValues['searchmedicinepatient'][locale.languageCode]; + localizedValues['searchmedicinepatient']![locale.languageCode]!; String get appointmentDate => - localizedValues['appointmentDate'][locale.languageCode]; + localizedValues['appointmentDate']![locale.languageCode]!; - String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; + String get arrivedP => localizedValues['arrived_p']![locale.languageCode]!; - String get details => localizedValues['details'][locale.languageCode]; + String get details => localizedValues['details']![locale.languageCode]!; - String get liveCare => localizedValues['liveCare'][locale.languageCode]; + String get liveCare => localizedValues['liveCare']![locale.languageCode]!; - String get outpatient => localizedValues['out-patient'][locale.languageCode]; + String get outpatient => + localizedValues['out-patient']![locale.languageCode]!; - String get billNo => localizedValues['BillNo'][locale.languageCode]; + String get billNo => localizedValues['BillNo']![locale.languageCode]!; - String get labResults => localizedValues['labResults'][locale.languageCode]; + String get labResults => localizedValues['labResults']![locale.languageCode]!; - String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; + String get sendSuc => localizedValues['sendSuc']![locale.languageCode]!; String get specialResult => - localizedValues['SpecialResult'][locale.languageCode]; + localizedValues['SpecialResult']![locale.languageCode]!; String get noDataAvailable => - localizedValues['noDataAvailable'][locale.languageCode]; + localizedValues['noDataAvailable']![locale.languageCode]!; String get showMoreBtn => - localizedValues['show-more-btn'][locale.languageCode]; + localizedValues['show-more-btn']![locale.languageCode]!; - String get showDetail => localizedValues['showDetail'][locale.languageCode]; + String get showDetail => localizedValues['showDetail']![locale.languageCode]!; - String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; + String get viewProfile => + localizedValues['viewProfile']![locale.languageCode]!; - String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; + String get fileNumber => localizedValues['fileNumber']![locale.languageCode]!; - String get reschedule => localizedValues['reschedule'][locale.languageCode]; + String get reschedule => localizedValues['reschedule']![locale.languageCode]!; - String get leaves => localizedValues['leaves'][locale.languageCode]; + String get leaves => localizedValues['leaves']![locale.languageCode]!; - String get openRad => localizedValues['open-rad'][locale.languageCode]; + String get openRad => localizedValues['open-rad']![locale.languageCode]!; String get totalApproval => - localizedValues['totalApproval'][locale.languageCode]; + localizedValues['totalApproval']![locale.languageCode]!; String get procedureStatus => - localizedValues['procedureStatus'][locale.languageCode]; + localizedValues['procedureStatus']![locale.languageCode]!; - String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; + String get unusedCount => + localizedValues['unusedCount']![locale.languageCode]!; - String get companyName => localizedValues['companyName'][locale.languageCode]; + String get companyName => + localizedValues['companyName']![locale.languageCode]!; String get procedureName => - localizedValues['procedureName'][locale.languageCode]; + localizedValues['procedureName']![locale.languageCode]!; - String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; + String get usageStatus => + localizedValues['usageStatus']![locale.languageCode]!; String get prescriptions => - localizedValues['prescriptions'][locale.languageCode]; + localizedValues['prescriptions']![locale.languageCode]!; - String get notes => localizedValues['notes'][locale.languageCode]; + String get notes => localizedValues['notes']![locale.languageCode]!; - String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; + String get dailyDoses => localizedValues['dailyDoses']![locale.languageCode]!; String get searchWithOther => - localizedValues['searchWithOther'][locale.languageCode]; + localizedValues['searchWithOther']![locale.languageCode]!; String get hideOtherCriteria => - localizedValues['hideOtherCriteria'][locale.languageCode]; + localizedValues['hideOtherCriteria']![locale.languageCode]!; String get applyForReschedule => - localizedValues['applyForReschedule'][locale.languageCode]; + localizedValues['applyForReschedule']![locale.languageCode]!; - String get startDate => localizedValues['startDate'][locale.languageCode]; + String get startDate => localizedValues['startDate']![locale.languageCode]!; - String get endDate => localizedValues['endDate'][locale.languageCode]; + String get endDate => localizedValues['endDate']![locale.languageCode]!; String get addReschedule => - localizedValues['add-reschedule'][locale.languageCode]; + localizedValues['add-reschedule']![locale.languageCode]!; String get updateReschedule => - localizedValues['update-reschedule'][locale.languageCode]; + localizedValues['update-reschedule']![locale.languageCode]!; - String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; + String get sickLeave => localizedValues['sick_leave']![locale.languageCode]!; - String get accepted => localizedValues['accepted'][locale.languageCode]; + String get accepted => localizedValues['accepted']![locale.languageCode]!; - String get cancelled => localizedValues['cancelled'][locale.languageCode]; + String get cancelled => localizedValues['cancelled']![locale.languageCode]!; - String get unReplied => localizedValues['unReplied'][locale.languageCode]; + String get unReplied => localizedValues['unReplied']![locale.languageCode]!; - String get replied => localizedValues['replied'][locale.languageCode]; + String get replied => localizedValues['replied']![locale.languageCode]!; String get typeHereToReply => - localizedValues['typeHereToReply'][locale.languageCode]; + localizedValues['typeHereToReply']![locale.languageCode]!; - String get searchHere => localizedValues['searchHere'][locale.languageCode]; + String get searchHere => localizedValues['searchHere']![locale.languageCode]!; - String get remove => localizedValues['remove'][locale.languageCode]; + String get remove => localizedValues['remove']![locale.languageCode]!; - String get inProgress => localizedValues['inProgress'][locale.languageCode]; + String get inProgress => localizedValues['inProgress']![locale.languageCode]!; - String get completed => localizedValues['Completed'][locale.languageCode]; + String get completed => localizedValues['Completed']![locale.languageCode]!; - String get locked => localizedValues['Locked'][locale.languageCode]; + String get locked => localizedValues['Locked']![locale.languageCode]!; - String get step => localizedValues['step'][locale.languageCode]; + String get step => localizedValues['step']![locale.languageCode]!; String get fieldRequired => - localizedValues['fieldRequired'][locale.languageCode]; + localizedValues['fieldRequired']![locale.languageCode]!; - String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; + String get noSickLeave => + localizedValues['no-sickleve']![locale.languageCode]!; String get changeOfSchedule => - localizedValues['changeOfSchedule'][locale.languageCode]; + localizedValues['changeOfSchedule']![locale.languageCode]!; - String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; + String get newSchedule => + localizedValues['newSchedule']![locale.languageCode]!; String get enterCredentials => - localizedValues['enter_credentials'][locale.languageCode]; + localizedValues['enter_credentials']![locale.languageCode]!; String get patpatientIDMobilenationalientID => - localizedValues['patientIDMobilenational'][locale.languageCode]; + localizedValues['patientIDMobilenational']![locale.languageCode]!; - String get updateNow => localizedValues['updateNow'][locale.languageCode]; + String get updateNow => localizedValues['updateNow']![locale.languageCode]!; String get updateTheApp => - localizedValues['updateTheApp'][locale.languageCode]; + localizedValues['updateTheApp']![locale.languageCode]!; String get admissionDate => - localizedValues['admission-date'][locale.languageCode]; + localizedValues['admission-date']![locale.languageCode]!; - String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; + String get noOfDays => localizedValues['noOfDays']![locale.languageCode]!; - String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; + String get numOfDays => localizedValues['numOfDays']![locale.languageCode]!; String get replayBefore => - localizedValues['replayBefore'][locale.languageCode]; + localizedValues['replayBefore']![locale.languageCode]!; - String get trySaying => localizedValues["try-saying"][locale.languageCode]; + String get trySaying => localizedValues["try-saying"]![locale.languageCode]!; String get acknowledged => - localizedValues['acknowledged'][locale.languageCode]; + localizedValues['acknowledged']![locale.languageCode]!; - String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; + String get didntCatch => localizedValues["didntCatch"]![locale.languageCode]!; String get pleaseEnterProcedure => - localizedValues["pleaseEnterProcedure"][locale.languageCode]; + localizedValues["pleaseEnterProcedure"]![locale.languageCode]!; - String get fillTheMandatoryProcedureDetails => - localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; + String get fillTheMandatoryProcedureDetails => localizedValues[ + "fillTheMandatoryProcedureDetails"]![locale.languageCode]!; String get atLeastThreeCharacters => - localizedValues["atLeastThreeCharacters"][locale.languageCode]; + localizedValues["atLeastThreeCharacters"]![locale.languageCode]!; String get searchProcedureHere => - localizedValues["searchProcedureHere"][locale.languageCode]; + localizedValues["searchProcedureHere"]![locale.languageCode]!; String get noInsuranceApprovalFound => - localizedValues["noInsuranceApprovalFound"][locale.languageCode]; + localizedValues["noInsuranceApprovalFound"]![locale.languageCode]!; - String get procedure => localizedValues["procedure"][locale.languageCode]; + String get procedure => localizedValues["procedure"]![locale.languageCode]!; - String get stopDate => localizedValues["stopDate"][locale.languageCode]; + String get stopDate => localizedValues["stopDate"]![locale.languageCode]!; - String get processed => localizedValues["processed"][locale.languageCode]; + String get processed => localizedValues["processed"]![locale.languageCode]!; - String get direction => localizedValues["direction"][locale.languageCode]; + String get direction => localizedValues["direction"]![locale.languageCode]!; - String get refill => localizedValues["refill"][locale.languageCode]; + String get refill => localizedValues["refill"]![locale.languageCode]!; String get medicationHasBeenAdded => - localizedValues["medicationHasBeenAdded"][locale.languageCode]; + localizedValues["medicationHasBeenAdded"]![locale.languageCode]!; String get newPrescriptionOrder => - localizedValues["newPrescriptionOrder"][locale.languageCode]; + localizedValues["newPrescriptionOrder"]![locale.languageCode]!; String get pleaseFillAllFields => - localizedValues["pleaseFillAllFields"][locale.languageCode]; + localizedValues["pleaseFillAllFields"]![locale.languageCode]!; String get narcoticMedicineCanOnlyBePrescribedFromVida => localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] - [locale.languageCode]; + ![locale.languageCode]!; String get only5DigitsAllowedForStrength => - localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; + localizedValues["only5DigitsAllowedForStrength"]![locale.languageCode]!; - String get unit => localizedValues["unit"][locale.languageCode]; + String get unit => localizedValues["unit"]![locale.languageCode]!; - String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; + String get boxQuantity => + localizedValues["boxQuantity"]![locale.languageCode]!; - String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; + String get orderTestOr => + localizedValues["orderTestOr"]![locale.languageCode]!; String get applyForRadiologyOrder => - localizedValues["applyForRadiologyOrder"][locale.languageCode]; + localizedValues["applyForRadiologyOrder"]![locale.languageCode]!; String get applyForNewLabOrder => - localizedValues["applyForNewLabOrder"][locale.languageCode]; + localizedValues["applyForNewLabOrder"]![locale.languageCode]!; - String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; + String get addLabOrder => + localizedValues["addLabOrder"]![locale.languageCode]!; String get addRadiologyOrder => - localizedValues["addRadiologyOrder"][locale.languageCode]; + localizedValues["addRadiologyOrder"]![locale.languageCode]!; String get newRadiologyOrder => - localizedValues["newRadiologyOrder"][locale.languageCode]; + localizedValues["newRadiologyOrder"]![locale.languageCode]!; - String get orderDate => localizedValues["orderDate"][locale.languageCode]; + String get orderDate => localizedValues["orderDate"]![locale.languageCode]!; - String get examType => localizedValues["examType"][locale.languageCode]; + String get examType => localizedValues["examType"]![locale.languageCode]!; - String get health => localizedValues["health"][locale.languageCode]; + String get health => localizedValues["health"]![locale.languageCode]!; - String get summary => localizedValues["summary"][locale.languageCode]; + String get summary => localizedValues["summary"]![locale.languageCode]!; String get applyForNewPrescriptionsOrder => - localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; + localizedValues["applyForNewPrescriptionsOrder"]![locale.languageCode]!; String get noPrescriptionsFound => - localizedValues["noPrescriptionsFound"][locale.languageCode]; + localizedValues["noPrescriptionsFound"]![locale.languageCode]!; String get noMedicalFileFound => - localizedValues["noMedicalFileFound"][locale.languageCode]; + localizedValues["noMedicalFileFound"]![locale.languageCode]!; - String get insurance22 => localizedValues["insurance22"][locale.languageCode]; + String get insurance22 => + localizedValues["insurance22"]![locale.languageCode]!; - String get approvals22 => localizedValues["approvals22"][locale.languageCode]; + String get approvals22 => + localizedValues["approvals22"]![locale.languageCode]!; - String get severe => localizedValues["severe"][locale.languageCode]; + String get severe => localizedValues["severe"]![locale.languageCode]!; String get graphDetails => - localizedValues["graphDetails"][locale.languageCode]; + localizedValues["graphDetails"]![locale.languageCode]!; - String get discharged => localizedValues["discharged"][locale.languageCode]; + String get discharged => localizedValues["discharged"]![locale.languageCode]!; String get addNewOrderSheet => - localizedValues["addNewOrderSheet"][locale.languageCode]; + localizedValues["addNewOrderSheet"]![locale.languageCode]!; String get addNewProgressNote => - localizedValues["addNewProgressNote"][locale.languageCode]; + localizedValues["addNewProgressNote"]![locale.languageCode]!; - String get notePending => localizedValues["notePending"][locale.languageCode]; + String get notePending => + localizedValues["notePending"]![locale.languageCode]!; String get noteCanceled => - localizedValues["noteCanceled"][locale.languageCode]; + localizedValues["noteCanceled"]![locale.languageCode]!; String get noteVerified => - localizedValues["noteVerified"][locale.languageCode]; + localizedValues["noteVerified"]![locale.languageCode]!; - String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; + String get noteVerify => localizedValues["noteVerify"]![locale.languageCode]!; - String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; + String get noteConfirm => + localizedValues["noteConfirm"]![locale.languageCode]!; - String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; + String get noteAdd => localizedValues["noteAdd"]![locale.languageCode]!; - String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode]; + String get noteUpdate => localizedValues["noteUpdate"]![locale.languageCode]!; - String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; + String get orderSheet => localizedValues["orderSheet"]![locale.languageCode]!; - String get order => localizedValues["order"][locale.languageCode]; + String get order => localizedValues["order"]![locale.languageCode]!; - String get sheet => localizedValues["sheet"][locale.languageCode]; + String get sheet => localizedValues["sheet"]![locale.languageCode]!; - String get medical => localizedValues["medical"][locale.languageCode]; + String get medical => localizedValues["medical"]![locale.languageCode]!; - String get report => localizedValues["report"][locale.languageCode]; + String get report => localizedValues["report"]![locale.languageCode]!; - String get discharge => localizedValues["discharge"][locale.languageCode]; + String get discharge => localizedValues["discharge"]![locale.languageCode]!; - String get none => localizedValues["none"][locale.languageCode]; + String get none => localizedValues["none"]![locale.languageCode]!; String get notRepliedYet => - localizedValues["notRepliedYet"][locale.languageCode]; + localizedValues["notRepliedYet"]![locale.languageCode]!; - String get clearText => localizedValues["clearText"][locale.languageCode]; + String get clearText => localizedValues["clearText"]![locale.languageCode]!; String get medicalReportAdd => - localizedValues['medicalReportAdd'][locale.languageCode]; + localizedValues['medicalReportAdd']![locale.languageCode]!; String get medicalReportVerify => - localizedValues['medicalReportVerify'][locale.languageCode]; + localizedValues['medicalReportVerify']![locale.languageCode]!; - String get comments => localizedValues['comments'][locale.languageCode]; + String get comments => localizedValues['comments']![locale.languageCode]!; String get initiateCall => - localizedValues['initiateCall'][locale.languageCode]; + localizedValues['initiateCall']![locale.languageCode]!; - String get endCall => localizedValues['endCall'][locale.languageCode]; + String get endCall => localizedValues['endCall']![locale.languageCode]!; - String get transferTo => localizedValues['transferTo'][locale.languageCode]; + String get transferTo => localizedValues['transferTo']![locale.languageCode]!; - String get admin => localizedValues['admin'][locale.languageCode]; + String get admin => localizedValues['admin']![locale.languageCode]!; String get instructions => - localizedValues['instructions'][locale.languageCode]; + localizedValues['instructions']![locale.languageCode]!; - String get sendLC => localizedValues['sendLC'][locale.languageCode]; + String get sendLC => localizedValues['sendLC']![locale.languageCode]!; - String get endLC => localizedValues['endLC'][locale.languageCode]; + String get endLC => localizedValues['endLC']![locale.languageCode]!; String get consultation => - localizedValues['consultation'][locale.languageCode]; + localizedValues['consultation']![locale.languageCode]!; - String get resume => localizedValues['resume'][locale.languageCode]; + String get resume => localizedValues['resume']![locale.languageCode]!; - String get theCall => localizedValues['theCall'][locale.languageCode]; + String get theCall => localizedValues['theCall']![locale.languageCode]!; String get createNewMedicalReport => - localizedValues['createNewMedicalReport'][locale.languageCode]; + localizedValues['createNewMedicalReport']![locale.languageCode]!; String get historyPhysicalFinding => - localizedValues['historyPhysicalFinding'][locale.languageCode]; + localizedValues['historyPhysicalFinding']![locale.languageCode]!; String get laboratoryPhysicalData => - localizedValues['laboratoryPhysicalData'][locale.languageCode]; + localizedValues['laboratoryPhysicalData']![locale.languageCode]!; String get impressionRecommendation => - localizedValues['impressionRecommendation'][locale.languageCode]; + localizedValues['impressionRecommendation']![locale.languageCode]!; - String get onHold => localizedValues['onHold'][locale.languageCode]; + String get onHold => localizedValues['onHold']![locale.languageCode]!; - String get verified => localizedValues['verified'][locale.languageCode]; + String get verified => localizedValues['verified']![locale.languageCode]!; String get favoriteTemplates => - localizedValues['favoriteTemplates'][locale.languageCode]; + localizedValues['favoriteTemplates']![locale.languageCode]!; String get allProcedures => - localizedValues['allProcedures'][locale.languageCode]; + localizedValues['allProcedures']![locale.languageCode]!; String get allRadiology => - localizedValues['allRadiology'][locale.languageCode]; + localizedValues['allRadiology']![locale.languageCode]!; - String get allLab => localizedValues['allLab'][locale.languageCode]; + String get allLab => localizedValues['allLab']![locale.languageCode]!; String get allPrescription => - localizedValues['allPrescription'][locale.languageCode]; + localizedValues['allPrescription']![locale.languageCode]!; String get addPrescription => - localizedValues['addPrescription'][locale.languageCode]; + localizedValues['addPrescription']![locale.languageCode]!; - String get edit => localizedValues['edit'][locale.languageCode]; + String get edit => localizedValues['edit']![locale.languageCode]!; String get summeryReply => - localizedValues['summeryReply'][locale.languageCode]; + localizedValues['summeryReply']![locale.languageCode]!; String get severityValidationError => - localizedValues['severityValidationError'][locale.languageCode]; + localizedValues['severityValidationError']![locale.languageCode]!; String get textCopiedSuccessfully => - localizedValues['textCopiedSuccessfully'][locale.languageCode]; + localizedValues['textCopiedSuccessfully']![locale.languageCode]!; - String get roomNo => localizedValues['roomNo'][locale.languageCode]; + String get roomNo => localizedValues['roomNo']![locale.languageCode]!; - String get seeMore => localizedValues['seeMore'][locale.languageCode]; + String get seeMore => localizedValues['seeMore']![locale.languageCode]!; String get replayCallStatus => - localizedValues['replayCallStatus'][locale.languageCode]; + localizedValues['replayCallStatus']![locale.languageCode]!; String get patientArrived => - localizedValues['patientArrived'][locale.languageCode]; + localizedValues['patientArrived']![locale.languageCode]!; String get calledAndNoResponse => - localizedValues['calledAndNoResponse'][locale.languageCode]; + localizedValues['calledAndNoResponse']![locale.languageCode]!; String get underProcess => - localizedValues['underProcess'][locale.languageCode]; + localizedValues['underProcess']![locale.languageCode]!; String get textResponse => - localizedValues['textResponse'][locale.languageCode]; + localizedValues['textResponse']![locale.languageCode]!; - String get special => localizedValues['special'][locale.languageCode]; + String get special => localizedValues['special']![locale.languageCode]!; - String get requestType => localizedValues['requestType'][locale.languageCode]; + String get requestType => + localizedValues['requestType']![locale.languageCode]!; - String get allClinic => localizedValues['allClinic'][locale.languageCode]; + String get allClinic => localizedValues['allClinic']![locale.languageCode]!; - String get notReplied => localizedValues['notReplied'][locale.languageCode]; + String get notReplied => localizedValues['notReplied']![locale.languageCode]!; String get registerNewPatient => - localizedValues['registerNewPatient'][locale.languageCode]; + localizedValues['registerNewPatient']![locale.languageCode]!; String get registeraPatient => - localizedValues['registeraPatient'][locale.languageCode]; + localizedValues['registeraPatient']![locale.languageCode]!; String get operationTimeStart => - localizedValues['operationTimeStart'][locale.languageCode]; + localizedValues['operationTimeStart']![locale.languageCode]!; String get operationDate => - localizedValues['operationDate'][locale.languageCode]; + localizedValues['operationDate']![locale.languageCode]!; - String get reservation => localizedValues['reservation'][locale.languageCode]; + String get reservation => + localizedValues['reservation']![locale.languageCode]!; - String get anesthetist => localizedValues['anesthetist'][locale.languageCode]; + String get anesthetist => + localizedValues['anesthetist']![locale.languageCode]!; String get bloodTransfusedDetail => - localizedValues['bloodTransfusedDetail'][locale.languageCode]; + localizedValues['bloodTransfusedDetail']![locale.languageCode]!; String get circulatingNurse => - localizedValues['circulatingNurse'][locale.languageCode]; + localizedValues['circulatingNurse']![locale.languageCode]!; - String get scrubNurse => localizedValues['scrubNurse'][locale.languageCode]; + String get scrubNurse => localizedValues['scrubNurse']![locale.languageCode]!; String get otherSpecimen => - localizedValues['otherSpecimen'][locale.languageCode]; + localizedValues['otherSpecimen']![locale.languageCode]!; String get microbiologySpecimen => - localizedValues['microbiologySpecimen'][locale.languageCode]; + localizedValues['microbiologySpecimen']![locale.languageCode]!; String get histopathSpecimen => - localizedValues['histopathSpecimen'][locale.languageCode]; + localizedValues['histopathSpecimen']![locale.languageCode]!; String get bloodLossDetail => - localizedValues['bloodLossDetail'][locale.languageCode]; + localizedValues['bloodLossDetail']![locale.languageCode]!; String get complicationDetails1 => - localizedValues['complicationDetails1'][locale.languageCode]; + localizedValues['complicationDetails1']![locale.languageCode]!; String get postOperationInstruction => - localizedValues['postOperationInstruction'][locale.languageCode]; + localizedValues['postOperationInstruction']![locale.languageCode]!; String get surgeryProcedure => - localizedValues['surgeryProcedure'][locale.languageCode]; + localizedValues['surgeryProcedure']![locale.languageCode]!; - String get finding => localizedValues['finding'][locale.languageCode]; + String get finding => localizedValues['finding']![locale.languageCode]!; String get preOperationDiagnosis => - localizedValues['preOperationDiagnosis'][locale.languageCode]; + localizedValues['preOperationDiagnosis']![locale.languageCode]!; String get postOperationDiagnosis => - localizedValues['postOperationDiagnosis'][locale.languageCode]; + localizedValues['postOperationDiagnosis']![locale.languageCode]!; - String get surgeon => localizedValues['surgeon'][locale.languageCode]; + String get surgeon => localizedValues['surgeon']![locale.languageCode]!; - String get assistant => localizedValues['assistant'][locale.languageCode]; + String get assistant => localizedValues['assistant']![locale.languageCode]!; String get askForIdentification => - localizedValues['askForIdentification'][locale.languageCode]; + localizedValues['askForIdentification']![locale.languageCode]!; - String get iDNumber => localizedValues['iDNumber'][locale.languageCode]; + String get iDNumber => localizedValues['iDNumber']![locale.languageCode]!; - String get calender => localizedValues['calender'][locale.languageCode]; + String get calender => localizedValues['calender']![locale.languageCode]!; - String get gregorian => localizedValues['gregorian'][locale.languageCode]; + String get gregorian => localizedValues['gregorian']![locale.languageCode]!; - String get hijri => localizedValues['hijri'][locale.languageCode]; + String get hijri => localizedValues['hijri']![locale.languageCode]!; - String get birthdate => localizedValues['birthdate'][locale.languageCode]; + String get birthdate => localizedValues['birthdate']![locale.languageCode]!; - String get activation => localizedValues['activation'][locale.languageCode]; + String get activation => localizedValues['activation']![locale.languageCode]!; String get confirmation => - localizedValues['confirmation'][locale.languageCode]; - - String get diabetic => localizedValues['diabetic'][locale.languageCode]; - - String get pharmacy => localizedValues['pharmacy'][locale.languageCode]; + localizedValues['confirmation']![locale.languageCode]!; - String get intervention => localizedValues['intervention'][locale.languageCode]; + String get diabetic => localizedValues['diabetic']![locale.languageCode]!; - String get chart => localizedValues['chart'][locale.languageCode]; + String get pharmacy => localizedValues['pharmacy']![locale.languageCode]!; - String get investigation => localizedValues['investigation'][locale.languageCode]; + String get intervention => + localizedValues['intervention']![locale.languageCode]!; - String get conditionOnDischarge => localizedValues['conditionOnDischarge'][locale.languageCode]; + String get chart => localizedValues['chart']![locale.languageCode]!; - String get planedProcedure => localizedValues['planedProcedure'][locale.languageCode]; + String get investigation => + localizedValues['investigation']![locale.languageCode]!; - String get moreDetails => localizedValues['moreDetails'][locale.languageCode]; + String get conditionOnDischarge => + localizedValues['conditionOnDischarge']![locale.languageCode]!; - String get VTE_Type => localizedValues['VTE_Type'][locale.languageCode]; + String get planedProcedure => + localizedValues['planedProcedure']![locale.languageCode]!; - String get pharmacology => localizedValues['pharmacology'][locale.languageCode]; + String get moreDetails => + localizedValues['moreDetails']![locale.languageCode]!; - String get reasonsThrombo => localizedValues['reasonsThrombo'][locale.languageCode]; + String get VTE_Type => localizedValues['VTE_Type']![locale.languageCode]!; - String get youDoNotHaveFavoriteTemplate => localizedValues['youDoNotHaveFavoriteTemplate'][locale.languageCode]; + String get pharmacology => + localizedValues['pharmacology']![locale.languageCode]!; - String get pleaseSelectItem => localizedValues['pleaseSelectItem'][locale.languageCode]; + String get reasonsThrombo => + localizedValues['reasonsThrombo']![locale.languageCode]!; - String get searchFavoriteTemplate => localizedValues['searchFavoriteTemplate'][locale.languageCode]; + String get youDoNotHaveFavoriteTemplate => + localizedValues['youDoNotHaveFavoriteTemplate']![locale.languageCode]!; - String get sorryNoMatch => localizedValues['sorryNoMatch'][locale.languageCode]; + String get pleaseSelectItem => + localizedValues['pleaseSelectItem']![locale.languageCode]!; - String get thousandIsTheMAXForTheStrength => localizedValues['thousandIsTheMAXForTheStrength'][locale.languageCode]; + String get searchFavoriteTemplate => + localizedValues['searchFavoriteTemplate']![locale.languageCode]!; - String get strengthCanNotBeZero => localizedValues['strengthCanNotBeZero'][locale.languageCode]; + String get sorryNoMatch => + localizedValues['sorryNoMatch']![locale.languageCode]!; - String get old => localizedValues['old'][locale.languageCode]; + String get thousandIsTheMAXForTheStrength => + localizedValues['thousandIsTheMAXForTheStrength']![locale.languageCode]!; - String get orderTypeDescription => localizedValues['orderTypeDescription'][locale.languageCode]; + String get strengthCanNotBeZero => + localizedValues['strengthCanNotBeZero']![locale.languageCode]!; - String get doseDetails => localizedValues['doseDetails'][locale.languageCode]; + String get old => localizedValues['old']![locale.languageCode]!; - String get selectCondition => localizedValues['selectCondition'][locale.languageCode]; + String get orderTypeDescription => + localizedValues['orderTypeDescription']![locale.languageCode]!; - String get yourOrderAddedSuccessfully => localizedValues['yourOrderAddedSuccessfully'][locale.languageCode]; + String get doseDetails => + localizedValues['doseDetails']![locale.languageCode]!; - String get youCannotAddOnlySpaces => localizedValues['youCannotAddOnlySpaces'][locale.languageCode]; + String get selectCondition => + localizedValues['selectCondition']![locale.languageCode]!; - String get conditionDescription => localizedValues['conditionDescription'][locale.languageCode]; + String get yourOrderAddedSuccessfully => + localizedValues['yourOrderAddedSuccessfully']![locale.languageCode]!; + String get youCannotAddOnlySpaces => + localizedValues['youCannotAddOnlySpaces']![locale.languageCode]!; + String get conditionDescription => + localizedValues['conditionDescription']![locale.languageCode]!; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index d641a78b..022233df 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -42,7 +42,7 @@ class Utils { ), actions: [ AppButton( - onPressed: okFunction, + onPressed: okFunction(), title: TranslationBase.of(context).noteConfirm, fontColor: Colors.white, color: AppGlobal.appGreenColor, @@ -53,7 +53,7 @@ class Utils { }, title: TranslationBase.of(context).cancel, fontColor: Colors.white, - color: Colors.red[600], + color: Colors.red[600]!, ), ], ), @@ -124,7 +124,7 @@ class Utils { children: items.map((item) { return Text( '${item.facilityName}', - style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), + style: TextStyle(fontSize: SizeConfig.textMultiplier! * 2), ); }).toList(), itemExtent: 25, @@ -226,14 +226,14 @@ class Utils { static String parseHtmlString(String htmlString) { final document = parse(htmlString); - final String parsedString = parse(document.body.text).documentElement.text; + final String parsedString = parse(document.body!.text).documentElement!.text; return parsedString; } static InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon, Color dropDownColor}) { + {Icon? suffixIcon, Color? dropDownColor}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -295,7 +295,7 @@ class Utils { return htmlRegex.hasMatch(text); } - 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 twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); @@ -329,7 +329,7 @@ class Utils { static String convertToTitleCase(String text) { if (text == null) { - return null; + return ""; } if (text.length <= 1) { diff --git a/lib/utils/video_channel_utils.dart b/lib/utils/video_channel_utils.dart index b9f99bee..a7f0b2bf 100644 --- a/lib/utils/video_channel_utils.dart +++ b/lib/utils/video_channel_utils.dart @@ -16,27 +16,27 @@ class VideoChannel { kToken, callDuration, warningDuration, - int vcId, - String tokenID, - String generalId, - int doctorId, - String patientName, + required int vcId, + required String tokenID, + required String generalId, + required int doctorId, + required String patientName, bool isRecording = false, - Function() onCallEnd, - Function(SessionStatusModel sessionStatusModel) onCallNotRespond, - Function(String error) onFailure, - VoidCallback onCallConnected, - VoidCallback onCallDisconnected}) async { + required Function() onCallEnd, + required Function(SessionStatusModel sessionStatusModel) onCallNotRespond, + required Function(String error) onFailure, + VoidCallback? onCallConnected, + VoidCallback? onCallDisconnected}) async { onCallConnected = onCallConnected ?? () {}; onCallDisconnected = onCallDisconnected ?? () {}; var result; try { _channel.setMethodCallHandler((call) { if (call.method == 'onCallConnected') { - onCallConnected(); + onCallConnected!(); } if (call.method == 'onCallDisconnected') { - onCallDisconnected(); + onCallDisconnected!(); } return true as dynamic; }); diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 126b89de..46f30ccb 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -7,10 +7,10 @@ import 'package:hexcolor/hexcolor.dart'; class MethodTypeCard extends StatelessWidget { const MethodTypeCard({ - Key key, - this.assetPath, - this.onTap, - this.label, + Key? key, + required this.assetPath, + required this.onTap, + required this.label, this.height = 20, this.isSvg = true, }) : super(key: key); diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index f6c2b8e8..00234c08 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -42,8 +42,8 @@ class SMSOTP { final focusD2 = FocusNode(); final focusD3 = FocusNode(); final focusD4 = FocusNode(); - String errorMsg; - ProjectViewModel projectProvider; + String errorMsg = ''; + late ProjectViewModel projectProvider; String displayTime = ''; bool isClosed = false; @@ -349,7 +349,7 @@ class SMSOTP { TextStyle buildTextStyle() { return TextStyle( - fontSize: SizeConfig.textMultiplier * 2.5, + fontSize: SizeConfig.textMultiplier! * 2.5, ); } @@ -358,15 +358,15 @@ class SMSOTP { counterText: " ", enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -381,13 +381,12 @@ class SMSOTP { return ' '; } else if (value.length == 3) { print(value); - } else { - return null; } + return ""; } checkValue() async { - if (verifyAccountForm.currentState.validate()) { + if (verifyAccountForm.currentState!.validate()) { onSuccess(digit1.text.toString() + digit2.text.toString() + digit3.text.toString() + diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 5e33463f..232c263c 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -8,13 +8,13 @@ import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; class VerificationMethodsList extends StatefulWidget { - final AuthMethodTypes authMethodType; - final Function(AuthMethodTypes type, bool isActive) authenticateUser; - final Function onShowMore; - final AuthenticationViewModel authenticationViewModel; + final AuthMethodTypes? authMethodType; + final Function(AuthMethodTypes type, bool isActive)? authenticateUser; + final Function? onShowMore; + final AuthenticationViewModel? authenticationViewModel; const VerificationMethodsList( - {Key key, + {Key? key, this.authMethodType, this.authenticateUser, this.onShowMore, @@ -28,7 +28,7 @@ class VerificationMethodsList extends StatefulWidget { class _VerificationMethodsListState extends State { final LocalAuthentication auth = LocalAuthentication(); - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { @@ -39,7 +39,7 @@ class _VerificationMethodsListState extends State { return MethodTypeCard( assetPath: 'assets/images/svgs/verification/verify-whtsapp.svg', onTap: () => - {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, + {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)}, label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifyWhatsApp, ); @@ -47,7 +47,7 @@ class _VerificationMethodsListState extends State { case AuthMethodTypes.SMS: return MethodTypeCard( assetPath: "assets/images/svgs/verification/verify-sms.svg", - onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, + onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)}, label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifySMS, ); @@ -56,9 +56,9 @@ class _VerificationMethodsListState extends State { return MethodTypeCard( assetPath: 'assets/images/svgs/verification/verify-finger.svg', onTap: () async { - if (await widget.authenticationViewModel + if (await widget.authenticationViewModel! .checkIfBiometricAvailable(BiometricType.fingerprint)) { - widget.authenticateUser(AuthMethodTypes.Fingerprint, true); + widget.authenticateUser!(AuthMethodTypes.Fingerprint, true); } }, label: TranslationBase.of(context).verifyWith + @@ -69,9 +69,9 @@ class _VerificationMethodsListState extends State { return MethodTypeCard( assetPath: 'assets/images/svgs/verification/verify-face.svg', onTap: () async { - if (await widget.authenticationViewModel + if (await widget.authenticationViewModel! .checkIfBiometricAvailable(BiometricType.face)) { - widget.authenticateUser(AuthMethodTypes.FaceID, true); + widget.authenticateUser!(AuthMethodTypes.FaceID, true); } }, label: TranslationBase.of(context).verifyWith + @@ -82,7 +82,7 @@ class _VerificationMethodsListState extends State { default: return MethodTypeCard( assetPath: 'assets/images/login/more_icon.png', - onTap: widget.onShowMore, + onTap: widget.onShowMore!(), isSvg: false, label: TranslationBase.of(context).moreVerification, height: 0, diff --git a/lib/widgets/bottom_sheet/bottom_sheet_container.dart b/lib/widgets/bottom_sheet/bottom_sheet_container.dart index a4c39adb..c1fa2ee8 100644 --- a/lib/widgets/bottom_sheet/bottom_sheet_container.dart +++ b/lib/widgets/bottom_sheet/bottom_sheet_container.dart @@ -1,15 +1,16 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; - class BottomSheetContainer extends StatelessWidget { - final Function onTap; - final String label; - final Widget widget; + final Function? onTap; + final String? label; + final Widget? widget; double headerHeight = SizeConfig.heightMultiplier! * 12; - BottomSheetContainer({Key key, this.onTap, this.label, this.widget}) : super(key: key); + BottomSheetContainer({Key? key, this.onTap, this.label, this.widget}) + : super(key: key); @override Widget build(BuildContext context) { @@ -27,15 +28,14 @@ class BottomSheetContainer extends StatelessWidget { children: [ Container( margin: EdgeInsets.only( - top: headerHeight * (SizeConfig.isWidthLarge ? 0.3 : 0.2), left: SizeConfig.heightMultiplier!*4.5 - ), + top: headerHeight * (SizeConfig.isWidthLarge ? 0.3 : 0.2), + left: SizeConfig.heightMultiplier! * 4.5), child: Center( - child: Row( - children: [ - widget, - ], - ) - ), + child: Row( + children: [ + widget!, + ], + )), ), SizedBox( height: 5, @@ -44,4 +44,10 @@ class BottomSheetContainer extends StatelessWidget { ), ); } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(DiagnosticsProperty('onTap', onTap)); + } } diff --git a/lib/widgets/bottom_sheet/custom_bottom_sheet_container.dart b/lib/widgets/bottom_sheet/custom_bottom_sheet_container.dart index ac24a861..1bb98d8e 100644 --- a/lib/widgets/bottom_sheet/custom_bottom_sheet_container.dart +++ b/lib/widgets/bottom_sheet/custom_bottom_sheet_container.dart @@ -11,7 +11,7 @@ class CustomBottomSheetContainer extends StatelessWidget { double headerHeight = SizeConfig.heightMultiplier! * 12; - CustomBottomSheetContainer({Key key, this.onTap, this.label}) : super(key: key); + CustomBottomSheetContainer({Key? key, required this.onTap, required this.label}) : super(key: key); @override Widget build(BuildContext context) { @@ -36,7 +36,7 @@ class CustomBottomSheetContainer extends StatelessWidget { child: AppButton( title: label, color: AppGlobal.appGreenColor, - onPressed: onTap, + onPressed: onTap(), ), ), ), diff --git a/lib/widgets/dashboard/dashboard_item_icons_texts.dart b/lib/widgets/dashboard/dashboard_item_icons_texts.dart index 607c4b20..9e8b2036 100644 --- a/lib/widgets/dashboard/dashboard_item_icons_texts.dart +++ b/lib/widgets/dashboard/dashboard_item_icons_texts.dart @@ -48,7 +48,7 @@ class _DashboardItemTextsState extends State { padding: EdgeInsets.all(10), child: Icon( widget.icon, - size: SizeConfig.textMultiplier * 2.8, + size: SizeConfig.textMultiplier! * 2.8, color: widget.iconColor, ), )), diff --git a/lib/widgets/dashboard/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart index e1ce6cb8..70e35f3b 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) { diff --git a/lib/widgets/dashboard/guage_chart.dart b/lib/widgets/dashboard/guage_chart.dart index c34af994..2d626412 100644 --- a/lib/widgets/dashboard/guage_chart.dart +++ b/lib/widgets/dashboard/guage_chart.dart @@ -1,8 +1,8 @@ -import 'package:flutter_charts/flutter_charts.dart' as charts; +import 'package:charts_flutter/flutter.dart' as charts; import 'package:flutter/material.dart'; class GaugeChart extends StatelessWidget { - final List seriesList; + final List seriesList; final bool animate; GaugeChart(this.seriesList, {this.animate = false}); @@ -49,7 +49,7 @@ class GaugeChart extends StatelessWidget { class GaugeSegment { final String segment; final int size; - final charts. color; + final color; GaugeSegment(this.segment, this.size, this.color); } diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 8fea0149..ebe568ca 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -19,12 +19,12 @@ class GetOutPatientStack extends StatelessWidget { ? 20 : 17); value.summaryoptions - .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + .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 = new List(); + var list = []; value.summaryoptions.forEach((result) => { list.add(getStack( result, value.summaryoptions.first.value, context, barHeight)) @@ -92,7 +92,7 @@ class GetOutPatientStack extends StatelessWidget { begin: Alignment.topLeft, end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds. - colors: [Color(0x8FF5F6FA), Colors.red[100]], + colors: [Color(0x8FF5F6FA), Colors.red[100]!], // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), @@ -126,7 +126,7 @@ class GetOutPatientStack extends StatelessWidget { child: Row( children: [ AppText( - value.kPIParameter, + value.kPIParameter!, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, textAlign: TextAlign.center, diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index b9ac83f5..40c60891 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -7,7 +7,7 @@ class RowCounts extends StatelessWidget { final name; final int count; final Color c; - final double height; + final double? height; RowCounts(this.name, this.count, this.c, {this.height}); diff --git a/lib/widgets/data_display/list/custom_Item.dart b/lib/widgets/data_display/list/custom_Item.dart index c11af999..a395053b 100644 --- a/lib/widgets/data_display/list/custom_Item.dart +++ b/lib/widgets/data_display/list/custom_Item.dart @@ -14,27 +14,27 @@ import 'package:flutter/material.dart'; /// [child] child of the widget /// [decoration] decoration of the widget class CustomItem extends StatelessWidget { - final IconData startIcon; + final IconData? startIcon; final double startIconSize; - final Color startIconColor; + final Color? startIconColor; final IconData endIcon; final double endIconSize; - final Color endIconColor; + final Color? endIconColor; final bool disabled; - final Function onTap; - final EdgeInsets padding; + final Function? onTap; + final EdgeInsets? padding; final Widget child; - final BoxDecoration decoration; + final BoxDecoration? decoration; CustomItem( - {Key key, + {Key? key, this.startIcon, - this.disabled: false, + this.disabled = false, this.onTap, this.startIconColor, this.endIcon = EvaIcons.chevronRight, this.padding, - this.child, + required this.child, this.endIconColor, this.endIconSize = 20, this.decoration, @@ -49,11 +49,11 @@ class CustomItem extends StatelessWidget { decoration: decoration != null ? decoration : BoxDecoration(), child: InkWell( onTap: () { - if (onTap != null) onTap(); + if (onTap != null) onTap!(); }, child: Padding( padding: padding != null - ? padding + ? padding! : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), child: Row( children: [ @@ -68,7 +68,7 @@ class CustomItem extends StatelessWidget { ), if (startIcon != null) SizedBox(width: 18.0), Expanded( - child: child, + child: child!, flex: 10, ), endIcon == null diff --git a/lib/widgets/data_display/list/flexible_container.dart b/lib/widgets/data_display/list/flexible_container.dart index 6ed049ad..4e4d63b3 100644 --- a/lib/widgets/data_display/list/flexible_container.dart +++ b/lib/widgets/data_display/list/flexible_container.dart @@ -15,15 +15,15 @@ import 'package:flutter/material.dart'; class FlexibleContainer extends StatelessWidget { final double widthFactor; final double heightFactor; - final EdgeInsets padding; + final EdgeInsets? padding; final Widget child; FlexibleContainer({ - Key key, + Key? key, this.widthFactor = 0.9, this.heightFactor = 1, this.padding, - this.child, + required this.child, }) : super(key: key); @override diff --git a/lib/widgets/dialog/AskPermissionDialog.dart b/lib/widgets/dialog/AskPermissionDialog.dart index 9bcea574..8b7eacb3 100644 --- a/lib/widgets/dialog/AskPermissionDialog.dart +++ b/lib/widgets/dialog/AskPermissionDialog.dart @@ -9,7 +9,7 @@ class AskPermissionDialog extends StatefulWidget { final String type; final Function onTapGrant; - AskPermissionDialog({this.type, this.onTapGrant}); + AskPermissionDialog({required this.type, required this.onTapGrant}); @override _AskPermissionDialogState createState() => _AskPermissionDialogState(); @@ -71,7 +71,7 @@ class _AskPermissionDialogState extends State { ), AppButton( fontColor: Theme.of(context).backgroundColor, - color: Colors.red[700], + color: Colors.red[700]!, title: "Turn On Camera, Microphone", onPressed: () async { openAppSettings().then((value) { diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index a867b5a2..846c9583 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -9,7 +9,7 @@ import 'package:hexcolor/hexcolor.dart'; class LabResultWidget extends StatefulWidget { final List labResult; - LabResultWidget({Key key, this.labResult}); + LabResultWidget({Key? key, required this.labResult}); @override _LabResultWidgetState createState() => _LabResultWidgetState(); @@ -30,7 +30,7 @@ class _LabResultWidgetState extends State { children: [ AppText( TranslationBase.of(context).generalResult, - fontSize: 2.5 * SizeConfig.textMultiplier, + fontSize: 2.5 * SizeConfig.textMultiplier!, fontWeight: FontWeight.bold, ), InkWell( @@ -135,7 +135,7 @@ class _LabResultWidgetState extends State { child: Center( child: AppText( '${result.description}', - color: Colors.grey[800], + color: Colors.grey[800]!, ), ), height: 60, @@ -146,7 +146,7 @@ class _LabResultWidgetState extends State { child: Center( child: AppText( '${result.resultValue}', - color: Colors.grey[800]), + color: Colors.grey[800]!), ), height: 60), ), @@ -155,7 +155,7 @@ class _LabResultWidgetState extends State { child: Center( child: AppText( '${result.referenceRange}', - color: Colors.grey[800]), + color: Colors.grey[800]!), ), height: 60), ), diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index 85e340a9..fa75fd62 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -13,13 +13,13 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; class MyReferralPatientWidget extends StatefulWidget { - final MyReferralPatientModel myReferralPatientModel; - final ReferralPatientViewModel model; - final bool isExpand; - final Function expandClick; + final MyReferralPatientModel? myReferralPatientModel; + final ReferralPatientViewModel? model; + final bool? isExpand; + final Function? expandClick; MyReferralPatientWidget( - {Key key, + {Key? key, this.myReferralPatientModel, this.model, this.isExpand, @@ -33,13 +33,13 @@ class MyReferralPatientWidget extends StatefulWidget { class _MyReferralPatientWidgetState extends State { bool _isLoading = false; final _formKey = GlobalKey(); - String error; - TextEditingController answerController; + String error = ''; + TextEditingController answerController = TextEditingController(); @override void initState() { answerController = new TextEditingController( - text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); + text: widget.myReferralPatientModel!.referredDoctorRemarks ?? ''); super.initState(); } @@ -79,8 +79,8 @@ class _MyReferralPatientWidgetState extends State { padding: EdgeInsets.symmetric( vertical: 4, horizontal: 4), child: AppText( - '${widget.myReferralPatientModel.priorityDescription}', - fontSize: 1.7 * SizeConfig.textMultiplier, + '${widget.myReferralPatientModel!.priorityDescription}', + fontSize: 1.7 * SizeConfig.textMultiplier!, fontWeight: FontWeight.bold, textAlign: TextAlign.start, color: Colors.white, @@ -90,8 +90,8 @@ class _MyReferralPatientWidgetState extends State { height: 10, ), AppText( - '${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.middleName} ${widget.myReferralPatientModel.lastName}', - fontSize: 2 * SizeConfig.textMultiplier, + '${widget.myReferralPatientModel!.firstName} ${widget.myReferralPatientModel!.middleName} ${widget.myReferralPatientModel!.lastName}', + fontSize: 2 * SizeConfig.textMultiplier!, fontWeight: FontWeight.bold, textAlign: TextAlign.start, color: Colors.black, @@ -103,7 +103,7 @@ class _MyReferralPatientWidgetState extends State { children: [ AppText( TranslationBase.of(context).fileNo, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, fontWeight: FontWeight.bold, textAlign: TextAlign.start, color: Colors.black, @@ -112,8 +112,8 @@ class _MyReferralPatientWidgetState extends State { width: 20, ), AppText( - '${widget.myReferralPatientModel.referralDoctor}', - fontSize: 1.7 * SizeConfig.textMultiplier, + '${widget.myReferralPatientModel!.referralDoctor!}', + fontSize: 1.7 * SizeConfig.textMultiplier!, fontWeight: FontWeight.normal, textAlign: TextAlign.start, color: Colors.black, @@ -127,7 +127,7 @@ class _MyReferralPatientWidgetState extends State { margin: EdgeInsets.symmetric(horizontal: 8, vertical: 8), child: InkWell( - onTap: widget.expandClick, + onTap: widget.expandClick!(), child: Image.asset( "assets/images/ic_circle_arrow.png", width: 25, @@ -155,7 +155,7 @@ class _MyReferralPatientWidgetState extends State { endIndent: 0, ), Container( - height: 1.8 * SizeConfig.textMultiplier * 6, + height: 1.8 * SizeConfig.textMultiplier! * 6, padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( @@ -171,7 +171,7 @@ class _MyReferralPatientWidgetState extends State { SizedBox( child: AppText( TranslationBase.of(context).referralDoctor, - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: 1.9 * SizeConfig.textMultiplier!, fontWeight: FontWeight.bold, textAlign: TextAlign.start, color: Colors.black, @@ -182,8 +182,8 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${widget.myReferralPatientModel.referringDoctorName}', - fontSize: 1.7 * SizeConfig.textMultiplier, + '${widget.myReferralPatientModel!.referringDoctorName}', + fontSize: 1.7 * SizeConfig.textMultiplier!, fontWeight: FontWeight.normal, textAlign: TextAlign.start, color: Colors.black, @@ -214,7 +214,7 @@ class _MyReferralPatientWidgetState extends State { SizedBox( child: AppText( TranslationBase.of(context).referringClinic, - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: 1.9 * SizeConfig.textMultiplier!, fontWeight: FontWeight.bold, textAlign: TextAlign.start, color: Colors.black, @@ -225,8 +225,8 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${widget.myReferralPatientModel.referringClinicDescription}', - fontSize: 1.7 * SizeConfig.textMultiplier, + '${widget.myReferralPatientModel!.referringClinicDescription}', + fontSize: 1.7 * SizeConfig.textMultiplier!, fontWeight: FontWeight.normal, textAlign: TextAlign.start, color: Colors.black, @@ -253,7 +253,7 @@ class _MyReferralPatientWidgetState extends State { height: 10, ), Container( - height: 1.8 * SizeConfig.textMultiplier * 6, + height: 1.8 * SizeConfig.textMultiplier! * 6, padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( @@ -269,7 +269,7 @@ class _MyReferralPatientWidgetState extends State { SizedBox( child: AppText( TranslationBase.of(context).frequency, - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: 1.9 * SizeConfig.textMultiplier!, fontWeight: FontWeight.bold, textAlign: TextAlign.start, color: Colors.black, @@ -280,8 +280,8 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${widget.myReferralPatientModel.frequencyDescription}', - fontSize: 1.7 * SizeConfig.textMultiplier, + '${widget.myReferralPatientModel!.frequencyDescription}', + fontSize: 1.7 * SizeConfig.textMultiplier!, fontWeight: FontWeight.normal, textAlign: TextAlign.start, color: Colors.black, @@ -312,7 +312,7 @@ class _MyReferralPatientWidgetState extends State { SizedBox( child: AppText( TranslationBase.of(context).maxResponseTime, - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: 1.9 * SizeConfig.textMultiplier!, fontWeight: FontWeight.bold, textAlign: TextAlign.start, color: Colors.black, @@ -323,8 +323,8 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime)}', - fontSize: 1.7 * SizeConfig.textMultiplier, + '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel!.mAXResponseTime!)}', + fontSize: 1.7 * SizeConfig.textMultiplier!, fontWeight: FontWeight.normal, textAlign: TextAlign.start, color: Colors.black, @@ -367,7 +367,7 @@ class _MyReferralPatientWidgetState extends State { child: AppText( TranslationBase.of(context) .clinicDetailsandRemarks, - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: 1.9 * SizeConfig.textMultiplier!, fontWeight: FontWeight.bold, textAlign: TextAlign.start, color: Colors.black, @@ -378,8 +378,8 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${widget.myReferralPatientModel.referringDoctorRemarks}', - fontSize: 1.7 * SizeConfig.textMultiplier, + '${widget.myReferralPatientModel!.referringDoctorRemarks}', + fontSize: 1.7 * SizeConfig.textMultiplier!, fontWeight: FontWeight.normal, textAlign: TextAlign.start, color: Colors.black, @@ -434,11 +434,11 @@ class _MyReferralPatientWidgetState extends State { title: TranslationBase.of(context).replay, onPressed: () async { final form = _formKey.currentState; - if (form.validate()) { + if (form!.validate()) { try { - await widget.model.replay( + await widget.model!.replay( answerController.text.toString(), - widget.myReferralPatientModel); + widget.myReferralPatientModel!); DrAppToastMsg.showSuccesToast( TranslationBase.of(context).replySuccessfully); } catch (e) { @@ -446,13 +446,13 @@ class _MyReferralPatientWidgetState extends State { } } }, - loading: widget.model.state == ViewState.BusyLocal, + loading: widget.model!.state == ViewState.BusyLocal, ), ) ], ), ), - isExpand: widget.isExpand, + isExpand: widget.isExpand!, ), ], ), diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index f1f78eb9..3ddd3489 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -14,13 +14,13 @@ import 'package:provider/provider.dart'; class MyScheduleWidget extends StatelessWidget { final ListDoctorWorkingHoursTable workingHoursTable; - MyScheduleWidget({Key key, this.workingHoursTable}); + MyScheduleWidget({Key? key, required this.workingHoursTable}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); List workingHours = Utils.getWorkingHours( - workingHoursTable.workingHours, + workingHoursTable.workingHours!, ); return Container( color: HexColor("#EFEFEF"), @@ -30,7 +30,6 @@ class MyScheduleWidget extends StatelessWidget { Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ SizedBox( height: 10, @@ -40,9 +39,10 @@ class MyScheduleWidget extends StatelessWidget { child: AppText( projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic( - workingHoursTable.date.weekday) - : AppDateUtils.getWeekDay(workingHoursTable.date.weekday), - fontSize: MediaQuery.of(context).size.width*0.032, + workingHoursTable.date!.weekday) + : AppDateUtils.getWeekDay( + workingHoursTable.date!.weekday), + fontSize: MediaQuery.of(context).size.width * 0.032, fontFamily: 'Poppins', fontWeight: FontWeight.w700, letterSpacing: -0.52, @@ -52,8 +52,8 @@ class MyScheduleWidget extends StatelessWidget { Padding( padding: const EdgeInsets.only(left: 19), child: AppText( - ' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', - fontSize: MediaQuery.of(context).size.width*0.051, + ' ${workingHoursTable.date!.day} ${(AppDateUtils.getMonth(workingHoursTable.date!.month).toString().substring(0, 3))}', + fontSize: MediaQuery.of(context).size.width * 0.051, fontWeight: FontWeight.w700, fontFamily: 'Poppins', letterSpacing: -0.72, @@ -64,24 +64,24 @@ class MyScheduleWidget extends StatelessWidget { ), ), Container( - width: MediaQuery.of(context).size.width * 0.70, + width: MediaQuery.of(context).size.width * 0.70, // height: MediaQuery.of(context).size.height * 0.16, child: CardWithBgWidget( padding: 12, marginLeft: 8, marginSymmetric: 7, hasBorder: false, - bgColor: AppDateUtils.isToday(workingHoursTable.date) + bgColor: AppDateUtils.isToday(workingHoursTable.date!) ? AppGlobal.appGreenColor : Colors.transparent, widget: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (AppDateUtils.isToday(workingHoursTable.date)) + if (AppDateUtils.isToday(workingHoursTable.date!)) AppText( "Today", - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier!, fontFamily: 'Poppins', color: AppGlobal.appGreenColor, ), @@ -99,22 +99,25 @@ class MyScheduleWidget extends StatelessWidget { ), if (workingHoursTable.clinicName != null) Container( - width: MediaQuery.of(context).size.width * 0.65, + width: + MediaQuery.of(context).size.width * 0.65, child: AppText( - Utils - .convertToTitleCase( - workingHoursTable.clinicName ?? ""), - fontSize: MediaQuery.of(context).size.width*0.04, - fontWeight: FontWeight.w700, + Utils.convertToTitleCase( + workingHoursTable.clinicName ?? ""), + fontSize: + MediaQuery.of(context).size.width * + 0.04, + fontWeight: FontWeight.w700, letterSpacing: -0.64, color: AppGlobal.scheduleTextColor, ), ), - // AppText( + // AppText( Container( child: AppText( '${work.from} - ${work.to}', - fontSize: MediaQuery.of(context).size.width*0.03, + fontSize: + MediaQuery.of(context).size.width * 0.03, fontWeight: FontWeight.w300, letterSpacing: -0.4, ), @@ -125,7 +128,8 @@ class MyScheduleWidget extends StatelessWidget { if (workingHoursTable.projectName != null) AppText( workingHoursTable.projectName ?? "", - fontSize: MediaQuery.of(context).size.width*0.04, + fontSize: + MediaQuery.of(context).size.width * 0.04, fontWeight: FontWeight.w700, letterSpacing: -0.64, color: AppGlobal.scheduleTextColor, diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index e32bd53d..2b8a2389 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -22,12 +22,14 @@ class MedicineItemWidget extends StatefulWidget { final String price; MedicineItemWidget( - {@required this.label, + {required this.label, this.backgroundColor = Colors.white, this.showBorder = true, this.borderColor = Colors.white, - this.url, - this.showArrow = true, this.showPrice = false, this.price}); + this.url = '', + this.showArrow = true, + this.showPrice = false, + this.price = "0"}); @override _MedicineItemWidgetState createState() => _MedicineItemWidgetState(); @@ -55,7 +57,7 @@ class _MedicineItemWidgetState extends State { height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text(''); }, )), @@ -66,7 +68,7 @@ class _MedicineItemWidgetState extends State { child: Align( alignment: Alignment.centerLeft, child: Column( - crossAxisAlignment:CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( Utils.convertToTitleCase(widget.label ?? ''), @@ -76,23 +78,22 @@ class _MedicineItemWidgetState extends State { fontWeight: FontWeight.w600, letterSpacing: -0.33, ), - if(widget.showPrice) - AppText( - Utils.convertToTitleCase(widget.price ?? ''), - fontHeight: 1.4, - color: AppGlobal.appTextColor, - textAlign: TextAlign.start, - fontWeight: FontWeight.w600, - letterSpacing: -0.33, - ), + if (widget.showPrice) + AppText( + Utils.convertToTitleCase(widget.price ?? ''), + fontHeight: 1.4, + color: AppGlobal.appTextColor, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, + letterSpacing: -0.33, + ), ], ), ), ), ), ), - if(widget.showArrow) - Icon(EvaIcons.arrowForward) + if (widget.showArrow) Icon(EvaIcons.arrowForward) ], ), ), diff --git a/lib/widgets/patients/clinic_list_dropdwon.dart b/lib/widgets/patients/clinic_list_dropdwon.dart index 3542269d..8bae711d 100644 --- a/lib/widgets/patients/clinic_list_dropdwon.dart +++ b/lib/widgets/patients/clinic_list_dropdwon.dart @@ -7,11 +7,11 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class ClinicList extends StatelessWidget { - ProjectViewModel projectsProvider; - final int clinicId; - final Function(int value) onClinicChange; + ProjectViewModel? projectsProvider; + final int? clinicId; + final Function(int value)? onClinicChange; - ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); + ClinicList({Key? key, this.clinicId, this.onClinicChange}) : super(key: key); @override Widget build(BuildContext context) { @@ -19,7 +19,7 @@ class ClinicList extends StatelessWidget { projectsProvider = Provider.of(context); return Container( - child: projectsProvider.doctorClinicsList.length > 0 + child: projectsProvider!.doctorClinicsList.length > 0 ? FractionallySizedBox( widthFactor: 0.9, child: Column( @@ -33,18 +33,18 @@ class ClinicList extends StatelessWidget { iconEnabledColor: Colors.black, isExpanded: true, value: clinicId == null - ? projectsProvider.doctorClinicsList[0].clinicID + ? projectsProvider!.doctorClinicsList[0].clinicID : clinicId, iconSize: 25, elevation: 16, selectedItemBuilder: (BuildContext context) { - return projectsProvider.doctorClinicsList.map((item) { + return projectsProvider!.doctorClinicsList.map((item) { return Row( mainAxisSize: MainAxisSize.max, children: [ AppText( - item.clinicName, - fontSize: SizeConfig.textMultiplier * 2.1, + item.clinicName!, + fontSize: SizeConfig.textMultiplier! * 2.1, color: Colors.black, ), ], @@ -52,12 +52,12 @@ class ClinicList extends StatelessWidget { }).toList(); }, onChanged: (newValue) { - onClinicChange(newValue); + onClinicChange!(newValue!); }, - items: projectsProvider.doctorClinicsList.map((item) { + items: projectsProvider!.doctorClinicsList.map((item) { return DropdownMenuItem( child: Text( - item.clinicName, + item.clinicName!, textAlign: TextAlign.end, ), value: item.clinicID, diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 0245455e..bf5ed9ea 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -8,24 +8,24 @@ import 'package:flutter/material.dart'; import '../../utils/utils.dart'; class PatientReferralItemWidget extends StatelessWidget { - final String referralStatus; - final int referralStatusCode; - final String patientName; - final int patientGender; - final String referredDate; - final String referredTime; - final String patientID; + final String? referralStatus; + final int? referralStatusCode; + final String? patientName; + final int? patientGender; + final String? referredDate; + final String? referredTime; + final String? patientID; final isSameBranch; final bool isReferral; final bool isReferralClinic; - final String referralClinic; - final String remark; - final String nationality; - final String nationalityFlag; - final String doctorAvatar; - final String referralDoctorName; - final String clinicDescription; - final Widget infoIcon; + final String? referralClinic; + final String? remark; + final String? nationality; + final String? nationalityFlag; + final String? doctorAvatar; + final String? referralDoctorName; + final String? clinicDescription; + final Widget? infoIcon; PatientReferralItemWidget( {this.referralStatus, @@ -36,20 +36,19 @@ class PatientReferralItemWidget extends StatelessWidget { this.referredTime, this.patientID, this.isSameBranch, - this.isReferral, + this.isReferral = false, this.remark, this.nationality, this.nationalityFlag, this.doctorAvatar, this.referralDoctorName, this.clinicDescription, - this.infoIcon, + this.infoIcon, this.isReferralClinic = false, this.referralClinic}); @override Widget build(BuildContext context) { - return Container( margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0), child: Column( @@ -58,14 +57,14 @@ class PatientReferralItemWidget extends StatelessWidget { child: CardWithBgWidget( bgColor: referralStatusCode == 1 ? AppGlobal.inProgressColor - //Color(0xffc4aa54) + //Color(0xffc4aa54) : referralStatusCode == 2 ? AppGlobal.appGreenColor : referralStatusCode == 46 ? AppGlobal.appGreenColor : referralStatusCode == 4 - ? Colors.red[700] - : Colors.red[900], + ? Colors.red[700]! + : Colors.red[900]!, hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -77,7 +76,7 @@ class PatientReferralItemWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - referralStatus != null ? referralStatus : "", + referralStatus != null ? referralStatus! : "", fontFamily: 'Poppins', fontSize: 12.0, letterSpacing: -0.48, @@ -89,8 +88,8 @@ class PatientReferralItemWidget extends StatelessWidget { : referralStatusCode == 46 ? AppGlobal.appGreenColor : referralStatusCode == 4 - ? Colors.red[700] - : Colors.red[900], + ? Colors.red[700]! + : Colors.red[900]!, ), Column( crossAxisAlignment: CrossAxisAlignment.end, @@ -149,7 +148,7 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ CustomRow( label: TranslationBase.of(context).fileNumber, - value: patientID, + value: patientID!, ), CustomRow( label: isSameBranch @@ -160,7 +159,9 @@ class PatientReferralItemWidget extends StatelessWidget { ? TranslationBase.of(context).sameBranch : TranslationBase.of(context) .otherBranch - : " " + Utils.convertToTitleCase(referralClinic ?? ""), + : " " + + Utils.convertToTitleCase( + referralClinic ?? ""), ), ], ), @@ -170,7 +171,7 @@ class PatientReferralItemWidget extends StatelessWidget { child: Row( children: [ AppText( - nationality != null ? nationality : "", + nationality != null ? nationality! : "", fontWeight: FontWeight.w600, color: Color(0xFF2E303A), fontSize: 10.0, @@ -180,16 +181,15 @@ class PatientReferralItemWidget extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - nationalityFlag, + nationalityFlag!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text(''); }, - ) - ) + )) : SizedBox() ], ), @@ -224,12 +224,12 @@ class PatientReferralItemWidget extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - doctorAvatar, + doctorAvatar!, height: 28, width: 28, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -246,13 +246,14 @@ class PatientReferralItemWidget extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, top: 17, bottom: 0), + margin: + EdgeInsets.only(left: 10, top: 17, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - Utils.convertToTitleCase(referralDoctorName ?? ""), + Utils.convertToTitleCase( + referralDoctorName ?? ""), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 14.0, @@ -261,8 +262,8 @@ class PatientReferralItemWidget extends StatelessWidget { ), if (clinicDescription != null) AppText( - Utils.convertToTitleCase(clinicDescription ?? "") - , + Utils.convertToTitleCase( + clinicDescription ?? ""), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 10.0, diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 5b75e1a4..c69b8fa5 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -17,8 +17,8 @@ import 'package:provider/provider.dart'; import 'ShowTimer.dart'; class PatientCard extends StatelessWidget { - final PatiantInformtion patientInfo; - final Function onTap; + final PatiantInformtion? patientInfo; + final Function? onTap; final String patientType; final String arrivalType; final bool isInpatient; @@ -27,12 +27,12 @@ class PatientCard extends StatelessWidget { final bool isFromLiveCare; PatientCard( - {Key key, + {Key? key, this.patientInfo, this.onTap, - this.patientType, - this.arrivalType, - this.isInpatient, + this.patientType = '', + this.arrivalType = '', + this.isInpatient = false, this.isMyPatient = false, this.isFromSearch = false, this.isFromLiveCare = false}) @@ -41,16 +41,16 @@ class PatientCard extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - String nationalityName = patientInfo.nationalityName != null - ? patientInfo.nationalityName.trim() - : patientInfo.nationality != null - ? patientInfo.nationality.trim() - : patientInfo.nationalityId != null - ? patientInfo.nationalityId + String nationalityName = patientInfo!.nationalityName != null + ? patientInfo!.nationalityName!.trim() + : patientInfo!.nationality != null + ? patientInfo!.nationality!.trim() + : patientInfo!.nationalityId != null + ? patientInfo!.nationalityId! : ""; return Container( - width: SizeConfig.screenWidth * 0.9, + width: SizeConfig.screenWidth! * 0.9, margin: EdgeInsets.all(6), padding: EdgeInsets.only( left: projectViewModel.isArabic ? 5 : 0, @@ -67,14 +67,14 @@ class PatientCard extends StatelessWidget { ? Colors.white : (isMyPatient && !isFromSearch) ? AppGlobal.appGreenColor - : patientInfo.patientStatusType == 43 + : patientInfo!.patientStatusType == 43 ? AppGlobal.appGreenColor : isMyPatient ? AppGlobal.appGreenColor : isInpatient ? Colors.white : !isFromSearch - ? Colors.red[800] + ? Colors.red[800]! : Colors.white, widget: Container( decoration: BoxDecoration( @@ -95,7 +95,7 @@ class PatientCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ - patientInfo.patientStatusType == 43 + patientInfo!.patientStatusType == 43 ? Row( children: [ PatientStatus( @@ -117,23 +117,23 @@ class PatientCard extends StatelessWidget { width: 8, ), PatientStatus( - label: patientInfo.status == 2 + label: patientInfo!.status == 2 ? 'Confirmed' : 'Booked', - color: patientInfo.status == 2 + color: patientInfo!.status == 2 ? AppGlobal.appGreenColor : Colors.grey, ), ], ) - : patientInfo.patientStatusType == 42 + : patientInfo!.patientStatusType == 42 ? Row( children: [ PatientStatus( label: TranslationBase.of(context) .notArrived, - color: Colors.red[800], + color: Colors.red[800]!, ), SizedBox( width: 8, @@ -149,10 +149,10 @@ class PatientCard extends StatelessWidget { width: 8, ), PatientStatus( - label: patientInfo.status == 2 + label: patientInfo!.status == 2 ? 'Confirmed' : 'Booked', - color: patientInfo.status == 2 + color: patientInfo!.status == 2 ? AppGlobal.appGreenColor : Colors.grey, ) @@ -160,7 +160,8 @@ class PatientCard extends StatelessWidget { ) : !isFromSearch && !isFromLiveCare && - patientInfo.patientStatusType == + patientInfo! + .patientStatusType == null ? Row( children: [ @@ -185,11 +186,11 @@ class PatientCard extends StatelessWidget { ), PatientStatus( label: - patientInfo.status == 2 + patientInfo!.status == 2 ? 'Booked' : 'Confirmed', color: - patientInfo.status == 2 + patientInfo!.status == 2 ? Colors.grey : AppGlobal .appGreenColor, @@ -199,32 +200,32 @@ class PatientCard extends StatelessWidget { : SizedBox(), this.arrivalType == '1' ? AppText( - patientInfo.startTime != null - ? patientInfo.startTime - : patientInfo.startTimes, + patientInfo!.startTime != null + ? patientInfo!.startTime! + : patientInfo!.startTimes!, fontFamily: 'Poppins', fontWeight: FontWeight.w400, ) - : patientInfo.arrivedOn != null + : patientInfo!.arrivedOn != null ? Container( padding: EdgeInsets.only(right: 9), child: AppText( - "${AppDateUtils.getStartTime(patientInfo.startTime)}", + "${AppDateUtils.getStartTime(patientInfo!.startTime!)}", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 11, letterSpacing: -0.64, ), ) - : (patientInfo.appointmentDate != + : (patientInfo!.appointmentDate != null && - patientInfo - .appointmentDate.isNotEmpty) + patientInfo!.appointmentDate! + .isNotEmpty) ? Container( padding: EdgeInsets.only(right: 9), child: AppText( - " ${AppDateUtils.getStartTime(patientInfo.startTime)}", + " ${AppDateUtils.getStartTime(patientInfo!.startTime!)}", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 11, @@ -261,12 +262,12 @@ class PatientCard extends StatelessWidget { AppText( isFromLiveCare ? Utils.capitalize( - patientInfo.fullName) + patientInfo!.fullName) : (Utils.capitalize( - patientInfo.firstName) + + patientInfo!.firstName) + " " + Utils.capitalize( - patientInfo.lastName)), + patientInfo!.lastName)), fontSize: 16, color: Color(0xFF2E303A), fontWeight: FontWeight.w600, @@ -274,7 +275,7 @@ class PatientCard extends StatelessWidget { letterSpacing: -0.64, textOverflow: TextOverflow.ellipsis, ), - if (patientInfo.gender == 1) + if (patientInfo!.gender == 1) Container( padding: EdgeInsets.symmetric( horizontal: 4, vertical: 2), @@ -290,7 +291,7 @@ class PatientCard extends StatelessWidget { ), if (isFromLiveCare) ShowTimer( - patientInfo: patientInfo, + patientInfo: patientInfo!, ), ]), ), @@ -313,8 +314,8 @@ class PatientCard extends StatelessWidget { ), ), ), - patientInfo.nationality != null || - patientInfo.nationalityId != null + patientInfo!.nationality != null || + patientInfo!.nationalityId != null ? Container( padding: EdgeInsets.only( right: 7, top: 5), @@ -322,11 +323,11 @@ class PatientCard extends StatelessWidget { borderRadius: BorderRadius.circular(20.0), child: CachedNetworkImage( - imageUrl: patientInfo + imageUrl: patientInfo! .nationalityFlagURL != null - ? patientInfo - .nationalityFlagURL + ? patientInfo! + .nationalityFlagURL! : '', height: 16, width: 22, @@ -357,7 +358,7 @@ class PatientCard extends StatelessWidget { height: 60, //TODO Elham* create widget for this to make it use every where child: SvgPicture.asset( - patientInfo.gender == 1 + patientInfo!.gender == 1 ? 'assets/images/svgs/male avatar.svg' : 'assets/images/svgs/female avatar.svg', fit: BoxFit.cover, @@ -380,16 +381,17 @@ class PatientCard extends StatelessWidget { CustomRow( label: TranslationBase.of(context) .fileNumber, - value: patientInfo.patientId.toString(), + value: + patientInfo!.patientId.toString(), ), CustomRow( label: TranslationBase.of(context).age + " : ", value: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}", ), - patientInfo.arrivedOn != null + patientInfo!.arrivedOn != null ? Column( crossAxisAlignment: CrossAxisAlignment.end, @@ -401,7 +403,7 @@ class PatientCard extends StatelessWidget { // .getDayMonthYearDateFormatted( // AppDateUtils // .convertStringToDate( - // patientInfo.arrivedOn, + // patientInfo!.arrivedOn, // ), // isMonthShort: true, // ), @@ -420,16 +422,16 @@ class PatientCard extends StatelessWidget { .getDayMonthYearDateFormatted( AppDateUtils .convertStringToDate( - patientInfo.arrivedOn, + patientInfo!.arrivedOn!, ), isMonthShort: true, ), ), ], ) - : (patientInfo.appointmentDate != + : (patientInfo!.appointmentDate != null && - patientInfo.appointmentDate + patientInfo!.appointmentDate! .isNotEmpty) ? Column( crossAxisAlignment: @@ -443,8 +445,8 @@ class PatientCard extends StatelessWidget { .appointmentDate + " : ", value: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( - patientInfo - .appointmentDate, + patientInfo! + .appointmentDate!, ), isMonthShort: true)}", ), ], @@ -454,38 +456,38 @@ class PatientCard extends StatelessWidget { if (isInpatient) CustomRow( label: - patientInfo.admissionDate == null + patientInfo!.admissionDate == null ? "" : TranslationBase.of(context) .admissionDate + " : ", - value: patientInfo.admissionDate == + value: patientInfo!.admissionDate == null ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate.toString()), isMonthShort: true)}", + : "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate.toString()), isMonthShort: true)}", ), - if (patientInfo.admissionDate != null) + if (patientInfo!.admissionDate != null) CustomRow( label: TranslationBase.of(context) .numOfDays + " : ", value: - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}", ), - if (patientInfo.admissionDate != null) + if (patientInfo!.admissionDate != null) CustomRow( label: TranslationBase.of(context) .clinicName + " : ", value: - "${patientInfo.clinicDescription}", + "${patientInfo!.clinicDescription}", ), - if (patientInfo.admissionDate != null) + if (patientInfo!.admissionDate != null) CustomRow( label: TranslationBase.of(context) .roomNo + " : ", - value: "${patientInfo.roomId}", + value: "${patientInfo!.roomId}", ), if (isFromLiveCare) Column( @@ -494,7 +496,7 @@ class PatientCard extends StatelessWidget { label: TranslationBase.of(context) .clinic + " : ", - value: patientInfo.clinicName, + value: patientInfo!.clinicName!, ), ], ), @@ -534,11 +536,12 @@ class PatientCard extends StatelessWidget { padding: EdgeInsets.only( left: 9, right: 9, bottom: 9), child: SvgPicture.asset( - patientInfo.appointmentType == + patientInfo!.appointmentType == 'Regular' && - patientInfo.visitTypeId == 100 + patientInfo!.visitTypeId == + 100 ? 'assets/images/svgs/profile_screen/livecare.svg' - : patientInfo.appointmentType == + : patientInfo!.appointmentType == 'Walkin' ? 'assets/images/svgs/profile_screen/walkin.svg' : 'assets/images/svgs/profile_screen/booked.svg', @@ -564,7 +567,7 @@ class PatientCard extends StatelessWidget { : SizedBox() ], ), - onTap: onTap, + onTap: onTap!(), )), )); } @@ -572,12 +575,12 @@ class PatientCard extends StatelessWidget { class PatientStatus extends StatelessWidget { PatientStatus({ - Key key, - this.label, + Key? key, + required this.label, this.color, }) : super(key: key); final String label; - final Color color; + final Color? color; @override Widget build(BuildContext context) { diff --git a/lib/widgets/patients/patient_card/ShowTimer.dart b/lib/widgets/patients/patient_card/ShowTimer.dart index 8eebe9c4..f8631072 100644 --- a/lib/widgets/patients/patient_card/ShowTimer.dart +++ b/lib/widgets/patients/patient_card/ShowTimer.dart @@ -7,8 +7,8 @@ class ShowTimer extends StatefulWidget { final PatiantInformtion patientInfo; const ShowTimer({ - Key key, - this.patientInfo, + Key? key, + required this.patientInfo, }) : super(key: key); @override @@ -48,7 +48,7 @@ class _ShowTimerState extends State { generateShowTimerString() { DateTime now = DateTime.now(); - DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime); + DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime!); String timer = AppDateUtils.differenceBetweenDateAndCurrent( liveCareDate, context, isShowSecond: true, isShowDays: false); diff --git a/lib/widgets/patients/patient_service_title.dart b/lib/widgets/patients/patient_service_title.dart index 08ce9293..8dc34c88 100644 --- a/lib/widgets/patients/patient_service_title.dart +++ b/lib/widgets/patients/patient_service_title.dart @@ -3,10 +3,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ServiceTitle extends StatefulWidget { - final String title; - final String subTitle; + final String? title; + final String? subTitle; - const ServiceTitle({Key key, this.title, this.subTitle}) : super(key: key); + const ServiceTitle({Key? key, this.title, this.subTitle}) : super(key: key); @override _ServiceTitleState createState() => _ServiceTitleState(); @@ -21,7 +21,7 @@ class _ServiceTitleState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - widget.title, + widget.title!, color: Color(0xff2E303A), fontSize: 12.0, letterSpacing: -0.72, @@ -29,7 +29,7 @@ class _ServiceTitleState extends State { fontHeight: 1.0, ), AppText( - widget.subTitle, + widget.subTitle!, color: Color(0xff2E303A), fontSize: 24, fontWeight: FontWeight.w700, diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 3993b465..997b9ce1 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -11,29 +11,29 @@ import 'package:provider/provider.dart'; // ignore: must_be_immutable class PatientProfileButton extends StatelessWidget { - final String nameLine1; - final String nameLine2; - final String icon; + final String? nameLine1; + final String? nameLine2; + final String? icon; final dynamic route; - final PatiantInformtion patient; - final String patientType; - String arrivalType; + final PatiantInformtion? patient; + final String? patientType; + String? arrivalType; final bool isInPatient; - String from; - String to; + String? from; + String? to; final String url = "assets/images/"; final bool isDisable; final bool isLoading; - final Function onTap; + final Function? onTap; final bool isDischargedPatient; final bool isSelectInpatient; final bool isDartIcon; - final IconData dartIcon; + final IconData? dartIcon; final bool isFromLiveCare; - final Color color; + final Color? color; PatientProfileButton({ - Key key, + Key? key, this.patient, this.patientType, this.arrivalType, @@ -65,8 +65,8 @@ class PatientProfileButton extends StatelessWidget { child: InkWell( onTap: isDisable ? null - : onTap != null - ? onTap + : onTap!() != null + ? onTap!() : () { navigator(context, this.route); }, @@ -86,7 +86,7 @@ class PatientProfileButton extends StatelessWidget { color: color ?? Color(0xFF333C45), ) : new SvgPicture.asset( - icon, + icon!, width: 30, height: 30, ), @@ -102,20 +102,20 @@ class PatientProfileButton extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - !projectsProvider.isArabic ? this.nameLine1 : nameLine2, + !projectsProvider.isArabic ? this.nameLine1! : nameLine2!, color: color ?? AppGlobal.appTextColor, letterSpacing: -0.33, fontWeight: FontWeight.w600, textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 1.30, + fontSize: SizeConfig.textMultiplier! * 1.30, ), AppText( - !projectsProvider.isArabic ? this.nameLine2 : nameLine1, + !projectsProvider.isArabic ? this.nameLine2! : nameLine1!, color: color ?? Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, fontHeight: 1.4, - fontSize: SizeConfig.textMultiplier * 1.30, + fontSize: SizeConfig.textMultiplier! * 1.30, ), if (isLoading) DrAppCircularProgressIndeicator() ], diff --git a/lib/widgets/patients/profile/Profile_general_info_Widget.dart b/lib/widgets/patients/profile/Profile_general_info_Widget.dart index 4068c7e5..3bb3ae03 100644 --- a/lib/widgets/patients/profile/Profile_general_info_Widget.dart +++ b/lib/widgets/patients/profile/Profile_general_info_Widget.dart @@ -13,7 +13,7 @@ import '../../shared/rounded_container_widget.dart'; *@desc: Profile General Info Widget class */ class ProfileGeneralInfoWidget extends StatelessWidget { - ProfileGeneralInfoWidget({Key key, this.patient}) : super(key: key); + ProfileGeneralInfoWidget({Key? key, required this.patient}) : super(key: key); PatiantInformtion patient; @@ -38,8 +38,8 @@ class ProfileGeneralInfoWidget extends StatelessWidget { ), ], ), - width: SizeConfig.screenWidth * 0.70, - height: SizeConfig.screenHeight * 0.25, + width: SizeConfig.screenWidth! * 0.70, + height: SizeConfig.screenHeight! * 0.25, ); } } diff --git a/lib/widgets/patients/profile/add-order/addNewOrder.dart b/lib/widgets/patients/profile/add-order/addNewOrder.dart index cc9223f6..d150d244 100644 --- a/lib/widgets/patients/profile/add-order/addNewOrder.dart +++ b/lib/widgets/patients/profile/add-order/addNewOrder.dart @@ -1,11 +1,12 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; class AddNewOrder extends StatelessWidget { const AddNewOrder({ - Key key, - this.onTap, - this.label, + Key? key, + required this.onTap, + required this.label, }) : super(key: key); final Function onTap; @@ -14,7 +15,7 @@ class AddNewOrder extends StatelessWidget { @override Widget build(BuildContext context) { return InkWell( - onTap: onTap, + onTap: onTap(), child: Container( width: double.maxFinite, height: MediaQuery.of(context).size.height * 0.18, @@ -59,4 +60,11 @@ class AddNewOrder extends StatelessWidget { ), ); } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(DiagnosticsProperty('onTap', onTap)); + properties.add(DiagnosticsProperty('onTap', onTap)); + } } diff --git a/lib/widgets/patients/profile/app_bar/header_row.dart b/lib/widgets/patients/profile/app_bar/header_row.dart index c5a0cd42..c55782b2 100644 --- a/lib/widgets/patients/profile/app_bar/header_row.dart +++ b/lib/widgets/patients/profile/app_bar/header_row.dart @@ -7,7 +7,7 @@ class HeaderRow extends StatelessWidget { final String value; final bool isExpanded; - const HeaderRow({Key key, this.label, this.value, this.isExpanded = false}) : super(key: key); + const HeaderRow({Key? key, required this.label, required this.value, this.isExpanded = false}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart index 8def36c8..b040226f 100644 --- a/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart @@ -14,7 +14,7 @@ import 'package:url_launcher/url_launcher.dart'; import '../large_avatar.dart'; import 'header_row.dart'; -class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { +class PatientProfileAppBar extends StatelessWidget { final PatiantInformtion patient; final double height; final bool isInpatient; @@ -23,7 +23,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final String doctorName; final String branch; - final DateTime appointmentDate; + final DateTime? appointmentDate; final String profileUrl; final String invoiceNO; final String orderNo; @@ -34,27 +34,27 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final String clinic; final bool isAppointmentHeader; final bool isFromLabResult; - final VoidCallback onPressed; + final VoidCallback? onPressed; PatientProfileAppBar(this.patient, {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, - this.doctorName, - this.branch, + this.doctorName = '', + this.branch = '', this.appointmentDate, - this.profileUrl, - this.invoiceNO, - this.orderNo, + this.profileUrl = '', + this.invoiceNO = '', + this.orderNo = '', this.isPrescriptions = false, - this.clinic, + this.clinic = '', this.isMedicalFile = false, - this.episode, - this.visitDate, + this.episode = '', + this.visitDate = '', this.isAppointmentHeader = false, this.isFromLabResult = false, - this.onPressed}); + this.onPressed}); @override Widget build(BuildContext context) { @@ -62,9 +62,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + gender = patient.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient.gender!; } return Container( @@ -89,7 +89,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { icon: Icon(Icons.arrow_back_ios), color: Color(0xFF2B353E), //Colors.black, onPressed: () { - if (onPressed != null) onPressed(); + if (onPressed != null) onPressed!(); Navigator.pop(context); }, ), @@ -100,8 +100,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { " " + Utils.capitalize(patient.lastName)) : Utils.capitalize(patient.fullName ?? - patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier * 1.8, + patient.patientDetails!.fullName), + fontSize: SizeConfig.textMultiplier! * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', color: Color(0xFF2B353E), @@ -121,7 +121,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient.mobileNumber!); }, child: Icon( Icons.phone, @@ -170,7 +170,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ) : AppText( TranslationBase.of(context).notArrived, - color: Colors.red[800], + color: Colors.red[800]!, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: SizeConfig @@ -180,7 +180,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { patient.startTime != null ? AppText( patient.startTime != null - ? patient.startTime + ? patient.startTime! : '', fontWeight: FontWeight.w700, fontSize: SizeConfig @@ -235,12 +235,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient.nationalityFlagURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -253,31 +253,31 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { HeaderRow( label: TranslationBase.of(context).age + " : ", value: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), if (patient.appointmentDate != null && - patient.appointmentDate.isNotEmpty && + patient.appointmentDate!.isNotEmpty && !isFromLabResult) HeaderRow( label: TranslationBase.of(context).appointmentDate + " : ", value: AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.convertStringToDate( - patient.appointmentDate)), + patient.appointmentDate!)), ), if (isFromLabResult) HeaderRow( label: "Result Date: ", value: - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', ), // if(isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (patient.admissionDate != null && - patient.admissionDate.isNotEmpty) + patient.admissionDate!.isNotEmpty) HeaderRow( label: patient.admissionDate == null ? "" @@ -292,8 +292,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && patient.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}", ) ], ), @@ -316,8 +316,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { shape: BoxShape.rectangle, border: Border( bottom: - BorderSide(color: Colors.grey[400], width: 2.5), - left: BorderSide(color: Colors.grey[400], width: 2.5), + BorderSide(color: Colors.grey[400]!, width: 2.5), + left: + BorderSide(color: Colors.grey[400]!, width: 2.5), )), ), Expanded( @@ -395,7 +396,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ? 'Result Date:' : 'Prescriptions Date ', value: - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', ), ]), ), diff --git a/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart index 996effed..c6f69580 100644 --- a/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart @@ -15,8 +15,7 @@ import 'package:url_launcher/url_launcher.dart'; import 'header_row.dart'; -class PatientProfileHeaderNewDesignAppBar extends StatelessWidget - with PreferredSizeWidget { +class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; @@ -25,7 +24,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final bool isDischargedPatient; final bool isFromLiveCare; - final Stream videoCallDurationStream; + final Stream? videoCallDurationStream; PatientProfileHeaderNewDesignAppBar( this.patient, this.patientType, this.arrivalType, @@ -39,9 +38,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget Widget build(BuildContext context) { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + gender = patient.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient.gender!; } return Container( padding: EdgeInsets.only( @@ -77,8 +76,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget " " + Utils.capitalize(patient.lastName)) : Utils.capitalize(patient.fullName ?? - patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier * 1.8, + patient.patientDetails!.fullName), + fontSize: SizeConfig.textMultiplier! * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), @@ -100,7 +99,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget eventCategory: "Patient Profile Header", eventAction: "Call Patient", ); - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient.mobileNumber!); }, child: Icon( Icons.phone, @@ -122,7 +121,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), child: Text( - snapshot.data, + snapshot.data!, style: TextStyle(color: Colors.white), ), ), @@ -170,7 +169,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ) : AppText( TranslationBase.of(context).notArrived, - color: Colors.red[800], + color: Colors.red[800]!, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, @@ -178,7 +177,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget arrivalType == '1' || patient.arrivedOn == null ? AppText( patient.startTime != null - ? patient.startTime + ? patient.startTime! : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -187,7 +186,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget patient.arrivedOn != null ? AppDateUtils .convertStringToDateFormat( - patient.arrivedOn, + patient.arrivedOn!, 'MM-dd-yyyy HH:mm') : '', fontFamily: 'Poppins', @@ -219,7 +218,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget child: AppText( patient.startTime ?? "", color: Colors.white, - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: + 1.5 * SizeConfig.textMultiplier!, textAlign: TextAlign.center, fontWeight: FontWeight.bold, ), @@ -232,7 +232,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget child: AppText( convertDateFormat2( patient.appointmentDate ?? ''), - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier!, fontWeight: FontWeight.bold, ), ), @@ -274,12 +274,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient.nationalityFlagURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text(''); }, )) @@ -292,7 +292,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget HeaderRow( label: TranslationBase.of(context).age + " : ", value: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), if (isInpatient) Column( @@ -312,8 +312,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && patient.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}", ) ], ) @@ -328,7 +328,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget } convertDateFormat2(String str) { - String newDate; + String newDate = ''; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index 36227ea5..90b5b65b 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -5,31 +5,31 @@ import 'package:flutter/material.dart'; class LargeAvatar extends StatelessWidget { LargeAvatar( - {Key key, - this.name, - this.url, - this.disableProfileView: false, + {Key? key, + required this.name, + this.url, + this.disableProfileView = false, this.radius = 60.0, this.width = 90, this.height = 90}) : super(key: key); final String name; - final String url; + final String? url; final bool disableProfileView; final double radius; final double width; final double height; Widget _getAvatar() { - if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { + if (url != null && url!.isNotEmpty && Uri.parse(url!).isAbsolute) { return CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, + radius: SizeConfig.imageSizeMultiplier! * 12, // radius: (52) child: ClipRRect( borderRadius: BorderRadius.circular(50), child: Image.network( - url, + url!, fit: BoxFit.fill, width: 700, ), @@ -69,8 +69,8 @@ class LargeAvatar extends StatelessWidget { begin: Alignment(-1, -1), end: Alignment(1, 1), colors: [ - Colors.grey[100], - Colors.grey[800], + Colors.grey[100]!, + Colors.grey[800]!, ]), boxShadow: [ BoxShadow( diff --git a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart index 1ca0d530..ec192073 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -15,7 +15,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { final List prescriptionReportForInPatientList; PrescriptionInPatientWidget( - {Key key, this.prescriptionReportForInPatientList}); + {Key? key, required this.prescriptionReportForInPatientList}); @override Widget build(BuildContext context) { @@ -80,7 +80,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { LargeAvatar( name: prescriptionReportForInPatientList[index] - .createdByName, + .createdByName!, radius: 10, width: 70, ), @@ -95,7 +95,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { AppText( '${prescriptionReportForInPatientList[index].createdByName}', fontSize: - 2.5 * SizeConfig.textMultiplier, + 2.5 * SizeConfig.textMultiplier!, ), SizedBox( height: 8, @@ -103,7 +103,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { AppText( '${prescriptionReportForInPatientList[index].itemDescription}', fontSize: - 2.5 * SizeConfig.textMultiplier, + 2.5 * SizeConfig.textMultiplier!, color: Theme.of(context).primaryColor), SizedBox( diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index 3883fe2c..21a7fa8a 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -14,7 +14,7 @@ import 'large_avatar.dart'; class PrescriptionOutPatientWidget extends StatelessWidget { final List patientPrescriptionsList; - PrescriptionOutPatientWidget({Key key, this.patientPrescriptionsList}); + PrescriptionOutPatientWidget({Key? key, required this.patientPrescriptionsList}); @override Widget build(BuildContext context) { @@ -85,7 +85,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { url: patientPrescriptionsList[index] .doctorImageURL, name: patientPrescriptionsList[index] - .doctorName, + .doctorName!, radius: 10, width: 70, ), @@ -100,7 +100,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { AppText( '${patientPrescriptionsList[index].name}', fontSize: - 2.5 * SizeConfig.textMultiplier, + 2.5 * SizeConfig.textMultiplier!, ), SizedBox( height: 8, @@ -108,7 +108,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { AppText( '${patientPrescriptionsList[index].clinicDescription}', fontSize: - 2.5 * SizeConfig.textMultiplier, + 2.5 * SizeConfig.textMultiplier!, color: Theme.of(context).primaryColor), SizedBox( diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index e3891be1..6f8142b3 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -36,7 +36,7 @@ class ProfileWelcomeWidget extends StatelessWidget { borderRadius: BorderRadius.circular(20), child: CachedNetworkImage( imageUrl: - authenticationViewModel.doctorProfile.doctorImageURL, + authenticationViewModel.doctorProfile!.doctorImageURL!, fit: BoxFit.fill, width: 75, height: 75, diff --git a/lib/widgets/patients/profile/profile_general_info_content_widget.dart b/lib/widgets/patients/profile/profile_general_info_content_widget.dart index f5c70ae6..eb418981 100644 --- a/lib/widgets/patients/profile/profile_general_info_content_widget.dart +++ b/lib/widgets/patients/profile/profile_general_info_content_widget.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -15,7 +16,7 @@ class ProfileGeneralInfoContentWidget extends StatelessWidget { String title; String info; - ProfileGeneralInfoContentWidget({this.title, this.info}); + ProfileGeneralInfoContentWidget({required this.title, required this.info}); @override Widget build(BuildContext context) { @@ -29,17 +30,22 @@ class ProfileGeneralInfoContentWidget extends StatelessWidget { ), AppText( title, - fontSize: SizeConfig.textMultiplier * 3, + fontSize: SizeConfig.textMultiplier! * 3, fontWeight: FontWeight.w700, color: HexColor('#58434F'), ), AppText( info, color: HexColor('#707070'), - fontSize: SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier! * 2, ) ], ), ); } + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(StringProperty('title', title)); + } } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 169abd85..2c328db0 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -8,21 +8,21 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ProfileMedicalInfoWidget extends StatelessWidget { - final String from; - final String to; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; + final String? from; + final String? to; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; final bool isInpatient; ProfileMedicalInfoWidget( - {Key key, + {Key? key, this.patient, this.patientType, this.arrivalType, this.from, this.to, - this.isInpatient}); + this.isInpatient = false}); @override Widget build(BuildContext context) { @@ -83,7 +83,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - isInPatient: isInpatient, + isInPatient: isInpatient!, route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, @@ -136,36 +136,36 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + if (patient!.appointmentNo != null && patient!.appointmentNo != 0) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: PATIENT_UCAF_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, + isDisable: patient!.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).ucaf, icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + if (patient!.appointmentNo != null && patient!.appointmentNo != 0) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: REFER_PATIENT_TO_DOCTOR, - isDisable: patient.patientStatusType != 43 ? true : false, + isDisable: patient!.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).referral, nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + if (patient!.appointmentNo != null && patient!.appointmentNo != 0) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: PATIENT_ADMISSION_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, + isDisable: patient!.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'patient/admission_req.png'), 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 index 140b3f4e..06b62dde 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -8,22 +8,22 @@ 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 String? from; + final String? to; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; final bool isInpatient; final bool isDischargedPatient; ProfileMedicalInfoWidgetInPatient( - {Key key, + {Key? key, this.patient, this.patientType, this.arrivalType, this.from, this.to, - this.isInpatient, + this.isInpatient = false, this.isDischargedPatient = false}); @override diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index 84877572..b45b09a9 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -7,29 +7,37 @@ import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class ProfileMedicalInfoWidgetSearch extends StatelessWidget { - final String from; - final String to; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; +class ProfileMedicalInfoWidgetSearch extends StatefulWidget { + final String? from; + final String? to; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; final bool isInpatient; final bool isDischargedPatient; ProfileMedicalInfoWidgetSearch( - {Key key, + {Key? key, this.patient, this.patientType, this.arrivalType, this.from, this.to, - this.isInpatient, - this.isDischargedPatient}); + this.isInpatient = false, + this.isDischargedPatient = false}); - TabController _tabController; + @override + State createState() => + _ProfileMedicalInfoWidgetSearchState(); +} + +class _ProfileMedicalInfoWidgetSearchState + extends State + with SingleTickerProviderStateMixin { + late TabController _tabController; void initState() { - _tabController = TabController(length: 2); + _tabController = TabController(length: 2, vsync: this); } void dispose() { @@ -42,7 +50,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { onModelReady: (model) async {}, builder: (_, model, w) => DefaultTabController( length: 2, - initialIndex: isInpatient ? 0 : 1, + initialIndex: widget.isInpatient ? 0 : 1, child: SizedBox( height: MediaQuery.of(context).size.height * 1.0, width: double.infinity, @@ -56,22 +64,22 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { crossAxisCount: 3, children: [ PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, + from: widget.from, + to: widget.to, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, route: VITAL_SIGN_DETAILS, icon: 'assets/images/svgs/profile_screen/vital signs.svg'), // if (selectedPatientType != 7) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, @@ -80,40 +88,40 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, route: LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'assets/images/svgs/profile_screen/lab results.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, + isInPatient: widget.isInpatient, route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, route: PATIENT_ECG, nameLine1: TranslationBase.of(context).patient, nameLine2: "ECG", icon: 'assets/images/svgs/profile_screen/ECG.svg'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, route: ORDER_PRESCRIPTION_OLD, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, @@ -121,10 +129,10 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { 'assets/images/svgs/profile_screen/order prescription.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, route: ORDER_PROCEDURE, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, @@ -132,10 +140,10 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { 'assets/images/svgs/profile_screen/Order Procedures.svg'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, @@ -143,67 +151,76 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { 'assets/images/svgs/profile_screen/insurance approval.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, route: ADD_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + if (widget.patient!.appointmentNo != null && + widget.patient!.appointmentNo != 0) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, route: PATIENT_UCAF_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, + isDisable: widget.patient!.patientStatusType != 43 + ? true + : false, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).ucaf, icon: 'assets/images/svgs/profile_screen/UCAF.svg'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + if (widget.patient!.appointmentNo != null && + widget.patient!.appointmentNo != 0) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, route: REFER_PATIENT_TO_DOCTOR, - isDisable: patient.patientStatusType != 43 ? true : false, + isDisable: widget.patient!.patientStatusType != 43 + ? true + : false, nameLine1: TranslationBase.of(context).referral, nameLine2: TranslationBase.of(context).patient, icon: 'assets/images/svgs/profile_screen/refer patient.svg'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + if (widget.patient!.appointmentNo != null && + widget.patient!.appointmentNo != 0) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, route: PATIENT_ADMISSION_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, + isDisable: widget.patient!.patientStatusType != 43 + ? true + : false, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'assets/images/svgs/profile_screen/admission req.svg'), - if (isInpatient) + if (widget.isInpatient) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, route: PROGRESS_NOTE, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), - if (isInpatient) + if (widget.isInpatient) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + key: widget.key, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType, route: ORDER_NOTE, nameLine1: "Order", //"Text", diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index be159769..49591e5b 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -6,13 +6,13 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class VitalSignDetailsWidget extends StatefulWidget { - final List vitalList; - final String title1; - final String title2; - final String viewKey; + final List? vitalList; + final String? title1; + final String? title2; + final String? viewKey; VitalSignDetailsWidget( - {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); + {Key? key, this.vitalList, this.title1, this.title2, this.viewKey}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -36,7 +36,7 @@ class _VitalSignDetailsWidgetState extends State { children: [ Table( border: TableBorder.symmetric( - inside: BorderSide(width: 2.0, color: Colors.grey[300]), + inside: BorderSide(width: 2.0, color: Colors.grey[300]!), ), children: fullData(), ), @@ -59,7 +59,7 @@ class _VitalSignDetailsWidgetState extends State { ), child: Center( child: AppText( - widget.title1, + widget.title1!, color: Colors.white, ), ), @@ -75,12 +75,12 @@ class _VitalSignDetailsWidgetState extends State { ), ), child: Center( - child: AppText(widget.title2, color: Colors.white), + child: AppText(widget.title2!, color: Colors.white), ), height: 60), ) ])); - widget.vitalList.forEach((vital) { + widget.vitalList!.forEach((vital) { tableRow.add(TableRow(children: [ Container( child: Container( @@ -88,7 +88,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: AppText( - '${AppDateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${AppDateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + '${AppDateUtils.getWeekDay(vital.vitalSignDate!.weekday)}, ${vital.vitalSignDate!.day} ${AppDateUtils.getMonth(vital.vitalSignDate!.month)}, ${vital.vitalSignDate!.year} ', textAlign: TextAlign.center, ), ), diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 3fa1eb2b..7a8f5efe 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -24,7 +24,7 @@ class AppDrawer extends StatefulWidget { class _AppDrawerState extends State { Utils helpers = new Utils(); - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { @@ -90,7 +90,7 @@ class _AppDrawerState extends State { TranslationBase.of(context).dr + capitalizeOnlyFirstLater( authenticationViewModel - .doctorProfile.doctorName + .doctorProfile!.doctorName! .replaceAll("DR.", "") .toLowerCase()), fontWeight: FontWeight.w700, @@ -104,7 +104,7 @@ class _AppDrawerState extends State { padding: EdgeInsets.only(top: 0), child: AppText( authenticationViewModel - .doctorProfile?.clinicDescription, + .doctorProfile!.clinicDescription!, fontWeight: FontWeight.w500, color: Color(0xFF2E303A), fontSize: 16, @@ -128,7 +128,8 @@ class _AppDrawerState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AddRescheduleLeaveScreen(), + builder: (context) => + AddRescheduleLeaveScreen(), settings: RouteSettings( name: 'AddRescheduleLeaveScreen') // MyReferredPatient(), diff --git a/lib/widgets/shared/app_expandable_notifier.dart b/lib/widgets/shared/app_expandable_notifier.dart index 9244f536..00ac0fe0 100644 --- a/lib/widgets/shared/app_expandable_notifier.dart +++ b/lib/widgets/shared/app_expandable_notifier.dart @@ -1,12 +1,13 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:expandable/expandable.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; class AppExpandableNotifier extends StatelessWidget { final Widget headerWid; final Widget bodyWid; - AppExpandableNotifier({this.headerWid, this.bodyWid}); + AppExpandableNotifier({required this.headerWid, required this.bodyWid}); @override Widget build(BuildContext context) { @@ -55,4 +56,9 @@ class AppExpandableNotifier extends StatelessWidget { initialExpanded: true, ); } + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(DiagnosticsProperty('headerWid', headerWid)); + } } diff --git a/lib/widgets/shared/app_loader_widget.dart b/lib/widgets/shared/app_loader_widget.dart index 6f6e27d9..e8a26f7a 100644 --- a/lib/widgets/shared/app_loader_widget.dart +++ b/lib/widgets/shared/app_loader_widget.dart @@ -3,10 +3,11 @@ import 'package:flutter/material.dart'; import 'loader/gif_loader_container.dart'; class AppLoaderWidget extends StatefulWidget { - AppLoaderWidget({Key key, this.title, this.containerColor}) : super(key: key); + AppLoaderWidget({Key? key, this.title, this.containerColor}) + : super(key: key); - final String title; - final Color containerColor; + final String? title; + final Color? containerColor; @override _AppLoaderWidgetState createState() => new _AppLoaderWidgetState(); diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index c214a040..5530e3de 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -12,16 +12,16 @@ import 'network_base_view.dart'; class AppScaffold extends StatelessWidget { final String appBarTitle; - final Widget body; + final Widget? body; final bool isLoading; final bool isShowAppBar; - final BaseViewModel baseViewModel; - final Widget bottomSheet; - final Color backgroundColor; - final Widget appBar; - final Widget drawer; - final Widget bottomNavigationBar; - final String subtitle; + final BaseViewModel? baseViewModel; + final Widget? bottomSheet; + final Color? backgroundColor; + final Widget? appBar; + final Widget? drawer; + final Widget? bottomNavigationBar; + final String? subtitle; final bool isHomeIcon; final bool extendBody; @@ -49,62 +49,60 @@ class AppScaffold extends StatelessWidget { FocusScope.of(context).requestFocus(new FocusNode()); }, child: Scaffold( - backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor - , + backgroundColor: + backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, drawer: drawer, extendBody: extendBody, bottomNavigationBar: bottomNavigationBar, - appBar: isShowAppBar - ? appBar ?? - AppBar( - elevation: 0, - backgroundColor: Colors.white, - //HexColor('#515B5D'), - textTheme: TextTheme( - headline6: TextStyle( - color: Colors.black87, - fontSize: 16.8, - )), - title: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text(appBarTitle.toUpperCase()), - if (subtitle != null) - Text( - subtitle, - style: TextStyle(fontSize: 12, color: Colors.red), - ), - ], - ), - leading: Builder(builder: (BuildContext context) { - return IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ); - }), - centerTitle: true, - actions: [ - isHomeIcon - ? IconButton( - icon: Icon(DoctorApp.home_icon_active), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pushNamedAndRemoveUntil( - context, HOME, (r) => false), - ) - : SizedBox() + appBar: isShowAppBar && appBar != null + ? appBar as PreferredSizeWidget + : AppBar( + elevation: 0, + backgroundColor: Colors.white, + //HexColor('#515B5D'), + titleTextStyle: TextStyle( + color: Colors.black87, + fontSize: 16.8, + ), + title: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text(appBarTitle.toUpperCase()), + if (subtitle != null) + Text( + subtitle!, + style: TextStyle(fontSize: 12, color: Colors.red), + ), ], - ) - : null, + ), + leading: Builder(builder: (BuildContext context) { + return IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ); + }), + centerTitle: true, + actions: [ + isHomeIcon + ? IconButton( + icon: Icon(DoctorApp.home_icon_active), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pushNamedAndRemoveUntil( + context, HOME, (r) => false), + ) + : SizedBox() + ], + ), bottomSheet: bottomSheet, body: projectProvider.isInternetConnection ? baseViewModel != null ? NetworkBaseView( - baseViewModel: baseViewModel, - child: body, + baseViewModel: baseViewModel!, + child: body!, ) : Stack( - children: [body, buildAppLoaderWidget(isLoading)]) + children: [body!, buildAppLoaderWidget(isLoading)]) : Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 006c1499..be63ce09 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -5,31 +5,31 @@ import 'package:hexcolor/hexcolor.dart'; class AppText extends StatefulWidget { final String text; - final String variant; + final String? variant; final Color color; - final FontWeight fontWeight; - final double fontSize; - final double fontHeight; + final FontWeight? fontWeight; + final double? fontSize; + final double? fontHeight; final String fontFamily; final int maxLength; final bool italic; - final double margin; + final double? margin; final double marginTop; final double marginRight; final double marginBottom; final double marginLeft; - final double letterSpacing; - final TextAlign textAlign; + final double? letterSpacing; + final TextAlign? textAlign; final bool bold; final bool regular; final bool medium; - final int maxLines; + final int? maxLines; final bool readMore; - final String style; + final String? style; final bool allowExpand; final bool visibility; - final TextOverflow textOverflow; - final TextDecoration textDecoration; + final TextOverflow? textOverflow; + final TextDecoration? textDecoration; final bool isCopyable; AppText( @@ -48,9 +48,9 @@ class AppText extends StatefulWidget { this.marginBottom = 0, this.marginLeft = 0, this.textAlign, - this.bold, - this.regular, - this.medium, + this.bold = false, + this.regular = false, + this.medium = false, this.maxLines, this.readMore = false, this.style, @@ -98,7 +98,7 @@ class _AppTextState extends State { return GestureDetector( child: Container( margin: widget.margin != null - ? EdgeInsets.all(widget.margin) + ? EdgeInsets.all(widget.margin!) : EdgeInsets.only( top: widget.marginTop, right: widget.marginRight, @@ -142,7 +142,7 @@ class _AppTextState extends State { }); }, child: Text(hidden ? "Read More" : "Read less", - style: _getFontStyle().copyWith( + style: _getFontStyle()!.copyWith( color: HexColor('#FF0000'), fontWeight: FontWeight.w800, fontFamily: "Poppins", @@ -165,7 +165,9 @@ class _AppTextState extends State { if (widget.isCopyable) { return Theme( data: ThemeData( - textSelectionColor: Colors.lightBlueAccent, + textSelectionTheme: TextSelectionThemeData( + selectionColor: Colors.lightBlueAccent, + ), ), child: Container( child: SelectableText( @@ -184,7 +186,7 @@ class _AppTextState extends State { // : null, maxLines: widget.maxLines ?? null, style: widget.style != null - ? _getFontStyle().copyWith( + ? _getFontStyle()!.copyWith( fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), @@ -214,13 +216,13 @@ class _AppTextState extends State { : text.length)), textAlign: widget.textAlign, overflow: widget.maxLines != null - ? ((widget.maxLines > 1) + ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null - ? _getFontStyle().copyWith( + ? _getFontStyle()!.copyWith( fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), @@ -239,30 +241,30 @@ class _AppTextState extends State { } } - TextStyle _getFontStyle() { + TextStyle? _getFontStyle() { switch (widget.style) { case "headline2": - return Theme.of(context).textTheme.headline2; + return Theme.of(context).textTheme.displayMedium; case "headline3": - return Theme.of(context).textTheme.headline3; + return Theme.of(context).textTheme.displaySmall; case "headline4": - return Theme.of(context).textTheme.headline4; + return Theme.of(context).textTheme.headlineMedium; case "headline5": - return Theme.of(context).textTheme.headline5; + return Theme.of(context).textTheme.headlineSmall; case "headline6": - return Theme.of(context).textTheme.headline6; + return Theme.of(context).textTheme.titleLarge; case "bodyText2": - return Theme.of(context).textTheme.bodyText2; + return Theme.of(context).textTheme.bodyMedium; case "bodyText_15": - return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0); + return Theme.of(context).textTheme.bodyMedium!.copyWith(fontSize: 15.0); case "bodyText1": - return Theme.of(context).textTheme.bodyText1; + return Theme.of(context).textTheme.bodyLarge; case "caption": - return Theme.of(context).textTheme.caption; + return Theme.of(context).textTheme.bodySmall; case "overline": - return Theme.of(context).textTheme.overline; + return Theme.of(context).textTheme.labelSmall; case "button": - return Theme.of(context).textTheme.button; + return Theme.of(context).textTheme.labelLarge; default: return TextStyle(); } @@ -301,7 +303,7 @@ class _AppTextState extends State { case "date": return 24.0; default: - return SizeConfig.textMultiplier * 2; + return SizeConfig.textMultiplier! * 2; } } @@ -347,7 +349,7 @@ class _AppTextState extends State { return FontWeight.w500; } } else { - return null; + return FontWeight.normal; } } } diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index 94ac581f..d0ec2e3f 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -12,7 +12,8 @@ class BottomNavBar extends StatefulWidget { DashboardViewModel dashboardViewModel = DashboardViewModel(); - BottomNavBar({Key key, this.changeIndex, this.index}) : super(key: key); + BottomNavBar({Key? key, required this.changeIndex, required this.index}) + : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 5fcba7be..3e142987 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -6,16 +6,17 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:badges/badges.dart' as badge; class BottomNavigationItem extends StatelessWidget { - final IconData icon; - final IconData activeIcon; - final ValueChanged changeIndex; - final int index; - final int currentIndex; - final String name; - final DashboardViewModel dashboardViewModel; - final String svgPath; + final IconData? icon; + final IconData? activeIcon; + final ValueChanged? changeIndex; + final int? index; + final int? currentIndex; + final String? name; + final DashboardViewModel? dashboardViewModel; + final String? svgPath; BottomNavigationItem( {this.icon, @@ -37,7 +38,7 @@ class BottomNavigationItem extends StatelessWidget { child: InkWell( highlightColor: Colors.transparent, splashColor: Colors.transparent, - onTap: () => changeIndex(currentIndex), + onTap: () => changeIndex!(currentIndex!), child: Stack( alignment: AlignmentDirectional.center, children: [ @@ -58,7 +59,7 @@ class BottomNavigationItem extends StatelessWidget { ), Container( child: SvgPicture.asset( - svgPath, + svgPath!, width: SizeConfig.widthMultiplier! * (10), height: SizeConfig.getHeightMultiplier( height: SizeConfig.heightMultiplier! * @@ -86,20 +87,23 @@ class BottomNavigationItem extends StatelessWidget { ], ), if (currentIndex == 3 && - dashboardViewModel.notRepliedCount != 0) + dashboardViewModel!.notRepliedCount != 0) Positioned( right: 18.0, bottom: 40.0, - child: Badge( - toAnimate: false, + child: badge.Badge( + badgeAnimation: + badge.BadgeAnimation.fade(toAnimate: false), position: BadgePosition.topEnd(), - shape: BadgeShape.circle, - badgeColor: Colors.red[800], - borderRadius: BorderRadius.circular(8), + badgeStyle: badge.BadgeStyle( + shape: BadgeShape.circle, + badgeColor: Colors.red[800]!, + borderRadius: BorderRadius.circular(8), + ), badgeContent: Container( // padding: EdgeInsets.all(2.0), child: AppText( - dashboardViewModel.notRepliedCount.toString(), + dashboardViewModel!.notRepliedCount.toString(), color: Colors.white, fontSize: 12.0), ), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index 7090169e..2b30e49c 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -10,9 +10,9 @@ import '../app_texts_widget.dart'; class AppButton extends StatefulWidget { final GestureTapCallback onPressed; final String title; - final IconData iconData; - final Widget icon; - final Color color; + final IconData? iconData; + final Widget? icon; + final Color? color; double fontSize; final double padding; final Color fontColor; @@ -27,12 +27,12 @@ class AppButton extends StatefulWidget { final double height; AppButton({ - @required this.onPressed, - this.title, + required this.onPressed, + this.title = '', this.iconData, this.icon, this.color, - this.fontSize, + this.fontSize = 15, this.padding = 8, this.loading = false, this.disabled = false, @@ -42,8 +42,8 @@ class AppButton extends StatefulWidget { this.hPadding = 0, this.radius = 8.0, this.hasBorder = false, - this.borderColor, - this.height, + this.borderColor = Colors.white, + this.height = 5, }); _AppButtonState createState() => _AppButtonState(); @@ -54,12 +54,21 @@ class _AppButtonState extends State { Widget build(BuildContext context) { if (widget.fontSize == null) { widget.fontSize = SizeConfig.getHeightMultiplier() * - (SizeConfig.isHeightVeryShort ? 2.1 :SizeConfig.isHeightShort?1.8: 1.7); + (SizeConfig.isHeightVeryShort + ? 2.1 + : SizeConfig.isHeightShort + ? 1.8 + : 1.7); } return Container( // height: MediaQuery.of(context).size.height * 0.075, - height: widget.height?? SizeConfig.heightMultiplier! * - (SizeConfig.isHeightVeryShort ? 6 :SizeConfig.isHeightShort?5.5: 5), + height: widget.height ?? + SizeConfig.heightMultiplier! * + (SizeConfig.isHeightVeryShort + ? 6 + : SizeConfig.isHeightShort + ? 5.5 + : 5), child: IgnorePointer( ignoring: widget.loading || widget.disabled, child: RawMaterialButton( @@ -103,7 +112,7 @@ class _AppButtonState extends State { child: CircularProgressIndicator( backgroundColor: Colors.white, valueColor: AlwaysStoppedAnimation( - Colors.grey[300], + Colors.grey[300]!, ), ), ), diff --git a/lib/widgets/shared/buttons/button_bottom_sheet.dart b/lib/widgets/shared/buttons/button_bottom_sheet.dart index 8de17cd1..0b50faec 100644 --- a/lib/widgets/shared/buttons/button_bottom_sheet.dart +++ b/lib/widgets/shared/buttons/button_bottom_sheet.dart @@ -5,9 +5,9 @@ import 'app_buttons_widget.dart'; class ButtonBottomSheet extends StatelessWidget { final GestureTapCallback onPressed; final String title; - final IconData iconData; - final Widget icon; - final Color color; + final IconData? iconData; + final Widget? icon; + final Color? color; final double fontSize; final double padding; final Color fontColor; @@ -21,8 +21,8 @@ class ButtonBottomSheet extends StatelessWidget { final double hPadding; ButtonBottomSheet({ - @required this.onPressed, - this.title, + required this.onPressed, + this.title = '', this.iconData, this.icon, this.color, @@ -36,7 +36,7 @@ class ButtonBottomSheet extends StatelessWidget { this.hPadding = 0, this.radius = 8.0, this.hasBorder = false, - this.borderColor, + this.borderColor = Colors.white, }); @override diff --git a/lib/widgets/shared/card_with_bgNew_widget.dart b/lib/widgets/shared/card_with_bgNew_widget.dart index 333d82e3..a1e1d6e2 100644 --- a/lib/widgets/shared/card_with_bgNew_widget.dart +++ b/lib/widgets/shared/card_with_bgNew_widget.dart @@ -12,7 +12,7 @@ import 'package:hexcolor/hexcolor.dart'; class CardWithBgWidgetNew extends StatelessWidget { final Widget widget; - CardWithBgWidgetNew({@required this.widget}); + CardWithBgWidgetNew({required this.widget}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index 9f45c187..6aa154cb 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -5,14 +5,14 @@ import 'package:provider/provider.dart'; class CardWithBgWidget extends StatelessWidget { final Widget widget; - final Color bgColor; + final Color? bgColor; final bool hasBorder; final double padding; final double marginLeft; final double marginSymmetric; CardWithBgWidget( - {@required this.widget, + {required this.widget, this.bgColor, this.hasBorder = true, this.padding = 15.0, diff --git a/lib/widgets/shared/dialogs/ShowImageDialog.dart b/lib/widgets/shared/dialogs/ShowImageDialog.dart index 8ef4513f..f1b11985 100644 --- a/lib/widgets/shared/dialogs/ShowImageDialog.dart +++ b/lib/widgets/shared/dialogs/ShowImageDialog.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; class ShowImageDialog extends StatelessWidget { final String imageUrl; - const ShowImageDialog({Key key, this.imageUrl}) : super(key: key); + const ShowImageDialog({Key? key, required this.imageUrl}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index ee2cd6e7..9a16fa24 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -16,14 +16,14 @@ class ListSelectDialog extends StatefulWidget { final String hintSearchText; ListSelectDialog({ - @required this.list, - @required this.attributeName, - @required this.attributeValueId, - @required this.okText, - @required this.okFunction, - this.searchWidget, + required this.list, + required this.attributeName, + required this.attributeValueId, + required this.okText, + required this.okFunction, + this.searchWidget = const SizedBox(), this.usingSearch = false, - this.hintSearchText, + this.hintSearchText = '', }); @override @@ -46,12 +46,12 @@ class _ListSelectDialogState extends State { } showAlertDialog(BuildContext context) { - Widget cancelButton = FlatButton( + Widget cancelButton = ElevatedButton( child: Text(TranslationBase.of(context).cancel), onPressed: () { Navigator.of(context).pop(); }); - Widget continueButton = FlatButton( + Widget continueButton = ElevatedButton( child: Text(this.widget.okText), onPressed: () { Navigator.of(context).pop(); @@ -80,7 +80,7 @@ class _ListSelectDialogState extends State { decoration: Utils.textFieldSelectorDecoration( widget.hintSearchText ?? TranslationBase.of(context).search, - null, + "", false, suffixIcon: Icon( Icons.search, @@ -97,8 +97,11 @@ class _ListSelectDialogState extends State { children: [ ...items .map((item) => RadioListTile( - title: Text("${Utils.convertToTitleCase(item[widget.attributeName].toString())}"), - groupValue: Utils.convertToTitleCase(widget.selectedValue[widget.attributeValueId].toString()), + title: Text( + "${Utils.convertToTitleCase(item[widget.attributeName].toString())}"), + groupValue: Utils.convertToTitleCase(widget + .selectedValue[widget.attributeValueId] + .toString()), value: item[widget.attributeValueId].toString(), activeColor: AppGlobal.appRedColor, selected: item[widget.attributeValueId] diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 4c4eb8f0..cb277121 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -12,13 +12,13 @@ class MasterKeyDailog extends StatefulWidget { final List list; final okText; final Function(MasterKeyModel) okFunction; - MasterKeyModel selectedValue; + MasterKeyModel? selectedValue; final bool isICD; MasterKeyDailog( - {@required this.list, - @required this.okText, - @required this.okFunction, + {required this.list, + required this.okText, + required this.okFunction, this.selectedValue, this.isICD = false}); @@ -41,7 +41,7 @@ class _MasterKeyDailogState extends State { showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { // set up the buttons - Widget cancelButton = FlatButton( + Widget cancelButton = ElevatedButton( child: AppText( TranslationBase.of(context).cancel, color: Colors.grey, @@ -51,7 +51,7 @@ class _MasterKeyDailogState extends State { onPressed: () { Navigator.of(context).pop(); }); - Widget continueButton = FlatButton( + Widget continueButton = ElevatedButton( child: AppText( this.widget.okText, color: Colors.grey, @@ -59,7 +59,7 @@ class _MasterKeyDailogState extends State { (SizeConfig.isWidthLarge ? 3.5 : 5), ), onPressed: () { - this.widget.okFunction(widget.selectedValue); + this.widget.okFunction(widget.selectedValue!); Navigator.of(context).pop(); }); // set up the AlertDialog @@ -87,17 +87,17 @@ class _MasterKeyDailogState extends State { (widget.isICD ? '/${item.code}' : ''), ), groupValue: widget.isICD - ? widget.selectedValue.code.toString() - : widget.selectedValue.id.toString(), + ? widget.selectedValue!.code.toString() + : widget.selectedValue!.id.toString(), value: widget.isICD - ? widget.selectedValue.code.toString() + ? widget.selectedValue!.code.toString() : item.id.toString(), activeColor: Colors.blue.shade700, selected: widget.isICD ? item.code.toString() == - widget.selectedValue.code.toString() + widget.selectedValue!.code.toString() : item.id.toString() == - widget.selectedValue.id.toString(), + widget.selectedValue!.id.toString(), onChanged: (val) { setState(() { widget.selectedValue = item; diff --git a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart index e528f2b5..a4c3ac95 100644 --- a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart +++ b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart @@ -1,3 +1,5 @@ +import 'dart:html'; + import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:flutter/material.dart'; @@ -10,11 +12,11 @@ class ListSelectDialog extends StatefulWidget { dynamic selectedValue; ListSelectDialog( - {@required this.list, - @required this.attributeName, - @required this.attributeValueId, - @required this.okText, - @required this.okFunction}); + {required this.list, + required this.attributeName, + required this.attributeValueId, + required this.okText, + required this.okFunction}); @override _ListSelectDialogState createState() => _ListSelectDialogState(); @@ -34,12 +36,12 @@ class _ListSelectDialogState extends State { showAlertDialog(BuildContext context) { // set up the buttons - Widget cancelButton = FlatButton( + Widget cancelButton = ElevatedButton( child: Text(TranslationBase.of(context).cancel), onPressed: () { Navigator.of(context).pop(); }); - Widget continueButton = FlatButton( + Widget continueButton = ElevatedButton( child: Text(this.widget.okText), onPressed: () { this.widget.okFunction(widget.selectedValue); diff --git a/lib/widgets/shared/divider_with_spaces_around.dart b/lib/widgets/shared/divider_with_spaces_around.dart index d757edcd..2b5e91e0 100644 --- a/lib/widgets/shared/divider_with_spaces_around.dart +++ b/lib/widgets/shared/divider_with_spaces_around.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; class DividerWithSpacesAround extends StatelessWidget { DividerWithSpacesAround({ - Key key, + Key? key, this.height = 0, }); diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 337581ad..735c3792 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -12,15 +12,15 @@ import 'package:provider/provider.dart'; import '../../config/size_config.dart'; class DoctorCard extends StatelessWidget { - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final Function? onTap; final bool isPrescriptions; - final String clinic; + final String? clinic; final bool isShowEye; final bool isShowTime; final bool isNoMargin; @@ -56,7 +56,7 @@ class DoctorCard extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(15.0), child: InkWell( - onTap: (isShowEye) ? onTap : null, + onTap: (isShowEye) ? onTap!() : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -73,16 +73,16 @@ class DoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), if (!isPrescriptions && isShowTime) AppText( - '${AppDateUtils.getHour(appointmentDate)}', + '${AppDateUtils.getHour(appointmentDate!)}', fontWeight: FontWeight.w600, - color: Colors.grey[700], + color: Colors.grey[700]!, fontSize: 14, ), ], @@ -95,7 +95,7 @@ class DoctorCard extends StatelessWidget { children: [ Container( child: LargeAvatar( - name: doctorName, + name: doctorName!, url: profileUrl, ), width: 55, @@ -114,14 +114,14 @@ class DoctorCard extends StatelessWidget { if (orderNo != null && !isPrescriptions) CustomRow( label: TranslationBase.of(context).orderNo , - value: orderNo, + value: orderNo!, valueSize: 13, labelSize: 13, ), if (invoiceNO != null && !isPrescriptions) CustomRow( label: TranslationBase.of(context).invoiceNo , - value: invoiceNO, + value: invoiceNO!, valueSize: 13, labelSize: 13, ), @@ -130,7 +130,7 @@ class DoctorCard extends StatelessWidget { label: TranslationBase.of(context).clinic + ": ", - value: clinic, + value: clinic!, valueSize: 13, labelSize: 13, ), @@ -138,7 +138,7 @@ class DoctorCard extends StatelessWidget { CustomRow( label: TranslationBase.of(context).branch + ": ", - value: branch, + value: branch!, valueSize: 13, labelSize: 13, ), diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index 7ddcb6da..6755fd04 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -12,18 +12,18 @@ import 'package:provider/provider.dart'; import '../../config/config.dart'; class DoctorCardInsurance extends StatelessWidget { - final String doctorName; - final String approvalNo; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; + final String? doctorName; + final String? approvalNo; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final Function? onTap; final bool isInsurance; - final String clinic; - final String approvalStatus; - final String patientOut; - final String branch2; + final String? clinic; + final String? approvalStatus; + final String? patientOut; + final String? branch2; DoctorCardInsurance( {this.doctorName, @@ -75,7 +75,7 @@ class DoctorCardInsurance extends StatelessWidget { left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0), child: InkWell( - onTap: onTap, + onTap: onTap!(), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -119,7 +119,7 @@ class DoctorCardInsurance extends StatelessWidget { children: [ Expanded( child: AppText( - doctorName, + doctorName!, fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600, @@ -131,7 +131,7 @@ class DoctorCardInsurance extends StatelessWidget { children: [ Container( child: LargeAvatar( - name: doctorName, + name: doctorName!, url: profileUrl, ), width: 55, @@ -147,33 +147,33 @@ class DoctorCardInsurance extends StatelessWidget { if (orderNo != null && !isInsurance) CustomRow( label: 'Invoice:', - value: invoiceNO, + value: invoiceNO!, ), if (invoiceNO != null && !isInsurance) CustomRow( label: 'Invoice:', - value: invoiceNO, + value: invoiceNO!, ), if (isInsurance) CustomRow( label: TranslationBase.of(context).clinic + ": ", - value: clinic, + value: clinic!, ), if (branch2 != null) CustomRow( label: TranslationBase.of(context).branch + ": ", - value: branch2, + value: branch2!, ), if (approvalNo != null) CustomRow( label: TranslationBase.of(context) .approvalNo + ": ", - value: approvalNo, + value: approvalNo!, ), ]), ), diff --git a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart index 17b9b5e6..1c7db539 100644 --- a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart +++ b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; class DrAppCircularProgressIndeicator extends StatelessWidget { const DrAppCircularProgressIndeicator({ - Key key, + Key? key, }) : super(key: key); @override diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 46497e17..ae9f0168 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -8,9 +8,9 @@ import '../shared/app_texts_widget.dart'; class DrawerItem extends StatefulWidget { final String title; final String subTitle; - final IconData icon; - final Color color; - final String assetLink; + final IconData? icon; + final Color? color; + final String? assetLink; DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink}); @@ -31,13 +31,13 @@ class _DrawerItemState extends State { Container( height: 20, width: 20, - child: Image.asset(widget.assetLink), + child: Image.asset(widget.assetLink!), ), if (widget.assetLink == null) Icon( widget.icon, color: widget.color ?? Colors.black87, - size: SizeConfig.imageSizeMultiplier * 5, + size: SizeConfig.imageSizeMultiplier! * 5, ), Expanded( child: Column( diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index c6a075cb..916cb7d0 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -5,8 +5,8 @@ import '../app_texts_widget.dart'; class ErrorMessage extends StatelessWidget { const ErrorMessage({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); final String error; diff --git a/lib/widgets/shared/expandable-widget-header-body.dart b/lib/widgets/shared/expandable-widget-header-body.dart index e5f06b7a..4d6864d9 100644 --- a/lib/widgets/shared/expandable-widget-header-body.dart +++ b/lib/widgets/shared/expandable-widget-header-body.dart @@ -2,15 +2,15 @@ import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; class HeaderBodyExpandableNotifier extends StatefulWidget { - final Widget headerWidget; - final Widget bodyWidget; - final Widget collapsed; + final Widget? headerWidget; + final Widget? bodyWidget; + final Widget? collapsed; final bool isExpand; bool expandFlag = false; var controller = new ExpandableController(); HeaderBodyExpandableNotifier( - {this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand}); + {this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand = false}); @override _HeaderBodyExpandableNotifierState createState() => @@ -50,7 +50,7 @@ class _HeaderBodyExpandableNotifierState ), // header: widget.headerWidget, collapsed: Container(), - expanded: widget.bodyWidget, + expanded: widget.bodyWidget!, builder: (_, collapsed, expanded) { return Padding( padding: EdgeInsets.only(left: 0, right: 0, bottom: 0), diff --git a/lib/widgets/shared/loader/gif_loader_container.dart b/lib/widgets/shared/loader/gif_loader_container.dart index eb9f2511..6c6fca9c 100644 --- a/lib/widgets/shared/loader/gif_loader_container.dart +++ b/lib/widgets/shared/loader/gif_loader_container.dart @@ -1,5 +1,5 @@ import 'package:flutter/cupertino.dart'; -import 'package:flutter_gifimage/flutter_gifimage.dart'; +import 'package:flutter_gif/flutter_gif.dart'; class GifLoaderContainer extends StatefulWidget { @override @@ -8,11 +8,11 @@ class GifLoaderContainer extends StatefulWidget { class _GifLoaderContainerState extends State with TickerProviderStateMixin { - GifController controller1; + late FlutterGifController controller1; @override void initState() { - controller1 = GifController(vsync: this); + controller1 = FlutterGifController(vsync: this); WidgetsBinding.instance.addPostFrameCallback((_) { controller1.repeat( diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index bcbd84ad..f58163ee 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -13,17 +13,17 @@ import 'app_texts_widget.dart'; import 'text_fields/app-textfield-custom.dart'; class MasterKeyCheckboxSearchWidget extends StatefulWidget { - final SOAPViewModel model; - final Function addSelectedHistories; - final Function(MasterKeyModel) removeHistory; - final Function(MasterKeyModel) addHistory; - final bool Function(MasterKeyModel) isServiceSelected; - final List masterList; - final String buttonName; - final String hintSearchText; + final SOAPViewModel? model; + final Function? addSelectedHistories; + final Function(MasterKeyModel)? removeHistory; + final Function(MasterKeyModel)? addHistory; + final bool Function(MasterKeyModel)? isServiceSelected; + final List? masterList; + final String? buttonName; + final String? hintSearchText; MasterKeyCheckboxSearchWidget( - {Key key, + {Key? key, this.model, this.addSelectedHistories, this.removeHistory, @@ -46,7 +46,7 @@ class _MasterKeyCheckboxSearchWidgetState @override void initState() { - items.addAll(widget.masterList); + items.addAll(widget.masterList!); super.initState(); } @@ -86,10 +86,12 @@ class _MasterKeyCheckboxSearchWidgetState filterSearchResults(value); }, suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.black, - )), + icon: Icon( + Icons.search, + color: Colors.black, + ), + onPressed: () {}, + ), ), // SizedBox(height: 15,), @@ -103,10 +105,11 @@ class _MasterKeyCheckboxSearchWidgetState InkWell( onTap: () { setState(() { - if (widget.isServiceSelected(historyInfo)) { - widget.removeHistory(historyInfo); + if (widget + .isServiceSelected!(historyInfo)) { + widget.removeHistory!(historyInfo); } else { - widget.addHistory(historyInfo); + widget.addHistory!(historyInfo); } }); }, @@ -114,15 +117,16 @@ class _MasterKeyCheckboxSearchWidgetState children: [ Checkbox( value: widget - .isServiceSelected(historyInfo), + .isServiceSelected!(historyInfo), activeColor: Colors.red[800], - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isServiceSelected( + if (widget.isServiceSelected!( historyInfo)) { - widget.removeHistory(historyInfo); + widget + .removeHistory!(historyInfo); } else { - widget.addHistory(historyInfo); + widget.addHistory!(historyInfo); } }); }), @@ -130,9 +134,9 @@ class _MasterKeyCheckboxSearchWidgetState child: AppText( projectViewModel.isArabic ? historyInfo.nameAr != "" - ? historyInfo.nameAr - : historyInfo.nameEn - : historyInfo.nameEn, + ? historyInfo.nameAr! + : historyInfo.nameEn! + : historyInfo.nameEn!, color: Color(0xFF575757), fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -164,12 +168,12 @@ class _MasterKeyCheckboxSearchWidgetState void filterSearchResults(String query) { List dummySearchList = []; - dummySearchList.addAll(widget.masterList); + dummySearchList.addAll(widget.masterList!); if (query.isNotEmpty) { List dummyListData = []; dummySearchList.forEach((item) { - if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || - item.nameEn.toLowerCase().contains(query.toLowerCase())) { + if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || + item.nameEn!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); @@ -181,7 +185,7 @@ class _MasterKeyCheckboxSearchWidgetState } else { setState(() { items.clear(); - items.addAll(widget.masterList); + items.addAll(widget.masterList!); }); } } diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index 5aeb0470..a11b2312 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -10,7 +10,7 @@ class NetworkBaseView extends StatelessWidget { final BaseViewModel baseViewModel; final Widget child; - NetworkBaseView({Key key, this.baseViewModel, this.child}); + NetworkBaseView({Key? key, required this.baseViewModel, required this.child}); @override Widget build(BuildContext context) { @@ -32,7 +32,7 @@ class NetworkBaseView extends StatelessWidget { break; case ViewState.Error: return ErrorMessage( - error: baseViewModel.error, + error: baseViewModel.error!, ); break; } diff --git a/lib/widgets/shared/profile_image_widget.dart b/lib/widgets/shared/profile_image_widget.dart index a1f2c9cd..d066a9bc 100644 --- a/lib/widgets/shared/profile_image_widget.dart +++ b/lib/widgets/shared/profile_image_widget.dart @@ -10,13 +10,13 @@ import 'package:flutter/material.dart'; *@desc: Profile Image Widget class */ class ProfileImageWidget extends StatelessWidget { - String url; - String name; - String des; - double height; - double width; - Color color; - double fontsize; + String? url; + String? name; + String? des; + double? height; + double? width; + Color? color; + double? fontsize; ProfileImageWidget( {this.url, @@ -36,12 +36,12 @@ class ProfileImageWidget extends StatelessWidget { height: height, width: width, child: CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, + radius: SizeConfig.imageSizeMultiplier! * 12, // radius: (52) child: ClipRRect( borderRadius: BorderRadius.circular(50), child: Image.network( - url, + url!, fit: BoxFit.fill, width: 700, ), @@ -56,19 +56,19 @@ class ProfileImageWidget extends StatelessWidget { name == null ? SizedBox() : AppText( - name, + name!, fontWeight: FontWeight.bold, fontSize: fontsize == null - ? SizeConfig.textMultiplier * 3.5 + ? SizeConfig.textMultiplier! * 3.5 : fontsize, - color: color, + color: color!, ), des == null ? SizedBox() : AppText( - des, + des!, fontSize: fontsize == null - ? SizeConfig.textMultiplier * 2.5 + ? SizeConfig.textMultiplier! * 2.5 : fontsize, ) ], diff --git a/lib/widgets/shared/rounded_container_widget.dart b/lib/widgets/shared/rounded_container_widget.dart index 25a23140..ee6bcd4f 100644 --- a/lib/widgets/shared/rounded_container_widget.dart +++ b/lib/widgets/shared/rounded_container_widget.dart @@ -5,7 +5,7 @@ class RoundedContainer extends StatefulWidget { final double height; final double raduis; final Color backgroundColor; - final EdgeInsets margin; + final EdgeInsets? margin; final double elevation; final bool showBorder; final Color borderColor; @@ -21,9 +21,9 @@ class RoundedContainer extends StatefulWidget { final double borderWidth; RoundedContainer( - {@required this.child, - this.width, - this.height, + {required this.child, + this.width = 0, + this.height = 0, this.raduis = 10, this.backgroundColor = Colors.white, this.margin, diff --git a/lib/widgets/shared/speech-text-popup.dart b/lib/widgets/shared/speech-text-popup.dart index fc3ff941..cfa10ed3 100644 --- a/lib/widgets/shared/speech-text-popup.dart +++ b/lib/widgets/shared/speech-text-popup.dart @@ -15,7 +15,7 @@ class SpeechToText { static stt.SpeechToText speech = stt.SpeechToText(); SpeechToText({ - @required this.context, + required this.context, }); showAlertDialog(BuildContext context) { @@ -44,7 +44,7 @@ typedef Disposer = void Function(); class MyStatefulBuilder extends StatefulWidget { const MyStatefulBuilder({ // @required this.builder, - @required this.dispose, + required this.dispose, }); //final StatefulWidgetBuilder builder; @@ -57,7 +57,7 @@ class MyStatefulBuilder extends StatefulWidget { class _MyStatefulBuilderState extends State { var event = RobotProvider(); var searchText; - static StreamSubscription streamSubscription; + late StreamSubscription streamSubscription; static var isClosed = false; @override @@ -136,7 +136,7 @@ class _MyStatefulBuilderState extends State { child: InkWell( child: Container( decoration: BoxDecoration( - border: Border.all(color: Colors.grey[300])), + border: Border.all(color: Colors.grey[300]!)), padding: EdgeInsets.all(5), child: AppText( 'Try Again', diff --git a/lib/widgets/shared/text_fields/TextFields.dart b/lib/widgets/shared/text_fields/TextFields.dart index bc4600b4..66f810c7 100644 --- a/lib/widgets/shared/text_fields/TextFields.dart +++ b/lib/widgets/shared/text_fields/TextFields.dart @@ -40,11 +40,11 @@ final _mobileFormatter = NumberTextInputFormatter(); class TextFields extends StatefulWidget { TextFields({ - Key key, + Key? key, this.type, this.hintText, this.suffixIcon, - this.autoFocus, + this.autoFocus = false, this.onChanged, this.initialValue, this.minLines, @@ -64,7 +64,7 @@ class TextFields extends StatefulWidget { this.borderOnlyError = false, this.onSaved, this.onSuffixTap, - this.readOnly: false, + this.readOnly = false, this.maxLength, this.prefixIcon, this.bare = false, @@ -83,26 +83,26 @@ class TextFields extends StatefulWidget { this.borderWidth = 1, }) : super(key: key); - final String hintText; - final String initialValue; - final String type; + final String? hintText; + final String? initialValue; + final String? type; final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final Function onTapTextFields; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; + final IconData? suffixIcon; + final Color? suffixIconColor; + final Icon? prefixIcon; + final VoidCallback? onTap; + final Function? onTapTextFields; + final TextEditingController? controller; + final TextInputType? keyboardType; + final FormFieldValidator? validator; + final Function? onSaved; + final Function? onSuffixTap; + final Function? onChanged; + final Function? onSubmit; final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; + final int? maxLength; + final int? minLines; + final int? maxLines; final bool maxLengthEnforced; final bool bare; final TextInputAction inputAction; @@ -110,16 +110,16 @@ class TextFields extends StatefulWidget { final FontWeight fontWeight; final bool keepPadding; final TextCapitalization textCapitalization; - final List inputFormatters; + final List? inputFormatters; final bool autoValidate; - final EdgeInsets padding; + final EdgeInsets? padding; final bool focus; final bool borderOnlyError; - final Color hintColor; - final Color fillColor; + final Color? hintColor; + final Color? fillColor; final bool hasBorder; final bool showLabelText; - Color borderColor; + Color? borderColor; final double borderRadius; final double borderWidth; bool hasLabelText; @@ -184,14 +184,14 @@ class _TextFieldsState extends State { default: if (widget.suffixIcon != null) return InkWell( - onTap: widget.onSuffixTap, + onTap: widget.onSuffixTap!(), child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); else - return null; + return SizedBox(); } } @@ -224,14 +224,14 @@ class _TextFieldsState extends State { child: Column( children: [ TextFormField( - onTap: widget.onTapTextFields, + onTap: widget.onTapTextFields!(), keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), // autovalidate: widget.autoValidate, textCapitalization: widget.textCapitalization, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null - ? widget.onSubmit + ? widget.onSubmit!() : (val) { _focusNode.nextFocus(); }) @@ -239,7 +239,7 @@ class _TextFieldsState extends State { textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, + // maxLengthEnforcement: widget.maxLengthEnforced, initialValue: widget.initialValue, onChanged: (value) { if (widget.showLabelText) { @@ -253,7 +253,7 @@ class _TextFieldsState extends State { }); } } - if (widget.onChanged != null) widget.onChanged(value); + if (widget.onChanged != null) widget.onChanged!(value); }, focusNode: _focusNode, maxLength: widget.maxLength ?? null, @@ -263,8 +263,8 @@ class _TextFieldsState extends State { obscureText: widget.type == "password" && !view ? true : false, autofocus: widget.autoFocus ?? false, validator: widget.validator, - onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText1.copyWith( + onSaved: widget.onSaved!(), + style: Theme.of(context).textTheme.bodyLarge!.copyWith( fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ @@ -328,7 +328,7 @@ class _TextFieldsState extends State { focusedBorder: OutlineInputBorder( borderSide: widget.hasBorder ? BorderSide( - color: widget.borderColor, width: widget.borderWidth) + color: widget.borderColor!, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder ? BorderRadius.circular( @@ -338,7 +338,7 @@ class _TextFieldsState extends State { disabledBorder: OutlineInputBorder( borderSide: widget.hasBorder ? BorderSide( - color: widget.borderColor, width: widget.borderWidth) + color: widget.borderColor!, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder ? BorderRadius.circular( @@ -347,7 +347,7 @@ class _TextFieldsState extends State { enabledBorder: OutlineInputBorder( borderSide: widget.hasBorder ? BorderSide( - color: widget.borderColor, width: widget.borderWidth) + color: widget.borderColor!, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder ? BorderRadius.circular( diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 1a17f315..d716370f 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -11,23 +11,23 @@ import '../app_texts_widget.dart'; class AppTextFieldCustom extends StatefulWidget { final double height; - final Function onClick; - final String hintText; - final TextEditingController controller; + final Function? onClick; + final String? hintText; + final TextEditingController? controller; final bool isTextFieldHasSuffix; final bool hasBorder; - final String dropDownText; - final IconButton suffixIcon; - final Color dropDownColor; + final String? dropDownText; + final IconButton? suffixIcon; + final Color? dropDownColor; final bool enabled; - final TextInputType inputType; + final TextInputType? inputType; final int minLines; final int maxLines; - final List inputFormatters; - final Function(String) onChanged; - final Function onFieldSubmitted; + final List? inputFormatters; + final Function(String)? onChanged; + final Function? onFieldSubmitted; - final String validationError; + final String? validationError; final bool isPrscription; final bool isSecure; final bool focus; @@ -91,10 +91,8 @@ class _AppTextFieldCustomState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - TextInputType localKeyboardType = widget.inputType ?? - (widget.maxLines == 1 - ? TextInputType.text - : TextInputType.multiline); + TextInputType localKeyboardType = widget.inputType ?? + (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline); return Column( children: [ @@ -113,7 +111,7 @@ class _AppTextFieldCustomState extends State { padding: EdgeInsets.only(top: 4.0, bottom: 0.0, left: 8.0, right: 8.0), child: InkWell( - onTap: widget.onClick ?? null, + onTap: widget.onClick!() ?? null, child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -128,13 +126,10 @@ class _AppTextFieldCustomState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - widget.hintText, + widget.hintText!, color: Color(0xFF2E303A), - fontSize: widget.isPrscription == false - ? 11.0 - : 0, + fontSize: widget.isPrscription == false ? 11.0 : 0, fontWeight: FontWeight.w600, letterSpacing: -0.44, fontFamily: 'Poppins', @@ -149,13 +144,18 @@ class _AppTextFieldCustomState extends State { focusNode: FocusNode(), autofocus: false, onKey: (rawKeyEvent) { - final isFormSkippedEnterEvent = rawKeyEvent is RawKeyDownEvent && - rawKeyEvent.isKeyPressed(LogicalKeyboardKey.enter); + final isFormSkippedEnterEvent = + rawKeyEvent is RawKeyDownEvent && + rawKeyEvent.isKeyPressed( + LogicalKeyboardKey.enter); - final needToInsertNewLine = isFormSkippedEnterEvent && - localKeyboardType == TextInputType.multiline; + final needToInsertNewLine = + isFormSkippedEnterEvent && + localKeyboardType == + TextInputType.multiline; if (needToInsertNewLine) { - TextEditingControllerHelper.insertText(widget.controller, '\n'); + TextEditingControllerHelper.insertText( + widget.controller!, '\n'); } }, child: TextFormField( @@ -166,9 +166,10 @@ class _AppTextFieldCustomState extends State { textAlignVertical: TextAlignVertical.top, decoration: TextFieldsUtils .textFieldSelectorDecoration( - widget.hintText, null, true), + widget.hintText!, "", true), style: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.7, + fontSize: + SizeConfig.textMultiplier! * 1.7, fontFamily: 'Poppins', color: Color(0xFF575757), fontWeight: FontWeight.w400, @@ -186,18 +187,19 @@ class _AppTextFieldCustomState extends State { onChanged: (value) { setState(() {}); if (widget.onChanged != null) { - widget.onChanged(value); + widget.onChanged!(value); } }, - onFieldSubmitted: widget.onFieldSubmitted, + onFieldSubmitted: + widget.onFieldSubmitted!(), obscureText: widget.isSecure), ), ) : AppText( - Utils.convertToTitleCase(widget.dropDownText), + Utils.convertToTitleCase(widget.dropDownText!), fontFamily: 'Poppins', color: Color(0xFF575757), - fontSize: SizeConfig.textMultiplier * 1.7, + fontSize: SizeConfig.textMultiplier! * 1.7, ), ], ), @@ -208,7 +210,7 @@ class _AppTextFieldCustomState extends State { ? Container( margin: EdgeInsets.only( bottom: widget.isSearchTextField - ? (widget.controller.text.isEmpty || + ? (widget.controller!.text.isEmpty || widget.controller == null) ? 10 : 25 @@ -228,8 +230,9 @@ class _AppTextFieldCustomState extends State { ), ), ), - if (widget.validationError != null && widget.validationError.isNotEmpty) - TextFieldsError(error: widget.validationError), + if (widget.validationError != null && + widget.validationError!.isNotEmpty) + TextFieldsError(error: widget.validationError!), ], ); } @@ -246,7 +249,7 @@ class TextEditingControllerHelper { final text = controller.text; final newText = - text.replaceRange(selection.start, selection.end, textToInsert); + text.replaceRange(selection.start, selection.end, textToInsert); controller.value = controller.value.copyWith( text: newText, selection: TextSelection.collapsed( @@ -254,4 +257,4 @@ class TextEditingControllerHelper { ), ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart index 10888c8e..6f8014a4 100644 --- a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart +++ b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart @@ -8,7 +8,7 @@ import 'app-textfield-custom.dart'; class AppTextFieldCustomSearch extends StatelessWidget { const AppTextFieldCustomSearch({ - Key key, + Key? key, this.onChangeFun, this.positionedChild, this.marginTop, @@ -18,34 +18,34 @@ class AppTextFieldCustomSearch extends StatelessWidget { this.inputFormatters, this.searchController, this.onFieldSubmitted, - this.hintText, this.height, + this.hintText, + this.height, }); - final TextEditingController searchController; + final TextEditingController? searchController; - final Function onChangeFun; - final Function onFieldSubmitted; + final Function? onChangeFun; + final Function? onFieldSubmitted; - final Widget positionedChild; - final IconButton suffixIcon; - final double marginTop; - final String validationError; - final String hintText; - - final TextInputType inputType; - final List inputFormatters; - final double height; + final Widget? positionedChild; + final IconButton? suffixIcon; + final double? marginTop; + final String? validationError; + final String? hintText; + final TextInputType? inputType; + final List? inputFormatters; + final double? height; @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop), + margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop!), child: Stack( children: [ AppTextFieldCustom( - height: height??0, + height: height ?? 0, hintText: hintText ?? TranslationBase.of(context).searchPatientName, isTextFieldHasSuffix: true, @@ -60,13 +60,13 @@ class AppTextFieldCustomSearch extends StatelessWidget { onPressed: () {}, ), controller: searchController, - onChanged: onChangeFun, + onChanged: onChangeFun!(), onFieldSubmitted: onFieldSubmitted, validationError: validationError), if (positionedChild != null) projectViewModel.isArabic - ? Positioned(left: 35, top: 5, child: positionedChild) - : Positioned(right: 35, top: 5, child: positionedChild) + ? Positioned(left: 35, top: 5, child: positionedChild!) + : Positioned(right: 35, top: 5, child: positionedChild!) ], ), ); diff --git a/lib/widgets/shared/text_fields/app_text_form_field.dart b/lib/widgets/shared/text_fields/app_text_form_field.dart index 655c6a9e..4ea520cb 100644 --- a/lib/widgets/shared/text_fields/app_text_form_field.dart +++ b/lib/widgets/shared/text_fields/app_text_form_field.dart @@ -6,22 +6,22 @@ import 'package:hexcolor/hexcolor.dart'; class AppTextFormField extends FormField { AppTextFormField( - {FormFieldSetter onSaved, - String inputFormatter, - FormFieldValidator validator, - ValueChanged onChanged, - GestureTapCallback onTap, + {FormFieldSetter? onSaved, + String? inputFormatter, + FormFieldValidator? validator, + ValueChanged? onChanged, + GestureTapCallback? onTap, bool obscureText = false, - TextEditingController controller, + TextEditingController? controller, bool autovalidate = true, - TextInputType textInputType, - String hintText, - FocusNode focusNode, + TextInputType? textInputType, + String? hintText, + FocusNode? focusNode, TextInputAction textInputAction = TextInputAction.done, - ValueChanged onFieldSubmitted, - IconButton prefix, - String labelText, - IconData suffixIcon, + ValueChanged? onFieldSubmitted, + IconButton? prefix, + String? labelText, + IconData? suffixIcon, bool readOnly = false, borderColor}) : super( @@ -53,13 +53,13 @@ class AppTextFormField extends FormField { hintText: hintText, suffixIcon: prefix, hintStyle: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.8, + fontSize: SizeConfig.textMultiplier! * 1.8, ), contentPadding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), labelText: labelText, labelStyle: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.7, + fontSize: SizeConfig.textMultiplier! * 1.7, ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(6)), @@ -83,7 +83,7 @@ class AppTextFormField extends FormField { ), state.hasError ? Text( - state.errorText, + state.errorText!, style: TextStyle(color: Colors.red), ) : Container() diff --git a/lib/widgets/shared/text_fields/auto_complete_text_field.dart b/lib/widgets/shared/text_fields/auto_complete_text_field.dart index 77d101f2..886ac264 100644 --- a/lib/widgets/shared/text_fields/auto_complete_text_field.dart +++ b/lib/widgets/shared/text_fields/auto_complete_text_field.dart @@ -8,9 +8,9 @@ class CustomAutoCompleteTextField extends StatelessWidget { final Widget child; const CustomAutoCompleteTextField({ - Key key, - this.isShowError, - this.child, + Key? key, + required this.isShowError, + required this.child, }) : super(key: key); @override diff --git a/lib/widgets/shared/text_fields/country_textfield_custom.dart b/lib/widgets/shared/text_fields/country_textfield_custom.dart index 3912159a..878f7dfd 100644 --- a/lib/widgets/shared/text_fields/country_textfield_custom.dart +++ b/lib/widgets/shared/text_fields/country_textfield_custom.dart @@ -8,17 +8,17 @@ import 'package:flutter/material.dart'; class CountryTextField extends StatefulWidget { final dynamic element; final String elementError; - final List elementList; - final String keyName; - final String keyId; - final String hintText; - final double width; - final Function(dynamic) okFunction; + final List? elementList; + final String? keyName; + final String? keyId; + final String? hintText; + final double? width; + final Function(dynamic)? okFunction; CountryTextField( - {Key key, - @required this.element, - @required this.elementError, + {Key? key, + required this.element, + required this.elementError, this.width, this.elementList, this.keyName, @@ -41,14 +41,14 @@ class _CountryTextfieldState extends State { ? () { Utils.hideKeyboard(context); ListSelectDialog dialog = ListSelectDialog( - list: widget.elementList, + list: widget.elementList!, attributeName: '${widget.keyName}', - attributeValueId: widget.elementList.length == 1 - ? widget.elementList[0]['${widget.keyId}'] + attributeValueId: widget.elementList!.length == 1 + ? widget.elementList![0]['${widget.keyId}'] : '${widget.keyId}', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) => - widget.okFunction(selectedValue), + widget.okFunction!(selectedValue), ); showDialog( barrierDismissible: false, @@ -61,14 +61,14 @@ class _CountryTextfieldState extends State { : null, child: AppTextFieldCustom( hintText: widget.hintText, - dropDownText: widget.elementList.length == 1 - ? widget.elementList[0]['${widget.keyName}'] + dropDownText: widget.elementList!.length == 1 + ? widget.elementList![0]['${widget.keyName}'] : widget.element != null ? widget.element['${widget.keyName}'] : null, isTextFieldHasSuffix: true, validationError: - widget.elementList.length != 1 ? widget.elementError : null, + widget.elementList!.length != 1 ? widget.elementError : null, enabled: false, ), ), diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index 041bd8a8..23400a01 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -14,13 +14,13 @@ import '../speech-text-popup.dart'; class HtmlRichEditor extends StatefulWidget { final String hint; - final String initialText; + final String? initialText; final double height; - final BoxDecoration decoration; + final BoxDecoration? decoration; final bool darkMode; final bool showBottomToolbar; - final List toolbar; - final HtmlEditorController controller; + final List? toolbar; + final HtmlEditorController? controller; HtmlRichEditor({ key, @@ -39,7 +39,7 @@ class HtmlRichEditor extends StatefulWidget { } class _HtmlRichEditorState extends State { - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); @@ -64,7 +64,7 @@ class _HtmlRichEditorState extends State { return Stack( children: [ HtmlEditor( - controller: widget.controller, + controller: widget.controller!, htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [ StyleButtons(), FontSettingButtons(), @@ -88,7 +88,7 @@ class _HtmlRichEditorState extends State { borderRadius: BorderRadius.all( Radius.circular(30.0), ), - border: Border.all(color: Colors.grey[200], width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), )), Positioned( @@ -146,12 +146,12 @@ class _HtmlRichEditorState extends State { void resultListener(result) async { recognizedWord = result.recognizedWords; event.setValue({"searchText": recognizedWord}); - String txt = await widget.controller.getText(); + String txt = await widget.controller!.getText(); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - widget.controller.setText(txt + recognizedWord); + widget.controller!.setText(txt + recognizedWord); }); } else { print(result.finalResult); diff --git a/lib/widgets/shared/text_fields/text_field_error.dart b/lib/widgets/shared/text_fields/text_field_error.dart index 9c781db0..b1ff9abd 100644 --- a/lib/widgets/shared/text_fields/text_field_error.dart +++ b/lib/widgets/shared/text_fields/text_field_error.dart @@ -6,8 +6,8 @@ import '../app_texts_widget.dart'; class TextFieldsError extends StatelessWidget { const TextFieldsError({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); final String error; @@ -30,7 +30,7 @@ class TextFieldsError extends StatelessWidget { child: AppText( error, fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.7, + fontSize: SizeConfig.textMultiplier! * 1.7, color: Colors.red.shade700, fontWeight: FontWeight.w700, ), diff --git a/lib/widgets/shared/text_fields/text_fields_utils.dart b/lib/widgets/shared/text_fields/text_fields_utils.dart index 23ae13a8..d68c2849 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -17,7 +17,7 @@ class TextFieldsUtils { static InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, - {IconData suffixIcon, Color dropDownColor}) { + {IconData? suffixIcon, Color? dropDownColor}) { return InputDecoration( isDense: true, contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index 58dfbc94..09a4cdfd 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -5,16 +5,16 @@ import '../app_texts_widget.dart'; class CustomRow extends StatelessWidget { const CustomRow({ - Key key, - this.label, - this.value, - this.labelSize, - this.valueSize, - this.width, + Key? key, + this.label = '', + this.value = '', + this.labelSize = 0, + this.valueSize = 0, + this.width = 0, this.isCopyable = true, this.isExpanded = true, - this.labelColor, - this.valueColor, + this.labelColor = Colors.white, + this.valueColor = Colors.white, }) : super(key: key); final String label; diff --git a/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart b/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart index 8a4891fd..10328ee9 100644 --- a/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart +++ b/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart @@ -35,8 +35,8 @@ class AnchoredOverlay extends StatelessWidget { AnchoredOverlay({ key, this.showOverlay = false, - this.overlayBuilder, - this.child, + required this.overlayBuilder, + required this.child, }) : super(key: key); @override @@ -90,8 +90,8 @@ class OverlayBuilder extends StatefulWidget { OverlayBuilder({ key, this.showOverlay = false, - this.overlayBuilder, - this.child, + required this.overlayBuilder, + required this.child, }) : super(key: key); @override @@ -99,7 +99,7 @@ class OverlayBuilder extends StatefulWidget { } class _OverlayBuilderState extends State { - OverlayEntry _overlayEntry; + late OverlayEntry _overlayEntry; @override void initState() { @@ -157,7 +157,9 @@ class _OverlayBuilderState extends State { void hideOverlay() { if (_overlayEntry != null) { _overlayEntry.remove(); - _overlayEntry = null; + _overlayEntry = OverlayEntry(builder: (context) { + return SizedBox(); + }); } } diff --git a/lib/widgets/shared/user-guid/app_get_position.dart b/lib/widgets/shared/user-guid/app_get_position.dart index c0430994..ef7ca880 100644 --- a/lib/widgets/shared/user-guid/app_get_position.dart +++ b/lib/widgets/shared/user-guid/app_get_position.dart @@ -1,75 +1,103 @@ /* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview + * Copyright (c) 2021 Simform Solutions + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ -/* -Customized By: Ibrahim Albitar - -*/ import 'package:flutter/material.dart'; class GetPosition { - final GlobalKey key; + final GlobalKey? key; + final EdgeInsets padding; + final double? screenWidth; + final double? screenHeight; - GetPosition({this.key}); + GetPosition({ + this.key, + this.padding = EdgeInsets.zero, + this.screenWidth, + this.screenHeight, + }); Rect getRect() { - RenderBox box = key.currentContext.findRenderObject(); + final box = key!.currentContext!.findRenderObject() as RenderBox; - final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); + var boxOffset = box.localToGlobal(const Offset(0.0, 0.0)); + if (boxOffset.dx.isNaN || boxOffset.dy.isNaN) { + return const Rect.fromLTRB(0, 0, 0, 0); + } + final topLeft = box.size.topLeft(boxOffset); + final bottomRight = box.size.bottomRight(boxOffset); - Rect rect = Rect.fromLTRB( - topLeft.dx, - topLeft.dy, - bottomRight.dx, - bottomRight.dy, + final rect = Rect.fromLTRB( + topLeft.dx - padding.left < 0 ? 0 : topLeft.dx - padding.left, + topLeft.dy - padding.top < 0 ? 0 : topLeft.dy - padding.top, + bottomRight.dx + padding.right > screenWidth! + ? screenWidth! + : bottomRight.dx + padding.right, + bottomRight.dy + padding.bottom > screenHeight! + ? screenHeight! + : bottomRight.dy + padding.bottom, ); return rect; } ///Get the bottom position of the widget double getBottom() { - RenderBox box = key.currentContext.findRenderObject(); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - return bottomRight.dy; + final box = key!.currentContext!.findRenderObject() as RenderBox; + final boxOffset = box.localToGlobal(const Offset(0.0, 0.0)); + if (boxOffset.dy.isNaN) return padding.bottom; + final bottomRight = box.size.bottomRight(boxOffset); + return bottomRight.dy + padding.bottom; } ///Get the top position of the widget double getTop() { - RenderBox box = key.currentContext.findRenderObject(); - final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - return topLeft.dy; + final box = key!.currentContext!.findRenderObject() as RenderBox; + final boxOffset = box.localToGlobal(const Offset(0.0, 0.0)); + if (boxOffset.dy.isNaN) return 0 - padding.top; + final topLeft = box.size.topLeft(boxOffset); + return topLeft.dy - padding.top; } ///Get the left position of the widget double getLeft() { - RenderBox box = key.currentContext.findRenderObject(); - final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - return topLeft.dx; + final box = key!.currentContext!.findRenderObject() as RenderBox; + final boxOffset = box.localToGlobal(const Offset(0.0, 0.0)); + if (boxOffset.dx.isNaN) return 0 - padding.left; + final topLeft = box.size.topLeft(boxOffset); + return topLeft.dx - padding.left; } ///Get the right position of the widget double getRight() { - RenderBox box = key.currentContext.findRenderObject(); + final box = key!.currentContext!.findRenderObject() as RenderBox; + final boxOffset = box.localToGlobal(const Offset(0.0, 0.0)); + if (boxOffset.dx.isNaN) return padding.right; final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - return bottomRight.dx; + box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); + return bottomRight.dx + padding.right; } - double getHeight() { - return getBottom() - getTop(); - } + double getHeight() => getBottom() - getTop(); - double getWidth() { - return getRight() - getLeft(); - } + double getWidth() => getRight() - getLeft(); - double getCenter() { - return (getLeft() + getRight()) / 2; - } -} + double getCenter() => (getLeft() + getRight()) / 2; +} \ No newline at end of file diff --git a/lib/widgets/shared/user-guid/app_shape_painter.dart b/lib/widgets/shared/user-guid/app_shape_painter.dart index 925d18d0..2513fdda 100644 --- a/lib/widgets/shared/user-guid/app_shape_painter.dart +++ b/lib/widgets/shared/user-guid/app_shape_painter.dart @@ -13,12 +13,12 @@ import 'package:flutter/material.dart'; class ShapePainter extends CustomPainter { Rect rect; - final ShapeBorder shapeBorder; - final Color color; - final double opacity; + final ShapeBorder? shapeBorder; + final Color? color; + final double? opacity; ShapePainter({ - @required this.rect, + required this.rect, this.color, this.shapeBorder, this.opacity, @@ -27,7 +27,7 @@ class ShapePainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { final paint = Paint(); - paint.color = color.withOpacity(opacity); + paint.color = color!.withOpacity(opacity!); RRect outer = RRect.fromLTRBR(0, 0, size.width, size.height, Radius.circular(0)); diff --git a/lib/widgets/shared/user-guid/app_showcase.dart b/lib/widgets/shared/user-guid/app_showcase.dart index 38625279..fc0aec48 100644 --- a/lib/widgets/shared/user-guid/app_showcase.dart +++ b/lib/widgets/shared/user-guid/app_showcase.dart @@ -21,12 +21,12 @@ import 'app_tool_tip_widget.dart'; class AppShowcase extends StatefulWidget { final Widget child; - final String title; - final String description; - final ShapeBorder shapeBorder; - final TextStyle titleTextStyle; - final TextStyle descTextStyle; - final GlobalKey key; + final String? title; + final String? description; + final ShapeBorder? shapeBorder; + final TextStyle? titleTextStyle; + final TextStyle? descTextStyle; + final GlobalKey? key; final Color overlayColor; final double overlayOpacity; final Widget container; @@ -36,17 +36,17 @@ class AppShowcase extends StatefulWidget { final double height; final double width; final Duration animationDuration; - final VoidCallback onToolTipClick; - final VoidCallback onTargetClick; - final VoidCallback onSkipClick; - final bool disposeOnTap; + final VoidCallback? onToolTipClick; + final VoidCallback? onTargetClick; + final VoidCallback? onSkipClick; + final bool? disposeOnTap; final bool disableAnimation; const AppShowcase( - {@required this.key, - @required this.child, + {this.key, + required this.child, this.title, - @required this.description, + required this.description, this.shapeBorder, this.overlayColor = Colors.black, this.overlayOpacity = 0.75, @@ -60,9 +60,9 @@ class AppShowcase extends StatefulWidget { this.disposeOnTap, this.animationDuration = const Duration(milliseconds: 2000), this.disableAnimation = false}) - : height = null, - width = null, - container = null, + : height = 0, + width = 0, + container = const SizedBox(), this.onToolTipClick = null, assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0, "overlay opacity should be >= 0.0 and <= 1.0."), @@ -92,10 +92,10 @@ class AppShowcase extends StatefulWidget { const AppShowcase.withWidget( {this.key, - @required this.child, - @required this.container, - @required this.height, - @required this.width, + required this.child, + required this.container, + required this.height, + required this.width, this.title, this.description, this.shapeBorder, @@ -134,10 +134,10 @@ class AppShowcase extends StatefulWidget { class _AppShowcaseState extends State with TickerProviderStateMixin { bool _showShowCase = false; - Animation _slideAnimation; - AnimationController _slideAnimationController; + late Animation _slideAnimation; + late AnimationController _slideAnimationController; - GetPosition position; + late GetPosition position; @override void initState() { @@ -181,7 +181,7 @@ class _AppShowcaseState extends State /// show overlay if there is any target widget /// void showOverlay() { - GlobalKey activeStep = ShowCaseWidget.activeTargetWidget(context); + GlobalKey activeStep = ShowCaseWidget.activeTargetWidget(context)!; setState(() { _showShowCase = activeStep == widget.key; }); @@ -205,7 +205,7 @@ class _AppShowcaseState extends State } _nextIfAny() { - ShowCaseWidget.of(context).completed(widget.key); + ShowCaseWidget.of(context).completed(widget.key!); if (!widget.disableAnimation) { _slideAnimationController.forward(); } @@ -219,7 +219,7 @@ class _AppShowcaseState extends State } : () { ShowCaseWidget.of(context).dismiss(); - widget.onTargetClick(); + widget.onTargetClick!(); }; } else { return widget.onTargetClick ?? _nextIfAny; @@ -234,7 +234,7 @@ class _AppShowcaseState extends State } : () { ShowCaseWidget.of(context).dismiss(); - widget.onToolTipClick(); + widget.onToolTipClick!(); }; } else { return widget.onToolTipClick ?? () {}; @@ -271,17 +271,17 @@ class _AppShowcaseState extends State offset: offset, size: size, onTap: _getOnTargetTap(), - shapeBorder: widget.shapeBorder, + shapeBorder: widget.shapeBorder!, ), AppToolTipWidget( position: position, offset: offset, screenSize: screenSize, - title: widget.title, - description: widget.description, + title: widget.title!, + description: widget.description!, animationOffset: _slideAnimation, - titleTextStyle: widget.titleTextStyle, - descTextStyle: widget.descTextStyle, + titleTextStyle: widget.titleTextStyle!, + descTextStyle: widget.descTextStyle!, container: widget.container, tooltipColor: widget.showcaseBackgroundColor, textColor: widget.textColor, @@ -307,14 +307,14 @@ class _AppShowcaseState extends State class _TargetWidget extends StatelessWidget { final Offset offset; - final Size size; - final Animation widthAnimation; - final VoidCallback onTap; - final ShapeBorder shapeBorder; + final Size? size; + final Animation? widthAnimation; + final VoidCallback? onTap; + final ShapeBorder? shapeBorder; _TargetWidget({ - Key key, - @required this.offset, + Key? key, + required this.offset, this.size, this.widthAnimation, this.onTap, @@ -331,8 +331,8 @@ class _TargetWidget extends StatelessWidget { child: GestureDetector( onTap: onTap, child: Container( - height: size.height + 16, - width: size.width + 16, + height: size!.height + 16, + width: size!.width + 16, decoration: ShapeDecoration( shape: shapeBorder ?? RoundedRectangleBorder( diff --git a/lib/widgets/shared/user-guid/app_showcase_widget.dart b/lib/widgets/shared/user-guid/app_showcase_widget.dart index 07577b3b..baac6b6f 100644 --- a/lib/widgets/shared/user-guid/app_showcase_widget.dart +++ b/lib/widgets/shared/user-guid/app_showcase_widget.dart @@ -1,33 +1,92 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ import 'package:flutter/material.dart'; class ShowCaseWidget extends StatefulWidget { final Builder builder; - final VoidCallback onFinish; - - const ShowCaseWidget({@required this.builder, this.onFinish}); - static activeTargetWidget(BuildContext context) { + /// Triggered when all the showcases are completed. + final VoidCallback? onFinish; + + /// Triggered every time on start of each showcase. + final Function(int?, GlobalKey)? onStart; + + /// Triggered every time on completion of each showcase + final Function(int?, GlobalKey)? onComplete; + + /// Whether all showcases will auto sequentially start + /// having time interval of [autoPlayDelay] . + /// + /// Default to `false` + final bool autoPlay; + + /// Visibility time of current showcase when [autoplay] sets to true. + /// + /// Default to [Duration(seconds: 3)] + final Duration autoPlayDelay; + + /// Whether blocking user interaction while [autoPlay] is enabled. + /// + /// Default to `false` + final bool enableAutoPlayLock; + + /// Whether disabling bouncing/moving animation for all tooltips + /// while showcasing + /// + /// Default to `false` + final bool disableMovingAnimation; + + /// Whether disabling initial scale animation for all the default tooltips + /// when showcase is started and completed + /// + /// Default to `false` + final bool disableScaleAnimation; + + /// Whether disabling barrier interaction + final bool disableBarrierInteraction; + + /// Provides time duration for auto scrolling when [enableAutoScroll] is true + final Duration scrollDuration; + + /// Default overlay blur used by showcase. if [Showcase.blurValue] + /// is not provided. + /// + /// Default value is 0. + final double blurValue; + + /// While target widget is out viewport then + /// whether enabling auto scroll so as to make the target widget visible. + final bool enableAutoScroll; + + /// Enable/disable showcase globally. Enabled by default. + final bool enableShowcase; + + const ShowCaseWidget({ + required this.builder, + this.onFinish, + this.onStart, + this.onComplete, + this.autoPlay = false, + this.autoPlayDelay = const Duration(milliseconds: 2000), + this.enableAutoPlayLock = false, + this.blurValue = 0, + this.scrollDuration = const Duration(milliseconds: 300), + this.disableMovingAnimation = false, + this.disableScaleAnimation = false, + this.enableAutoScroll = false, + this.disableBarrierInteraction = false, + this.enableShowcase = true, + }); + + static GlobalKey? activeTargetWidget(BuildContext context) { return context .dependOnInheritedWidgetOfExactType<_InheritedShowCaseView>() - .activeWidgetIds; + ?.activeWidgetIds; } static ShowCaseWidgetState of(BuildContext context) { - ShowCaseWidgetState state = - context.findAncestorStateOfType(); + final state = context.findAncestorStateOfType(); if (state != null) { - return context.findAncestorStateOfType(); + return state; } else { throw Exception('Please provide ShowCaseView context'); } @@ -38,35 +97,111 @@ class ShowCaseWidget extends StatefulWidget { } class ShowCaseWidgetState extends State { - List ids; - int activeWidgetId; + List? ids; + int? activeWidgetId; + + /// These properties are only here so that it can be accessed by + /// [Showcase] + bool get autoPlay => widget.autoPlay; + + bool get disableMovingAnimation => widget.disableMovingAnimation; + + bool get disableScaleAnimation => widget.disableScaleAnimation; + + Duration get autoPlayDelay => widget.autoPlayDelay; + + bool get enableAutoPlayLock => widget.enableAutoPlayLock; + + bool get enableAutoScroll => widget.enableAutoScroll; + bool get disableBarrierInteraction => widget.disableBarrierInteraction; + + bool get enableShowcase => widget.enableShowcase; + + /// Returns value of [ShowCaseWidget.blurValue] + double get blurValue => widget.blurValue; + + /// Starts Showcase view from the beginning of specified list of widget ids. + /// If this function is used when showcase has been disabled then it will + /// throw an exception. void startShowCase(List widgetIds) { + if (!enableShowcase) { + throw Exception( + "You are trying to start Showcase while it has been disabled with " + "`enableShowcase` parameter to false from ShowCaseWidget", + ); + } + if (!mounted) return; setState(() { - this.ids = widgetIds; + ids = widgetIds; activeWidgetId = 0; + _onStart(); }); } - void completed(GlobalKey id) { - if (ids != null && ids[activeWidgetId] == id) { + /// Completes showcase of given key and starts next one + /// otherwise will finish the entire showcase view + void completed(GlobalKey? key) { + if (ids != null && ids![activeWidgetId!] == key && mounted) { + setState(() { + _onComplete(); + activeWidgetId = activeWidgetId! + 1; + _onStart(); + + if (activeWidgetId! >= ids!.length) { + _cleanupAfterSteps(); + widget.onFinish?.call(); + } + }); + } + } + + /// Completes current active showcase and starts next one + /// otherwise will finish the entire showcase view + void next() { + if (ids != null && mounted) { setState(() { - ++activeWidgetId; + _onComplete(); + activeWidgetId = activeWidgetId! + 1; + _onStart(); + + if (activeWidgetId! >= ids!.length) { + _cleanupAfterSteps(); + widget.onFinish?.call(); + } + }); + } + } - if (activeWidgetId >= ids.length) { + /// Completes current active showcase and starts previous one + /// otherwise will finish the entire showcase view + void previous() { + if (ids != null && ((activeWidgetId ?? 0) - 1) >= 0 && mounted) { + setState(() { + _onComplete(); + activeWidgetId = activeWidgetId! - 1; + _onStart(); + if (activeWidgetId! >= ids!.length) { _cleanupAfterSteps(); - if (widget.onFinish != null) { - widget.onFinish(); - } + widget.onFinish?.call(); } }); } } + /// Dismiss entire showcase view void dismiss() { - setState(() { - _cleanupAfterSteps(); - }); + if (mounted) setState(_cleanupAfterSteps); + } + + void _onStart() { + if (activeWidgetId! < ids!.length) { + widget.onStart?.call(activeWidgetId, ids![activeWidgetId!]); + } + } + + void _onComplete() { + widget.onComplete?.call(activeWidgetId, ids![activeWidgetId!]); } void _cleanupAfterSteps() { @@ -77,21 +212,21 @@ class ShowCaseWidgetState extends State { @override Widget build(BuildContext context) { return _InheritedShowCaseView( + activeWidgetIds: ids?.elementAt(activeWidgetId!), child: widget.builder, - activeWidgetIds: ids?.elementAt(activeWidgetId), ); } } class _InheritedShowCaseView extends InheritedWidget { - final GlobalKey activeWidgetIds; + final GlobalKey? activeWidgetIds; - _InheritedShowCaseView({ - @required this.activeWidgetIds, - @required child, + const _InheritedShowCaseView({ + required this.activeWidgetIds, + required Widget child, }) : super(child: child); @override bool updateShouldNotify(_InheritedShowCaseView oldWidget) => oldWidget.activeWidgetIds != activeWidgetIds; -} +} \ No newline at end of file diff --git a/lib/widgets/shared/user-guid/app_tool_tip_widget.dart b/lib/widgets/shared/user-guid/app_tool_tip_widget.dart index 285caa8e..6856efb1 100644 --- a/lib/widgets/shared/user-guid/app_tool_tip_widget.dart +++ b/lib/widgets/shared/user-guid/app_tool_tip_widget.dart @@ -16,22 +16,22 @@ import 'package:flutter/material.dart'; import 'app_get_position.dart'; class AppToolTipWidget extends StatelessWidget { - final GetPosition position; - final Offset offset; - final Size screenSize; - final String title; - final String description; - final Animation animationOffset; - final TextStyle titleTextStyle; - final TextStyle descTextStyle; - final Widget container; - final Color tooltipColor; - final Color textColor; - final bool showArrow; - final double contentHeight; - final double contentWidth; - static bool isArrowUp; - final VoidCallback onTooltipTap; + final GetPosition? position; + final Offset? offset; + final Size? screenSize; + final String? title; + final String? description; + final Animation? animationOffset; + final TextStyle? titleTextStyle; + final TextStyle? descTextStyle; + final Widget? container; + final Color? tooltipColor; + final Color? textColor; + final bool? showArrow; + final double? contentHeight; + final double? contentWidth; + static bool? isArrowUp; + final VoidCallback? onTooltipTap; AppToolTipWidget({ this.position, @@ -54,9 +54,9 @@ class AppToolTipWidget extends StatelessWidget { bool isCloseToTopOrBottom(Offset position) { double height = 120; if (contentHeight != null) { - height = contentHeight; + height = contentHeight!; } - return (screenSize.height - position.dy) <= height; + return (screenSize!.height - position.dy) <= height; } String findPositionForContent(Offset position) { @@ -68,8 +68,8 @@ class AppToolTipWidget extends StatelessWidget { } double _getTooltipWidth() { - double titleLength = title == null ? 0 : (title.length * 10.0); - double descriptionLength = (description.length * 7.0); + double titleLength = title == null ? 0 : (title!.length * 10.0); + double descriptionLength = (description!.length * 7.0); if (titleLength > descriptionLength) { return titleLength + 10; } else { @@ -78,51 +78,51 @@ class AppToolTipWidget extends StatelessWidget { } bool _isLeft() { - double screenWidth = screenSize.width / 3; - return !(screenWidth <= position.getCenter()); + double screenWidth = screenSize!.width / 3; + return !(screenWidth <= position!.getCenter()); } bool _isRight() { - double screenWidth = screenSize.width / 3; - return ((screenWidth * 2) <= position.getCenter()); + double screenWidth = screenSize!.width / 3; + return ((screenWidth * 2) <= position!.getCenter()); } double _getLeft() { if (_isLeft()) { - double leftPadding = position.getCenter() - (_getTooltipWidth() * 0.1); - if (leftPadding + _getTooltipWidth() > screenSize.width) { - leftPadding = (screenSize.width - 20) - _getTooltipWidth(); + double leftPadding = position!.getCenter() - (_getTooltipWidth() * 0.1); + if (leftPadding + _getTooltipWidth() > screenSize!.width) { + leftPadding = (screenSize!.width - 20) - _getTooltipWidth(); } if (leftPadding < 20) { leftPadding = 14; } return leftPadding; } else if (!(_isRight())) { - return position.getCenter() - (_getTooltipWidth() * 0.5); + return position!.getCenter() - (_getTooltipWidth() * 0.5); } else { - return null; + return 0.0; } } double _getRight() { if (_isRight()) { - double rightPadding = position.getCenter() + (_getTooltipWidth() / 2); - if (rightPadding + _getTooltipWidth() > screenSize.width) { + double rightPadding = position!.getCenter() + (_getTooltipWidth() / 2); + if (rightPadding + _getTooltipWidth() > screenSize!.width) { rightPadding = 14; } return rightPadding; } else if (!(_isLeft())) { - return position.getCenter() - (_getTooltipWidth() * 0.5); + return position!.getCenter() - (_getTooltipWidth() * 0.5); } else { - return null; + return 0.0; } } double _getSpace() { - double space = position.getCenter() - (contentWidth / 2); - if (space + contentWidth > screenSize.width) { - space = screenSize.width - contentWidth - 8; - } else if (space < (contentWidth / 2)) { + double space = position!.getCenter() - (contentWidth! / 2); + if (space + contentWidth! > screenSize!.width) { + space = screenSize!.width - contentWidth! - 8; + } else if (space < (contentWidth! / 2)) { space = 16; } return space; @@ -130,20 +130,20 @@ class AppToolTipWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final contentOrientation = findPositionForContent(offset); + final contentOrientation = findPositionForContent(offset!); final contentOffsetMultiplier = contentOrientation == "BELOW" ? 1.0 : -1.0; isArrowUp = contentOffsetMultiplier == 1.0 ? true : false; - final contentY = isArrowUp - ? position.getBottom() + (contentOffsetMultiplier * 3) - : position.getTop() + (contentOffsetMultiplier * 3); + final contentY = isArrowUp! + ? position!.getBottom() + (contentOffsetMultiplier * 3) + : position!.getTop() + (contentOffsetMultiplier * 3); final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); - double paddingTop = isArrowUp ? 22 : 0; - double paddingBottom = isArrowUp ? 0 : 27; + double paddingTop = isArrowUp! ? 22 : 0; + double paddingBottom = isArrowUp! ? 0 : 27; - if (!showArrow) { + if (!showArrow!) { paddingTop = 10; paddingBottom = 10; } @@ -151,7 +151,7 @@ class AppToolTipWidget extends StatelessWidget { if (container == null) { return Stack( children: [ - showArrow ? _getArrow(contentOffsetMultiplier) : Container(), + showArrow! ? _getArrow(contentOffsetMultiplier) : Container(), Positioned( top: contentY, left: _getLeft(), @@ -162,7 +162,7 @@ class AppToolTipWidget extends StatelessWidget { position: Tween( begin: Offset(0.0, contentFractionalOffset / 10), end: Offset(0.0, 0.100), - ).animate(animationOffset), + ).animate(animationOffset!), child: Material( color: Colors.transparent, child: Container( @@ -195,8 +195,8 @@ class AppToolTipWidget extends StatelessWidget { DoctorApp.search_patient), ), AppText( - title, - color: textColor, + title!, + color: textColor!, margin: 2, fontWeight: FontWeight.bold, fontSize: 16, @@ -205,8 +205,8 @@ class AppToolTipWidget extends StatelessWidget { ) : Container(), AppText( - description, - color: textColor, + description!, + color: textColor!, margin: 8, ), ], @@ -236,7 +236,7 @@ class AppToolTipWidget extends StatelessWidget { position: Tween( begin: Offset(0.0, contentFractionalOffset / 5), end: Offset(0.0, 0.100), - ).animate(animationOffset), + ).animate(animationOffset!), child: Material( color: Colors.transparent, child: GestureDetector( @@ -263,16 +263,16 @@ class AppToolTipWidget extends StatelessWidget { Widget _getArrow(contentOffsetMultiplier) { final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); return Positioned( - top: isArrowUp ? position.getBottom() : position.getTop() - 1, - left: position.getCenter() - 24, + top: isArrowUp! ? position!.getBottom() : position!.getTop() - 1, + left: position!.getCenter() - 24, child: FractionalTranslation( translation: Offset(0.0, contentFractionalOffset), child: SlideTransition( position: Tween( begin: Offset(0.0, contentFractionalOffset / 5), end: Offset(0.0, 0.150), - ).animate(animationOffset), - child: isArrowUp + ).animate(animationOffset!), + child: isArrowUp! ? Icon( Icons.arrow_drop_up, color: tooltipColor, diff --git a/lib/widgets/shared/user-guid/custom_validation_error.dart b/lib/widgets/shared/user-guid/custom_validation_error.dart index 7df79115..6154255d 100644 --- a/lib/widgets/shared/user-guid/custom_validation_error.dart +++ b/lib/widgets/shared/user-guid/custom_validation_error.dart @@ -7,8 +7,8 @@ class CustomValidationError extends StatelessWidget { String error; CustomValidationError({ - Key key, - this.error, + Key? key, + required this.error, }) : super(key: key); @override diff --git a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart index dc2cab3e..a35be666 100644 --- a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart +++ b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart @@ -7,16 +7,16 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class InPatientDoctorCard extends StatelessWidget { - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; - final bool isPrescriptions; - final String clinic; - final createdBy; + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final Function? onTap; + final bool? isPrescriptions; + final String? clinic; + final dynamic createdBy; InPatientDoctorCard( {this.doctorName, @@ -47,7 +47,7 @@ class InPatientDoctorCard extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(15.0), child: InkWell( - onTap: onTap, + onTap: onTap!(), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -55,7 +55,7 @@ class InPatientDoctorCard extends StatelessWidget { children: [ Expanded( child: AppText( - doctorName, + doctorName!, bold: true, )), Expanded( @@ -63,16 +63,16 @@ class InPatientDoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), - if (!isPrescriptions) + if (!isPrescriptions!) AppText( - '${AppDateUtils.getHour(appointmentDate)}', + '${AppDateUtils.getHour(appointmentDate!)}', fontWeight: FontWeight.w600, - color: Colors.grey[700], + color: Colors.grey[700]!, fontSize: 14, ), ], diff --git a/lib/widgets/transitions/fade_page.dart b/lib/widgets/transitions/fade_page.dart index 0265d815..7545e8b0 100644 --- a/lib/widgets/transitions/fade_page.dart +++ b/lib/widgets/transitions/fade_page.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; class FadePage extends PageRouteBuilder { final Widget page; - FadePage({this.page}) + FadePage({required this.page}) : super( opaque: false, settings: RouteSettings(name: page.runtimeType.toString()), diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart index b83e2386..57895871 100644 --- a/lib/widgets/transitions/slide_up_page.dart +++ b/lib/widgets/transitions/slide_up_page.dart @@ -9,10 +9,10 @@ class SlideUpPageRoute extends PageRouteBuilder { final Widget widget; final bool fullscreenDialog; final bool opaque; - final String settingRoute; + final String? settingRoute; SlideUpPageRoute( - {this.widget, + {required this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) diff --git a/pubspec.yaml b/pubspec.yaml index 092ad1d6..6094d1a9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,8 +28,6 @@ dependencies: flutter: sdk: flutter hexcolor: ^3.0.1 - #flutter_localization: any - intl: any flutter_device_type: ^0.4.0 http: ^1.1.2 provider: ^6.1.1 @@ -43,7 +41,7 @@ dependencies: connectivity: ^3.0.6 maps_launcher: ^2.2.0 url_launcher: ^6.2.1 - charts_flutter: any + charts_flutter: ^0.12.0 #flutter_charts: ^0.5.2 #gelin: ^0.1.6 #flutter_swiper: ^1.1.6 @@ -93,7 +91,7 @@ dependencies: # Flutter Html View flutter_html: ^2.1.0 sticky_headers: ^0.3.0+2 - file_picker: ^6.1.1 + file_picker: any #speech to text # speech_to_text: @@ -105,7 +103,8 @@ dependencies: flutter_colorpicker: ^1.0.3 # Html Editor Enhanced - html_editor_enhanced: any + #html_editor_enhanced: any + html_editor_enhanced: ^2.5.1 #Network Image cached_network_image: ^3.3.0 @@ -118,11 +117,16 @@ dependencies: # hijri: ^2.0.3 hijri_picker: ^3.0.0 flutter_datetime_picker: ^1.5.1 - + localization: ^2.1.1 # flutter_math_fork: ^0.6.0 # flutter_math_fork: ^0.6.0 +dependency_overrides: + flutter_localizations: + sdk: flutter + intl: ^0.18.1 + dev_dependencies: flutter_test: