diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 0e45825e..028f175d 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -804,8 +804,8 @@ class SOAPViewModel extends BaseViewModel { episodeId: patientInfo.episodeNo, appointmentNo: patientInfo.appointmentNo, remarks: "", - historyId: history.selectedHistory.id, - historyType: history.selectedHistory.typeId, + historyId: history.selectedHistory!.id, + historyType: history.selectedHistory!.typeId, isChecked: history.isChecked, )); }); diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index a8df56a3..d79c0634 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -74,7 +74,7 @@ class _DischargedPatientState extends State { DoctorApp.filter_1, color: Colors.black, ), - iconSize: 20, onPressed: () { }, + iconSize: 20, ), ), SizedBox( diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index d44a2e7e..a6d353e9 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -33,10 +33,10 @@ class UcafDetailScreen extends StatefulWidget { } class _UcafDetailScreenState extends State { - final PatiantInformtion patient; - final UcafViewModel model; + PatiantInformtion patient; + UcafViewModel model; - UcafViewModel ucafModel; + late UcafViewModel ucafModel; int _activeTap = 0; diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index fe8ff250..a5b11fc0 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -16,7 +16,7 @@ class PageStepperWidget extends StatelessWidget { final int stepsCount; final int currentStepIndex; final Size screenSize; - final List? stepsTitles; + final List stepsTitles; PageStepperWidget( {required this.stepsCount, diff --git a/lib/screens/patients/profile/soap_update/soap_utils.dart b/lib/screens/patients/profile/soap_update/soap_utils.dart index 6c5d4f02..5fdf4c93 100644 --- a/lib/screens/patients/profile/soap_update/soap_utils.dart +++ b/lib/screens/patients/profile/soap_update/soap_utils.dart @@ -20,7 +20,7 @@ class SoapUtils { isChecked = false, remark, isLocal = true, - int createdBy, + int ?createdBy, bool isExpanded = false}) { MySelectedAllergy mySelectedAllergy = MySelectedAllergy( selectedAllergy: allergy, diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index d2048a62..1b3f9cec 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -44,7 +44,8 @@ class _AddMedicationState extends State { TextEditingController frequencyController = TextEditingController(); GetMedicationResponseModel? _selectedMedication; - GlobalKey key = new GlobalKey>(); + GlobalKey> key = new GlobalKey>(); + bool isFormSubmitted = false; @override @@ -59,7 +60,7 @@ class _AddMedicationState extends State { baseViewModel: model, isShowAppBar: true, appBar: BottomSheetTitle( - title: TranslationBase.of(context).addMedication, + title: TranslationBase.of(context).addMedication!, ), body: Center( child: Container( @@ -103,8 +104,8 @@ class _AddMedicationState extends State { .textFieldSelectorDecoration( TranslationBase.of( context) - .searchMedicineNameHere, - null, + .searchMedicineNameHere!, + '', true, suffixIcon: Icons.search), @@ -119,22 +120,22 @@ class _AddMedicationState extends State { suggestion) => new Padding( child: AppText(suggestion - .description + + .description! + '/' + - suggestion - .genericName), + suggestion! + .genericName!), padding: EdgeInsets.all( 8.0)), itemSorter: (a, b) => 1, itemFilter: (suggestion, input) => - suggestion.genericName.toLowerCase().startsWith( + suggestion.genericName!.toLowerCase().startsWith( input.toLowerCase()) || - suggestion.description + suggestion.description! .toLowerCase() .startsWith(input .toLowerCase()) || - suggestion.keywords + suggestion.keywords! .toLowerCase() .startsWith(input .toLowerCase()), @@ -145,9 +146,9 @@ class _AddMedicationState extends State { Helpers.getTextFieldHeight(), hintText: _selectedMedication != null - ? _selectedMedication - .description + - (' (${_selectedMedication.genericName} )') + ? _selectedMedication! + .description! + + (' (${_selectedMedication!.genericName!} )') : TranslationBase.of(context) .searchMedicineNameHere, minLines: 1, @@ -157,7 +158,7 @@ class _AddMedicationState extends State { icon: Icon( Icons.search, color: Colors.grey.shade600, - )), + ), onPressed: () { },), enabled: false, ), ), @@ -174,8 +175,8 @@ class _AddMedicationState extends State { .width * 0.7, child: AppText( - _selectedMedication.description + - (' (${_selectedMedication.genericName} )'), + _selectedMedication!.description! + + (' (${_selectedMedication!.genericName!} )'), color: Color(0xFF575757), fontSize: 10, fontWeight: FontWeight.w700, @@ -386,7 +387,7 @@ class _AddMedicationState extends State { _selectedMedicationFrequency != null) { widget.medicationController.text = widget .medicationController.text + - '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; + '${_selectedMedication!.description!} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; Navigator.of(context).pop(); } }, diff --git a/lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart b/lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart index e8d0e11f..7bfa44ba 100644 --- a/lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart +++ b/lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart @@ -1,3 +1,5 @@ +import 'package:flutter/cupertino.dart'; + abstract class SubjectiveCallBack{ - Function nextFunction(model); + VoidCallback? nextFunction(model); } \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index 79417789..6463163a 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -139,7 +139,7 @@ class _UpdateSubjectivePageState extends State SoapUtils.generateMySelectedAllergy( allergy: selectedAllergy, isChecked: element.isChecked, - createdBy: element.createdBy, + createdBy: element!.createdBy!, remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity); @@ -265,13 +265,13 @@ if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidge } addSubjectiveInfo( - {SOAPViewModel model, - List myAllergiesList, - List myHistoryList}) async { + {required SOAPViewModel model, + required List myAllergiesList, + required List myHistoryList}) async { if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); widget.changeLoadingState(true); - formKey.currentState.save(); - formKey.currentState.validate(); + formKey.currentState!.save(); + formKey.currentState!.validate(); model.complaintsControllerError = ''; model.medicationControllerError = ''; @@ -315,8 +315,8 @@ if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidge } @override - Function nextFunction(model) { - addSubjectiveInfo( + VoidCallback? nextFunction(model) { + addSubjectiveInfo( model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList); diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index 707770eb..df245783 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -204,7 +204,7 @@ class _UpdateSoapIndexState extends State with TickerProviderSt Expanded( child: AppButton( title: patient.admissionNo != null && - patient.admissionNo.isNotEmpty && !model.isAddExamInProgress?TranslationBase.of(context).finish: TranslationBase.of(context).next, + patient.admissionNo!.isNotEmpty && !model.isAddExamInProgress?TranslationBase.of(context).finish: TranslationBase.of(context).next, fontWeight: FontWeight.w600, color: Colors.red[700], height: SizeConfig.heightMultiplier * @@ -307,6 +307,11 @@ class _UpdateSoapIndexState extends State with TickerProviderSt ); } break; + default: { + return Container(height: 0,); + } + break; + } } } diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart index 225d6141..8c51a21a 100644 --- a/lib/screens/patients/register_patient/CustomEditableText.dart +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -10,7 +10,7 @@ class CustomEditableText extends StatefulWidget { required this.controller, this.hint, this.isEditable = false, - this.isSubmitted, + required this.isSubmitted, }) : super(key: key); final TextEditingController controller; diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index 8e8bde13..08cec4a0 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -44,10 +44,7 @@ class RegisterConfirmationPatientPage extends StatefulWidget { final PatientRegistrationViewModel model; const RegisterConfirmationPatientPage( - {Key? key, - this.operationReportViewModel, - this.patient, - required this.model}) + {Key? key, this.operationReportViewModel, this.patient, required this.model}) : super(key: key); @override @@ -58,7 +55,7 @@ class RegisterConfirmationPatientPage extends StatefulWidget { class _RegisterConfirmationPatientPageState extends State { bool isSubmitted = false; - ProjectViewModel? projectViewModel; + late ProjectViewModel? projectViewModel; late TextEditingController firstNameN; late TextEditingController middleNameN; late TextEditingController lastNameN; @@ -66,7 +63,7 @@ class _RegisterConfirmationPatientPageState late TextEditingController middleNameAr; late TextEditingController lastNameAr; late TextEditingController emailAddressController; - TextEditingController langController = TextEditingController(text: "English"); + late TextEditingController langController = TextEditingController(text: "English"); int selectedLang = 1; @override diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 861e9295..556d6748 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -39,7 +39,7 @@ class RegisterSearchPatientPage extends StatefulWidget { } class _RegisterSearchPatientPageState extends State { - late String countryError; + var countryError; dynamic _selectedCountry; late List countryList; @@ -203,7 +203,7 @@ class _RegisterSearchPatientPageState extends State { title: AppText("Hijri"), value: CalenderType.Hijri, groupValue: calenderType, - onChanged: (CalenderType? value) { + onChanged: (CalenderType ? value) { setState(() { calenderType = value!; });