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 e50c6ae1..89e00fa9 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -24,7 +24,7 @@ class UcafDetailScreen extends StatefulWidget { final UcafViewModel model; final Function changeLoadingState; - UcafDetailScreen(this.patient, this.model, {this.changeLoadingState}); + UcafDetailScreen(this.patient, this.model, {required this.changeLoadingState}); @override _UcafDetailScreenState createState() => _UcafDetailScreenState(this.patient, this.model); @@ -32,10 +32,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/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 1d1d549b..3b8ef243 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -21,7 +21,7 @@ class UCAFInputScreen extends StatefulWidget { final PatiantInformtion patient; final Function changeLoadingState; - UCAFInputScreen(this.patient, {this.changeLoadingState}); + UCAFInputScreen(this.patient, {required this.changeLoadingState}); @override _UCAFInputScreenState createState() => _UCAFInputScreenState(this.patient); diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index 78f7f6db..dc6b4a0b 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, required this.currentStepIndex, required this.screenSize, this.stepsTitles}); @@ -33,9 +33,9 @@ class PageStepperWidget extends StatelessWidget { children: [ for (int i = 1; i <= stepsCount; i++) if (i == currentStepIndex) - StepWidget(i, true, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles,) + StepWidget(i, true, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles!,) else - StepWidget(i, false, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles,) + StepWidget(i, false, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles!,) ], ) ], @@ -52,7 +52,7 @@ class StepWidget extends StatelessWidget { final double dividerWidth; final List stepsTitles; - StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth, {this.stepsTitles}); + StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth, {required this.stepsTitles}); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index 2be71d19..f95fea71 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -23,13 +23,13 @@ class UCAFPagerScreen extends StatefulWidget { class _UCAFPagerScreenState extends State with TickerProviderStateMixin { - PageController _controller; + late PageController _controller; int _currentIndex = 0; bool _isLoading = true; - PatiantInformtion patient; - String patientType; - String arrivalType; + late PatiantInformtion patient; + late String patientType; + late String arrivalType; changePageViewIndex(pageIndex, {isChangeState = true}) { if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); @@ -65,7 +65,7 @@ class _UCAFPagerScreenState extends State isShowAppBar: true, isLoading: _isLoading, appBar: PatientProfileAppBar(patient), - appBarTitle: TranslationBase.of(context).ucaf, + appBarTitle: TranslationBase.of(context).ucaf!, body: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index fc3c6096..5a076c30 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -475,7 +475,7 @@ class VitalSignDetailsScreen extends StatelessWidget { : Container( color: Theme.of(context).scaffoldBackgroundColor, child: ErrorMessage( - error: TranslationBase.of(context).vitalSignEmptyMsg, + error: TranslationBase.of(context).vitalSignEmptyMsg!, )), ), ); diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart index ac20d1e1..244d68d9 100644 --- a/lib/screens/patients/register_patient/CustomEditableText.dart +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -6,16 +6,16 @@ import 'package:flutter/material.dart'; class CustomEditableText extends StatefulWidget { CustomEditableText({ - Key key, + Key? key, required this.controller, this.hint, this.isEditable = false, - this.isSubmitted, + required this.isSubmitted, }) : super(key: key); final TextEditingController controller; - final String hint; + final String? hint; bool isEditable; final bool isSubmitted; diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index 6aaacb26..8bad5500 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -39,12 +39,12 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; import 'CustomEditableText.dart'; class RegisterConfirmationPatientPage extends StatefulWidget { - final OperationReportViewModel operationReportViewModel; - final PatiantInformtion patient; + final OperationReportViewModel? operationReportViewModel; + final PatiantInformtion? patient; final PatientRegistrationViewModel model; const RegisterConfirmationPatientPage( - {Key? key, this.operationReportViewModel, this.patient, this.model}) + {Key? key, this.operationReportViewModel, this.patient, required this.model}) : super(key: key); @override @@ -55,15 +55,15 @@ class RegisterConfirmationPatientPage extends StatefulWidget { class _RegisterConfirmationPatientPageState extends State { bool isSubmitted = false; - ProjectViewModel projectViewModel; - TextEditingController firstNameN; - TextEditingController middleNameN; - TextEditingController lastNameN; - TextEditingController firstNameAr; - TextEditingController middleNameAr; - TextEditingController lastNameAr; - TextEditingController emailAddressController; - TextEditingController langController = TextEditingController(text: "English"); + late ProjectViewModel projectViewModel; + late TextEditingController firstNameN; + late TextEditingController middleNameN; + late TextEditingController lastNameN; + late TextEditingController firstNameAr; + late TextEditingController middleNameAr; + late TextEditingController lastNameAr; + late TextEditingController emailAddressController; + late TextEditingController langController = TextEditingController(text: "English"); int selectedLang = 1; @override @@ -393,7 +393,7 @@ class _RegisterConfirmationPatientPageState widget.model.getPatientInfoResponseModel.dateOfBirth); var dateFormat = DateFormat('MM/dd/yyyy').parse( - widget.model.getPatientInfoResponseModel.dateOfBirth); + widget.model.getPatientInfoResponseModel.dateOfBirth!); String wellFormat = "${dateFormat.day}\/${dateFormat.month}\/${dateFormat.year}"; print( @@ -425,7 +425,7 @@ class _RegisterConfirmationPatientPageState strDateofBirth: dateFormat.toUtc().toString(), dateofBirth: AppDateUtils.convertToServerFormat( widget.model.getPatientInfoResponseModel - .dateOfBirth, + .dateOfBirth!, 'MM/dd/yyyy'), dateofBirthN: '$hijriDate', gender: (widget.model.getPatientInfoResponseModel.gender == "M") diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 9bc2d6fe..5ec38223 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -20,7 +20,7 @@ class RegisterPatientPage extends StatefulWidget { class _RegisterPatientPageState extends State with TickerProviderStateMixin { - PageController _controller; + late PageController _controller; int _currentIndex = 0; bool _isLoading = false; @@ -61,7 +61,7 @@ class _RegisterPatientPageState extends State isShowAppBar: true, isLoading: _isLoading, appBar: PatientSearchHeader( - title: TranslationBase.of(context).registeraPatient, + title: TranslationBase.of(context).registeraPatient!, ), body: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 3fdbedd2..6e3b41e9 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -30,7 +30,7 @@ class RegisterSearchPatientPage extends StatefulWidget { final PatientRegistrationViewModel model; const RegisterSearchPatientPage( - {Key? key, this.changePageViewIndex, this.model}) + {Key? key, required this.changePageViewIndex, required this.model}) : super(key: key); @override @@ -39,7 +39,7 @@ class RegisterSearchPatientPage extends StatefulWidget { } class _RegisterSearchPatientPageState extends State { - late String countryError; + var countryError; dynamic _selectedCountry; late List countryList; @@ -191,9 +191,9 @@ class _RegisterSearchPatientPageState extends State { title: AppText("Gregorian"), value: CalenderType.Gregorian, groupValue: calenderType, - onChanged: (CalenderType value) { + onChanged: (CalenderType? value) { setState(() { - calenderType = value; + calenderType = value!; }); }, ), @@ -203,9 +203,9 @@ class _RegisterSearchPatientPageState extends State { title: AppText("Hijri"), value: CalenderType.Hijri, groupValue: calenderType, - onChanged: (CalenderType value) { + onChanged: (CalenderType ? value) { setState(() { - calenderType = value; + calenderType = value!; }); }, ), @@ -307,7 +307,7 @@ class _RegisterSearchPatientPageState extends State { isSubmitted = true; }); if (country == null) { - countryError = TranslationBase.of(context).fieldRequired; + countryError = TranslationBase.of(context).fieldRequired!; } else { countryError = null; } @@ -397,7 +397,7 @@ class _RegisterSearchPatientPageState extends State { ); if (pickedH != null && birthDateInHijri != pickedH) updateDate(pickedH); } else { - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: dateTime ?? DateTime.now(), firstDate: DateTime(DateTime.now().year - 150),