diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 61f83109..2c82edf0 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -545,6 +545,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -727,6 +728,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; SWIFT_COMPILATION_MODE = singlefile; "SWIFT_COMPILATION_MODE[arch=*]" = singlefile; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/lib/config/config.dart b/lib/config/config.dart index f3f37cb4..b1dc8323 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -621,7 +621,7 @@ class AppGlobal { AppSharedPreferences sharedPref = AppSharedPreferences(); - static bool isNetworkDebugEnabled = false; + static bool isNetworkDebugEnabled = true; static String appLanguage = ""; Request getPublicRequest() { diff --git a/lib/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart index 67acc1aa..d95ced18 100644 --- a/lib/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart +++ b/lib/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart @@ -7,7 +7,7 @@ class CheckActivationCodeForEReferralResponseModel { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; diff --git a/lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_request_model.dart index 0b897806..f2302b2a 100644 --- a/lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_request_model.dart +++ b/lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_request_model.dart @@ -5,7 +5,7 @@ class GetAllCitiesRequestModel { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; diff --git a/lib/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart index 5efe2317..c3d3b2cb 100644 --- a/lib/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart +++ b/lib/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart @@ -1,11 +1,11 @@ class GetAllProjectsResponseModel { String? desciption; - Null desciptionN; + dynamic desciptionN; int? iD; String? legalName; String? legalNameN; String? name; - Null nameN; + dynamic nameN; String? phoneNumber; String? setupID; int? distanceInKilometers; @@ -13,7 +13,7 @@ class GetAllProjectsResponseModel { String? latitude; String? longitude; int? mainProjectID; - Null projectOutSA; + dynamic projectOutSA; bool? usingInDoctorApp; GetAllProjectsResponseModel( diff --git a/lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_request_model.dart index 081c071e..a85b74ac 100644 --- a/lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_request_model.dart +++ b/lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_request_model.dart @@ -5,7 +5,7 @@ class GetAllRelationshipTypeRequestModel { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; diff --git a/lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart index d4995b4e..deb3a92d 100644 --- a/lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart +++ b/lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart @@ -6,7 +6,7 @@ class SearchEReferralRequestModel { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; int? referralNumber; diff --git a/lib/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart index 1a8588f8..43e4c2eb 100644 --- a/lib/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart +++ b/lib/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart @@ -7,7 +7,7 @@ class SendActivationCodeForEReferralRequestModel { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; diff --git a/lib/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart b/lib/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart index 49771f44..dbc6b990 100644 --- a/lib/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart +++ b/lib/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart @@ -10,8 +10,8 @@ class ClinicCategory { String? fullmageAR; bool? isActive; bool? isCategoryGroup; - Null sortOrderAR; - Null sortOrderEN; + dynamic sortOrderAR; + dynamic sortOrderEN; String? clinicName; ClinicCategory( diff --git a/lib/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart b/lib/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart index 9f5204dc..04e839ec 100644 --- a/lib/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart +++ b/lib/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart @@ -3,10 +3,10 @@ class DiseasesByClinic { String? diseasesEN; String? diseasesAR; int? diseasesCategoryID; - Null diseasesCategoryEN; - Null diseasesCategoryAR; + dynamic diseasesCategoryEN; + dynamic diseasesCategoryAR; String? diseases; - Null diseasesCategory; + dynamic diseasesCategory; DiseasesByClinic( {this.diseasesID, diff --git a/lib/core/model/childvaccines/create_new_user_model.dart b/lib/core/model/childvaccines/create_new_user_model.dart index eb148648..2d496651 100644 --- a/lib/core/model/childvaccines/create_new_user_model.dart +++ b/lib/core/model/childvaccines/create_new_user_model.dart @@ -1,42 +1,42 @@ class CreateNewUser_New { - Null date; + dynamic date; int? languageID; int? serviceName; - Null time; - Null androidLink; - Null authenticationTokenID; - Null data; + dynamic time; + dynamic androidLink; + dynamic authenticationTokenID; + dynamic data; bool? dataw; int? dietType; - Null errorCode; - Null errorEndUserMessage; - Null errorEndUserMessageN; - Null errorMessage; + dynamic errorCode; + dynamic errorEndUserMessage; + dynamic errorEndUserMessageN; + dynamic errorMessage; int? errorType; int? foodCategory; - Null iOSLink; + dynamic iOSLink; bool? isAuthenticated; int? mealOrderStatus; int? mealType; int? messageStatus; int? numberOfResultRecords; - Null patientBlodType; - Null successMsg; - Null successMsgN; - Null htmlResult; + dynamic patientBlodType; + dynamic successMsg; + dynamic successMsgN; + dynamic htmlResult; bool? isHMGPatient; bool? isRegister; bool? isSendSMS; - Null listBabyInformationModel; - Null listBabyNeedReminderModel; - Null listCreateVaccinationTableModel; - Null listHisPatientModel; - Null listUserInformationModel; - Null listUserInformationModelNew; - Null listVaccinationTableModel; - Null tokinID; + dynamic listBabyInformationModel; + dynamic listBabyNeedReminderModel; + dynamic listCreateVaccinationTableModel; + dynamic listHisPatientModel; + dynamic listUserInformationModel; + dynamic listUserInformationModelNew; + dynamic listVaccinationTableModel; + dynamic tokinID; int? userID; - Null verificationCode; + dynamic verificationCode; CreateNewUser_New( {this.date, diff --git a/lib/core/model/doctor/doctor_profile.dart b/lib/core/model/doctor/doctor_profile.dart index b86db2b7..36d77f53 100644 --- a/lib/core/model/doctor/doctor_profile.dart +++ b/lib/core/model/doctor/doctor_profile.dart @@ -1,34 +1,34 @@ class DoctorProfile { int? doctorID; String? doctorName; - Null doctorNameN; + dynamic doctorNameN; int? clinicID; String? clinicDescription; - Null clinicDescriptionN; - Null licenseExpiry; + dynamic clinicDescriptionN; + dynamic licenseExpiry; int? employmentType; - Null setupID; + dynamic setupID; int? projectID; String? projectName; String? nationalityID; String? nationalityName; - Null nationalityNameN; + dynamic nationalityNameN; int? gender; String? genderDescription; - Null genderDescriptionN; - Null doctorTitle; - Null projectNameN; + dynamic genderDescriptionN; + dynamic doctorTitle; + dynamic projectNameN; bool? isAllowWaitList; String? titleDescription; - Null titleDescriptionN; - Null isRegistered; - Null isDoctorDummy; + dynamic titleDescriptionN; + dynamic isRegistered; + dynamic isDoctorDummy; bool? isActive; - Null isDoctorAppointmentDisplayed; + dynamic isDoctorAppointmentDisplayed; bool? doctorClinicActive; - Null isbookingAllowed; + dynamic isbookingAllowed; String? doctorCases; - Null doctorPicture; + dynamic doctorPicture; String? doctorProfileInfo; List? specialty; int? actualDoctorRate; diff --git a/lib/core/model/doctor/doctor_rating.dart b/lib/core/model/doctor/doctor_rating.dart index 3c879fd7..7996cbaa 100644 --- a/lib/core/model/doctor/doctor_rating.dart +++ b/lib/core/model/doctor/doctor_rating.dart @@ -1,6 +1,6 @@ class DoctorRating { - Null projectID; - Null clinicID; + dynamic projectID; + dynamic clinicID; int? doctorID; int? patientNumber; int? doctorRate; diff --git a/lib/core/model/eye/AppoimentAllHistoryResult.dart b/lib/core/model/eye/AppoimentAllHistoryResult.dart index 13d53e60..fb62f3f5 100644 --- a/lib/core/model/eye/AppoimentAllHistoryResult.dart +++ b/lib/core/model/eye/AppoimentAllHistoryResult.dart @@ -5,7 +5,7 @@ class AppoimentAllHistoryResultList { int? projectID; int? appointmentNo; String? appointmentDate; - Null appointmentDateN; + dynamic appointmentDateN; int? appointmentType; DateTime? bookDate; dynamic patientType; @@ -26,14 +26,14 @@ class AppoimentAllHistoryResultList { String? confirmedOn; int? arrivalChangedBy; String? arrivedOn; - Null editedBy; - Null editedOn; - Null doctorName; - Null doctorNameN; + dynamic editedBy; + dynamic editedOn; + dynamic doctorName; + dynamic doctorNameN; String? statusDesc; - Null statusDescN; + dynamic statusDescN; bool? vitalStatus; - Null vitalSignAppointmentNo; + dynamic vitalSignAppointmentNo; int? episodeID; int? actualDoctorRate; String? clinicName; diff --git a/lib/core/model/feedback/COC_items.dart b/lib/core/model/feedback/COC_items.dart index afbe4cf2..ed62d8ba 100644 --- a/lib/core/model/feedback/COC_items.dart +++ b/lib/core/model/feedback/COC_items.dart @@ -1,5 +1,5 @@ class COCItem { - Null appointment; + dynamic appointment; String? appointmentClinicName; String? appointmentDate; String? appointmentProjectName; diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index 2dc69ef6..9243c5ad 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -4,13 +4,13 @@ class PatientLabOrders { int? actualDoctorRate; String? clinicDescription; String? clinicDescriptionEnglish; - Null clinicDescriptionN; + dynamic clinicDescriptionN; int? clinicID; int? doctorID; String? doctorImageURL; String? doctorName; String? doctorNameEnglish; - Null doctorNameN; + dynamic doctorNameN; int? doctorRate; String ?doctorTitle; int? gender; @@ -31,7 +31,7 @@ class PatientLabOrders { String? patientID; String? projectID; String? projectName; - Null projectNameN; + dynamic projectNameN; String? qR; String? setupID; List? speciality; diff --git a/lib/core/model/my_balance/patient_info_and_mobile_number.dart b/lib/core/model/my_balance/patient_info_and_mobile_number.dart index a201c4eb..45b9402e 100644 --- a/lib/core/model/my_balance/patient_info_and_mobile_number.dart +++ b/lib/core/model/my_balance/patient_info_and_mobile_number.dart @@ -5,18 +5,18 @@ class PatientInfoAndMobileNumber { int? patientType; int? patientID; String? firstName; - Null middleName; - Null lastName; - Null firstNameN; - Null middleNameN; - Null lastNameN; - Null gender; - Null dateofBirth; - Null dateofBirthN; - Null nationalityID; + dynamic middleName; + dynamic lastName; + dynamic firstNameN; + dynamic middleNameN; + dynamic lastNameN; + dynamic gender; + dynamic dateofBirth; + dynamic dateofBirthN; + dynamic nationalityID; String? mobileNumber; String? emailAddress; - Null zipCode; + dynamic zipCode; PatientInfoAndMobileNumber( {this.setupID, diff --git a/lib/core/model/pharmacies/Reviews.dart b/lib/core/model/pharmacies/Reviews.dart index da563239..47975cdd 100644 --- a/lib/core/model/pharmacies/Reviews.dart +++ b/lib/core/model/pharmacies/Reviews.dart @@ -16,7 +16,7 @@ class Reviews { int? helpfulNoTotal; String? createdOnUtc; Customer? customer; - //Null product; + //dynamic product; Reviews( {this.id, diff --git a/lib/core/model/pharmacies/ShoppingCart.dart b/lib/core/model/pharmacies/ShoppingCart.dart index d19aba2c..09629352 100644 --- a/lib/core/model/pharmacies/ShoppingCart.dart +++ b/lib/core/model/pharmacies/ShoppingCart.dart @@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart' class ShoppingCart { int? languageId; String? id; - // List productAttributes; + // List productAttributes; double? customerEnteredPrice; int? quantity; dynamic discountAmountInclTax; @@ -74,9 +74,9 @@ class ShoppingCart { languageId = json['language_id']; id = json['id']; /*if (json['product_attributes'] != null) { - productAttributes = new List(); + productAttributes = new List(); json['product_attributes'].forEach((v) { - productAttributes.add(new Null.fromJson(v)); + productAttributes.add(new dynamic.fromJson(v)); }); }*/ customerEnteredPrice = json['customer_entered_price']; diff --git a/lib/core/model/pharmacies/recommendedProduct_model.dart b/lib/core/model/pharmacies/recommendedProduct_model.dart index a908ee79..c8f39955 100644 --- a/lib/core/model/pharmacies/recommendedProduct_model.dart +++ b/lib/core/model/pharmacies/recommendedProduct_model.dart @@ -57,7 +57,7 @@ class RecommendedProductModel { bool? allowBackInStockSubscriptions; dynamic orderMinimumQuantity; dynamic orderMaximumQuantity; -// Null allowedQuantities; +// dynamic allowedQuantities; bool? allowAddingOnlyExistingAttributeCombinations; bool? disableBuyButton; bool? disableWishlistButton; @@ -336,28 +336,28 @@ class RecommendedProductModel { productType = json['product_type']; parentGroupedProductId = json['parent_grouped_product_id']; // if (json['role_ids'] != null) { -// roleIds = new List(); +// roleIds = new List(); // json['role_ids'].forEach((v) { -// roleIds.add(new Null.fromJson(v)); +// roleIds.add(new dynamic.fromJson(v)); // }); // } // if (json['discount_ids'] != null) { -// discountIds = new List(); +// discountIds = new List(); // json['discount_ids'].forEach((v) { -// discountIds.add(new Null.fromJson(v)); +// discountIds.add(new dynamic.fromJson(v)); // }); // } // if (json['store_ids'] != null) { -// storeIds = new List(); +// storeIds = new List(); // json['store_ids'].forEach((v) { -// storeIds.add(new Null.fromJson(v)); +// storeIds.add(new dynamic.fromJson(v)); // }); // } manufacturerIds = json['manufacturer_ids'].cast(); // if (json['reviews'] != null) { -// reviews = new List(); +// reviews = new List(); // json['reviews'].forEach((v) { -// reviews.add(new Null.fromJson(v)); +// reviews.add(new dynamic.fromJson(v)); // }); // } if (json['images'] != null) { @@ -367,9 +367,9 @@ class RecommendedProductModel { }); } // if (json['attributes'] != null) { -// attributes = new List(); +// attributes = new List(); // json['attributes'].forEach((v) { -// attributes.add(new Null.fromJson(v)); +// attributes.add(new dynamic.fromJson(v)); // }); // } if (json['specifications'] != null) { @@ -379,15 +379,15 @@ class RecommendedProductModel { }); } // if (json['associated_product_ids'] != null) { -// associatedProductIds = new List(); +// associatedProductIds = new List(); // json['associated_product_ids'].forEach((v) { -// associatedProductIds.add(new Null.fromJson(v)); +// associatedProductIds.add(new dynamic.fromJson(v)); // }); // } // if (json['tags'] != null) { -// tags = new List(); +// tags = new List(); // json['tags'].forEach((v) { -// tags.add(new Null.fromJson(v)); +// tags.add(new dynamic.fromJson(v)); // }); // } vendorId = json['vendor_id']; diff --git a/lib/core/model/pharmacy/brands_model.dart b/lib/core/model/pharmacy/brands_model.dart index 0e9d7c7d..9747012f 100644 --- a/lib/core/model/pharmacy/brands_model.dart +++ b/lib/core/model/pharmacy/brands_model.dart @@ -2,7 +2,7 @@ class BrandsModel { String? id; String? name; String? namen; - Null image; + dynamic image; BrandsModel({this.id, this.name, this.namen, this.image}); diff --git a/lib/core/model/pharmacy/offers_model.dart b/lib/core/model/pharmacy/offers_model.dart index 7ba18053..99d31135 100644 --- a/lib/core/model/pharmacy/offers_model.dart +++ b/lib/core/model/pharmacy/offers_model.dart @@ -3,7 +3,7 @@ class OffersModel { String? name; String? namen; List? localizedNames; - Null description; + dynamic description; int? categoryTemplateId; String? metaKeywords; String? metaDescription; @@ -11,10 +11,10 @@ class OffersModel { int? parentCategoryId; int? pageSize; String? pageSizeOptions; - Null priceRanges; + dynamic priceRanges; bool? showOnHomePage; bool? includeInTopMenu; - Null hasDiscountsApplied; + dynamic hasDiscountsApplied; bool? published; bool? deleted; int? displayOrder; @@ -154,8 +154,8 @@ class LocalizedNames { class Image { String? src; - Null thumb; - Null attachment; + dynamic thumb; + dynamic attachment; Image({this.src, this.thumb, this.attachment}); diff --git a/lib/core/model/pharmacy/pharmacy_categorise.dart b/lib/core/model/pharmacy/pharmacy_categorise.dart index bca595b8..7b0762e9 100644 --- a/lib/core/model/pharmacy/pharmacy_categorise.dart +++ b/lib/core/model/pharmacy/pharmacy_categorise.dart @@ -72,8 +72,8 @@ class LocalizedNames { class Image { String? src; - Null thumb; - Null attachment; + dynamic thumb; + dynamic attachment; Image({this.src, this.thumb, this.attachment}); diff --git a/lib/core/model/prescriptions/perscription_pharmacy.dart b/lib/core/model/prescriptions/perscription_pharmacy.dart index 90773c79..5207ab4f 100644 --- a/lib/core/model/prescriptions/perscription_pharmacy.dart +++ b/lib/core/model/prescriptions/perscription_pharmacy.dart @@ -9,11 +9,11 @@ class PharmacyPrescriptions { String? locationDescription; dynamic locationDescriptionN; String? itemDescription; - Null itemDescriptionN; + dynamic itemDescriptionN; String? alias; int? locationTypeID; int? barcode; - Null companybarcode; + dynamic companybarcode; int? cityID; String? cityName; dynamic distanceInKilometers; @@ -22,7 +22,7 @@ class PharmacyPrescriptions { String? longitude; String? phoneNumber; String? projectImageURL; - Null sortOrder; + dynamic sortOrder; PharmacyPrescriptions( {this.expiryDate, diff --git a/lib/core/model/prescriptions/prescription_report_enh.dart b/lib/core/model/prescriptions/prescription_report_enh.dart index f3ada2d0..15fad569 100644 --- a/lib/core/model/prescriptions/prescription_report_enh.dart +++ b/lib/core/model/prescriptions/prescription_report_enh.dart @@ -2,16 +2,16 @@ class PrescriptionReportEnh { String? address; int? appointmentNo; String? clinic; - Null companyName; + dynamic companyName; int? days; String? doctorName; num? doseDailyQuantity; String? frequency; int? frequencyNumber; - Null image; - Null imageExtension; + dynamic image; + dynamic imageExtension; String? imageSRCUrl; - Null imageString; + dynamic imageString; String? imageThumbUrl; String? isCovered; String? itemDescription; @@ -21,10 +21,10 @@ class PrescriptionReportEnh { int? patientID; String? patientName; String? phoneOffice1; - Null prescriptionQR; + dynamic prescriptionQR; num? prescriptionTimes; - Null productImage; - Null productImageBase64; + dynamic productImage; + dynamic productImageBase64; String? productImageString; int? projectID; String? projectName; diff --git a/lib/core/model/prescriptions/prescription_report_inp.dart b/lib/core/model/prescriptions/prescription_report_inp.dart index cd44826e..6bb9c032 100644 --- a/lib/core/model/prescriptions/prescription_report_inp.dart +++ b/lib/core/model/prescriptions/prescription_report_inp.dart @@ -20,7 +20,7 @@ class PrescriptionReportINP { String? orderDate; int? doseDailyQuantity; int? itemID; - Null productImage; + dynamic productImage; String? sKU; String? itemDescriptionN; String? routeN; diff --git a/lib/core/model/qr/qr_parking_model.dart b/lib/core/model/qr/qr_parking_model.dart index fa3b1175..8311ac3a 100644 --- a/lib/core/model/qr/qr_parking_model.dart +++ b/lib/core/model/qr/qr_parking_model.dart @@ -1,11 +1,11 @@ class QRParkingModel { - Null totalRecords; - Null nRowID; + dynamic totalRecords; + dynamic nRowID; int? qRParkingID; String? description; String? descriptionN; - Null qRCompare; - Null qRValue; + dynamic qRCompare; + dynamic qRValue; String? imagePath; bool? isActive; int? parkingID; @@ -15,11 +15,11 @@ class QRParkingModel { int? rowID; int? gateID; int? floorID; - Null imagePath1; + dynamic imagePath1; int? createdBy; String? createdOn; - Null editedBy; - Null editedOn; + dynamic editedBy; + dynamic editedOn; String? parkingDescription; String? parkingDescriptionN; String? gateDescription; diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 45c3ebdf..4b139742 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -14,7 +14,7 @@ class FinalRadiology { String? imageURL; String? procedureID; int? appointmentNo; - Null dIAPacsURL; + dynamic dIAPacsURL; bool? isRead; String? readOn; var admissionNo; diff --git a/lib/core/model/rate/appoitment_rated.dart b/lib/core/model/rate/appoitment_rated.dart index 23a0b836..64c0f579 100644 --- a/lib/core/model/rate/appoitment_rated.dart +++ b/lib/core/model/rate/appoitment_rated.dart @@ -26,12 +26,12 @@ class AppoitmentRated { String? arrivedOn; int? editedBy; String? editedOn; - Null doctorName; + dynamic doctorName; String? doctorNameN; String? statusDesc; String? statusDescN; bool? vitalStatus; - Null vitalSignAppointmentNo; + dynamic vitalSignAppointmentNo; int? episodeID; String? doctorTitle; bool? isAppoitmentLiveCare; diff --git a/lib/core/model/reports/Reports.dart b/lib/core/model/reports/Reports.dart index e86aa554..315aae6f 100644 --- a/lib/core/model/reports/Reports.dart +++ b/lib/core/model/reports/Reports.dart @@ -19,7 +19,7 @@ class Reports { String? clinicDescription; dynamic clinicDescriptionN; String? docName; - Null docNameN; + dynamic docNameN; String? doctorImageURL; dynamic doctorName; dynamic doctorNameN; diff --git a/lib/core/model/sick_leave/sick_leave.dart b/lib/core/model/sick_leave/sick_leave.dart index 6658d3b6..d089366f 100644 --- a/lib/core/model/sick_leave/sick_leave.dart +++ b/lib/core/model/sick_leave/sick_leave.dart @@ -28,7 +28,7 @@ class SickLeave { String? isInOutPatientDescription; String? isInOutPatientDescriptionN; int? noOfPatientsRate; - Null patientName; + dynamic patientName; String? projectName; String? qR; List? speciality; diff --git a/lib/core/model/weahter/weather_model.dart b/lib/core/model/weahter/weather_model.dart index f726cd61..ddef871c 100644 --- a/lib/core/model/weahter/weather_model.dart +++ b/lib/core/model/weahter/weather_model.dart @@ -1,34 +1,34 @@ class WeatherIndicatorModel { - Null date; + dynamic date; int? languageID; int? serviceName; - Null time; - Null androidLink; - Null authenticationTokenID; - Null data; + dynamic time; + dynamic androidLink; + dynamic authenticationTokenID; + dynamic data; bool? dataw; int? dietType; - Null errorCode; - Null errorEndUserMessage; - Null errorEndUserMessageN; - Null errorMessage; + dynamic errorCode; + dynamic errorEndUserMessage; + dynamic errorEndUserMessageN; + dynamic errorMessage; int? errorType; int? foodCategory; - Null iOSLink; + dynamic iOSLink; bool? isAuthenticated; int? mealOrderStatus; int? mealType; int? messageStatus; int? numberOfResultRecords; - Null patientBlodType; - Null successMsg; - Null successMsgN; - Null citiesList; - Null cityName; - Null get5DaysWeatherForecastList; + dynamic patientBlodType; + dynamic successMsg; + dynamic successMsgN; + dynamic citiesList; + dynamic cityName; + dynamic get5DaysWeatherForecastList; List? getCityInfoList; - Null getTodayWeatherForecastList; - Null iniciesList; + dynamic getTodayWeatherForecastList; + dynamic iniciesList; WeatherIndicatorModel( {this.date, diff --git a/lib/core/service/AuthenticatedUserObject.dart b/lib/core/service/AuthenticatedUserObject.dart index be065ce6..5f73c5e8 100644 --- a/lib/core/service/AuthenticatedUserObject.dart +++ b/lib/core/service/AuthenticatedUserObject.dart @@ -3,7 +3,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; class AuthenticatedUserObject { - AuthenticatedUser? user; + AuthenticatedUser user = AuthenticatedUser(); AppSharedPreferences sharedPref = AppSharedPreferences(); bool isLogin = false; @@ -11,20 +11,24 @@ class AuthenticatedUserObject { getUser(); } - getUser({bool getUser = false}) async { + Future getUser({bool getUser = false}) async { if (getUser) { - var userData; - await sharedPref.getObject(USER_PROFILE).then((value) { - userData = value; - }); - if (userData != null) user = AuthenticatedUser.fromJson(userData); + var userData = await sharedPref.getObject(USER_PROFILE); + if (userData != null) { + user = AuthenticatedUser.fromJson(userData); + } } else if (user == null) { var userData = await sharedPref.getObject(USER_PROFILE); - if (userData != null) user = AuthenticatedUser.fromJson(userData); + if (userData != null) { + // user = AuthenticatedUser.fromJson(userData); + user = AuthenticatedUser( + patientID: 1, + ); + } } } - logout() async { + void logout() { isLogin = false; } } diff --git a/lib/core/service/base_service.dart b/lib/core/service/base_service.dart index 81859b77..2b8ec3d3 100644 --- a/lib/core/service/base_service.dart +++ b/lib/core/service/base_service.dart @@ -18,7 +18,7 @@ class BaseService { BaseService() { authenticatedUserObject.getUser(); - user = authenticatedUserObject.user!; + user = authenticatedUserObject.user; // getUser(); } diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 99a17d5b..df7d1427 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/service/packages_offers/PackagesOffersServices.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/main.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; @@ -58,7 +59,7 @@ class BaseAppClient { var user = await sharedPref.getObject(USER_PROFILE); Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; if (!isExternal) { - String token = await sharedPref.getString(TOKEN); + var token = await sharedPref.getString(TOKEN); var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); if (endPoint == SEND_ACTIVATION_CODE) { languageID = 'en'; diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index a7102b91..9920f8f4 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -120,7 +120,7 @@ class InsuranceCardService extends BaseService { sharedPref.setObject(FAMILY_FILE, localRes); getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(localRes); } catch (error) { - print(error); + print("------------"+error.toString()); throw error; } } diff --git a/lib/core/service/privilege_service.dart b/lib/core/service/privilege_service.dart index 433fc1b4..a68f071f 100644 --- a/lib/core/service/privilege_service.dart +++ b/lib/core/service/privilege_service.dart @@ -2,27 +2,35 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/main.dart'; class PrivilegeService extends BaseService { - List privilegeModelList =[]; - List vidaPlusProjectListModel =[]; + List privilegeModelList = []; + List vidaPlusProjectListModel = []; Future getPrivilege() async { Map body = Map(); body['PatientType'] = 4; - await baseAppClient.post(GET_PRIVILEGE, onSuccess: (dynamic response, int statusCode) { - response['ServicePrivilegeList'].forEach((item) { - privilegeModelList.add(PrivilegeModel.fromJson(item)); - }); - - if (response['ProjectListVidaPlus'].length != 0) { - response['ProjectListVidaPlus'].forEach((item) { - vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); + await baseAppClient.post( + GET_PRIVILEGE, + onSuccess: (dynamic response, int statusCode) { + response['ServicePrivilegeList'].forEach((item) { + privilegeModelList.add(PrivilegeModel.fromJson(item)); }); - } - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + + if (response['ProjectListVidaPlus'].length != 0) { + response['ProjectListVidaPlus'].forEach((item) { + vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); + }); + } + }, + onFailure: (String error, int statusCode) { + print(error); + print(statusCode); + hasError = true; + super.error = error; + }, + body: body, + ); } } diff --git a/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart b/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart index 25273968..af040cb6 100644 --- a/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart @@ -58,7 +58,7 @@ class Addresses { dynamic company; int? countryId; String? country; - Null stateProvinceId; + dynamic stateProvinceId; String? city; String? address1; String? address2; diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart index e0498134..2efae385 100644 --- a/lib/core/viewModels/base_view_model.dart +++ b/lib/core/viewModels/base_view_model.dart @@ -17,7 +17,7 @@ class BaseViewModel extends ChangeNotifier { String error = ""; String languageID = "en"; - AuthenticatedUser? user; + late AuthenticatedUser user; AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUserObject authenticatedUserObject = locator(); @@ -33,10 +33,10 @@ class BaseViewModel extends ChangeNotifier { this.user = user; notifyListeners(); } - + BaseViewModel() { //authenticatedUserObject.getUser(); - user = authenticatedUserObject.user; + user = authenticatedUserObject.user!; this.isLogin = authenticatedUserObject.isLogin; } diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index a66a0752..47d0ed5e 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -1,8 +1,7 @@ import 'dart:async'; -import 'package:connectivity/connectivity.dart'; +import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; @@ -15,7 +14,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_datetime_picker_plus/flutter_datetime_picker_plus.dart'; -var isAppArabic = false; +bool isAppArabic = false; class ProjectViewModel extends BaseViewModel { GAnalytics get analytics => locator(); @@ -35,18 +34,10 @@ class ProjectViewModel extends BaseViewModel { String error = ''; dynamic searchvalue; bool isLogin = false; - int? laserSelectionDuration; - double? _latitude; - double? _longitude; + RegisterInfoResponse _registerInfo = RegisterInfoResponse(); - RegisterInfoResponse? _registerInfo = RegisterInfoResponse(); - - double get latitude => _latitude!; - - double get longitude => _longitude!; - - RegisterInfoResponse get registerInfo => _registerInfo!; + RegisterInfoResponse get registerInfo => _registerInfo; dynamic get searchValue => searchvalue; @@ -57,47 +48,52 @@ class ProjectViewModel extends BaseViewModel { bool get isArabic => _isArabic; bool isLoginChild = false; - List privilegeRootUser =[]; - List privilegeChildUser =[]; - List _vidaPlusProjectListModel =[]; + List privilegeRootUser = []; + List privilegeChildUser = []; + List _vidaPlusProjectListModel = []; + + List get vidaPlusProjectList => _vidaPlusProjectListModel; + List selectedBodyPartList = []; List get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser; - List get vidaPlusProjectList => _vidaPlusProjectListModel; + late StreamSubscription subscription; - List selectedBodyPartList = []; + late double _latitude; + late double _longitude; + + double get latitude => _latitude; - StreamSubscription? subscription; + double get longitude => _longitude; + + late int laserSelectionDuration; ProjectViewModel() { - loadSharedPrefLanguage(); - subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { - switch (result) { - case ConnectivityResult.wifi: - isInternetConnection = true; - break; - case ConnectivityResult.mobile: + try { + loadSharedPrefLanguage(); + subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { + if (result == ConnectivityResult.mobile) { isInternetConnection = true; - break; - case ConnectivityResult.none: + } else if (result == ConnectivityResult.wifi) { + } else if (result == ConnectivityResult.none) { isInternetConnection = false; - break; - } - notifyListeners(); - }); - } - - void setLatitudeLongitude(double lat, double long) { - _latitude = lat; - _longitude = long; - notifyListeners(); + } + notifyListeners(); + }); + } catch (e) { + print(e); + } } Future loadSharedPrefLanguage() async { - currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - _appLocale = Locale(currentLanguage); - isAppArabic = _isArabic = currentLanguage == 'ar'; - notifyListeners(); + try { + currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + _appLocale = Locale(currentLanguage); + isAppArabic = _isArabic = currentLanguage == 'ar'; + notifyListeners(); + } catch (e) { + print(e); + } } void changeLanguage(String lan) { @@ -120,18 +116,11 @@ class ProjectViewModel extends BaseViewModel { this.isLoginChild = isLoginChild; privilegeRootUser = privilege!; - AppGlobal.isNetworkDebugEnabled = havePrivilege(93); - - notifyListeners(); - } - - setVidaPlusProjectList(List vidaPlusProjectListModelInput) { - _vidaPlusProjectListModel = vidaPlusProjectListModelInput; notifyListeners(); } setPrivilege({privilegeList, bool isLoginChild = false}) { - List privilege =[]; + List privilege = []; privilegeList['List'][0]['ListPrivilege'].forEach((item) { privilege.add(PrivilegeModel.fromJson(item)); @@ -151,23 +140,32 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } + setVidaPlusProjectList(List vidaPlusProjectListModelInput) { + _vidaPlusProjectListModel = vidaPlusProjectListModelInput; + notifyListeners(); + } + bool havePrivilege(int id) { bool isHavePrivilege = false; - if (isLoginChild) - privilegeChildUser.forEach((element) { - if (element.iD == id) isHavePrivilege = element.privilege!; - }); - else { - privilegeRootUser.forEach((element) { - if (element.iD == id) isHavePrivilege = element.privilege!; - }); + try { + if (isLoginChild) { + privilegeChildUser.forEach((element) { + if (element.iD == id) isHavePrivilege = element.privilege!; + }); + } else { + privilegeRootUser.forEach((element) { + if (element.iD == id) isHavePrivilege = element.privilege!; + }); + } + } catch (e) { + print(e); } return isHavePrivilege; } @override void dispose() { - if (subscription != null) subscription!.cancel(); + if (subscription != null) subscription.cancel(); super.dispose(); } @@ -176,6 +174,12 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } + void setLatitudeLongitude(double lat, double long) { + _latitude = lat; + _longitude = long; + notifyListeners(); + } + setRegisterData(RegisterInfoResponse data) { _registerInfo = data; notifyListeners(); diff --git a/lib/d_q_icons_icons.dart b/lib/d_q_icons_icons.dart index 19c04948..83335a36 100644 --- a/lib/d_q_icons_icons.dart +++ b/lib/d_q_icons_icons.dart @@ -19,7 +19,7 @@ class DQIcons { DQIcons._(); static const _kFontFam = 'DQIcons'; - static const Null _kFontPkg = null; + static const dynamic _kFontPkg = null; static const IconData blood_pressure = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); diff --git a/lib/main.dart b/lib/main.dart index 7f294b3c..f77f766e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel. import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; +import 'package:diplomaticquarterapp/splashPage.dart'; import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; @@ -15,7 +16,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:in_app_update/in_app_update.dart'; +import 'package:logger/logger.dart'; import 'package:provider/provider.dart'; import 'config/size_config.dart'; @@ -24,6 +25,22 @@ import 'core/viewModels/project_view_model.dart'; import 'locator.dart'; import 'pages/pharmacies/compare-list.dart'; +var logger = Logger( + printer: PrettyPrinter( + methodCount: 2, + // Number of method calls to be displayed + errorMethodCount: 8, + // Number of method calls if stacktrace is provided + lineLength: 500, + // Width of the output + colors: true, + // Colorful log messages + printEmojis: true, + // Print an emoji for each log message + printTime: false // Should each log print contain a timestamp + ), +); + void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); @@ -45,23 +62,27 @@ class MyHttpOverrides extends HttpOverrides { } class _MyApp extends State { - late AppUpdateInfo _updateInfo; + // late AppUpdateInfo _updateInfo; final GlobalKey navigatorKey = GlobalKey(); - checkForUpdate() { - // todo need to verify 'imp' - InAppUpdate.checkForUpdate().then((info) { - print("checkForUpdate!!!"); - print(info.toString()); - if (info.immediateUpdateAllowed) { - print("Immediate Allowed!!!"); - InAppUpdate.performImmediateUpdate().then((value) {}).catchError((e) => print(e.toString())); - } - }).catchError((e) { - print(e.toString()); - }); - } + //0537503378 + //1231755 + + + // checkForUpdate() { + // // todo need to verify 'imp' + // InAppUpdate.checkForUpdate().then((info) { + // print("checkForUpdate!!!"); + // print(info.toString()); + // if (info.immediateUpdateAllowed) { + // print("Immediate Allowed!!!"); + // InAppUpdate.performImmediateUpdate().then((value) {}).catchError((e) => print(e.toString())); + // } + // }).catchError((e) { + // print(e.toString()); + // }); + // } @override void initState() { @@ -79,7 +100,6 @@ class _MyApp extends State { @override Widget build(BuildContext context) { PlatformBridge.init(context); - LocalNotification.init(onNotificationClick: (payload) { LocalNotification.getInstance()?.showNow(title: "Payload", subtitle: payload, payload: payload); }); @@ -133,13 +153,16 @@ class _MyApp extends State { ], child: Consumer( builder: (context, projectProvider, child) => MaterialApp( - builder: (_, __) { + builder: (_, mchild) { return MediaQuery( data: MediaQuery.of(context).copyWith( textScaleFactor: 1.0, ), //set desired text scale factor here - child: child ?? SizedBox(), + child: mchild! ); + // Container( + // color: Colors.blue, + // )); }, navigatorKey: locator().navigatorKey, showSemanticsDebugger: false, diff --git a/lib/models/Authentication/check_activation_code_request.dart b/lib/models/Authentication/check_activation_code_request.dart index 84a0d9ab..9a3cdc3e 100644 --- a/lib/models/Authentication/check_activation_code_request.dart +++ b/lib/models/Authentication/check_activation_code_request.dart @@ -19,7 +19,7 @@ class CheckActivationCodeReq { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; bool? forRegisteration; diff --git a/lib/models/Authentication/check_activation_code_request_register.dart b/lib/models/Authentication/check_activation_code_request_register.dart index 6de96c5a..85e1f56f 100644 --- a/lib/models/Authentication/check_activation_code_request_register.dart +++ b/lib/models/Authentication/check_activation_code_request_register.dart @@ -19,7 +19,7 @@ class CheckActivationCodeRegisterReq { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; bool? forRegisteration; diff --git a/lib/models/Authentication/check_paitent_authentication_req.dart b/lib/models/Authentication/check_paitent_authentication_req.dart index 7d0eeb37..8aa348c1 100644 --- a/lib/models/Authentication/check_paitent_authentication_req.dart +++ b/lib/models/Authentication/check_paitent_authentication_req.dart @@ -12,7 +12,7 @@ class CheckPatientAuthenticationReq { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; String? dob; diff --git a/lib/models/Authentication/check_user_status_reponse.dart b/lib/models/Authentication/check_user_status_reponse.dart index d5c7b618..0701c8b3 100644 --- a/lib/models/Authentication/check_user_status_reponse.dart +++ b/lib/models/Authentication/check_user_status_reponse.dart @@ -1,48 +1,48 @@ class CheckUserStatusResponse { - Null date; + dynamic date; int? languageID; int? serviceName; - Null time; - Null androidLink; - Null authenticationTokenID; - Null data; + dynamic time; + dynamic androidLink; + dynamic authenticationTokenID; + dynamic data; bool? dataw; int? dietType; - Null errorCode; - Null errorEndUserMessage; - Null errorEndUserMessageN; - Null errorMessage; + dynamic errorCode; + dynamic errorEndUserMessage; + dynamic errorEndUserMessageN; + dynamic errorMessage; int? errorType; int? foodCategory; - Null iOSLink; + dynamic iOSLink; bool? isAuthenticated; int? mealOrderStatus; int? mealType; int? messageStatus; int? numberOfResultRecords; - Null patientBlodType; - Null successMsg; - Null successMsgN; - Null accessTokenObject; + dynamic patientBlodType; + dynamic successMsg; + dynamic successMsgN; + dynamic accessTokenObject; int? age; - Null clientIdentifierId; + dynamic clientIdentifierId; int? createdBy; String? dateOfBirth; String? firstNameAr; String? firstNameEn; String? gender; - Null genderAr; - Null genderEn; + dynamic genderAr; + dynamic genderEn; String? healthId; String? idNumber; String? idType; bool? isHijri; int? isInstertedOrUpdated; - int? isNull; + int? isdynamic; int? isPatientExistNHIC; String? lastNameAr; String? lastNameEn; - Null listActiveAccessToken; + dynamic listActiveAccessToken; String? maritalStatus; String? maritalStatusCode; String? nationality; @@ -50,31 +50,31 @@ class CheckUserStatusResponse { String? occupation; String? patientStatus; String? placeofBirth; - Null practitionerStatusCode; - Null practitionerStatusDescAr; - Null practitionerStatusDescEn; + dynamic practitionerStatusCode; + dynamic practitionerStatusDescAr; + dynamic practitionerStatusDescEn; String? secondNameAr; String? secondNameEn; String? thirdNameAr; String? thirdNameEn; - Null accessToken; + dynamic accessToken; int? categoryCode; - Null categoryNameAr; - Null categoryNameEn; + dynamic categoryNameAr; + dynamic categoryNameEn; int? constraintCode; - Null constraintNameAr; - Null constraintNameEn; - Null content; - Null licenseExpiryDate; - Null licenseIssuedDate; - Null licenseStatusCode; - Null licenseStatusDescAr; - Null licenseStatusDescEn; - Null organizations; - Null registrationNumber; + dynamic constraintNameAr; + dynamic constraintNameEn; + dynamic content; + dynamic licenseExpiryDate; + dynamic licenseIssuedDate; + dynamic licenseStatusCode; + dynamic licenseStatusDescAr; + dynamic licenseStatusDescEn; + dynamic organizations; + dynamic registrationNumber; int? specialtyCode; - Null specialtyNameAr; - Null specialtyNameEn; + dynamic specialtyNameAr; + dynamic specialtyNameEn; CheckUserStatusResponse( {this.date, @@ -116,7 +116,7 @@ class CheckUserStatusResponse { this.idType, this.isHijri, this.isInstertedOrUpdated, - this.isNull, + this.isdynamic, this.isPatientExistNHIC, this.lastNameAr, this.lastNameEn, @@ -194,7 +194,7 @@ class CheckUserStatusResponse { idType = json['IdType']; isHijri = json['IsHijri']; isInstertedOrUpdated = json['IsInstertedOrUpdated']; - isNull = json['IsNull']; + isdynamic = json['Isdynamic']; isPatientExistNHIC = json['IsPatientExistNHIC']; lastNameAr = json['LastNameAr']; lastNameEn = json['LastNameEn']; @@ -274,7 +274,7 @@ class CheckUserStatusResponse { data['IdType'] = this.idType; data['IsHijri'] = this.isHijri; data['IsInstertedOrUpdated'] = this.isInstertedOrUpdated; - data['IsNull'] = this.isNull; + data['Isdynamic'] = this.isdynamic; data['IsPatientExistNHIC'] = this.isPatientExistNHIC; data['LastNameAr'] = this.lastNameAr; data['LastNameEn'] = this.lastNameEn; diff --git a/lib/models/Authentication/check_user_status_req.dart b/lib/models/Authentication/check_user_status_req.dart index 00282fe9..69f94fd6 100644 --- a/lib/models/Authentication/check_user_status_req.dart +++ b/lib/models/Authentication/check_user_status_req.dart @@ -8,7 +8,7 @@ class CheckUserStatusRequest { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; diff --git a/lib/models/Authentication/checkpatient_for_registration.dart b/lib/models/Authentication/checkpatient_for_registration.dart index 9f165e3b..fa23df5f 100644 --- a/lib/models/Authentication/checkpatient_for_registration.dart +++ b/lib/models/Authentication/checkpatient_for_registration.dart @@ -8,7 +8,7 @@ class CheckPatientForRegistration { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; String? tokenID; diff --git a/lib/models/Authentication/get_mobile_info_request.dart b/lib/models/Authentication/get_mobile_info_request.dart index d870b038..07025c35 100644 --- a/lib/models/Authentication/get_mobile_info_request.dart +++ b/lib/models/Authentication/get_mobile_info_request.dart @@ -17,7 +17,7 @@ class GetMobileLoginInfoRequest { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; diff --git a/lib/models/Authentication/get_mobile_info_response.dart b/lib/models/Authentication/get_mobile_info_response.dart index 5368f9ee..3b41300a 100644 --- a/lib/models/Authentication/get_mobile_info_response.dart +++ b/lib/models/Authentication/get_mobile_info_response.dart @@ -1,66 +1,66 @@ class GetMobileLoginInfoResponse { - Null date; + dynamic date; int? languageID; int? serviceName; - Null time; - Null androidLink; - Null authenticationTokenID; - Null data; + dynamic time; + dynamic androidLink; + dynamic authenticationTokenID; + dynamic data; bool? dataw; int? dietType; - Null errorCode; - Null errorEndUserMessage; - Null errorEndUserMessageN; - Null errorMessage; + dynamic errorCode; + dynamic errorEndUserMessage; + dynamic errorEndUserMessageN; + dynamic errorMessage; int? errorType; int? foodCategory; - Null iOSLink; + dynamic iOSLink; bool? isAuthenticated; int? mealOrderStatus; int? mealType; int? messageStatus; int? numberOfResultRecords; - Null patientBlodType; - Null successMsg; - Null successMsgN; - Null doctorInformationList; - Null getAllPendingRecordsList; - Null getAllSharedRecordsByStatusList; - Null getResponseFileList; + dynamic patientBlodType; + dynamic successMsg; + dynamic successMsgN; + dynamic doctorInformationList; + dynamic getAllPendingRecordsList; + dynamic getAllSharedRecordsByStatusList; + dynamic getResponseFileList; bool? isHMGPatient; bool? isLoginSuccessfully; bool? isNeedUpdateIdintificationNo; bool? kioskSendSMS; - Null list; - Null listAskHabibMobileLoginInfo; - Null listAskHabibPatientFile; - Null listMergeFiles; + dynamic list; + dynamic listAskHabibMobileLoginInfo; + dynamic listAskHabibPatientFile; + dynamic listMergeFiles; List? listMobileLoginInfo; - Null listPatientCount; + dynamic listPatientCount; String? logInTokenID; - Null mohemmPrivilegeList; + dynamic mohemmPrivilegeList; int? pateintID; - Null patientBloodType; + dynamic patientBloodType; bool? patientHasFile; - Null patientMergedIDs; + dynamic patientMergedIDs; bool? patientOutSA; int? patientShareRequestID; int? patientType; int? projectIDOut; - Null returnMessage; + dynamic returnMessage; bool? sMSLoginRequired; - Null servicePrivilegeList; - Null sharePatientName; - Null verificationCode; - Null email; - Null errorList; + dynamic servicePrivilegeList; + dynamic sharePatientName; + dynamic verificationCode; + dynamic email; + dynamic errorList; bool? hasFile; bool? isActiveCode; bool? isMerged; bool? isNeedUserAgreement; bool? isSMSSent; - Null memberList; - Null message; + dynamic memberList; + dynamic message; int? statusCode; GetMobileLoginInfoResponse( diff --git a/lib/models/Authentication/register_info_response.dart b/lib/models/Authentication/register_info_response.dart index a51b1b14..58a83232 100644 --- a/lib/models/Authentication/register_info_response.dart +++ b/lib/models/Authentication/register_info_response.dart @@ -1,48 +1,48 @@ class RegisterInfoResponse { - Null date; + dynamic date; int? languageID; int? serviceName; - Null time; - Null androidLink; - Null authenticationTokenID; - Null data; + dynamic time; + dynamic androidLink; + dynamic authenticationTokenID; + dynamic data; bool? dataw; int? dietType; - Null errorCode; - Null errorEndUserMessage; - Null errorEndUserMessageN; - Null errorMessage; + dynamic errorCode; + dynamic errorEndUserMessage; + dynamic errorEndUserMessageN; + dynamic errorMessage; int? errorType; int? foodCategory; - Null iOSLink; + dynamic iOSLink; bool? isAuthenticated; int? mealOrderStatus; int? mealType; int? messageStatus; int? numberOfResultRecords; - Null patientBlodType; - Null successMsg; - Null successMsgN; - Null accessTokenObject; + dynamic patientBlodType; + dynamic successMsg; + dynamic successMsgN; + dynamic accessTokenObject; int? age; - Null clientIdentifierId; + dynamic clientIdentifierId; int? createdBy; String? dateOfBirth; String? firstNameAr; String? firstNameEn; String? gender; - Null genderAr; - Null genderEn; + dynamic genderAr; + dynamic genderEn; String? healthId; String? idNumber; String? idType; bool? isHijri; int? isInstertedOrUpdated; - int? isNull; + int? isdynamic; int? isPatientExistNHIC; String? lastNameAr; String? lastNameEn; - Null listActiveAccessToken; + dynamic listActiveAccessToken; String? maritalStatus; String? maritalStatusCode; String? nationality; @@ -50,31 +50,31 @@ class RegisterInfoResponse { String? occupation; String? patientStatus; String? placeofBirth; - Null practitionerStatusCode; - Null practitionerStatusDescAr; - Null practitionerStatusDescEn; + dynamic practitionerStatusCode; + dynamic practitionerStatusDescAr; + dynamic practitionerStatusDescEn; String? secondNameAr; String? secondNameEn; String? thirdNameAr; String? thirdNameEn; - Null accessToken; + dynamic accessToken; int? categoryCode; - Null categoryNameAr; - Null categoryNameEn; + dynamic categoryNameAr; + dynamic categoryNameEn; int? constraintCode; - Null constraintNameAr; - Null constraintNameEn; - Null content; - Null licenseExpiryDate; - Null licenseIssuedDate; - Null licenseStatusCode; - Null licenseStatusDescAr; - Null licenseStatusDescEn; - Null organizations; - Null registrationNumber; + dynamic constraintNameAr; + dynamic constraintNameEn; + dynamic content; + dynamic licenseExpiryDate; + dynamic licenseIssuedDate; + dynamic licenseStatusCode; + dynamic licenseStatusDescAr; + dynamic licenseStatusDescEn; + dynamic organizations; + dynamic registrationNumber; int? specialtyCode; - Null specialtyNameAr; - Null specialtyNameEn; + dynamic specialtyNameAr; + dynamic specialtyNameEn; RegisterInfoResponse( {this.date, @@ -116,7 +116,7 @@ class RegisterInfoResponse { this.idType, this.isHijri, this.isInstertedOrUpdated, - this.isNull, + this.isdynamic, this.isPatientExistNHIC, this.lastNameAr, this.lastNameEn, @@ -194,7 +194,7 @@ class RegisterInfoResponse { idType = json['IdType']; isHijri = json['IsHijri']; isInstertedOrUpdated = json['IsInstertedOrUpdated']; - isNull = json['IsNull']; + isdynamic = json['Isdynamic']; isPatientExistNHIC = json['IsPatientExistNHIC']; lastNameAr = json['LastNameAr']; lastNameEn = json['LastNameEn']; @@ -274,7 +274,7 @@ class RegisterInfoResponse { data['IdType'] = this.idType; data['IsHijri'] = this.isHijri; data['IsInstertedOrUpdated'] = this.isInstertedOrUpdated; - data['IsNull'] = this.isNull; + data['Isdynamic'] = this.isdynamic; data['IsPatientExistNHIC'] = this.isPatientExistNHIC; data['LastNameAr'] = this.lastNameAr; data['LastNameEn'] = this.lastNameEn; diff --git a/lib/models/Authentication/register_user_requet.dart b/lib/models/Authentication/register_user_requet.dart index 71549d80..bfc48da8 100644 --- a/lib/models/Authentication/register_user_requet.dart +++ b/lib/models/Authentication/register_user_requet.dart @@ -9,7 +9,7 @@ class RegisterUserRequest { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; String? dob; diff --git a/lib/models/Authentication/send_activation_request.dart b/lib/models/Authentication/send_activation_request.dart index 738e212d..04e684e9 100644 --- a/lib/models/Authentication/send_activation_request.dart +++ b/lib/models/Authentication/send_activation_request.dart @@ -18,7 +18,7 @@ class SendActivationRequest { String? iPAdress; String? generalid; int? patientOutSA; - Null sessionID; + dynamic sessionID; bool? isDentalAllowedBackend; int? deviceTypeID; String? sMSSignature; diff --git a/lib/models/Clinics/ClinicListResponse.dart b/lib/models/Clinics/ClinicListResponse.dart index cca958bd..43b78970 100644 --- a/lib/models/Clinics/ClinicListResponse.dart +++ b/lib/models/Clinics/ClinicListResponse.dart @@ -52,7 +52,7 @@ class ListClinicCentralized { class ListGetBookScheduleConfigsList { int? iD; String? description; - Null descriptionN; + dynamic descriptionN; bool? value; bool? isActive; diff --git a/lib/models/LiveCare/ClinicsServiceTimingsResponse.dart b/lib/models/LiveCare/ClinicsServiceTimingsResponse.dart index 876037c8..a7f5c12b 100644 --- a/lib/models/LiveCare/ClinicsServiceTimingsResponse.dart +++ b/lib/models/LiveCare/ClinicsServiceTimingsResponse.dart @@ -24,11 +24,11 @@ class ClinicsServiceTimingsResponse { class PatientERGetClinicsServiceTimingsList { int? iD; int? serviceID; - Null shiftID; + dynamic shiftID; int? dayOfWeek; String? dayOfWeekStr; - Null startTime; - Null endTime; + dynamic startTime; + dynamic endTime; bool? isActive; String? createdOn; String? createdBy; diff --git a/lib/models/anicllary-orders/ancillary_order_proc_model.dart b/lib/models/anicllary-orders/ancillary_order_proc_model.dart index dc1941fd..451d775e 100644 --- a/lib/models/anicllary-orders/ancillary_order_proc_model.dart +++ b/lib/models/anicllary-orders/ancillary_order_proc_model.dart @@ -8,7 +8,7 @@ class AncillaryOrdersListProcListModel { String? companyName; int? doctorID; String? doctorName; - Null errCode; + dynamic errCode; int? groupID; String? insurancePolicyNo; String? message; diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 225f434d..e391ca53 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -45,7 +45,7 @@ class _SearchState extends State with TickerProviderStateMixin { showNewAppBar: true, appBarTitle: TranslationBase.of(context).bookAppo, backgroundColor: Color(0xFFF7F7F7), - onTap: widget.onBackClick!(), + onTap: widget.onBackClick, body: Column( children: [ TabBar( @@ -79,7 +79,7 @@ class _SearchState extends State with TickerProviderStateMixin { child: TabBarView( physics: NeverScrollableScrollPhysics(), children: [ - SearchByClinic(clnicIds: widget.clnicIds!), + SearchByClinic(clnicIds: widget.clnicIds), SearchByDoctor(), ], controller: _tabController, diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 4c73a626..b3e41923 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -30,7 +30,7 @@ import 'LaserClinic.dart'; import 'LiveCareBookAppointment.dart'; class SearchByClinic extends StatefulWidget { - final List clnicIds; + final List? clnicIds; SearchByClinic({required this.clnicIds}); @@ -40,10 +40,9 @@ class SearchByClinic extends StatefulWidget { class _SearchByClinicState extends State { bool nearestAppo = false; - late String dropdownValue; - + String dropdownValue = ""; String dropdownTitle = ""; - late String projectDropdownValue; + String projectDropdownValue = ""; // var event = RobotProvider(); List clinicsList = []; @@ -52,8 +51,8 @@ class _SearchByClinicState extends State { bool isLoaded = false; bool isProjectLoaded = false; - late ListClinicCentralized selectedClinic; - late HospitalsModel selectedHospital; + ListClinicCentralized selectedClinic = ListClinicCentralized(); + HospitalsModel selectedHospital = HospitalsModel(); AuthenticatedUser authUser = new AuthenticatedUser(); AuthProvider authProvider = new AuthProvider(); @@ -63,7 +62,7 @@ class _SearchByClinicState extends State { TextEditingController ageController = new TextEditingController(); late ProjectViewModel projectViewModel; - late String radioValue; + String radioValue = ""; late LocationUtils locationUtils; @@ -212,7 +211,7 @@ class _SearchByClinicState extends State { ], ), ), - widget.clnicIds != null && widget.clnicIds.length > 1 && isLoaded == true + widget.clnicIds != null && widget.clnicIds!.length > 1 && isLoaded == true ? Column( crossAxisAlignment: CrossAxisAlignment.start, children: clinicsList.map((result) { @@ -324,17 +323,22 @@ class _SearchByClinicState extends State { isExpanded: true, style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black), items: projectsList.map((item) { - return new DropdownMenuItem( + return DropdownMenuItem( value: item, - child: new Text(item.name!), + child: Text(item.name!), ); }).toList(), onChanged: (newValue) async { setState(() { - selectedHospital = newValue!; + selectedHospital = HospitalsModel.fromJson(newValue!.toJson()); projectDropdownValue = newValue.mainProjectID.toString(); if (dropdownValue.split("-")[0] == "253") { - Navigator.push(context, FadePage(page: LaserClinic(selectedHospital: selectedHospital))); + Navigator.push( + context, + FadePage( + page: LaserClinic(selectedHospital: selectedHospital), + ), + ); } else { getDoctorsList(context); } @@ -686,8 +690,8 @@ class _SearchByClinicState extends State { filterClinic() { setState(() { - if (widget.clnicIds != null && widget.clnicIds.length > 0) { - clinicsList = clinicsList.where((i) => widget.clnicIds.indexOf(i.clinicID) > -1).toList(); + if (widget.clnicIds != null && widget.clnicIds!.length > 0) { + clinicsList = clinicsList.where((i) => widget.clnicIds!.indexOf(i.clinicID) > -1).toList(); isLoaded = true; } }); diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 520784a6..74023677 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -27,7 +27,7 @@ class CovidDrivethruLocation extends StatefulWidget { } class _CovidDrivethruLocationState extends State { - late String projectDropdownValue; + String projectDropdownValue = ''; List projectsList = []; List proceduresList = []; bool isLocationSelected = false; @@ -37,7 +37,7 @@ class _CovidDrivethruLocationState extends State { String projectID = ""; List imagesInfo = []; - late DriveThroughTestingCenterModel selectedProject; + DriveThroughTestingCenterModel selectedProject = DriveThroughTestingCenterModel(); final GlobalKey locationDropdownKey = GlobalKey(); late ProjectViewModel projectViewModel; diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index a7dcf313..75745e17 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -48,16 +48,16 @@ class MyFamily extends StatefulWidget { } class _MyFamily extends State with TickerProviderStateMixin { - List imagesInfo =[]; + List imagesInfo = []; final familyFileProvider = FamilyFilesProvider(); - AppSharedPreferences sharedPref = new AppSharedPreferences(); + AppSharedPreferences sharedPref = AppSharedPreferences(); var userID; late TabController _tabController; int _tabIndex = 0; AuthenticatedUserObject authenticatedUserObject = locator(); AppointmentRateViewModel appointmentRateViewModel = locator(); late ProjectViewModel projectViewModel; - late AuthenticatedUser user; + AuthenticatedUser user = AuthenticatedUser(); VitalSignService _vitalSignService = locator(); PharmacyModuleViewModel pharmacyModuleViewModel = locator(); late ToDoCountProviderModel toDoProvider; @@ -447,13 +447,11 @@ class _MyFamily extends State with TickerProviderStateMixin { refreshFamily(context); GifLoaderDialogUtils.hideDialog(context); }); - } refreshFamily(context) async { - - await sharedPref.remove(FAMILY_FILE); - await checkUserData(); + await sharedPref.remove(FAMILY_FILE); + await checkUserData(); } switchUser(user, context) { @@ -528,9 +526,8 @@ class _MyFamily extends State with TickerProviderStateMixin { Map request = {}; request["ID"] = ID; request["Status"] = status; - this.familyFileProvider.acceptRejectFamily(request).then((value) async{ - - await refreshFamily(context); + this.familyFileProvider.acceptRejectFamily(request).then((value) async { + await refreshFamily(context); GifLoaderDialogUtils.hideDialog(context); }); } @@ -541,11 +538,8 @@ class _MyFamily extends State with TickerProviderStateMixin { // var data2 = AuthenticatedUser.fromJson(await this.sharedPref.getObject(MAIN_USER)); await getFamilyFiles(); - this.user = data; - setState(() { - - }); - + this.user = data; + setState(() {}); } } @@ -562,19 +556,18 @@ class _MyFamily extends State with TickerProviderStateMixin { GifLoaderDialogUtils.showMyDialog(context); try { if (familySharedRecords == null) { - familySharedRecords = await familyFileProvider.getSharedRecordByStatus(); } - sentRecordsList =[]; - familySharedRecordsList =[]; + sentRecordsList = []; + familySharedRecordsList = []; familySharedRecords.getAllSharedRecordsByStatusList!.forEach((element) { if (element.status == 3) { familySharedRecordsList.add(element); } sentRecordsList.add(element); }); - approvedRecordsList =[]; - pendingRecordsList =[]; + approvedRecordsList = []; + pendingRecordsList = []; GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest(); pendingAndApprovedRecords.getAllSharedRecordsByStatusList!.forEach((element) { @@ -586,7 +579,6 @@ class _MyFamily extends State with TickerProviderStateMixin { } }); } catch (ex) { - familySharedRecords = GetAllSharedRecordsByStatusResponse(getAllSharedRecordsByStatusList: []); } GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/ErService/EdOnline/DdServicesPage.dart b/lib/pages/ErService/EdOnline/DdServicesPage.dart index b6e3bd81..47d31a21 100644 --- a/lib/pages/ErService/EdOnline/DdServicesPage.dart +++ b/lib/pages/ErService/EdOnline/DdServicesPage.dart @@ -62,7 +62,7 @@ class _DdServicesPageState extends State { EdOnlineQuestionsPage( changePageViewIndex: _changePageViewIndex, selectedQuestions: selectedQuestions, - selectedHospital: triageInformationRequest.selectedHospital!, + selectedHospital: triageInformationRequest.selectedHospital, ), EdOnlineNotesPage( changePageViewIndex: _changePageViewIndex, @@ -70,7 +70,7 @@ class _DdServicesPageState extends State { triageInformationRequest: triageInformationRequest, ), EdPaymentInformationPage( - selectedHospital: triageInformationRequest.selectedHospital!, + selectedHospital: triageInformationRequest.selectedHospital, ) ], ), diff --git a/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart b/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart index 4007a140..23153fa0 100644 --- a/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart +++ b/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart @@ -22,9 +22,9 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class EdPaymentInformationPage extends StatefulWidget { - final HospitalsModel selectedHospital; + final HospitalsModel? selectedHospital; - const EdPaymentInformationPage({Key? key, required this.selectedHospital}) : super(key: key); + const EdPaymentInformationPage({Key? key, this.selectedHospital}) : super(key: key); @override _EdPaymentInformationPageState createState() => _EdPaymentInformationPageState(); @@ -138,8 +138,8 @@ class _EdPaymentInformationPageState extends State { print(value); if (value != null) { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); - appo.projectID = widget.selectedHospital.iD; - openPayment(value[0], projectViewModel.user!, model.erPatientShareModel.patientShareWithTax!, appo); + appo.projectID = widget.selectedHospital!.iD; + openPayment(value[0], projectViewModel.user, model.erPatientShareModel.patientShareWithTax!, appo); } }, ); @@ -166,7 +166,7 @@ class _EdPaymentInformationPageState extends State { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); - transID = Utils.getAdvancePaymentTransID(widget.selectedHospital.iD, projectViewModel.user!.patientID!); + transID = Utils.getAdvancePaymentTransID(widget.selectedHospital!.iD, projectViewModel.user!.patientID!); browser.openPaymentBrowser(amount, "ER Online Check-In", transID, appo.projectID.toString(), authenticatedUser.emailAddress!, paymentMethod, authenticatedUser.patientType, authenticatedUser.firstName!, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "", context); } diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 5b613150..0a271b77 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -32,6 +32,7 @@ class _NearestErState extends State { @override void initState() { + isDataLoaded = false; locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); WidgetsBinding.instance.addPostFrameCallback((_) { locationUtils.getCurrentLocation(); diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 8948e964..2d1bd150 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -177,7 +177,7 @@ class _AppointmentActionsState extends State { _getConfirmedAppoActionsList(); } } else { - print("isConfirmed Null"); + print("isConfirmed dynamic"); } if (isBooked()) { if (widget.appo.isOnlineCheckedIN!) { @@ -186,7 +186,7 @@ class _AppointmentActionsState extends State { _getBookedAppoActionsList(); } } else { - print("isBooked Null"); + print("isBooked dynamic"); } if (isArrived()) { if (widget.appo.clinicID == 17) { @@ -195,10 +195,10 @@ class _AppointmentActionsState extends State { _getArrivedAppoActionsList(); } } else { - print("isArrived Null"); + print("isArrived dynamic"); } } else { - print("Appo Null"); + print("Appo dynamic"); } } diff --git a/lib/pages/appUpdatePage/app_update_page.dart b/lib/pages/appUpdatePage/app_update_page.dart index 1692d096..c4c49628 100644 --- a/lib/pages/appUpdatePage/app_update_page.dart +++ b/lib/pages/appUpdatePage/app_update_page.dart @@ -5,7 +5,6 @@ import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:in_app_update/in_app_update.dart'; import 'package:url_launcher/url_launcher.dart'; class AppUpdatePage extends StatefulWidget { @@ -79,16 +78,16 @@ class _AppUpdatePageState extends State { openAppUpdateLink() { if (Platform.isAndroid) { // _launchURL("https://play.google.com/store/apps/details?id=com.ejada.hmg"); - InAppUpdate.checkForUpdate().then((info) { - print("checkForUpdate!!!"); - print(info.toString()); - if (info.immediateUpdateAllowed) { - print("Immediate Allowed!!!"); - InAppUpdate.performImmediateUpdate().then((value) {}).catchError((e) => print(e.toString())); - } - }).catchError((e) { - print(e.toString()); - }); + // InAppUpdate.checkForUpdate().then((info) { + // print("checkForUpdate!!!"); + // print(info.toString()); + // if (info.immediateUpdateAllowed) { + // print("Immediate Allowed!!!"); + // InAppUpdate.performImmediateUpdate().then((value) {}).catchError((e) => print(e.toString())); + // } + // }).catchError((e) { + // print(e.toString()); + // }); } if (Platform.isIOS) { _launchURL("https://itunes.apple.com/app/id733503978"); diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index 0f5558df..d6bd5932 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -14,7 +14,7 @@ import 'status_feedback_page.dart'; class FeedbackHomePage extends StatefulWidget { final AppoitmentAllHistoryResultList? appointment; final MessageType messageType; - const FeedbackHomePage({Key? key, this.appointment, this.messageType = MessageType.NON}) : super(key: key); + const FeedbackHomePage({Key? key, this.appointment, this.messageType = MessageType.NON}) : super(key: key); @override _FeedbackHomePageState createState() => _FeedbackHomePageState(); @@ -72,7 +72,8 @@ class _FeedbackHomePageState extends State with SingleTickerPr controller: _tabController, children: [ SendFeedbackPage( - appointment: widget.appointment!, + appointment: widget.appointment, + messageType: widget.messageType, ), StatusFeedbackPage() diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index a5e9506f..d6701285 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -25,6 +25,7 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; + // import 'package:speech_to_text/speech_recognition_error.dart'; // import 'package:speech_to_text/speech_to_text.dart' as stt; @@ -43,12 +44,13 @@ class _SendFeedbackPageState extends State { TextEditingController messageController = TextEditingController(); List images = []; late String title; - late AppoitmentAllHistoryResultList appointHistory; + AppoitmentAllHistoryResultList appointHistory = AppoitmentAllHistoryResultList(); bool isShowListAppointHistory = true; - late String message; + String message = ""; final formKey = GlobalKey(); MessageType messageType = MessageType.NON; var _currentLocaleId; + // stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; int selectedStatusIndex = 5; @@ -91,7 +93,7 @@ class _SendFeedbackPageState extends State { void initState() { setState(() { this.messageType = widget.messageType; - this.appointHistory = widget.appointment!; + this.appointHistory = widget.appointment ?? AppoitmentAllHistoryResultList(); }); // requestPermissions(); event.controller.stream.listen((p) { @@ -491,7 +493,7 @@ class _SendFeedbackPageState extends State { if (res['MessageStatus'] == 1) { if (res['AppoimentAllHistoryResultList'].length != 0) { res['AppoimentAllHistoryResultList'].forEach((v) { - appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + appoList.add(AppoitmentAllHistoryResultList.fromJson(v)); }); setState(() { appointHistory = AppoitmentAllHistoryResultList(); @@ -522,11 +524,11 @@ class _SendFeedbackPageState extends State { _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); // if (available) { - // speech.listen( - // onResult: resultListener, - // listenMode: stt.ListenMode.confirmation, - // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', - // ); + // speech.listen( + // onResult: resultListener, + // listenMode: stt.ListenMode.confirmation, + // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', + // ); // } else { // print("The user has denied the use of speech recognition."); // } @@ -535,7 +537,7 @@ class _SendFeedbackPageState extends State { // void errorListener(SpeechRecognitionError error) { // event.setValue({"searchText": 'null'}); // SpeechToText.closeAlertDialog(context); - // print(error); + // print(error); // } void statusListener(String status) { diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index e5e1a24f..4528897c 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -84,8 +84,13 @@ class _HomePageFragment2State extends State { }, child: LoggedSliderView( projectViewModel, - new SliderData(TranslationBase.of(context).fileno + ": " + (projectViewModel.user?.patientID?.toString() ?? ""), - projectViewModel.user!.firstName! + ' ' + (projectViewModel.user?.lastName ?? ""), "", bannerColor[0].darkColor, bannerColor[0].lightColor), + new SliderData( + TranslationBase.of(context).fileno + ": " + (projectViewModel.user.patientID.toString()?? ""), + projectViewModel.user.firstName! + ' ' + (projectViewModel.user.lastName ?? ""), + "", + bannerColor[0].darkColor, + bannerColor[0].lightColor, + ), widget.model, ), ), @@ -97,7 +102,7 @@ class _HomePageFragment2State extends State { margin: EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6), child: SliderView( onLoginClick: () { - widget.onLoginClick!(); + widget.onLoginClick; projectViewModel.analytics.loginRegistration.login_register_initiate(); }, ), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 0ed24c82..58344c5e 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -645,7 +645,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { authService.getDashboard().then((value) => { setState(() { if (value != null) { - notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + notificationCount = value['List_PatientDashboard'].isNotEmpty?? value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); model.setState(model.count, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); FlutterAppIconBadge.updateBadge(int.parse(notificationCount)); diff --git a/lib/pages/landing/widgets/logged_slider_view.dart b/lib/pages/landing/widgets/logged_slider_view.dart index 1c4a39be..98e4b252 100644 --- a/lib/pages/landing/widgets/logged_slider_view.dart +++ b/lib/pages/landing/widgets/logged_slider_view.dart @@ -122,7 +122,7 @@ class LoggedSliderView extends StatelessWidget { Padding( padding: const EdgeInsets.only(left: 20, right: 20), child: Text( - '${DateUtil.getMonthDayYearDateFormatted(projectViewModel.user!.dateofBirthDataTime!)} ,${projectViewModel.user!.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${projectViewModel.user!.age.toString() + " " + TranslationBase.of(context).patientAge.toString()}', + '${DateUtil.getMonthDayYearDateFormatted(projectViewModel.user.dateofBirthDataTime!)} ,${projectViewModel.user!.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${projectViewModel.user!.age.toString() + " " + TranslationBase.of(context).patientAge.toString()}', style: TextStyle( color: Colors.white, fontSize: 12, diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index b8cf2a91..a83097c1 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; @@ -40,11 +41,11 @@ class _Login extends State { final nationalIDorFile = TextEditingController(); final mobileNumberController = TextEditingController(); int loginType = LoginType.loginType; - late String mobileNo; + String? mobileNo; String countryCode = '966'; bool isButtonDisabled = true; - final authService = new AuthProvider(); - var sharedPref = new AppSharedPreferences(); + final authService = AuthProvider(); + var sharedPref = AppSharedPreferences(); bool isLoading = false; AppointmentRateViewModel appointmentRateViewModel = locator(); PharmacyModuleViewModel pharmacyModuleViewModel = locator(); @@ -62,8 +63,8 @@ class _Login extends State { super.initState(); // if (BASE_URL.contains("uat.")) { - // nationalIDorFile.text = "2001273"; - // mobileNumberController.text = mobileNo = "0555416043"; + // nationalIDorFile.text = "2344670985"; + // mobileNumberController.text = mobileNo = "0537503378"; // } getRegisterData(); /* else { @@ -106,7 +107,13 @@ class _Login extends State { SizedBox(height: 50), Text( loginType == 1 ? TranslationBase.of(context).enterNationalId : TranslationBase.of(context).enterFile, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.64, + height: 23 / 16, + ), ), SizedBox(height: 20), PhoneNumberSelectorWidget( @@ -116,8 +123,13 @@ class _Login extends State { ), SizedBox(height: 12), Directionality( - textDirection: TextDirection.ltr, - child: inputWidget(loginType == 1 ? TranslationBase.of(context).nationalIdNumber : TranslationBase.of(context).medicalFileNumber, "Xxxxxxxxx", nationalIDorFile)), + textDirection: TextDirection.ltr, + child: inputWidget( + loginType == 1 ? TranslationBase.of(context).nationalIdNumber : TranslationBase.of(context).medicalFileNumber, + "Xxxxxxxxx", + nationalIDorFile, + ), + ), ], ), ), @@ -126,11 +138,10 @@ class _Login extends State { ), DefaultButton( TranslationBase.of(context).login, - isButtonDisabled - ? null - : () { - this.startLogin(); - }, + () { + // if (!isButtonDisabled) + this.startLogin(); + }, disabledColor: Color(0xff575757), ), ]), @@ -221,9 +232,9 @@ class _Login extends State { } startLogin() { - if (isButtonDisabled == false) { + //if (isButtonDisabled == false) { checkUserAuthentication(); - } + // } } void validateForm() { @@ -233,7 +244,7 @@ class _Login extends State { }); } else { setState(() { - isButtonDisabled = true; + isButtonDisabled = false; }); } } @@ -242,7 +253,7 @@ class _Login extends State { // showLoader(true); var request = CheckPatientAuthenticationReq(); request.isRegister = false; - request.patientMobileNumber = int.parse(mobileNo); + request.patientMobileNumber = int.parse(mobileNo!); request.zipCode = countryCode; request.searchType = this.loginType; request.deviceTypeID = this.loginType; @@ -257,16 +268,16 @@ class _Login extends State { GifLoaderDialogUtils.showMyDialog(context); authService.checkPatientAuthentication(request).then((value) { // if (value['UserAccountIsActivated']) { - if (value['isSMSSent']) { - sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']); - sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request); - GifLoaderDialogUtils.hideDialog(context); - Navigator.of(context).push(FadePage(page: ConfirmLogin())); - } else { - if (value['IsAuthenticated']) { - this.checkActivationCode(); - } + if (value['isSMSSent']) { + sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']); + sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request); + GifLoaderDialogUtils.hideDialog(context); + Navigator.of(context).push(FadePage(page: ConfirmLogin())); + } else { + if (value['IsAuthenticated']) { + this.checkActivationCode(); } + } // } else { // ConfirmDialog activationDialog = new ConfirmDialog( // context: context, @@ -316,7 +327,7 @@ class _Login extends State { checkActivationCode({code}) async { Map request = {}; - if (code == null) request['PatientMobileNumber'] = int.parse(mobileNo); + if (code == null) request['PatientMobileNumber'] = int.parse(mobileNo!); request['ZipCode'] = countryCode; request['SearchType'] = loginType; request['LoginType'] = loginType; diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 0abb3093..a010150d 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -178,7 +178,7 @@ class _Register extends State { ); } - Future _selectDate(BuildContext context) async { + Future _selectDate(BuildContext context) async { DatePicker.showDatePicker( context, showTitleActions: true, diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index ad98fe0e..f203d879 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -38,16 +38,16 @@ class _AdvancePaymentPageState extends State { TextEditingController _fileTextController = TextEditingController(); TextEditingController _notesTextController = TextEditingController(); BeneficiaryType beneficiaryType = BeneficiaryType.NON; - late HospitalsModel _selectedHospital; + HospitalsModel _selectedHospital = HospitalsModel(); String amount = ""; - late String email; - late PatientInfo _selectedPatientInfo; - late AuthenticatedUser authenticatedUser; - late GetAllSharedRecordsByStatusList selectedPatientFamily; + String email = ""; + PatientInfo _selectedPatientInfo = PatientInfo(); + AuthenticatedUser authenticatedUser = AuthenticatedUser(); + GetAllSharedRecordsByStatusList selectedPatientFamily = GetAllSharedRecordsByStatusList(); AdvanceModel advanceModel = AdvanceModel(); AppSharedPreferences sharedPref = AppSharedPreferences(); - late AuthenticatedUser authUser; + AuthenticatedUser authUser = AuthenticatedUser(); List imagesInfo =[]; @@ -263,7 +263,7 @@ class _AdvancePaymentPageState extends State { if (model.user != null) NewTextFields( hintText: TranslationBase.of(context).depositorEmail, - initialValue: model.user!.emailAddress!, + initialValue: model.user.emailAddress, onChanged: (value) { email = value; }, @@ -446,7 +446,7 @@ class _AdvancePaymentPageState extends State { } String getHospitalName() { - if (_selectedHospital != null) + if (_selectedHospital != null && _selectedHospital.name != null) return _selectedHospital.name!; else return TranslationBase.of(context).selectHospital; diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 7b5e62ab..ca927632 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -126,9 +126,9 @@ class _HomeReportPageState extends State with SingleTickerProvid child: IndexedStack( index: _currentPage, children: [ - ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user!.emailAddress!), - ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user!.emailAddress!), - ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user!.emailAddress!), + ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress), ], ), ) diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart index d0dc44df..44d85cc5 100644 --- a/lib/pages/vaccine/my_vaccines_screen.dart +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -42,7 +42,11 @@ class _MyVaccinesState extends State { children: [ AppExpandableNotifier( isExpand: true, - title: model.state == ViewState.Idle ? DateUtil.convertStringToDate(model.vaccineList[0].vaccinationDate!).year.toString() : "", + title: model.state == ViewState.Idle + ? model.vaccineList.isEmpty + ? "" + : DateUtil.convertStringToDate(model.vaccineList[0].vaccinationDate!).year.toString() + : "", bodyWidget: Container( child: ListView.separated( physics: ScrollPhysics(), @@ -69,29 +73,30 @@ class _MyVaccinesState extends State { ), ), ), - SizedBox(height: 40.0,) + SizedBox( + height: 40.0, + ) // SpaceBetweenTexts(space: 165.0), ], ), ), bottomSheet: Container( - color: Colors.white, - padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), - child: DefaultButton( - TranslationBase.of(context).sendEmail, - () { - showDialog( - context: context, - builder: (cxt) => ConfirmSendEmailDialog( - email: projectViewModel.user!.emailAddress!, - onTapSendEmail: () { - model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully); - }, - ), - ); - }, - ) - ), + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).sendEmail, + () { + showDialog( + context: context, + builder: (cxt) => ConfirmSendEmailDialog( + email: projectViewModel.user!.emailAddress!, + onTapSendEmail: () { + model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully); + }, + ), + ); + }, + )), ), ); } diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index e86ff18e..26b60fcc 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/main.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart'; @@ -68,7 +69,7 @@ class AuthProvider with ChangeNotifier { } void getUserAuthentication() async { - Map profile = await sharedPref.getObject(USER_PROFILE); + Map profile = await sharedPref.getObject(USER_PROFILE) ?? Map(); languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); if (profile != null) { isLoading = false; @@ -153,16 +154,20 @@ class AuthProvider with ChangeNotifier { Future selectDeviceImei(imei) async { try { dynamic localRes; + print(imei); Map request = {}; request['IMEI'] = imei; - await new BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { - localRes = SelectDeviceIMEIRES.fromJson(response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); + await BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { + localRes = Map(); + if (response['Patient_SELECTDeviceIMEIbyIMEIList'][0] != null) { + localRes = SelectDeviceIMEIRES.fromJson(response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); + } }, onFailure: (String error, int statusCode) { throw error; }, body: request); return Future.value(localRes); } catch (error) { - return Future.value(null); + return Future.error(error); } } @@ -247,7 +252,7 @@ class AuthProvider with ChangeNotifier { return Future.value(localRes); } - Future checkActivationCode(request, [value]) async { + Future checkActivationCode(request, [value]) async { var neRequest = CheckActivationCodeReq.fromJson(request); neRequest.activationCode = value ?? "0000"; @@ -376,16 +381,14 @@ class AuthProvider with ChangeNotifier { requestN.patientOutSA = requestN.patientobject!.patientOutSA!; final DateFormat dateFormat = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); - if(nhic !=null) { - requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format( - dateFormat.parse(nhic['DateOfBirth'])); + if (nhic != null) { + requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth'])); requestN.isHijri = nhic['IsHijri'] ? 1 : 0; requestN.healthId = requestN.patientobject!.eHealthIDField!; } requestN.zipCode = requestN.patientOutSA == 1 ? '971' : '966'; - await sharedPref.remove(USER_PROFILE); dynamic localRes; diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index a9443538..eb001bdc 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -53,7 +53,7 @@ class FamilyFilesProvider with ChangeNotifier { sharedPref.setObject(FAMILY_FILE, localRes); return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(localRes)); } catch (error) { - print(error); + print("-------" + error.toString()); throw error; } } @@ -258,14 +258,22 @@ class FamilyFilesProvider with ChangeNotifier { // request['LogInTokenID'] = ''; // request['PatientOutSA'] = currentUser.outSA; //? 1 : 0; - request['PatientOutSA'] = switchUser.familyRegionID != null ? switchUser.familyRegionID == 1 ? 0 : 1 : currentUser.outSA; //currentUser.outSA; //? 1 : 0; + request['PatientOutSA'] = switchUser.familyRegionID != null + ? switchUser.familyRegionID == 1 + ? 0 + : 1 + : currentUser.outSA; //currentUser.outSA; //? 1 : 0; request['PatientMobileNumber'] = switchUser.mobileNumber; //['MobileNumber']; request['SearchType'] = 2; request['SuperUser'] = switchUser.patientID; //currentUser.PatientID; request['PatientIdentificationID'] = ''; request['IsSilentLogin'] = true; request['PatientID'] = switchUser.responseID; //['PatientID']; - request['ZipCode'] = switchUser.familyRegionID != null ? switchUser.familyRegionID == 1 ? "966" : "971" : "966"; + request['ZipCode'] = switchUser.familyRegionID != null + ? switchUser.familyRegionID == 1 + ? "966" + : "971" + : "966"; // request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; request['activationCode'] = '0000'; request['isRegister'] = false; @@ -273,7 +281,7 @@ class FamilyFilesProvider with ChangeNotifier { try { dynamic localRes; - await new BaseAppClient().post(ACTIVATION_CODE_URL, onSuccess: (dynamic response, int statusCode) { + await BaseAppClient().post(ACTIVATION_CODE_URL, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { AppToast.showErrorToast(message: error); diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 04e1c3b5..d75e57e2 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; @@ -34,6 +35,7 @@ class _SplashScreenState extends State { Duration(seconds: 1, milliseconds: 500), () { loadPrivilege().then((value) { + print(value); Navigator.of(context).pushReplacement( MaterialPageRoute( builder: (BuildContext context) => LandingPage(), @@ -44,7 +46,7 @@ class _SplashScreenState extends State { ); AppSharedPreferences().getAll().then((value) { - // debugPrint("ALL SHARED PREFERENCES!!!!!"); + // debugPrint("ALL SHARED PREFERENCES!!!!!"); // debugPrint(jsonEncode(value)); }); } @@ -59,7 +61,7 @@ class _SplashScreenState extends State { AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en"); var themeNotifier = Provider.of(context, listen: false); themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins')); - PushNotificationHandler(context).init(); // Asyncronously + if (Platform.isIOS) PushNotificationHandler.getInstance().init(context); // Asyncronously } @override diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 80e921a2..7ee12788 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -115,8 +115,9 @@ _incomingCall(Map data) async { } class PushNotificationHandler { - final BuildContext context; - static late PushNotificationHandler _instance; + late BuildContext context; + static final PushNotificationHandler _instance = PushNotificationHandler._internal(); + final voIPKit = FlutterIOSVoIPKit.instance; late HmsApiAvailability hmsApiAvailability; @@ -143,9 +144,9 @@ class PushNotificationHandler { "is_call": "true" }; - PushNotificationHandler(this.context) { - PushNotificationHandler._instance = this; - } + PushNotificationHandler._internal(); + + factory PushNotificationHandler() => _instance; static PushNotificationHandler getInstance() => _instance; @@ -163,11 +164,15 @@ class PushNotificationHandler { }); } - init() async { + init(BuildContext context) async { + + this.context = context; // VoIP Callbacks voIPKit.getVoIPToken().then((value) { print('🎈 example: getVoIPToken: $value'); - AppSharedPreferences().setString(APNS_TOKEN, value!); + if (value != null) { + AppSharedPreferences().setString(APNS_TOKEN, value); + } }); voIPKit.onDidUpdatePushToken = ( @@ -263,12 +268,12 @@ class PushNotificationHandler { try { FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage? message) async { - if (message! != null) { + if (message != null) { if (Platform.isIOS) await Future.delayed(Duration(milliseconds: 3000)).then((value) { - if (message! != null) newMessage(message!); + if (message != null) newMessage(message); }); - else if (message! != null) newMessage(message!); + else if (message != null) newMessage(message); } }); } catch (ex) {} diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index ca645f09..0e27ff33 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -6,7 +6,7 @@ import 'dart:typed_data'; import 'package:auto_size_text/auto_size_text.dart'; import 'package:badges/badges.dart' as badge_import; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:connectivity/connectivity.dart'; +import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:crypto/crypto.dart' as crypto; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; @@ -75,7 +75,7 @@ class Utils { /// Check The Internet Connection static Future checkConnection({bool bypassConnectionCheck = false}) async { if (bypassConnectionCheck) return true; - + //return true; ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) { return true; @@ -101,9 +101,14 @@ class Utils { static showPermissionConsentDialog(BuildContext context, String message, VoidCallback? onTap) { showDialog( context: context, - builder: (cxt) => CovidConsentDialog( - okTitle: TranslationBase.of(context).acceptLbl, - title: TranslationBase.of(context).covidConsentHeader, + builder: (cxt) => + CovidConsentDialog( + okTitle: TranslationBase + .of(context) + .acceptLbl, + title: TranslationBase + .of(context) + .covidConsentHeader, message: message, onTap: onTap!, )); @@ -156,19 +161,21 @@ class Utils { } static String getAdvancePaymentTransID(int projectID, int fileNumber) { - return projectID.toString() + '-' + fileNumber.toString() + '-' + DateTime.now().millisecondsSinceEpoch.toString(); + return projectID.toString() + '-' + fileNumber.toString() + '-' + DateTime + .now() + .millisecondsSinceEpoch + .toString(); } - bool validateIDBox(String value, type) { - String pattern = loginIDPattern(type).toString(); //r'^\d+(?:\.\d+)?$'; - - RegExp regex = new RegExp(pattern); + bool validateIDBox(String value, int type) { + String pattern = loginIDPattern(type); // Get the pattern based on type + RegExp regex = RegExp(pattern); return regex.hasMatch(value); } - String loginIDPattern(loginType) { + String loginIDPattern(int loginType) { var length = loginType == 1 ? 10 : 1; - return "([0-9]{" + length.toString() + "})"; + return "([0-9]{$length})"; } static showProgressDialog(context, [String message = "Loading..."]) async { @@ -226,74 +233,86 @@ class Utils { onTap: () => projectViewModel!.havePrivilege(5) ? Navigator.push(context!, FadePage(page: MyAppointments())) : null, child: isLogin! ? Stack(children: [ - Container( - width: double.infinity, - height: double.infinity, - child: MedicalProfileItem( - title: TranslationBase.of(context!).myAppointments, - imagePath: 'appointment_list.svg', - subTitle: TranslationBase.of(context!).myAppointmentsList, - hasBadge: true, - isEnable: projectViewModel!.havePrivilege(5)), - ), - projectViewModel.isArabic - ? !projectViewModel.user!.isFamily - ? Positioned( - left: 8, - top: 4, - child: badge_import.Badge( - badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), - badgeStyle: badge_import.BadgeStyle( - elevation: 0, - shape: badge_import.BadgeShape.circle, - badgeColor: secondaryColor!.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - ), - position: badge_import.BadgePosition.topEnd(), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), - ), - ), - ) - : Container() - : !projectViewModel.user!.isFamily - ? Positioned( - right: 8, - top: 4, - child: badge_import.Badge( - position: badge_import.BadgePosition.topEnd(), - badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), - badgeStyle: badge_import.BadgeStyle( - elevation: 0, - shape: badge_import.BadgeShape.circle, - badgeColor: secondaryColor!.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - ), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), - ), - ), - ) - : Container(), - ]) - : MedicalProfileItem( - title: TranslationBase.of(context!).myAppointments, + Container( + width: double.infinity, + height: double.infinity, + child: MedicalProfileItem( + title: TranslationBase + .of(context!) + .myAppointments, imagePath: 'appointment_list.svg', - subTitle: TranslationBase.of(context!).myAppointmentsList, + subTitle: TranslationBase + .of(context!) + .myAppointmentsList, hasBadge: true, - isEnable: projectViewModel!.havePrivilege(5), + isEnable: projectViewModel!.havePrivilege(5)), + ), + projectViewModel.isArabic + ? !projectViewModel.user!.isFamily + ? Positioned( + left: 8, + top: 4, + child: badge_import.Badge( + badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), + badgeStyle: badge_import.BadgeStyle( + elevation: 0, + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor!.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + ), + position: badge_import.BadgePosition.topEnd(), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Container() + : !projectViewModel.user!.isFamily + ? Positioned( + right: 8, + top: 4, + child: badge_import.Badge( + position: badge_import.BadgePosition.topEnd(), + badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), + badgeStyle: badge_import.BadgeStyle( + elevation: 0, + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor!.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), ), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Container(), + ]) + : MedicalProfileItem( + title: TranslationBase + .of(context!) + .myAppointments, + imagePath: 'appointment_list.svg', + subTitle: TranslationBase + .of(context!) + .myAppointmentsList, + hasBadge: true, + isEnable: projectViewModel!.havePrivilege(5), + ), )); if (projectViewModel.havePrivilege(10)) { medical.add(InkWell( onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), child: MedicalProfileItem( - title: TranslationBase.of(context).lab, + title: TranslationBase + .of(context) + .lab, imagePath: 'lab_result.svg', - subTitle: TranslationBase.of(context).labSubtitle, + subTitle: TranslationBase + .of(context) + .labSubtitle, ), )); } @@ -301,9 +320,13 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).radiology, + title: TranslationBase + .of(context) + .radiology, imagePath: 'radiology.svg', - subTitle: TranslationBase.of(context).radiologySubtitle, + subTitle: TranslationBase + .of(context) + .radiologySubtitle, isEnable: projectViewModel.havePrivilege(7), ), )); @@ -311,24 +334,33 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).medicines, + title: TranslationBase + .of(context) + .medicines, imagePath: 'medicine_prescription.svg', - subTitle: TranslationBase.of(context).medicinesSubtitle, + subTitle: TranslationBase + .of(context) + .medicinesSubtitle, isEnable: projectViewModel.havePrivilege(12), ), )); medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(25) + onTap: () => + projectViewModel.havePrivilege(25) ? Navigator.push( - context, - FadePage(page: VitalSignDetailsScreen()), - ) + context, + FadePage(page: VitalSignDetailsScreen()), + ) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).vitalSigns, + title: TranslationBase + .of(context) + .vitalSigns, imagePath: 'vital_signs.svg', - subTitle: TranslationBase.of(context).vitalSignsSubtitle, + subTitle: TranslationBase + .of(context) + .vitalSignsSubtitle, isEnable: projectViewModel.havePrivilege(25), ), )); @@ -338,32 +370,45 @@ class Utils { if (projectViewModel.havePrivilege(48)) Navigator.push(context, FadePage(page: ActiveMedicationsPage())); }, child: MedicalProfileItem( - title: TranslationBase.of(context).myMedical, + title: TranslationBase + .of(context) + .myMedical, imagePath: 'active_medication.svg', - subTitle: TranslationBase.of(context).myMedicalSubtitle, + subTitle: TranslationBase + .of(context) + .myMedicalSubtitle, isEnable: projectViewModel.havePrivilege(48), ), )); medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(6) + onTap: () => + projectViewModel.havePrivilege(6) ? Navigator.push( - context, - FadePage( - page: DoctorHomePage(), - ), - ) + context, + FadePage( + page: DoctorHomePage(), + ), + ) : null, child: - MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), + MedicalProfileItem(title: TranslationBase + .of(context) + .myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase + .of(context) + .myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), )); medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).invoicesList, + title: TranslationBase + .of(context) + .invoicesList, imagePath: 'invoice_list.svg', - subTitle: TranslationBase.of(context).myInvoice, + subTitle: TranslationBase + .of(context) + .myInvoice, isEnable: projectViewModel.havePrivilege(14), ), )); @@ -372,10 +417,14 @@ class Utils { onTap: () => projectViewModel.havePrivilege(85) ? Navigator.push(context, FadePage(page: AnicllaryOrders())) : null, // onTap: () => Navigator.push(context, FadePage(page: AnicllaryOrders())), child: MedicalProfileItem( - title: TranslationBase.of(context).anicllaryOrders, + title: TranslationBase + .of(context) + .anicllaryOrders, imagePath: 'ancillary.svg', isPngImage: false, - subTitle: TranslationBase.of(context).myInvoice, + subTitle: TranslationBase + .of(context) + .myInvoice, isEnable: projectViewModel.havePrivilege(85), ), )); @@ -383,19 +432,35 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).eye, + title: TranslationBase + .of(context) + .eye, imagePath: 'eye_measurement.svg', - subTitle: TranslationBase.of(context).eyeSubtitle, + subTitle: TranslationBase + .of(context) + .eyeSubtitle, isEnable: projectViewModel.havePrivilege(14), ), )); medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(22) ? Navigator.push(context, FadePage(page: InsuranceCard(appointmentNo: 0,))) : null, + onTap: () => + projectViewModel.havePrivilege(22) + ? Navigator.push( + context, + FadePage( + page: InsuranceCard( + appointmentNo: 0, + ))) + : null, child: MedicalProfileItem( - title: TranslationBase.of(context).insurance, + title: TranslationBase + .of(context) + .insurance, imagePath: 'insurance_card.svg', - subTitle: TranslationBase.of(context).insuranceSubtitle, + subTitle: TranslationBase + .of(context) + .insuranceSubtitle, isEnable: projectViewModel.havePrivilege(22), ), )); @@ -405,18 +470,34 @@ class Utils { Navigator.push(context, FadePage(page: InsuranceUpdate())); }, child: MedicalProfileItem( - title: TranslationBase.of(context).updateInsurance, + title: TranslationBase + .of(context) + .updateInsurance, imagePath: 'insurance_card.svg', - subTitle: TranslationBase.of(context).updateInsuranceSubtitle, + subTitle: TranslationBase + .of(context) + .updateInsuranceSubtitle, ), )); medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval(appointmentNo: 0,))) : null, + onTap: () => + projectViewModel.havePrivilege(18) + ? Navigator.push( + context, + FadePage( + page: InsuranceApproval( + appointmentNo: 0, + ))) + : null, child: MedicalProfileItem( - title: TranslationBase.of(context).insuranceApproval, + title: TranslationBase + .of(context) + .insuranceApproval, imagePath: 'insurance_approval.svg', - subTitle: TranslationBase.of(context).insuranceApprovalSubtitle, + subTitle: TranslationBase + .of(context) + .insuranceApprovalSubtitle, isEnable: projectViewModel.havePrivilege(18), ), )); @@ -424,9 +505,13 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(23) ? Navigator.push(context, FadePage(page: AllergiesPage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).allergies, + title: TranslationBase + .of(context) + .allergies, imagePath: 'allergies_diagnosed.svg', - subTitle: TranslationBase.of(context).allergiesSubtitle, + subTitle: TranslationBase + .of(context) + .allergiesSubtitle, isEnable: projectViewModel.havePrivilege(23), ), )); @@ -434,9 +519,13 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(26) ? Navigator.push(context, FadePage(page: MyVaccines())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).myVaccines, + title: TranslationBase + .of(context) + .myVaccines, imagePath: 'vaccine_list.svg', - subTitle: TranslationBase.of(context).myVaccinesSubtitle, + subTitle: TranslationBase + .of(context) + .myVaccinesSubtitle, isEnable: projectViewModel.havePrivilege(26), ), )); @@ -444,9 +533,13 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).medical, + title: TranslationBase + .of(context) + .medical, imagePath: 'medical_report.svg', - subTitle: TranslationBase.of(context).medicalSubtitle, + subTitle: TranslationBase + .of(context) + .medicalSubtitle, isEnable: projectViewModel.havePrivilege(20), ), )); @@ -454,9 +547,13 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).monthly, + title: TranslationBase + .of(context) + .monthly, imagePath: 'monthly_report.svg', - subTitle: TranslationBase.of(context).monthlySubtitle, + subTitle: TranslationBase + .of(context) + .monthlySubtitle, isEnable: projectViewModel.havePrivilege(19), ), )); @@ -464,9 +561,13 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).sick, + title: TranslationBase + .of(context) + .sick, imagePath: 'sick_leave.svg', - subTitle: TranslationBase.of(context).sickSubtitle, + subTitle: TranslationBase + .of(context) + .sickSubtitle, isEnable: projectViewModel.havePrivilege(16), ), )); @@ -474,9 +575,13 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(47) ? Navigator.push(context, FadePage(page: MyBalancePage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).myBalance, + title: TranslationBase + .of(context) + .myBalance, imagePath: 'balance_credit.svg', - subTitle: TranslationBase.of(context).myBalanceSubtitle, + subTitle: TranslationBase + .of(context) + .myBalanceSubtitle, isEnable: projectViewModel.havePrivilege(47), ), )); @@ -491,9 +596,13 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).myTrackers, + title: TranslationBase + .of(context) + .myTrackers, imagePath: 'tracker.svg', - subTitle: TranslationBase.of(context).myTrackersSubtitle, + subTitle: TranslationBase + .of(context) + .myTrackersSubtitle, isEnable: projectViewModel.havePrivilege(24), ), )); @@ -501,9 +610,13 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(30) ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).smartWatchesSubtitle, + title: TranslationBase + .of(context) + .smartWatchesSubtitle, imagePath: 'smart_watch.svg', - subTitle: TranslationBase.of(context).smartWatches, + subTitle: TranslationBase + .of(context) + .smartWatches, isEnable: projectViewModel.havePrivilege(30), ), )); @@ -511,14 +624,20 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(28) ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).askYourSubtitle, imagePath: 'ask_doctor.svg', subTitle: TranslationBase.of(context).askYour, isEnable: projectViewModel.havePrivilege(28)), + title: TranslationBase + .of(context) + .askYourSubtitle, imagePath: 'ask_doctor.svg', subTitle: TranslationBase + .of(context) + .askYour, isEnable: projectViewModel.havePrivilege(28)), )); if (projectViewModel.havePrivilege(32) || true) { medical.add(InkWell( onTap: () { if (Platform.isAndroid) { - showPermissionConsentDialog(context, TranslationBase.of(context).wifiPermission, () { + showPermissionConsentDialog(context, TranslationBase + .of(context) + .wifiPermission, () { connectWifi(projectViewModel, context); }); } else { @@ -526,9 +645,13 @@ class Utils { } }, child: MedicalProfileItem( - title: TranslationBase.of(context).internet, + title: TranslationBase + .of(context) + .internet, imagePath: 'internet_connection.svg', - subTitle: TranslationBase.of(context).internetSubtitle, + subTitle: TranslationBase + .of(context) + .internetSubtitle, ), )); } @@ -536,9 +659,13 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(40) ? launch('whatsapp://send?phone=18885521858&text=') : null, child: MedicalProfileItem( - title: TranslationBase.of(context).chatbot, + title: TranslationBase + .of(context) + .chatbot, imagePath: 'chatbot.svg', - subTitle: TranslationBase.of(context).chatbotSubtitle, + subTitle: TranslationBase + .of(context) + .chatbotSubtitle, isEnable: projectViewModel.havePrivilege(40), ), )); @@ -607,69 +734,81 @@ class Utils { onTap: () => projectViewModel!.havePrivilege(5) ? Navigator.push(context!, FadePage(page: MyAppointments())) : null, child: isLogin! ? Stack(children: [ - MedicalProfileItem( - title: TranslationBase.of(context!).myAppointments, - imagePath: 'appointment_list.svg', - subTitle: TranslationBase.of(context!).myAppointmentsList, - hasBadge: true, - isEnable: projectViewModel!.havePrivilege(5)), - projectViewModel.isArabic! - ? !projectViewModel.isLoginChild - ? Positioned( - left: 8, - top: 4, - child: badge_import.Badge( - position: badge_import.BadgePosition.topEnd(), - badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), - badgeStyle: badge_import.BadgeStyle( - elevation: 0, - shape: badge_import.BadgeShape.circle, - badgeColor: secondaryColor!.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - ), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), - ), - ), - ) - : Container() - : !projectViewModel.isLoginChild - ? Positioned( - right: 8, - top: 4, - child: badge_import.Badge( - badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), - badgeStyle: badge_import.BadgeStyle( - elevation: 0, - shape: badge_import.BadgeShape.circle, - badgeColor: secondaryColor!.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - ), - position: badge_import.BadgePosition.topEnd(), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), - ), - ), - ) - : Container(), - ]) - : MedicalProfileItem( - title: TranslationBase.of(context!).myAppointments, - imagePath: 'appointment_list.svg', - subTitle: TranslationBase.of(context!).myAppointmentsList, - hasBadge: true, - isEnable: projectViewModel!.havePrivilege(5), + MedicalProfileItem( + title: TranslationBase + .of(context!) + .myAppointments, + imagePath: 'appointment_list.svg', + subTitle: TranslationBase + .of(context!) + .myAppointmentsList, + hasBadge: true, + isEnable: projectViewModel!.havePrivilege(5)), + projectViewModel.isArabic! + ? !projectViewModel.isLoginChild + ? Positioned( + left: 8, + top: 4, + child: badge_import.Badge( + position: badge_import.BadgePosition.topEnd(), + badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), + badgeStyle: badge_import.BadgeStyle( + elevation: 0, + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor!.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + ), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), ), + ), + ) + : Container() + : !projectViewModel.isLoginChild + ? Positioned( + right: 8, + top: 4, + child: badge_import.Badge( + badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), + badgeStyle: badge_import.BadgeStyle( + elevation: 0, + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor!.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + ), + position: badge_import.BadgePosition.topEnd(), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Container(), + ]) + : MedicalProfileItem( + title: TranslationBase + .of(context!) + .myAppointments, + imagePath: 'appointment_list.svg', + subTitle: TranslationBase + .of(context!) + .myAppointmentsList, + hasBadge: true, + isEnable: projectViewModel!.havePrivilege(5), + ), )); medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(10) ? Navigator.push(context, FadePage(page: LabsHomePage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).lab, + title: TranslationBase + .of(context) + .lab, imagePath: 'lab_result.svg', - subTitle: TranslationBase.of(context).labSubtitle, + subTitle: TranslationBase + .of(context) + .labSubtitle, isEnable: projectViewModel.havePrivilege(10), ), )); @@ -677,9 +816,13 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).radiology, + title: TranslationBase + .of(context) + .radiology, imagePath: 'radiology.svg', - subTitle: TranslationBase.of(context).radiologySubtitle, + subTitle: TranslationBase + .of(context) + .radiologySubtitle, isEnable: projectViewModel.havePrivilege(7), ), )); @@ -687,24 +830,33 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).medicines, + title: TranslationBase + .of(context) + .medicines, imagePath: 'medicine_prescription.svg', - subTitle: TranslationBase.of(context).medicinesSubtitle, + subTitle: TranslationBase + .of(context) + .medicinesSubtitle, isEnable: projectViewModel.havePrivilege(12), ), )); medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(6) + onTap: () => + projectViewModel.havePrivilege(6) ? Navigator.push( - context, - FadePage( - page: DoctorHomePage(), - ), - ) + context, + FadePage( + page: DoctorHomePage(), + ), + ) : null, child: - MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), + MedicalProfileItem(title: TranslationBase + .of(context) + .myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase + .of(context) + .myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), )); return medical; @@ -744,7 +896,11 @@ class Utils { SizedBox(height: 6), Text( text, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), + style: TextStyle(fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + letterSpacing: -0.48, + height: 18 / 12), ), SizedBox(height: 5), if (showDivider) @@ -765,10 +921,16 @@ class Utils { children: [ SizedBox(height: 12), Text( - isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text, + isCapitable && !projectViewModel.isArabic ? text + .toLowerCase() + .capitalizeFirstofEach : text, maxLines: 2, overflow: TextOverflow.ellipsis, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), + style: TextStyle(fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff575757), + letterSpacing: -0.4, + height: 16 / 10), ), SizedBox(height: 12), if (!isLast) @@ -783,7 +945,10 @@ class Utils { static Future isGoogleServicesAvailable() async { GooglePlayServicesAvailability availability = await GoogleApiAvailability.instance.checkGooglePlayServicesAvailability(); - String status = availability.toString().split('.').last; + String status = availability + .toString() + .split('.') + .last; if (status == "success") { return true; } @@ -798,10 +963,17 @@ class Utils { children: [ SizedBox(height: 14), AutoSizeText( - isCapitable ? text.toLowerCase().capitalizeFirstofEach : text, + isCapitable ? text + .toLowerCase() + .capitalizeFirstofEach : text, maxLines: 1, minFontSize: 6, - style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48, height: 18 / 12), + style: TextStyle(decoration: TextDecoration.underline, + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xffD02127), + letterSpacing: -0.48, + height: 18 / 12), ), SizedBox(height: 10), if (!isLast) diff --git a/lib/uitl/utils_new.dart b/lib/uitl/utils_new.dart index afc9b06a..685ab36b 100644 --- a/lib/uitl/utils_new.dart +++ b/lib/uitl/utils_new.dart @@ -31,16 +31,11 @@ Widget getPaymentMethods() { mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Image.asset("assets/images/new/payment/Mada.png", - width: 40, height: 40), - Image.asset("assets/images/new/payment/tamara_en.png", - width: 40, height: 40), - Image.asset("assets/images/new/payment/visa.png", - width: 40, height: 40), - Image.asset("assets/images/new/payment/Mastercard.png", - width: 50, height: 40), - Image.asset("assets/images/new/payment/Apple_Pay.png", - width: 40, height: 40), + Image.asset("assets/images/new/payment/Mada.png", width: 40, height: 40), + Image.asset("assets/images/new/payment/tamara_en.png", width: 40, height: 40), + Image.asset("assets/images/new/payment/visa.png", width: 40, height: 40), + Image.asset("assets/images/new/payment/Mastercard.png", width: 50, height: 40), + Image.asset("assets/images/new/payment/Apple_Pay.png", width: 40, height: 40), ], ), ); @@ -52,15 +47,8 @@ Widget getNoDataWidget(BuildContext context) { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - SvgPicture.asset('assets/images/new/not_found.svg', - width: 110.0, height: 110.0), - Container( - margin: EdgeInsets.only(top: 15.0), - child: Text(TranslationBase.of(context).noResultFound, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - color: Color(0xFFBABABA)))), + SvgPicture.asset('assets/images/new/not_found.svg', width: 110.0, height: 110.0), + Container(margin: EdgeInsets.only(top: 15.0), child: Text(TranslationBase.of(context).noResultFound, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xFFBABABA)))), ], ), ), @@ -88,8 +76,7 @@ spacer() { } Future navigateTo(context, page) async { - return await Navigator.push( - context, MaterialPageRoute(builder: (context) => page)); + return await Navigator.push(context, MaterialPageRoute(builder: (context) => page)); } // Future navigateToReplace(context, page) async { @@ -148,10 +135,11 @@ Widget circularAviator( width: s, height: s, decoration: containerColorRadiusBorderWidth( - bcColor! == null ? Colors.grey[200]! : bcColor, - 2000, - brColor == null ? Colors.blueGrey[800]! : brColor, - borderWidth! == null ? 2 : borderWidth!), + bcColor == null ? Colors.grey[200]! : bcColor, + 2000, + brColor == null ? Colors.blueGrey[800]! : brColor, + borderWidth == null ? 2 : borderWidth, + ), child: Icon( icon == null ? Icons.person : icon, size: s / 1.7, @@ -233,8 +221,7 @@ RoundedRectangleBorder buttonShape() { ); } -Decoration containerRadiusWithGradient(double radius, - {Color? color1, Color? color2}) { +Decoration containerRadiusWithGradient(double radius, {Color? color1, Color? color2}) { return BoxDecoration( borderRadius: BorderRadius.circular(radius), gradient: LinearGradient( @@ -248,8 +235,7 @@ Decoration containerRadiusWithGradient(double radius, ); } -Decoration containerBottomRightRadiusWithGradient(double radius, - {Color? darkColor, Color? lightColor}) { +Decoration containerBottomRightRadiusWithGradient(double radius, {Color? darkColor, Color? lightColor}) { return BoxDecoration( borderRadius: BorderRadius.only(bottomRight: Radius.circular(radius)), gradient: LinearGradient( @@ -263,8 +249,7 @@ Decoration containerBottomRightRadiusWithGradient(double radius, ); } -Decoration containerBottomRightRadiusWithGradientForAr(double radius, - {Color? darkColor, Color? lightColor}) { +Decoration containerBottomRightRadiusWithGradientForAr(double radius, {Color? darkColor, Color? lightColor}) { return BoxDecoration( borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius)), gradient: LinearGradient( @@ -307,11 +292,7 @@ Decoration containerRadiusWithGradientServices( ); } -Decoration containerBottomRightRadiusWithGradientBorder(double radius, - {Color? darkColor, - Color? lightColor, - Color borderColor = Colors.transparent, - double w = 0}) { +Decoration containerBottomRightRadiusWithGradientBorder(double radius, {Color? darkColor, Color? lightColor, Color borderColor = Colors.transparent, double w = 0}) { return BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(radius)), border: Border.all( @@ -340,8 +321,7 @@ Decoration containerRadius(Color background, double radius) { ); } -Decoration containerColorRadiusBorder( - Color background, double radius, Color color) { +Decoration containerColorRadiusBorder(Color background, double radius, Color color) { return BoxDecoration( color: background, border: Border.all( @@ -352,8 +332,7 @@ Decoration containerColorRadiusBorder( ); } -Decoration containerColorRadiusBorderWidth( - Color background, double radius, Color color, double w) { +Decoration containerColorRadiusBorderWidth(Color background, double radius, Color color, double w) { return BoxDecoration( color: background, border: Border.all( @@ -364,8 +343,7 @@ Decoration containerColorRadiusBorderWidth( ); } -Decoration containerColorRadiusBorderWidthCircular( - Color background, double radius, Color color, double w) { +Decoration containerColorRadiusBorderWidthCircular(Color background, double radius, Color color, double w) { return BoxDecoration( color: background, border: Border.all( @@ -380,36 +358,29 @@ Decoration containerColorRadiusBorderWidthCircular( Decoration containerColorRadiusRight(Color background, double radius) { return BoxDecoration( color: background, - borderRadius: BorderRadius.only( - topRight: Radius.circular(radius), - bottomRight: Radius.circular(radius)), + borderRadius: BorderRadius.only(topRight: Radius.circular(radius), bottomRight: Radius.circular(radius)), ); } Decoration containerColorRadiusLeft(Color background, double radius) { return BoxDecoration( color: background, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)), + borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)), ); } -Decoration containerColorRadiusRightBorder( - Color background, double radius, double w) { +Decoration containerColorRadiusRightBorder(Color background, double radius, double w) { return BoxDecoration( color: background, border: Border.all( width: w, // color: Colors.white // <--- border width here ), - borderRadius: BorderRadius.only( - topRight: Radius.circular(radius), - bottomRight: Radius.circular(radius)), + borderRadius: BorderRadius.only(topRight: Radius.circular(radius), bottomRight: Radius.circular(radius)), ); } -Decoration containerColorRadiusRightBorderc( - Color background, double radius, double w, Color borderColor) { +Decoration containerColorRadiusRightBorderc(Color background, double radius, double w, Color borderColor) { return BoxDecoration( color: background, border: Border.all( @@ -440,16 +411,14 @@ Decoration containerColorRadiusBottom(Color color, double radius) { ); } -Decoration containerColorRadiusLeftBorder( - Color background, double radius, double w) { +Decoration containerColorRadiusLeftBorder(Color background, double radius, double w) { return BoxDecoration( color: background, border: Border.all( width: w, // color: Colors.white // <--- border width here ), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)), + borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)), ); } @@ -481,23 +450,19 @@ OutlinedBorder cardRadiusNew(double radius) { ShapeBorder cardRadiusTop(double radius) { return RoundedRectangleBorder( side: BorderSide(color: Colors.transparent, width: 0), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(radius), topRight: Radius.circular(radius)), + borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), topRight: Radius.circular(radius)), ); } ShapeBorder cardRadiusTop2(double radius) { return RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(radius), topRight: Radius.circular(radius)), + borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), topRight: Radius.circular(radius)), ); } ShapeBorder cardRadiusBottom(double radius) { return RoundedRectangleBorder( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(radius), - bottomRight: Radius.circular(radius)), + borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius), bottomRight: Radius.circular(radius)), ); } @@ -620,8 +585,7 @@ FontStyle getFontStyle(String fontStyle) { bool timeCalculator(int startHour, int startMint, int endHour, int endMint) { DateTime now = DateTime.now(); - DateTime startDate = - DateTime(now.year, now.month, now.day, startHour, startHour); + DateTime startDate = DateTime(now.year, now.month, now.day, startHour, startHour); DateTime endDate = DateTime(now.year, now.month, now.day, endHour, endMint); if (startDate.isBefore(now) && endDate.isAfter(now)) return true; diff --git a/lib/widgets/Loader/gif_loader_container.dart b/lib/widgets/Loader/gif_loader_container.dart index f473d3ff..94daca0b 100644 --- a/lib/widgets/Loader/gif_loader_container.dart +++ b/lib/widgets/Loader/gif_loader_container.dart @@ -1,7 +1,6 @@ - import 'package:flutter/cupertino.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter_gif/flutter_gif.dart'; - class GifLoaderContainer extends StatefulWidget { @override _GifLoaderContainerState createState() => _GifLoaderContainerState(); @@ -10,10 +9,9 @@ class GifLoaderContainer extends StatefulWidget { class _GifLoaderContainerState extends State with TickerProviderStateMixin { late FlutterGifController controller; - @override void initState() { - FlutterGifController controller= FlutterGifController(vsync: this); + controller = FlutterGifController(vsync: this); WidgetsBinding.instance.addPostFrameCallback((_) { try { diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 0d12774f..e5ac52bf 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -227,37 +227,37 @@ class _AppScaffoldState extends State { // ? widget.customAppBar != null // ? widget.customAppBar - appBar: isUserNotLogin! + appBar: isUserNotLogin ? null - : widget.isShowPharmacyAppbar! - ? PreferredSize(preferredSize: Size.fromHeight(70), child: pharmacyAppbar()!) - : (widget.showNewAppBar! + : widget.isShowPharmacyAppbar + ? PreferredSize(preferredSize: Size.fromHeight(70), child: pharmacyAppbar()) + : (widget.showNewAppBar ? PreferredSize( preferredSize: Size.fromHeight(70), child: NewAppBarWidget( - title: widget.appBarTitle!, - showTitle: widget.showNewAppBarTitle!, - showDropDown: widget.showDropDown!, - dropdownIndexValue: widget.dropdownIndexValue!, - dropDownList: widget.dropDownList! ?? [], + title: widget.appBarTitle, + showTitle: widget.showNewAppBarTitle, + showDropDown: widget.showDropDown, + dropdownIndexValue: widget.dropdownIndexValue, + dropDownList: widget.dropDownList ?? [], dropDownIndexChange: widget.dropDownIndexChange, - appBarIcons: widget.appBarIcons!, + appBarIcons: widget.appBarIcons, onTap: () { widget.onTap; }, )) - : (widget.isShowAppBar! + : (widget.isShowAppBar ? widget.customAppBar != null ? PreferredSize(preferredSize: Size.fromHeight(70), child: widget.customAppBar!) : appBar = AppBarWidget( - appBarTitle: widget.appBarTitle!, - appBarIcons: widget.appBarIcons!, - showHomeAppBarIcon: widget.showHomeAppBarIcon!, - isPharmacy: widget.isPharmacy!, - showPharmacyCart: widget.showPharmacyCart!, - isOfferPackages: widget.isOfferPackages!, - showOfferPackagesCart: widget.showOfferPackagesCart!, - isShowDecPage: widget.isShowDecPage!, + appBarTitle: widget.appBarTitle, + appBarIcons: widget.appBarIcons, + showHomeAppBarIcon: widget.showHomeAppBarIcon, + isPharmacy: widget.isPharmacy, + showPharmacyCart: widget.showPharmacyCart, + isOfferPackages: widget.isOfferPackages, + showOfferPackagesCart: widget.showOfferPackagesCart, + isShowDecPage: widget.isShowDecPage, backButtonTab: () { widget.backButtonTab; }, @@ -270,7 +270,7 @@ class _AppScaffoldState extends State { child: isUserNotLogin ? NotAutPage( title: widget.title ?? widget.appBarTitle, - description: widget.description!, + description: widget.description, infoList: widget.infoList, imagesInfo: widget.imagesInfo, icon: widget.icon, @@ -300,7 +300,7 @@ class _AppScaffoldState extends State { widget.changeCurrentTab!(value); } else { Navigator.pushAndRemoveUntil( - locator().navigatorKey!.currentContext!, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: value)), (Route r) => false); + locator().navigatorKey.currentContext!, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: value)), (Route r) => false); } } diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index 741c9062..f9dab34e 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -20,12 +20,12 @@ import '../../splashPage.dart'; class NotAutPage extends StatefulWidget { final String title; - final String description; + final String? description; final List? infoList; final List? imagesInfo; final String? icon; - NotAutPage({required this.title, required this.description, this.infoList, this.imagesInfo, this.icon}); + NotAutPage({required this.title, this.description, this.infoList, this.imagesInfo, this.icon}); @override _NotAutPageState createState() => _NotAutPageState(); @@ -160,7 +160,7 @@ class _NotAutPageState extends State { style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), ), Text( - widget.description, + widget.description!, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), ), SizedBox( diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index 66d16d34..d886c455 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -24,7 +24,7 @@ class SMSOTP { int remainingTime = 120; - Future? timer; + Future? timer; static BuildContext? _context; diff --git a/pubspec.yaml b/pubspec.yaml index bc85dcd7..fdc1054f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,8 @@ dependencies: # http client http: ^0.13.4 - connectivity: ^3.0.6 + #connectivity: ^3.0.6 + connectivity_plus: ^5.0.1 async: ^2.8.1 audio_wave: ^0.1.4 @@ -179,7 +180,7 @@ dependencies: speech_to_text: ^6.1.1 # path: speech_to_text - in_app_update: ^4.2.2 + #in_app_update: ^4.2.2 in_app_review: ^2.0.3 @@ -212,6 +213,9 @@ dependencies: # open_file: ^3.2.1 open_filex: ^4.3.2 path_provider: ^2.0.8 + + logger: ^2.0.2+1 + # flutter_callkit_incoming: ^1.0.3+3 # firebase_core: 1.12.0 @@ -219,7 +223,7 @@ dependencies: # crypto: dependency_overrides: - provider: ^5.0.0 + #provider: ^5.0.0 # permission_handler : ^10.2.0 #flutter_svg: ^1.1.6 # firebase_messaging_platform_interface: any @@ -232,6 +236,7 @@ dev_dependencies: flutter_test: sdk: flutter build_runner: ^2.1.5 + flutter: uses-material-design: true