diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index e37e8809..c0f71633 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -37,15 +37,11 @@ class ProjectViewModel extends BaseViewModel { String error = ''; dynamic searchvalue; bool isLogin = false; - int laserSelectionDuration; bool isPatientAdmitted = false; bool patientHasAdmissionRequest = false; int inPatientProjectID = 0; - GetAdmissionInfoResponseModel getAdmissionInfoResponseModel; - GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel; - - double _latitude; - double _longitude; + GetAdmissionInfoResponseModel getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel(); + GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel(); RegisterInfoResponse _registerInfo = RegisterInfoResponse(); @@ -75,14 +71,14 @@ class ProjectViewModel extends BaseViewModel { late StreamSubscription subscription; - late double _latitude; - late double _longitude; + late double _latitude = 0.0; + late double _longitude = 0.0; double get latitude => _latitude; double get longitude => _longitude; - late int laserSelectionDuration; + late int laserSelectionDuration = 0; ProjectViewModel() { try { diff --git a/lib/main.dart b/lib/main.dart index 1842c15e..ef50efaa 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -71,7 +71,7 @@ class _MyApp extends State { //1231755 //0567184134 mobile - //2466305493 + //246305493 @@ -111,7 +111,7 @@ class _MyApp extends State { // SystemChrome.setPreferredOrientations([ // DeviceOrientation.portraitUp, - // DeviceOrientation.portraitDown, + // DeviceOrientationO.portraitDown, // ]); // final themeNotifier = Provider.of(context); precacheImage(AssetImage('assets/images/powerd-by.jpg'), context); @@ -158,6 +158,7 @@ class _MyApp extends State { ], child: Consumer( builder: (context, projectProvider, child) => MaterialApp( + builder: (_, mchild) { return MediaQuery( data: MediaQuery.of(context).copyWith( diff --git a/lib/models/InPatientServices/get_admission_info_response_model.dart b/lib/models/InPatientServices/get_admission_info_response_model.dart index 25d87884..85fe08d1 100644 --- a/lib/models/InPatientServices/get_admission_info_response_model.dart +++ b/lib/models/InPatientServices/get_admission_info_response_model.dart @@ -1,24 +1,24 @@ class GetAdmissionInfoResponseModel { - String setupID; - int projectID; - int admissionNo; - String admissionDate; - int admissionRequestNo; - int admissionType; - int patientType; - int patientID; - int clinicID; - int doctorID; - int admittingClinicID; - int admittingDoctorID; - int categoryID; - String roomID; - String bedID; + String? setupID; + int? projectID; + int? admissionNo; + String? admissionDate; + int? admissionRequestNo; + int? admissionType; + int? patientType; + int? patientID; + int? clinicID; + int? doctorID; + int? admittingClinicID; + int? admittingDoctorID; + int? categoryID; + String? roomID; + String? bedID; dynamic dischargeDate; - int approvalNo; - int status; - String statusDesc; - String statusDescN; + int? approvalNo; + int? status; + String? statusDesc; + String? statusDescN; GetAdmissionInfoResponseModel( {this.setupID, diff --git a/lib/models/InPatientServices/get_admission_request_info_response_model.dart b/lib/models/InPatientServices/get_admission_request_info_response_model.dart index c11a7ccd..73de052b 100644 --- a/lib/models/InPatientServices/get_admission_request_info_response_model.dart +++ b/lib/models/InPatientServices/get_admission_request_info_response_model.dart @@ -1,16 +1,16 @@ class GetAdmissionRequestInfoResponseModel { - int admissionRequestNo; - String clinicName; - String doctorName; - String expectedAdmissionDate; - List medicalInstructions; + int? admissionRequestNo; + String? clinicName; + String? doctorName; + String? expectedAdmissionDate; + List ?medicalInstructions; dynamic medicalInstructionsXML; - String medicalRemarks; - int projectId; - String projectName; - String setupId; - int clinicId; - int doctorId; + String? medicalRemarks; + int? projectId; + String? projectName; + String? setupId; + int? clinicId; + int? doctorId; GetAdmissionRequestInfoResponseModel( {this.admissionRequestNo, @@ -36,7 +36,7 @@ class GetAdmissionRequestInfoResponseModel { if (json['medicaLInstructions'] != null) { medicalInstructions = []; json['medicaLInstructions'].forEach((v) { - medicalInstructions.add(new MedicaLInstructions.fromJson(v)); + medicalInstructions!.add(new MedicaLInstructions.fromJson(v)); }); } medicalInstructionsXML = json['medicalInstructionsXML']; @@ -55,7 +55,7 @@ class GetAdmissionRequestInfoResponseModel { data['doctorId'] = this.doctorId; data['expectedAdmissionDate'] = this.expectedAdmissionDate; if (this.medicalInstructions != null) { - data['medicaLInstructions'] = this.medicalInstructions.map((v) => v.toJson()).toList(); + data['medicaLInstructions'] = this.medicalInstructions!.map((v) => v.toJson()).toList(); } data['medicalInstructionsXML'] = this.medicalInstructionsXML; data['medicalRemarks'] = this.medicalRemarks; @@ -67,8 +67,8 @@ class GetAdmissionRequestInfoResponseModel { } class MedicaLInstructions { - String description; - int parameterCode; + String? description; + int? parameterCode; MedicaLInstructions({this.description, this.parameterCode}); diff --git a/lib/models/InPatientServices/get_admitted_patient_response_model.dart b/lib/models/InPatientServices/get_admitted_patient_response_model.dart index 17836ed1..6bc55ae9 100644 --- a/lib/models/InPatientServices/get_admitted_patient_response_model.dart +++ b/lib/models/InPatientServices/get_admitted_patient_response_model.dart @@ -1,25 +1,25 @@ class GetAdmittedPatientsResponseModel { - String setupID; - int projectID; - int admissionNo; - String admissionDate; - int patientType; - int patientID; - int clinicID; - int doctorID; - String roomID; - String bedID; - int status; - int admissionStatus; - String createdOn; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; + String? setupID; + int? projectID; + int? admissionNo; + String? admissionDate; + int? patientType; + int? patientID; + int? clinicID; + int? doctorID; + String? roomID; + String? bedID; + int? status; + int? admissionStatus; + String? createdOn; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + int? gender; + String? dateofBirth; dynamic companionFirstName; dynamic companionMiddleName; dynamic companionLastName; @@ -28,28 +28,28 @@ class GetAdmittedPatientsResponseModel { dynamic companionLastNameN; dynamic companionID; dynamic companionGender; - bool isHasCompanion; - int buildingID; - int floorID; - int nursingStationID; - int dietType; - String dietTypeDateCahnged; - String dietTypeDescription; - String dietTypeDescriptionN; + bool? isHasCompanion; + int? buildingID; + int? floorID; + int? nursingStationID; + int? dietType; + String? dietTypeDateCahnged; + String? dietTypeDescription; + String? dietTypeDescriptionN; dynamic allergyDiseaseDateCahnged; dynamic allergyDiseaseChecked; dynamic doctorRemarks; dynamic allergyRemarks; - String age; + String? age; dynamic allergies; - String companionFullName; - bool dietTypeChanged; - String dietTypeDateCahngedDate; - String genderDescription; + String? companionFullName; + bool? dietTypeChanged; + String? dietTypeDateCahngedDate; + String? genderDescription; dynamic genderImageUrl; - bool hasAllergy; - bool isNewAdmitted; - String patientFullName; + bool? hasAllergy; + bool? isNewAdmitted; + String? patientFullName; dynamic allergyRemark; GetAdmittedPatientsResponseModel( diff --git a/lib/models/InPatientServices/get_general_instructions_response_model.dart b/lib/models/InPatientServices/get_general_instructions_response_model.dart index e582782d..7869a40e 100644 --- a/lib/models/InPatientServices/get_general_instructions_response_model.dart +++ b/lib/models/InPatientServices/get_general_instructions_response_model.dart @@ -1,12 +1,12 @@ class GetGeneralInstructions { - int rowID; - int iD; - int projectID; - String text; - String textN; - bool isActive; - int createdBy; - String createdOn; + int? rowID; + int? iD; + int? projectID; + String? text; + String? textN; + bool? isActive; + int? createdBy; + String? createdOn; dynamic editedBy; dynamic editedOn; diff --git a/lib/models/InPatientServices/get_inpatient_advance_history_response_model.dart b/lib/models/InPatientServices/get_inpatient_advance_history_response_model.dart index fcc42771..d6753707 100644 --- a/lib/models/InPatientServices/get_inpatient_advance_history_response_model.dart +++ b/lib/models/InPatientServices/get_inpatient_advance_history_response_model.dart @@ -1,9 +1,9 @@ class InPatientAdvanceHistoryResponseModel { - int advanceNumber; - int errorCode; - String message; - List responseInpatientAdvanceInfo; - int statusCode; + int? advanceNumber; + int? errorCode; + String? message; + List? responseInpatientAdvanceInfo; + int? statusCode; InPatientAdvanceHistoryResponseModel({this.advanceNumber, this.errorCode, this.message, this.responseInpatientAdvanceInfo, this.statusCode}); @@ -14,7 +14,7 @@ class InPatientAdvanceHistoryResponseModel { if (json['responseInpatientAdvanceInfo'] != null) { responseInpatientAdvanceInfo = []; json['responseInpatientAdvanceInfo'].forEach((v) { - responseInpatientAdvanceInfo.add(new ResponseInpatientAdvanceInfo.fromJson(v)); + responseInpatientAdvanceInfo!.add(new ResponseInpatientAdvanceInfo.fromJson(v)); }); } statusCode = json['statusCode']; @@ -26,7 +26,7 @@ class InPatientAdvanceHistoryResponseModel { data['errorCode'] = this.errorCode; data['message'] = this.message; if (this.responseInpatientAdvanceInfo != null) { - data['responseInpatientAdvanceInfo'] = this.responseInpatientAdvanceInfo.map((v) => v.toJson()).toList(); + data['responseInpatientAdvanceInfo'] = this.responseInpatientAdvanceInfo!.map((v) => v.toJson()).toList(); } data['statusCode'] = this.statusCode; return data; @@ -34,14 +34,14 @@ class InPatientAdvanceHistoryResponseModel { } class ResponseInpatientAdvanceInfo { - int admissionNo; - int admissionReqNo; - String createdOn; - int patientId; - int projectId; - num requestedAmount; - String setupId; - int status; + int? admissionNo; + int? admissionReqNo; + String? createdOn; + int? patientId; + int? projectId; + num? requestedAmount; + String? setupId; + int? status; ResponseInpatientAdvanceInfo({this.admissionNo, this.admissionReqNo, this.createdOn, this.patientId, this.projectId, this.requestedAmount, this.setupId, this.status}); diff --git a/lib/models/InPatientServices/get_inpatient_advance_requests_response_model.dart b/lib/models/InPatientServices/get_inpatient_advance_requests_response_model.dart index b5f4fb49..658cbfa3 100644 --- a/lib/models/InPatientServices/get_inpatient_advance_requests_response_model.dart +++ b/lib/models/InPatientServices/get_inpatient_advance_requests_response_model.dart @@ -1,9 +1,9 @@ class InPatientAdvanceResponseModel { - int advanceNumber; + int? advanceNumber; Null errorCode; - String message; - List responseInpatientAdvanceInfo; - int statusCode; + String? message; + List? responseInpatientAdvanceInfo; + int? statusCode; InPatientAdvanceResponseModel({this.advanceNumber, this.errorCode, this.message, this.responseInpatientAdvanceInfo, this.statusCode}); @@ -14,7 +14,7 @@ class InPatientAdvanceResponseModel { if (json['responseInpatientAdvanceInfo'] != null) { responseInpatientAdvanceInfo = []; json['responseInpatientAdvanceInfo'].forEach((v) { - responseInpatientAdvanceInfo.add(new ResponseInpatientAdvanceInfo.fromJson(v)); + responseInpatientAdvanceInfo!.add(new ResponseInpatientAdvanceInfo.fromJson(v)); }); } statusCode = json['statusCode']; @@ -26,7 +26,7 @@ class InPatientAdvanceResponseModel { data['errorCode'] = this.errorCode; data['message'] = this.message; if (this.responseInpatientAdvanceInfo != null) { - data['responseInpatientAdvanceInfo'] = this.responseInpatientAdvanceInfo.map((v) => v.toJson()).toList(); + data['responseInpatientAdvanceInfo'] = this.responseInpatientAdvanceInfo!.map((v) => v.toJson()).toList(); } data['statusCode'] = this.statusCode; return data; @@ -34,15 +34,15 @@ class InPatientAdvanceResponseModel { } class ResponseInpatientAdvanceInfo { - int admissionNo; - int admissionReqNo; - String createdOn; - int patientId; - int projectId; - num requestedAmount; - String setupId; - int status; - int paymentRequestID; + int? admissionNo; + int? admissionReqNo; + String? createdOn; + int? patientId; + int? projectId; + num? requestedAmount; + String? setupId; + int? status; + int? paymentRequestID; ResponseInpatientAdvanceInfo({this.admissionNo, this.admissionReqNo, this.createdOn, this.patientId, this.projectId, this.requestedAmount, this.setupId, this.status, this.paymentRequestID}); diff --git a/lib/models/InPatientServices/get_meal_items_schedule_response_model.dart b/lib/models/InPatientServices/get_meal_items_schedule_response_model.dart index c55d716d..5d3f7ddb 100644 --- a/lib/models/InPatientServices/get_meal_items_schedule_response_model.dart +++ b/lib/models/InPatientServices/get_meal_items_schedule_response_model.dart @@ -1,18 +1,18 @@ import 'package:flutter/material.dart'; class GetMealItemsScheduleResponseModel { - int itemID; - String description; - String descriptionN; + int? itemID; + String? description; + String? descriptionN; dynamic comment; dynamic commentN; - String imageURL; - bool isDefault; - int categoryID; - String categoryDescription; - String categoryDescriptionN; - int scheduleID; - int cal; + String? imageURL; + bool? isDefault; + int? categoryID; + String? categoryDescription; + String? categoryDescriptionN; + int? scheduleID; + int? cal; GetMealItemsScheduleResponseModel( {this.itemID, @@ -62,13 +62,13 @@ class GetMealItemsScheduleResponseModel { } class GetMealItemsScheduleResponseModelList { - String filterName = ""; + String? filterName; List getMealItemsScheduleResponseModelList = []; // int selectedItemID = 0; final ValueNotifier selectedItemID = ValueNotifier(0); - GetMealItemsScheduleResponseModelList({this.filterName, GetMealItemsScheduleResponseModel getMealItemsScheduleResponseModel}) { - getMealItemsScheduleResponseModelList.add(getMealItemsScheduleResponseModel); + GetMealItemsScheduleResponseModelList({this.filterName, GetMealItemsScheduleResponseModel? getMealItemsScheduleResponseModel}) { + getMealItemsScheduleResponseModelList.add(getMealItemsScheduleResponseModel!); } } diff --git a/lib/models/InPatientServices/get_meals_schedule_response_model.dart b/lib/models/InPatientServices/get_meals_schedule_response_model.dart index 178ba426..c691ee84 100644 --- a/lib/models/InPatientServices/get_meals_schedule_response_model.dart +++ b/lib/models/InPatientServices/get_meals_schedule_response_model.dart @@ -1,16 +1,16 @@ class GetMealsScheduleResponseModel { - int scheduleID; - int mealID; - String description; - String descriptionN; - int weekID; - String weekDescription; - String weekDescriptionN; - String tAT; - int dietTypeID; - int dayID; - bool isShow; - String tATTime; + int? scheduleID; + int? mealID; + String? description; + String? descriptionN; + int? weekID; + String? weekDescription; + String? weekDescriptionN; + String? tAT; + int? dietTypeID; + int? dayID; + bool? isShow; + String? tATTime; GetMealsScheduleResponseModel( {this.scheduleID, diff --git a/lib/models/InPatientServices/get_medical_instructions_response_model.dart b/lib/models/InPatientServices/get_medical_instructions_response_model.dart index 2396e588..110975ba 100644 --- a/lib/models/InPatientServices/get_medical_instructions_response_model.dart +++ b/lib/models/InPatientServices/get_medical_instructions_response_model.dart @@ -1,15 +1,15 @@ class GetMedicalInstructions { dynamic propertyChanged; - int admissionRequestNoField; - String clinicNameField; - String doctorNameField; - String expectedAdmissionDateField; - List medicaLInstructionsField; + int? admissionRequestNoField; + String? clinicNameField; + String? doctorNameField; + String? expectedAdmissionDateField; + List? medicaLInstructionsField; dynamic medicalInstructionsXMLField; - String medicalRemarksField; - int projectIdField; - String projectNameField; - String setupIdField; + String? medicalRemarksField; + int? projectIdField; + String? projectNameField; + String? setupIdField; GetMedicalInstructions( {this.propertyChanged, @@ -33,7 +33,7 @@ class GetMedicalInstructions { if (json['medicaLInstructions'] != null) { medicaLInstructionsField = []; json['medicaLInstructions'].forEach((v) { - medicaLInstructionsField.add(new MedicaLInstructionsField.fromJson(v)); + medicaLInstructionsField!.add(new MedicaLInstructionsField.fromJson(v)); }); } medicalInstructionsXMLField = json['medicalInstructionsXMLField']; @@ -51,7 +51,7 @@ class GetMedicalInstructions { data['doctorNameField'] = this.doctorNameField; data['expectedAdmissionDateField'] = this.expectedAdmissionDateField; if (this.medicaLInstructionsField != null) { - data['medicaLInstructionsField'] = this.medicaLInstructionsField.map((v) => v.toJson()).toList(); + data['medicaLInstructionsField'] = this.medicaLInstructionsField!.map((v) => v.toJson()).toList(); } data['medicalInstructionsXMLField'] = this.medicalInstructionsXMLField; data['medicalRemarksField'] = this.medicalRemarksField; @@ -64,8 +64,8 @@ class GetMedicalInstructions { class MedicaLInstructionsField { Null propertyChanged; - String descriptionField; - int parameterCodeField; + String? descriptionField; + int? parameterCodeField; MedicaLInstructionsField({this.propertyChanged, this.descriptionField, this.parameterCodeField}); diff --git a/lib/pages/InPatientServices/birth_notification.dart b/lib/pages/InPatientServices/birth_notification.dart index 23ae1a4c..6d8e60c5 100644 --- a/lib/pages/InPatientServices/birth_notification.dart +++ b/lib/pages/InPatientServices/birth_notification.dart @@ -14,7 +14,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class BirthNotification extends StatefulWidget { - const BirthNotification({Key key}) : super(key: key); + const BirthNotification({Key? key}) : super(key: key); @override State createState() => _BirthNotificationState(); @@ -29,7 +29,7 @@ class _BirthNotificationState extends State { TextEditingController babyNameAR = new TextEditingController(); TextEditingController contactNumber = new TextEditingController(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; List images = []; @@ -37,8 +37,8 @@ class _BirthNotificationState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); motherMRN.text = projectViewModel.user.patientID.toString(); - motherName.text = projectViewModel.user.firstName + " " + projectViewModel.user.lastName; - contactNumber.text = projectViewModel.user.mobileNumber; + motherName.text = projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!; + contactNumber.text = projectViewModel.user.mobileNumber!; return AppScaffold( isShowAppBar: true, isShowDecPage: false, @@ -83,7 +83,7 @@ class _BirthNotificationState extends State { TranslationBase.of(context).scanID, () { confirmAttachInsuranceCardImageDialogDialog( - context: context, name: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, fileNo: projectViewModel.user.patientID.toString()); + context: context, name: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, fileNo: projectViewModel.user.patientID.toString()); }, color: CustomColors.accentColor, disabledColor: CustomColors.grey2, @@ -195,7 +195,7 @@ class _BirthNotificationState extends State { GifLoaderDialogUtils.showMyDialog(context); service .submitBirthNotification( - projectViewModel.user.patientID, projectViewModel.inPatientProjectID, fatherNameAR.text, fatherName.text, babyNameAR.text, babyName.text, contactNumber.text, images[0], context) + projectViewModel.user.patientID!, projectViewModel.inPatientProjectID, fatherNameAR.text, fatherName.text, babyNameAR.text, babyName.text, contactNumber.text, images[0], context) .then((res) { GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully); @@ -205,7 +205,7 @@ class _BirthNotificationState extends State { }); } - void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo}) { + void confirmAttachInsuranceCardImageDialogDialog({required BuildContext context, required String name, required String fileNo}) { showDialog( context: context, builder: (cxt) => AttachInsuranceCardImageDialog( @@ -221,7 +221,7 @@ class _BirthNotificationState extends State { ); } - Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) { return Container( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), alignment: Alignment.center, diff --git a/lib/pages/InPatientServices/components/inpatient_paid_advance_payment.dart b/lib/pages/InPatientServices/components/inpatient_paid_advance_payment.dart index 460c7309..a2c550de 100644 --- a/lib/pages/InPatientServices/components/inpatient_paid_advance_payment.dart +++ b/lib/pages/InPatientServices/components/inpatient_paid_advance_payment.dart @@ -11,15 +11,15 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class InPatientPaidAdvancePayment extends StatefulWidget { - const InPatientPaidAdvancePayment({Key key}) : super(key: key); + const InPatientPaidAdvancePayment({Key? key}) : super(key: key); @override State createState() => _InPatientPaidAdvancePaymentState(); } class _InPatientPaidAdvancePaymentState extends State { - ProjectViewModel projectViewModel; - InPatientAdvanceHistoryResponseModel inPatientAdvanceHistoryResponseModel; + late ProjectViewModel projectViewModel; + InPatientAdvanceHistoryResponseModel inPatientAdvanceHistoryResponseModel = InPatientAdvanceHistoryResponseModel(); @override void initState() { @@ -36,7 +36,7 @@ class _InPatientPaidAdvancePaymentState extends State createState() => _InPatientPendingAdvancePaymentState(); } class _InPatientPendingAdvancePaymentState extends State { - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; InAppBrowser browser = new InAppBrowser(); var _InAppBrowserOptions = InAppBrowserClassOptions( @@ -58,7 +58,7 @@ class _InPatientPendingAdvancePaymentState extends State getGeneralInstructionsList; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; - GeneralInstructions({@required this.getGeneralInstructionsList}); + GeneralInstructions({required this.getGeneralInstructionsList}); @override Widget build(BuildContext context) { @@ -64,7 +64,7 @@ class GeneralInstructions extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.75, margin: EdgeInsets.only(left: 5.0, right: 5.0), - child: Text(projectViewModel.isArabic ? getGeneralInstructionsList[index].textN : getGeneralInstructionsList[index].text, + child: Text(projectViewModel.isArabic ? getGeneralInstructionsList[index].textN! : getGeneralInstructionsList[index].text!, overflow: TextOverflow.clip, style: TextStyle( fontSize: 14.0, diff --git a/lib/pages/InPatientServices/help_PRO.dart b/lib/pages/InPatientServices/help_PRO.dart index 385f0672..f5e8f6b4 100644 --- a/lib/pages/InPatientServices/help_PRO.dart +++ b/lib/pages/InPatientServices/help_PRO.dart @@ -11,7 +11,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class HelpPRO extends StatefulWidget { - const HelpPRO({Key key}) : super(key: key); + const HelpPRO({Key? key}) : super(key: key); @override State createState() => _HelpPROState(); @@ -19,7 +19,7 @@ class HelpPRO extends StatefulWidget { class _HelpPROState extends State { TextEditingController assistText = new TextEditingController(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -69,7 +69,7 @@ class _HelpPROState extends State { ); } - Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) { return Container( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), alignment: Alignment.center, @@ -155,8 +155,8 @@ class _HelpPROState extends State { ClinicListService service = new ClinicListService(); GifLoaderDialogUtils.showMyDialog(context); service - .insertInPatientOrder(projectViewModel.getAdmissionInfoResponseModel, 1, (projectViewModel.user.firstName + " " + projectViewModel.user.lastName), - (projectViewModel.user.firstNameN + " " + projectViewModel.user.lastNameN), projectViewModel.user.mobileNumber, assistText.text, context) + .insertInPatientOrder(projectViewModel.getAdmissionInfoResponseModel, 1, (projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!), + (projectViewModel.user.firstNameN! + " " + projectViewModel.user.lastNameN!), projectViewModel.user.mobileNumber!, assistText.text, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: TranslationBase.of(context).successSendReport); diff --git a/lib/pages/InPatientServices/inpatient_advance_payment.dart b/lib/pages/InPatientServices/inpatient_advance_payment.dart index 8761388a..453dc114 100644 --- a/lib/pages/InPatientServices/inpatient_advance_payment.dart +++ b/lib/pages/InPatientServices/inpatient_advance_payment.dart @@ -8,8 +8,8 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class InPatientAdvancePayment extends StatefulWidget { - InPatientAdvanceResponseModel inPatientAdvanceResponseModel; - bool isHasData; + InPatientAdvanceResponseModel? inPatientAdvanceResponseModel; + bool? isHasData; InPatientAdvancePayment({this.isHasData, this.inPatientAdvanceResponseModel}); @@ -18,8 +18,8 @@ class InPatientAdvancePayment extends StatefulWidget { } class _InPatientAdvancePaymentState extends State with SingleTickerProviderStateMixin { - TabController _tabController; - ProjectViewModel projectViewModel; + late TabController _tabController; + late ProjectViewModel projectViewModel; @override void initState() { @@ -65,7 +65,7 @@ class _InPatientAdvancePaymentState extends State with physics: BouncingScrollPhysics(), controller: _tabController, children: [ - InPatientPendingAdvancePayment(isHasData: widget.isHasData, inPatientAdvanceResponseModel: widget.inPatientAdvanceResponseModel), + InPatientPendingAdvancePayment(isHasData: widget.isHasData!, inPatientAdvanceResponseModel: widget.inPatientAdvanceResponseModel!), InPatientPaidAdvancePayment(), ], ), diff --git a/lib/pages/InPatientServices/inpatient_home.dart b/lib/pages/InPatientServices/inpatient_home.dart index bcc2010e..276435c1 100644 --- a/lib/pages/InPatientServices/inpatient_home.dart +++ b/lib/pages/InPatientServices/inpatient_home.dart @@ -29,8 +29,8 @@ class InPatientServicesHome extends StatefulWidget { } class _InPatientServicesHomeState extends State { - ProjectViewModel projectViewModel; - InPatientAdvanceResponseModel inPatientAdvanceResponseModel; + late ProjectViewModel projectViewModel; + InPatientAdvanceResponseModel inPatientAdvanceResponseModel = InPatientAdvanceResponseModel(); bool isReceivePrescriptionEnabled = false; @override @@ -76,7 +76,7 @@ class _InPatientServicesHomeState extends State { } List getInPatientServicesList(BuildContext context) { - List serviceList = List(); + List serviceList = []; serviceList.add( InkWell( @@ -259,8 +259,8 @@ class _InPatientServicesHomeState extends State { ClinicListService service = new ClinicListService(); GifLoaderDialogUtils.showMyDialog(context); service - .insertInPatientOrder(projectViewModel.getAdmissionInfoResponseModel, 2, (projectViewModel.user.firstName + " " + projectViewModel.user.lastName), - (projectViewModel.user.firstNameN + " " + projectViewModel.user.lastNameN), projectViewModel.user.mobileNumber, "I need my medicines", context) + .insertInPatientOrder(projectViewModel.getAdmissionInfoResponseModel, 2, (projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!), + (projectViewModel.user.firstNameN! + " " + projectViewModel.user.lastNameN!), projectViewModel.user.mobileNumber!, "I need my medicines", context) .then((res) { GifLoaderDialogUtils.hideDialog(context); }).catchError((err) { @@ -272,7 +272,7 @@ class _InPatientServicesHomeState extends State { void openBirthNotificationsPage(BuildContext context) { ClinicListService service = new ClinicListService(); GifLoaderDialogUtils.showMyDialog(context); - service.getBirthNotification(projectViewModel.user.patientID, context).then((res) { + service.getBirthNotification(projectViewModel.user.patientID!, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res["MessageStatus"] == 1) { print(res['birthNotification']); @@ -330,19 +330,24 @@ class _InPatientServicesHomeState extends State { ClinicListService service = new ClinicListService(); GifLoaderDialogUtils.showMyDialog(context); service - .getInPatientAdvancePaymentRequests(projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.projectID : projectViewModel.getAdmissionRequestInfoResponseModel.projectId, projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionNo : 0, - projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionRequestNo : projectViewModel.getAdmissionRequestInfoResponseModel.admissionRequestNo, context) + .getInPatientAdvancePaymentRequests( + projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.projectID! : projectViewModel.getAdmissionRequestInfoResponseModel.projectId!, + projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionNo! : 0, + projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionRequestNo! : projectViewModel.getAdmissionRequestInfoResponseModel.admissionRequestNo!, + context) .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res["MessageStatus"] == 1) { if (res['responseInpatient'] != null) { inPatientAdvanceResponseModel = InPatientAdvanceResponseModel.fromJson(res["responseInpatient"]); - Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel))); + Navigator.push(context, + FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel))); } else { AppToast.showErrorToast(message: TranslationBase.of(context).noData); } } else { - Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel))); + Navigator.push(context, + FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel))); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/InPatientServices/meal_plan.dart b/lib/pages/InPatientServices/meal_plan.dart index 053ea6e3..4e300900 100644 --- a/lib/pages/InPatientServices/meal_plan.dart +++ b/lib/pages/InPatientServices/meal_plan.dart @@ -18,15 +18,15 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class MealPlanPage extends StatefulWidget { - const MealPlanPage({Key key}) : super(key: key); + const MealPlanPage({Key? key}) : super(key: key); @override State createState() => _MealPlanPageState(); } class _MealPlanPageState extends State { - ProjectViewModel projectViewModel; - GetAdmittedPatientsResponseModel getAdmittedPatientsResponseModel; + late ProjectViewModel projectViewModel; + GetAdmittedPatientsResponseModel getAdmittedPatientsResponseModel = GetAdmittedPatientsResponseModel(); List getMealsScheduleResponseModelList = []; List getMealItemsScheduleResponseModelBreakfast = []; @@ -69,13 +69,13 @@ class _MealPlanPageState extends State { ? Column( children: [ Container( - decoration: containerRadius((getMealsScheduleResponseModelList[0].isShow) ? Colors.white : Colors.grey[300], 12), + decoration: containerRadius((getMealsScheduleResponseModelList[0].isShow)! ? Colors.white : Colors.grey[300]!, 12), child: AppExpandableNotifier( - title: "Breakfast TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[0].tATTime), + title: "Breakfast TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[0].tATTime!), isTitleSingleLine: false, widgetColor: Colors.transparent, - isExpand: getMealsScheduleResponseModelList[0].isShow, - isDisabled: !getMealsScheduleResponseModelList[0].isShow, + isExpand: getMealsScheduleResponseModelList[0].isShow!, + isDisabled: !getMealsScheduleResponseModelList[0].isShow!, bodyWidget: Column( children: [ getDivider(), @@ -88,7 +88,7 @@ class _MealPlanPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(_getMealItemsScheduleResponseModelBreakfast[index].filterName, + Text(_getMealItemsScheduleResponseModelBreakfast[index].filterName!, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)), SizedBox( height: 12.0, @@ -110,7 +110,7 @@ class _MealPlanPageState extends State { groupValue: _getMealItemsScheduleResponseModelBreakfast[index].selectedItemID.value, activeColor: Colors.red[800], onChanged: (value) { - _getMealItemsScheduleResponseModelBreakfast[index].selectedItemID.value = value; + _getMealItemsScheduleResponseModelBreakfast[index].selectedItemID.value = value!; }, ); }), @@ -131,8 +131,8 @@ class _MealPlanPageState extends State { MyRichText( "", projectViewModel.isArabic - ? _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].descriptionN - : _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].description, + ? _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].descriptionN! + : _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].description!, projectViewModel.isArabic), ], ), @@ -173,13 +173,13 @@ class _MealPlanPageState extends State { ), mHeight(21), Container( - decoration: containerRadius(getMealsScheduleResponseModelList[1].isShow ? Colors.white : Colors.grey[300], 12), + decoration: containerRadius(getMealsScheduleResponseModelList[1].isShow! ? Colors.white : Colors.grey[300]!, 12), child: AppExpandableNotifier( - title: "Lunch TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[1].tATTime), + title: "Lunch TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[1].tATTime!), isTitleSingleLine: false, widgetColor: Colors.transparent, - isExpand: getMealsScheduleResponseModelList[1].isShow, - isDisabled: !getMealsScheduleResponseModelList[1].isShow, + isExpand: getMealsScheduleResponseModelList[1].isShow!, + isDisabled: !getMealsScheduleResponseModelList[1].isShow!, bodyWidget: Column( children: [ getDivider(), @@ -192,7 +192,7 @@ class _MealPlanPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(_getMealItemsScheduleResponseModelLunch[index].filterName, + Text(_getMealItemsScheduleResponseModelLunch[index].filterName!, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)), SizedBox( height: 12.0, @@ -214,7 +214,7 @@ class _MealPlanPageState extends State { groupValue: _getMealItemsScheduleResponseModelLunch[index].selectedItemID.value, activeColor: Colors.red[800], onChanged: (value) { - _getMealItemsScheduleResponseModelLunch[index].selectedItemID.value = value; + _getMealItemsScheduleResponseModelLunch[index].selectedItemID.value = value!; }, ); }), @@ -235,8 +235,8 @@ class _MealPlanPageState extends State { MyRichText( "", projectViewModel.isArabic - ? _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].descriptionN - : _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].description, + ? _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].descriptionN! + : _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].description!, projectViewModel.isArabic), ], ), @@ -277,13 +277,13 @@ class _MealPlanPageState extends State { ), mHeight(21), Container( - decoration: containerRadius(getMealsScheduleResponseModelList[2].isShow ? Colors.white : Colors.grey[300], 12), + decoration: containerRadius(getMealsScheduleResponseModelList[2].isShow! ? Colors.white : Colors.grey[300]!, 12), child: AppExpandableNotifier( - title: "Dinner TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[2].tATTime), + title: "Dinner TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[2].tATTime!), isTitleSingleLine: false, widgetColor: Colors.transparent, - isExpand: getMealsScheduleResponseModelList[2].isShow, - isDisabled: !getMealsScheduleResponseModelList[2].isShow, + isExpand: getMealsScheduleResponseModelList[2].isShow!, + isDisabled: !getMealsScheduleResponseModelList[2].isShow!, bodyWidget: Column( children: [ getDivider(), @@ -296,7 +296,7 @@ class _MealPlanPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(_getMealItemsScheduleResponseModelDinner[index].filterName, + Text(_getMealItemsScheduleResponseModelDinner[index].filterName!, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)), SizedBox( height: 12.0, @@ -318,7 +318,7 @@ class _MealPlanPageState extends State { groupValue: _getMealItemsScheduleResponseModelDinner[index].selectedItemID.value, activeColor: Colors.red[800], onChanged: (value) { - _getMealItemsScheduleResponseModelDinner[index].selectedItemID.value = value; + _getMealItemsScheduleResponseModelDinner[index].selectedItemID.value = value!; }, ); }), @@ -339,8 +339,8 @@ class _MealPlanPageState extends State { MyRichText( "", projectViewModel.isArabic - ? _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].descriptionN - : _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].description, + ? _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].descriptionN! + : _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].description!, projectViewModel.isArabic), ], ), @@ -398,8 +398,8 @@ class _MealPlanPageState extends State { valueListenable: isFasting, builder: (context, val, child) { return Checkbox( - onChanged: (bool value) { - isFasting.value = value; + onChanged: (bool? value) { + isFasting.value = value!; isFastingVal = value; }, value: isFastingVal, @@ -453,8 +453,8 @@ class _MealPlanPageState extends State { ClinicListService service = new ClinicListService(); GifLoaderDialogUtils.showMyDialog(context); service - .placeMealPlanOrder(getAdmittedPatientsResponseModel.projectID, selectedMealScheduleID, selectedItemIDs.join(","), projectViewModel.user.patientID, - getAdmittedPatientsResponseModel.admissionNo, getAdmittedPatientsResponseModel.isHasCompanion, isFastingVal, context) + .placeMealPlanOrder(getAdmittedPatientsResponseModel.projectID!, selectedMealScheduleID, selectedItemIDs.join(","), projectViewModel.user.patientID!, + getAdmittedPatientsResponseModel.admissionNo!, getAdmittedPatientsResponseModel.isHasCompanion!, isFastingVal, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: "Your meal order has been received successfully"); @@ -479,13 +479,13 @@ class _MealPlanPageState extends State { void getAdmittedPatientDetails() { ClinicListService service = new ClinicListService(); GifLoaderDialogUtils.showMyDialog(context); - service.getAdmittedPatientDetails(projectViewModel.user.patientID, projectViewModel.inPatientProjectID, projectViewModel.getAdmissionInfoResponseModel.admissionNo, 0, 0, 0, context).then((res) { + service.getAdmittedPatientDetails(projectViewModel.user.patientID!, projectViewModel.inPatientProjectID, projectViewModel.getAdmissionInfoResponseModel.admissionNo!, 0, 0, 0, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res["List_MOP_AdmittedPatients"] != null && res["List_MOP_AdmittedPatients"].length != 0) { print(res["List_MOP_AdmittedPatients"]); getAdmittedPatientsResponseModel = new GetAdmittedPatientsResponseModel.fromJson(res["List_MOP_AdmittedPatients"][0]); print(getAdmittedPatientsResponseModel.dietType); - getCurrentWeekIDAndDay(getAdmittedPatientsResponseModel.dietType); + getCurrentWeekIDAndDay(getAdmittedPatientsResponseModel.dietType!); } else { AppToast.showErrorToast(message: "No data found for admitted patient"); getCurrentWeekIDAndDay(1); @@ -513,23 +513,23 @@ class _MealPlanPageState extends State { void getMealsOfScheduleID(int dietType) { ClinicListService service = new ClinicListService(); GifLoaderDialogUtils.showMyDialog(context); - service.getMealsOfScheduleID(projectViewModel.inPatientProjectID, projectViewModel.getAdmissionInfoResponseModel.admissionNo, dietType, currentWeek, currentDay, context).then((res) { + service.getMealsOfScheduleID(projectViewModel.inPatientProjectID, projectViewModel.getAdmissionInfoResponseModel.admissionNo!, dietType, currentWeek, currentDay, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res["List_MOP_MealsOfScheduleID_Mobile"] != null && res["List_MOP_MealsOfScheduleID_Mobile"].length != 0) { res['List_MOP_MealsOfScheduleID_Mobile'].forEach((scheduleItem) { getMealsScheduleResponseModelList.add(GetMealsScheduleResponseModel.fromJson(scheduleItem)); }); - if (getMealsScheduleResponseModelList[0].isShow) { - selectedMealScheduleID = getMealsScheduleResponseModelList[0].scheduleID; - getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[0].scheduleID, 1); + if (getMealsScheduleResponseModelList[0].isShow!) { + selectedMealScheduleID = getMealsScheduleResponseModelList[0].scheduleID!; + getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[0].scheduleID!, 1); } - if (getMealsScheduleResponseModelList[1].isShow) { - selectedMealScheduleID = getMealsScheduleResponseModelList[1].scheduleID; - getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[1].scheduleID, 2); + if (getMealsScheduleResponseModelList[1].isShow!) { + selectedMealScheduleID = getMealsScheduleResponseModelList[1].scheduleID!; + getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[1].scheduleID!, 2); } - if (getMealsScheduleResponseModelList[2].isShow) { - selectedMealScheduleID = getMealsScheduleResponseModelList[2].scheduleID; - getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[2].scheduleID, 3); + if (getMealsScheduleResponseModelList[2].isShow!) { + selectedMealScheduleID = getMealsScheduleResponseModelList[2].scheduleID!; + getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[2].scheduleID!, 3); } } else { AppToast.showErrorToast(message: "No meal schedule found for admitted patient"); @@ -589,8 +589,8 @@ class _MealPlanPageState extends State { _getMealItemsScheduleResponseModelBreakfast.forEach((element) { element.getMealItemsScheduleResponseModelList.forEach((elementInner) { - if (elementInner.isDefault) { - element.selectedItemID.value = elementInner.itemID; + if (elementInner.isDefault!) { + element.selectedItemID.value = elementInner.itemID!; } }); }); @@ -611,8 +611,8 @@ class _MealPlanPageState extends State { _getMealItemsScheduleResponseModelLunch.forEach((element) { element.getMealItemsScheduleResponseModelList.forEach((elementInner) { - if (elementInner.isDefault) { - element.selectedItemID.value = elementInner.itemID; + if (elementInner.isDefault!) { + element.selectedItemID.value = elementInner.itemID!; } }); }); @@ -632,8 +632,8 @@ class _MealPlanPageState extends State { }); _getMealItemsScheduleResponseModelDinner.forEach((element) { element.getMealItemsScheduleResponseModelList.forEach((elementInner) { - if (elementInner.isDefault) { - element.selectedItemID.value = elementInner.itemID; + if (elementInner.isDefault!) { + element.selectedItemID.value = elementInner.itemID!; } }); }); diff --git a/lib/pages/InPatientServices/medical_instructions.dart b/lib/pages/InPatientServices/medical_instructions.dart index 099c5558..bbab1b5f 100644 --- a/lib/pages/InPatientServices/medical_instructions.dart +++ b/lib/pages/InPatientServices/medical_instructions.dart @@ -11,14 +11,14 @@ import '../../models/InPatientServices/get_medical_instructions_response_model.d class MedicalInstructionsPage extends StatefulWidget { List getMedicalInstructionsList; - MedicalInstructionsPage({@required this.getMedicalInstructionsList}); + MedicalInstructionsPage({required this.getMedicalInstructionsList}); @override State createState() => _MedicalInstructionsPageState(); } class _MedicalInstructionsPageState extends State { - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -59,7 +59,7 @@ class _MedicalInstructionsPageState extends State { padding: EdgeInsets.all(16.0), child: Container( child: ListView.separated( - itemCount: widget.getMedicalInstructionsList[0].medicaLInstructionsField.length, + itemCount: widget.getMedicalInstructionsList[0].medicaLInstructionsField!.length, itemBuilder: (BuildContext context, int index) { return Container( child: Row( @@ -71,7 +71,7 @@ class _MedicalInstructionsPageState extends State { Container( width: MediaQuery.of(context).size.width * 0.75, margin: EdgeInsets.only(left: 5.0, right: 5.0), - child: Text(widget.getMedicalInstructionsList[0].medicaLInstructionsField[index].descriptionField, + child: Text(widget.getMedicalInstructionsList[0].medicaLInstructionsField![index].descriptionField!, overflow: TextOverflow.clip, style: TextStyle( fontSize: 14.0, diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index 2083ce39..93e74183 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -11,14 +11,14 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class AttachInsuranceCardImageDialog extends StatefulWidget { - final String name; - final String fileNo; - final String identificationNo; - final String mobileNo; - final Function(File file, String image) image; - final bool isBirthNotification; + String name; + String fileNo; + String? identificationNo; + String? mobileNo; + Function(File file, String image) image; + bool isBirthNotification; - const AttachInsuranceCardImageDialog({Key? key, required this.name, required this.fileNo, required this.identificationNo, required this.mobileNo, required this.image, this.isBirthNotification = false}) : super(key: key); + AttachInsuranceCardImageDialog({Key? key, required this.name, required this.fileNo, this.identificationNo, this.mobileNo, required this.image, this.isBirthNotification = false}) : super(key: key); @override _AttachInsuranceCardImageDialogState createState() => _AttachInsuranceCardImageDialogState(); @@ -30,8 +30,8 @@ class _AttachInsuranceCardImageDialogState extends State _AppExpandableNotifier();