diff --git a/android/build.gradle b/android/build.gradle index bf0f679d..ae74fcf6 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:7.0.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.3' } @@ -17,7 +17,8 @@ allprojects { google() jcenter() mavenCentral() - maven { url 'https://tokbox.bintray.com/maven' } + maven { url 'https://developer.huawei.com/repo/' } +// maven { url 'https://tokbox.bintray.com/maven' } } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146b..c17bc40a 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Jun 23 08:50:38 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a16..919434a6 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/lib/UpdatePage.dart b/lib/UpdatePage.dart index 16284ed1..5633d901 100644 --- a/lib/UpdatePage.dart +++ b/lib/UpdatePage.dart @@ -10,12 +10,11 @@ import 'package:url_launcher/url_launcher.dart'; import 'widgets/shared/buttons/secondary_button.dart'; class UpdatePage extends StatelessWidget { - final String message; - final String androidLink; - final String iosLink; + final String? message; + final String? androidLink; + final String? iosLink; - const UpdatePage({Key key, this.message, this.androidLink, this.iosLink}) - : super(key: key); + const UpdatePage({Key? key, this.message, this.androidLink, this.iosLink}) : super(key: key); @override Widget build(BuildContext context) { @@ -35,7 +34,7 @@ class UpdatePage extends StatelessWidget { Image.asset('assets/images/HMG_logo.png'), SizedBox(height: 8,), AppText( - TranslationBase.of(context).updateTheApp.toUpperCase(),fontSize: 17, + TranslationBase.of(context).updateTheApp!.toUpperCase(),fontSize: 17, fontWeight: FontWeight.w600, ), SizedBox(height: 12,), @@ -55,11 +54,11 @@ class UpdatePage extends StatelessWidget { color: Colors.red[800], onTap: () { if (Platform.isIOS) - launch(iosLink); + launch(iosLink!); else - launch(androidLink); + launch(androidLink!); }, - label: TranslationBase.of(context).updateNow.toUpperCase(), + label: TranslationBase.of(context).updateNow!.toUpperCase(), ), ), ), diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index af4e6e97..15ae3382 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -22,9 +22,9 @@ Helpers helpers = new Helpers(); class BaseAppClient { //TODO change the post fun to nun static when you change all service post(String endPoint, - {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, + {required Map body, + required Function(dynamic response, int statusCode) onSuccess, + required Function(String error, int statusCode) onFailure, bool isAllowAny = false, bool isLiveCare = false, bool isFallLanguage = false}) async { @@ -36,30 +36,28 @@ class BaseAppClient { bool callLog = true; try { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map? profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); + DoctorProfileModel? doctorProfile; if (profile != null) { - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) - body['DoctorID'] = doctorProfile?.doctorID; + doctorProfile = DoctorProfileModel.fromJson(profile); + if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile!.doctorID; if (body['DoctorID'] == "") body['DoctorID'] = null; - if (body['EditedBy'] == null) - body['EditedBy'] = doctorProfile?.doctorID; + if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile!.doctorID; if (body['ProjectID'] == null) { - body['ProjectID'] = doctorProfile?.projectID; + body['ProjectID'] = doctorProfile!.projectID; } - if (body['ClinicID'] == null) - body['ClinicID'] = doctorProfile?.clinicID; - } - if (body['DoctorID'] == '') { - body['DoctorID'] = null; - } - if (body['EditedBy'] == '') { - body.remove("EditedBy"); + if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile!.clinicID; + if (body['DoctorID'] == '') { + body['DoctorID'] = null; + } + if (body['EditedBy'] == '') { + body.remove("EditedBy"); + } } if (body['TokenID'] == null) { - body['TokenID'] = token ?? ''; + body['TokenID'] = token; } // body['TokenID'] = "@dm!n" ?? ''; if (!isFallLanguage) { @@ -82,12 +80,10 @@ class BaseAppClient { body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA; if (body['VidaAuthTokenID'] == null) { - body['VidaAuthTokenID'] = - await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); } if (body['VidaRefreshTokenID'] == null) { - body['VidaRefreshTokenID'] = - await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); } int projectID = await sharedPref.getInt(PROJECT_ID); @@ -107,30 +103,22 @@ class BaseAppClient { var asd = json.encode(body); var asd2; if (await Helpers.checkConnection()) { - final response = await http.post(url, - body: json.encode(body), - headers: { - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }); + final response = await http.post(Uri.parse(url), + body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}); final int statusCode = response.statusCode; if (statusCode < 200 || statusCode >= 400) { onFailure(Helpers.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], - parsed['AndroidLink'], parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); } if (parsed['IsAuthenticated'] != null && !parsed['IsAuthenticated']) { if (body['OTP_SendType'] != null) { onFailure(getError(parsed), statusCode); } else if (!isAllowAny) { - await Provider.of(AppGlobal.CONTEX, - listen: false) - .logout(); - + await Provider.of(AppGlobal.CONTEX, listen: false).logout(); Helpers.showErrorToast('Your session expired Please login again'); locator().pushNamedAndRemoveUntil(ROOT); } @@ -156,22 +144,18 @@ class BaseAppClient { } postPatient(String endPoint, - {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - @required PatiantInformtion patient, + {required Map body, + required Function(dynamic response, int statusCode) onSuccess, + required Function(String error, int statusCode) onFailure, + PatiantInformtion? patient, bool isExternal = false}) async { String url = BASE_URL + endPoint; try { - Map headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }; + Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; String token = await sharedPref.getString(TOKEN); - var languageID = - await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] @@ -191,12 +175,11 @@ class BaseAppClient { : PATIENT_OUT_SA_PATIENT_REQ; if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = - body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; @@ -204,7 +187,7 @@ class BaseAppClient { body['PatientType'] = body.containsKey('PatientType') ? body['PatientType'] != null ? body['PatientType'] - : patient.patientType != null + : patient!.patientType != null ? patient.patientType : PATIENT_TYPE : PATIENT_TYPE; @@ -212,15 +195,13 @@ class BaseAppClient { body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID'] != null ? body['PatientTypeID'] - : patient.patientType != null + : patient!.patientType != null ? patient.patientType : PATIENT_TYPE_ID : PATIENT_TYPE_ID; body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] : token; - body['PatientID'] = body['PatientID'] != null - ? body['PatientID'] - : patient.patientId ?? patient.patientMRN; + body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient!.patientId ?? patient.patientMRN; body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['SessionID'] = SESSION_ID; //getSe @@ -236,8 +217,7 @@ class BaseAppClient { var asd = json.encode(body); var asd2; if (await Helpers.checkConnection()) { - final response = await http.post(url.trim(), - body: json.encode(body), headers: headers); + final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final int statusCode = response.statusCode; print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { @@ -249,8 +229,7 @@ class BaseAppClient { onSuccess(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], - parsed['AndroidLink'], parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); } if (parsed['IsAuthenticated'] == null) { if (parsed['isSMSSent'] == true) { @@ -266,28 +245,20 @@ class BaseAppClient { onFailure(getError(parsed), statusCode); } } - } else if (parsed['MessageStatus'] == 1 || - parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && - parsed['IsAuthenticated']) { + } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { onSuccess(parsed, statusCode); } else { - if (parsed['message'] == null && - parsed['ErrorEndUserMessage'] == null) { + if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure("Server Error found with no available message", - statusCode); + onFailure("Server Error found with no available message", statusCode); } else { onFailure(parsed['ErrorSearchMsg'], statusCode); } } else { - onFailure( - parsed['message'] ?? - parsed['ErrorEndUserMessage'] ?? - parsed['ErrorMessage'], - statusCode); + onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } } else { @@ -297,9 +268,7 @@ class BaseAppClient { if (parsed['message'] != null) { onFailure(parsed['message'] ?? parsed['message'], statusCode); } else { - onFailure( - parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); + onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } } @@ -322,12 +291,8 @@ class BaseAppClient { if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { - for (var i = 0; - i < parsed["ValidationErrors"]["ValidationErrors"].length; - i++) { - error = error + - parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + - "\n"; + for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) { + error = error + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n"; } } } diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 21859d3b..c6ec4fdd 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -5,15 +5,16 @@ class SizeConfig { static double _blockWidth = 0; static double _blockHeight = 0; - static double realScreenWidth; - static double realScreenHeight; - static double screenWidth; - static double screenHeight; - static double textMultiplier; - static double imageSizeMultiplier; - static double heightMultiplier; + static late double realScreenWidth; + static late double realScreenHeight; + static late double screenWidth; + static late double screenHeight; + static late double textMultiplier; + static late double imageSizeMultiplier; + static late double heightMultiplier; + static late double widthMultiplier; + static bool isPortrait = true; - static double widthMultiplier; static bool isMobilePortrait = false; static bool isMobile = false; static bool isHeightShort = false; @@ -24,6 +25,7 @@ class SizeConfig { void init(BoxConstraints constraints, Orientation orientation) { realScreenHeight = constraints.maxHeight; realScreenWidth = constraints.maxWidth; + if (constraints.maxWidth <= MAX_SMALL_SCREEN) { isMobile = true; } @@ -46,20 +48,16 @@ class SizeConfig { if (realScreenWidth < 450) { isMobilePortrait = true; } - // textMultiplier = _blockHeight; - // imageSizeMultiplier = _blockWidth; screenHeight = realScreenHeight; screenWidth = realScreenWidth; } else { isPortrait = false; isMobilePortrait = false; - // textMultiplier = _blockWidth; - // imageSizeMultiplier = _blockHeight; screenHeight = realScreenWidth; screenWidth = realScreenHeight; } - _blockWidth = screenWidth / 100; - _blockHeight = screenHeight / 100; + _blockWidth = (screenWidth / 100); + _blockHeight = (screenHeight / 100); textMultiplier = _blockHeight; imageSizeMultiplier = _blockWidth; @@ -74,9 +72,11 @@ class SizeConfig { print('widthMultiplier $widthMultiplier'); print('isPortrait $isPortrait'); print('isMobilePortrait $isMobilePortrait'); + + } - static getTextMultiplierBasedOnWidth({double width}) { + static getTextMultiplierBasedOnWidth({double? width}) { // TODO handel LandScape case if (width != null) { return width / 100; @@ -84,7 +84,7 @@ class SizeConfig { return widthMultiplier; } - static getWidthMultiplier({double width}) { +static getWidthMultiplier({double? width}) { // TODO handel LandScape case if (width != null) { return width / 100; @@ -92,7 +92,7 @@ class SizeConfig { return widthMultiplier; } - static getHeightMultiplier({double height}) { + static getHeightMultiplier({double? height}) { // TODO handel LandScape case if (height != null) { return height / 100; diff --git a/lib/core/insurance_approval_request_model.dart b/lib/core/insurance_approval_request_model.dart index 02f71ecb..11f7804e 100644 --- a/lib/core/insurance_approval_request_model.dart +++ b/lib/core/insurance_approval_request_model.dart @@ -1,17 +1,17 @@ class InsuranceApprovalInPatientRequestModel { - int patientID; - int patientTypeID; - int eXuldAPPNO; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? patientID; + int? patientTypeID; + int? eXuldAPPNO; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; InsuranceApprovalInPatientRequestModel( {this.patientID, diff --git a/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart b/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart index 4b95c1b0..ff412db2 100644 --- a/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart +++ b/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart @@ -1,29 +1,29 @@ class CheckActivationCodeModel { - int patientMobileNumber; - String mobileNo; - int projectOutSA; - int loginType; - String zipCode; - bool isRegister; - String logInTokenID; - int searchType; - int patientID; - int nationalID; - int patientIdentificationID; - bool forRegisteration; - String activationCode; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - Null sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - String dOB; - int isHijri; - String healthId; + int? patientMobileNumber; + String? mobileNo; + int? projectOutSA; + int? loginType; + String? zipCode; + bool? isRegister; + String? logInTokenID; + int? searchType; + int? patientID; + int? nationalID; + int? patientIdentificationID; + bool? forRegisteration; + String? activationCode; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + Null? sessionID; + bool? isDentalAllowedBackend; + int ?deviceTypeID; + String? dOB; + int? isHijri; + String? healthId; CheckActivationCodeModel( {this.patientMobileNumber, diff --git a/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart index 3465cf8d..89e1bfd6 100644 --- a/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart @@ -1,40 +1,40 @@ class CheckPatientForRegistrationModel { - int patientIdentificationID; - int patientMobileNumber; - String zipCode; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; + int? patientIdentificationID; + int? patientMobileNumber; + String? zipCode; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; Null sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - String tokenID; - int patientID; - bool isRegister; - String dOB; - int isHijri; + bool? isDentalAllowedBackend; + int? deviceTypeID; + String? tokenID; + int? patientID; + bool? isRegister; + String? dOB; + int? isHijri; CheckPatientForRegistrationModel( {this.patientIdentificationID, - this.patientMobileNumber, - this.zipCode, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.tokenID, - this.patientID, - this.isRegister, - this.dOB, - this.isHijri}); + this.patientMobileNumber, + this.zipCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.isRegister, + this.dOB, + this.isHijri}); CheckPatientForRegistrationModel.fromJson(Map json) { patientIdentificationID = json['PatientIdentificationID']; diff --git a/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart b/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart index f05131ef..1f00fba0 100644 --- a/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart +++ b/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart @@ -1,30 +1,30 @@ class GetPatientInfoRequestModel { - String patientIdentificationID; - String dOB; - int isHijri; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; + String? patientIdentificationID; + String? dOB; + int? isHijri; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; Null sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; + bool? isDentalAllowedBackend; + int? deviceTypeID; GetPatientInfoRequestModel( {this.patientIdentificationID, - this.dOB, - this.isHijri, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID}); + this.dOB, + this.isHijri, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); GetPatientInfoRequestModel.fromJson(Map json) { patientIdentificationID = json['PatientIdentificationID']; diff --git a/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart b/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart index 158bd1e2..0aeb5660 100644 --- a/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart +++ b/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart @@ -1,78 +1,78 @@ class GetPatientInfoResponseModel { dynamic date; - int languageID; - int serviceName; + int? languageID; + int? serviceName; dynamic time; dynamic androidLink; dynamic authenticationTokenID; dynamic data; - bool dataw; - int dietType; + bool? dataw; + int? dietType; dynamic errorCode; dynamic errorEndUserMessage; dynamic errorEndUserMessageN; dynamic errorMessage; - int errorType; - int foodCategory; + int? errorType; + int? foodCategory; dynamic iOSLink; - bool isAuthenticated; - int mealOrderStatus; - int mealType; - int messageStatus; - int numberOfResultRecords; + bool? isAuthenticated; + int? mealOrderStatus; + int? mealType; + int? messageStatus; + int? numberOfResultRecords; dynamic patientBlodType; dynamic successMsg; dynamic successMsgN; dynamic vidaUpdatedResponse; dynamic accessTokenObject; - int age; + int? age; dynamic clientIdentifierId; - int createdBy; - String dateOfBirth; - String firstNameAr; - String firstNameEn; - String gender; + int? createdBy; + String? dateOfBirth; + String? firstNameAr; + String? firstNameEn; + String? gender; dynamic genderAr; dynamic genderEn; - String healthId; - String idNumber; - String idType; - bool isHijri; - int isInstertedOrUpdated; - int isNull; - int isPatientExistNHIC; - bool isRecordLockedByCurrentUser; - String lastNameAr; - String lastNameEn; + String? healthId; + String? idNumber; + String? idType; + bool? isHijri; + int? isInstertedOrUpdated; + int? isNull; + int? isPatientExistNHIC; + bool? isRecordLockedByCurrentUser; + String? lastNameAr; + String? lastNameEn; dynamic listActiveAccessToken; - String maritalStatus; - String maritalStatusCode; - String nationalDateOfBirth; - String nationality; - String nationalityCode; - String occupation; + String? maritalStatus; + String? maritalStatusCode; + String? nationalDateOfBirth; + String? nationality; + String? nationalityCode; + String? occupation; dynamic pCDTransactionDataResultList; dynamic pCDGetVidaPatientForManualVerificationList; dynamic pCDNHICHMGPatientDetailsMatchCalulationList; - int pCDReturnValue; - String patientStatus; - String placeofBirth; + int? pCDReturnValue; + String? patientStatus; + String? placeofBirth; dynamic practitionerStatusCode; dynamic practitionerStatusDescAr; dynamic practitionerStatusDescEn; - int rowCount; - String secondNameAr; - String secondNameEn; - String thirdNameAr; - String thirdNameEn; + int? rowCount; + String? secondNameAr; + String? secondNameEn; + String? thirdNameAr; + String? thirdNameEn; dynamic yakeenVidaPatientDataStatisticsByPatientIdList; dynamic yakeenVidaPatientDataStatisticsList; dynamic yakeenVidaPatientDataStatisticsPrefferedList; dynamic accessToken; - int categoryCode; + int? categoryCode; dynamic categoryNameAr; dynamic categoryNameEn; - int constraintCode; + int? constraintCode; dynamic constraintNameAr; dynamic constraintNameEn; dynamic content; @@ -84,99 +84,99 @@ class GetPatientInfoResponseModel { dynamic licenseStatusDescEn; dynamic organizations; dynamic registrationNumber; - int specialtyCode; + int? specialtyCode; dynamic specialtyNameAr; dynamic specialtyNameEn; GetPatientInfoResponseModel( {this.date, - this.languageID, - this.serviceName, - this.time, - this.androidLink, - this.authenticationTokenID, - this.data, - this.dataw, - this.dietType, - this.errorCode, - this.errorEndUserMessage, - this.errorEndUserMessageN, - this.errorMessage, - this.errorType, - this.foodCategory, - this.iOSLink, - this.isAuthenticated, - this.mealOrderStatus, - this.mealType, - this.messageStatus, - this.numberOfResultRecords, - this.patientBlodType, - this.successMsg, - this.successMsgN, - this.vidaUpdatedResponse, - this.accessTokenObject, - this.age, - this.clientIdentifierId, - this.createdBy, - this.dateOfBirth, - this.firstNameAr, - this.firstNameEn, - this.gender, - this.genderAr, - this.genderEn, - this.healthId, - this.idNumber, - this.idType, - this.isHijri, - this.isInstertedOrUpdated, - this.isNull, - this.isPatientExistNHIC, - this.isRecordLockedByCurrentUser, - this.lastNameAr, - this.lastNameEn, - this.listActiveAccessToken, - this.maritalStatus, - this.maritalStatusCode, - this.nationalDateOfBirth, - this.nationality, - this.nationalityCode, - this.occupation, - this.pCDTransactionDataResultList, - this.pCDGetVidaPatientForManualVerificationList, - this.pCDNHICHMGPatientDetailsMatchCalulationList, - this.pCDReturnValue, - this.patientStatus, - this.placeofBirth, - this.practitionerStatusCode, - this.practitionerStatusDescAr, - this.practitionerStatusDescEn, - this.rowCount, - this.secondNameAr, - this.secondNameEn, - this.thirdNameAr, - this.thirdNameEn, - this.yakeenVidaPatientDataStatisticsByPatientIdList, - this.yakeenVidaPatientDataStatisticsList, - this.yakeenVidaPatientDataStatisticsPrefferedList, - this.accessToken, - this.categoryCode, - this.categoryNameAr, - this.categoryNameEn, - this.constraintCode, - this.constraintNameAr, - this.constraintNameEn, - this.content, - this.errorList, - this.licenseExpiryDate, - this.licenseIssuedDate, - this.licenseStatusCode, - this.licenseStatusDescAr, - this.licenseStatusDescEn, - this.organizations, - this.registrationNumber, - this.specialtyCode, - this.specialtyNameAr, - this.specialtyNameEn}); + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.vidaUpdatedResponse, + this.accessTokenObject, + this.age, + this.clientIdentifierId, + this.createdBy, + this.dateOfBirth, + this.firstNameAr, + this.firstNameEn, + this.gender, + this.genderAr, + this.genderEn, + this.healthId, + this.idNumber, + this.idType, + this.isHijri, + this.isInstertedOrUpdated, + this.isNull, + this.isPatientExistNHIC, + this.isRecordLockedByCurrentUser, + this.lastNameAr, + this.lastNameEn, + this.listActiveAccessToken, + this.maritalStatus, + this.maritalStatusCode, + this.nationalDateOfBirth, + this.nationality, + this.nationalityCode, + this.occupation, + this.pCDTransactionDataResultList, + this.pCDGetVidaPatientForManualVerificationList, + this.pCDNHICHMGPatientDetailsMatchCalulationList, + this.pCDReturnValue, + this.patientStatus, + this.placeofBirth, + this.practitionerStatusCode, + this.practitionerStatusDescAr, + this.practitionerStatusDescEn, + this.rowCount, + this.secondNameAr, + this.secondNameEn, + this.thirdNameAr, + this.thirdNameEn, + this.yakeenVidaPatientDataStatisticsByPatientIdList, + this.yakeenVidaPatientDataStatisticsList, + this.yakeenVidaPatientDataStatisticsPrefferedList, + this.accessToken, + this.categoryCode, + this.categoryNameAr, + this.categoryNameEn, + this.constraintCode, + this.constraintNameAr, + this.constraintNameEn, + this.content, + this.errorList, + this.licenseExpiryDate, + this.licenseIssuedDate, + this.licenseStatusCode, + this.licenseStatusDescAr, + this.licenseStatusDescEn, + this.organizations, + this.registrationNumber, + this.specialtyCode, + this.specialtyNameAr, + this.specialtyNameEn}); GetPatientInfoResponseModel.fromJson(Map json) { date = json['Date']; diff --git a/lib/core/model/PatientRegistration/PatientRegistrationModel.dart b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart index 83ff53d7..a73ecb0b 100644 --- a/lib/core/model/PatientRegistration/PatientRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart @@ -1,42 +1,42 @@ class PatientRegistrationModel { - Patientobject patientobject; - String patientIdentificationID; - String patientMobileNumber; - String logInTokenID; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; + Patientobject? patientobject; + String? patientIdentificationID; + String? patientMobileNumber; + String? logInTokenID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; Null sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - String tokenID; - String dOB; - int isHijri; - String healthId; - String zipCode; + bool? isDentalAllowedBackend; + int? deviceTypeID; + String? tokenID; + String? dOB; + int? isHijri; + String? healthId; + String? zipCode; PatientRegistrationModel( {this.patientobject, - this.patientIdentificationID, - this.patientMobileNumber, - this.logInTokenID, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.tokenID, - this.dOB, - this.isHijri, - this.healthId, - this.zipCode}); + this.patientIdentificationID, + this.patientMobileNumber, + this.logInTokenID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.dOB, + this.isHijri, + this.healthId, + this.zipCode}); PatientRegistrationModel.fromJson(Map json) { patientobject = json['Patientobject'] != null @@ -64,7 +64,7 @@ class PatientRegistrationModel { Map toJson() { final Map data = new Map(); if (this.patientobject != null) { - data['Patientobject'] = this.patientobject.toJson(); + data['Patientobject'] = this.patientobject!.toJson(); } data['PatientIdentificationID'] = this.patientIdentificationID; data['PatientMobileNumber'] = this.patientMobileNumber; @@ -88,50 +88,50 @@ class PatientRegistrationModel { } class Patientobject { - bool tempValue; - int patientIdentificationType; - String patientIdentificationNo; - int mobileNumber; - int patientOutSA; - String firstNameN; - String middleNameN; - String lastNameN; - String firstName; - String middleName; - String lastName; - String strDateofBirth; - String dateofBirth; - int gender; - String nationalityID; - String dateofBirthN; - String emailAddress; - String sourceType; - String preferredLanguage; - String marital; - String eHealthIDField; + bool? tempValue; + int? patientIdentificationType; + String? patientIdentificationNo; + int? mobileNumber; + int? patientOutSA; + String? firstNameN; + String? middleNameN; + String? lastNameN; + String? firstName; + String? middleName; + String? lastName; + String? strDateofBirth; + String? dateofBirth; + int? gender; + String? nationalityID; + String? dateofBirthN; + String? emailAddress; + String? sourceType; + String? preferredLanguage; + String? marital; + String? eHealthIDField; Patientobject( {this.tempValue, - this.patientIdentificationType, - this.patientIdentificationNo, - this.mobileNumber, - this.patientOutSA, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.firstName, - this.middleName, - this.lastName, - this.strDateofBirth, - this.dateofBirth, - this.gender, - this.nationalityID, - this.dateofBirthN, - this.emailAddress, - this.sourceType, - this.preferredLanguage, - this.marital, - this.eHealthIDField}); + this.patientIdentificationType, + this.patientIdentificationNo, + this.mobileNumber, + this.patientOutSA, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.firstName, + this.middleName, + this.lastName, + this.strDateofBirth, + this.dateofBirth, + this.gender, + this.nationalityID, + this.dateofBirthN, + this.emailAddress, + this.sourceType, + this.preferredLanguage, + this.marital, + this.eHealthIDField}); Patientobject.fromJson(Map json) { tempValue = json['TempValue']; diff --git a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart index 8244a95f..af08661f 100644 --- a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart @@ -1,54 +1,54 @@ class SendActivationCodeByOTPNotificationTypeForRegistrationModel { - int patientMobileNumber; - String mobileNo; - int projectOutSA; - int loginType; - String zipCode; - bool isRegister; - String logInTokenID; - int searchType; - int patientID; - int nationalID; - int patientIdentificationID; - int oTPSendType; - int languageID; - double versionID; - int channel; - String iPAdress; - String generalid; - int patientOutSA; + int? patientMobileNumber; + String? mobileNo; + int? projectOutSA; + int? loginType; + String? zipCode; + bool? isRegister; + String? logInTokenID; + int? searchType; + int? patientID; + int? nationalID; + int? patientIdentificationID; + int? oTPSendType; + int? languageID; + double? versionID; + int? channel; + String? iPAdress; + String? generalid; + int? patientOutSA; Null sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - String dOB; - int isHijri; - String healthId; + bool? isDentalAllowedBackend; + int? deviceTypeID; + String? dOB; + int? isHijri; + String? healthId; SendActivationCodeByOTPNotificationTypeForRegistrationModel( {this.patientMobileNumber, - this.mobileNo, - this.projectOutSA, - this.loginType, - this.zipCode, - this.isRegister, - this.logInTokenID, - this.searchType, - this.patientID, - this.nationalID, - this.patientIdentificationID, - this.oTPSendType, - this.languageID, - this.versionID, - this.channel, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.dOB, - this.isHijri, - this.healthId}); + this.mobileNo, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.oTPSendType, + this.languageID, + this.versionID, + this.channel, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( Map json) { diff --git a/lib/core/model/Prescriptions/Prescriptions.dart b/lib/core/model/Prescriptions/Prescriptions.dart index c47a813a..af893503 100644 --- a/lib/core/model/Prescriptions/Prescriptions.dart +++ b/lib/core/model/Prescriptions/Prescriptions.dart @@ -1,77 +1,78 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class Prescriptions { - String setupID; - int projectID; - int patientID; - int appointmentNo; - String appointmentDate; - String doctorName; - String clinicDescription; - String name; - int episodeID; - int actualDoctorRate; - int admission; - int clinicID; - String companyName; - String despensedStatus; - DateTime dischargeDate; - int dischargeNo; - int doctorID; - String doctorImageURL; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - bool isLiveCareAppointment; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isInsurancePatient; - String nationalityFlagURL; - int noOfPatientsRate; - String qR; - List speciality; + String? setupID; + int? projectID; + int? patientID; + int? appointmentNo; + String? appointmentDate; + String? doctorName; + String? clinicDescription; + String? name; + int? episodeID; + int? actualDoctorRate; + int? admission; + int? clinicID; + String? companyName; + String? despensedStatus; + DateTime? dischargeDate; + int? dischargeNo; + int? doctorID; + String? doctorImageURL; + int? doctorRate; + String? doctorTitle; + int? gender; + String? genderDescription; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; + bool? isLiveCareAppointment; + String? isInOutPatientDescription; + String? isInOutPatientDescriptionN; + bool? isInsurancePatient; + String? nationalityFlagURL; + int? noOfPatientsRate; + String? qR; + List? speciality; Prescriptions( {this.setupID, - this.projectID, - this.patientID, - this.appointmentNo, - this.appointmentDate, - this.doctorName, - this.clinicDescription, - this.name, - this.episodeID, - this.actualDoctorRate, - this.admission, - this.clinicID, - this.companyName, - this.despensedStatus, - this.dischargeDate, - this.dischargeNo, - this.doctorID, - this.doctorImageURL, - this.doctorRate, - this.doctorTitle, - this.gender, - this.genderDescription, - this.isActiveDoctorProfile, - this.isDoctorAllowVedioCall, - this.isExecludeDoctor, - this.isInOutPatient, - this.isInOutPatientDescription, - this.isInOutPatientDescriptionN, - this.isInsurancePatient, - this.nationalityFlagURL, - this.noOfPatientsRate, - this.qR, - this.speciality,this.isLiveCareAppointment}); + this.projectID, + this.patientID, + this.appointmentNo, + this.appointmentDate, + this.doctorName, + this.clinicDescription, + this.name, + this.episodeID, + this.actualDoctorRate, + this.admission, + this.clinicID, + this.companyName, + this.despensedStatus, + this.dischargeDate, + this.dischargeNo, + this.doctorID, + this.doctorImageURL, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isInsurancePatient, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.qR, + this.speciality, + this.isLiveCareAppointment}); - Prescriptions.fromJson(Map json) { + Prescriptions.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -105,11 +106,11 @@ class Prescriptions { noOfPatientsRate = json['NoOfPatientsRate']; qR = json['QR']; isLiveCareAppointment = json['IsLiveCareAppointment']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; @@ -149,10 +150,10 @@ class Prescriptions { } class PrescriptionsList { - String filterName = ""; - List prescriptionsList = List(); + String? filterName = ""; + List prescriptionsList =[]; - PrescriptionsList({this.filterName, Prescriptions prescriptions}) { + PrescriptionsList({this.filterName, required Prescriptions prescriptions}) { prescriptionsList.add(prescriptions); } } diff --git a/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart b/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart index 8ba07f2a..4644131e 100644 --- a/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart +++ b/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart @@ -1,40 +1,40 @@ class GetMedicationForInPatientModel { - String setupID; - int projectID; - int admissionNo; - int patientID; - int orderNo; - int prescriptionNo; - int lineItemNo; - String prescriptionDatetime; - int itemID; - int directionID; - int refillID; - String dose; - int unitofMeasurement; - String startDatetime; - String stopDatetime; - int noOfDoses; - int routeId; - String comments; - int reviewedPharmacist; + String? setupID; + int? projectID; + int? admissionNo; + int? patientID; + int? orderNo; + int? prescriptionNo; + int? lineItemNo; + String? prescriptionDatetime; + int? itemID; + int? directionID; + int? refillID; + String? dose; + int? unitofMeasurement; + String? startDatetime; + String? stopDatetime; + int? noOfDoses; + int? routeId; + String? comments; + int? reviewedPharmacist; dynamic reviewedPharmacistDatetime; dynamic discountinueDatetime; dynamic rescheduleDatetime; - int status; - String statusDescription; - int createdBy; - String createdOn; + int? status; + String? statusDescription; + int? createdBy; + String? createdOn; dynamic editedBy; dynamic editedOn; dynamic strength; - String pHRItemDescription; - String pHRItemDescriptionN; - String doctorName; - String uomDescription; - String routeDescription; - String directionDescription; - String refillDescription; + String? pHRItemDescription; + String? pHRItemDescriptionN; + String? doctorName; + String? uomDescription; + String? routeDescription; + String? directionDescription; + String? refillDescription; GetMedicationForInPatientModel( {this.setupID, diff --git a/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart b/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart index 7c906643..71c1305a 100644 --- a/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart +++ b/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart @@ -1,16 +1,16 @@ class GetMedicationForInPatientRequestModel { - bool isDentalAllowedBackend; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int deviceTypeID; - String tokenID; - int patientID; - int admissionNo; - String sessionID; - int projectID; + bool? isDentalAllowedBackend; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? deviceTypeID; + String? tokenID; + int? patientID; + int? admissionNo; + String? sessionID; + int? projectID; GetMedicationForInPatientRequestModel( {this.isDentalAllowedBackend, diff --git a/lib/core/model/Prescriptions/in_patient_prescription_model.dart b/lib/core/model/Prescriptions/in_patient_prescription_model.dart index f6e88bf7..3f67e659 100644 --- a/lib/core/model/Prescriptions/in_patient_prescription_model.dart +++ b/lib/core/model/Prescriptions/in_patient_prescription_model.dart @@ -1,5 +1,5 @@ class InPatientPrescriptionRequestModel { - String vidaAuthTokenID; + String? vidaAuthTokenID; dynamic patientMRN; dynamic appNo; dynamic admissionNo; diff --git a/lib/core/model/Prescriptions/perscription_pharmacy.dart b/lib/core/model/Prescriptions/perscription_pharmacy.dart index 3adaef7e..c6b013d3 100644 --- a/lib/core/model/Prescriptions/perscription_pharmacy.dart +++ b/lib/core/model/Prescriptions/perscription_pharmacy.dart @@ -1,28 +1,28 @@ class PharmacyPrescriptions { - String expiryDate; + String? expiryDate; dynamic sellingPrice; - int quantity; - int itemID; - int locationID; - int projectID; - String setupID; - String locationDescription; - Null locationDescriptionN; - String itemDescription; - Null itemDescriptionN; - String alias; - int locationTypeID; - int barcode; - Null companybarcode; - int cityID; - String cityName; - int distanceInKilometers; - String latitude; - int locationType; - String longitude; - String phoneNumber; - String projectImageURL; - Null sortOrder; + int?quantity; + int?itemID; + int?locationID; + int?projectID; + String ?setupID; + String ?locationDescription; + dynamic locationDescriptionN; + String ? itemDescription; + dynamic itemDescriptionN; + String ? alias; + int ? locationTypeID; + int ? barcode; + dynamic companybarcode; + int ? cityID; + String? cityName; + int ? distanceInKilometers; + String? latitude; + int ?locationType; + String? longitude; + String ?phoneNumber; + String ? projectImageURL; + dynamic sortOrder; PharmacyPrescriptions( {this.expiryDate, diff --git a/lib/core/model/Prescriptions/post_prescrition_req_model.dart b/lib/core/model/Prescriptions/post_prescrition_req_model.dart index 06a524ed..9609a0df 100644 --- a/lib/core/model/Prescriptions/post_prescrition_req_model.dart +++ b/lib/core/model/Prescriptions/post_prescrition_req_model.dart @@ -1,10 +1,10 @@ class PostPrescriptionReqModel { - String vidaAuthTokenID; - int clinicID; - int episodeID; - int appointmentNo; - int patientMRN; - List prescriptionRequestModel; + String ?vidaAuthTokenID; + int? clinicID; + int? episodeID; + int? appointmentNo; + int? patientMRN; + List ?prescriptionRequestModel; PostPrescriptionReqModel( {this.vidaAuthTokenID, @@ -21,9 +21,9 @@ class PostPrescriptionReqModel { appointmentNo = json['AppointmentNo']; patientMRN = json['PatientMRN']; if (json['prescriptionRequestModel'] != null) { - prescriptionRequestModel = new List(); + prescriptionRequestModel =[]; json['prescriptionRequestModel'].forEach((v) { - prescriptionRequestModel.add(new PrescriptionRequestModel.fromJson(v)); + prescriptionRequestModel!.add(new PrescriptionRequestModel.fromJson(v)); }); } } @@ -37,25 +37,25 @@ class PostPrescriptionReqModel { data['PatientMRN'] = this.patientMRN; if (this.prescriptionRequestModel != null) { data['prescriptionRequestModel'] = - this.prescriptionRequestModel.map((v) => v.toJson()).toList(); + this.prescriptionRequestModel!.map((v) => v.toJson()).toList(); } return data; } } class PrescriptionRequestModel { - int itemId; - String doseStartDate; - int duration; - double dose; - int doseUnitId; - int route; - int frequency; - int doseTime; - bool covered; - bool approvalRequired; - String remarks; - String icdcode10Id; + int ? itemId; + String? doseStartDate; + int ?duration; + double? dose; + int ?doseUnitId; + int ?route; + int ?frequency; + int ?doseTime; + bool ?covered; + bool ?approvalRequired; + String ?remarks; + String ?icdcode10Id; PrescriptionRequestModel({ this.itemId, diff --git a/lib/core/model/Prescriptions/prescription_in_patient.dart b/lib/core/model/Prescriptions/prescription_in_patient.dart index c66bc8a4..0a3352a2 100644 --- a/lib/core/model/Prescriptions/prescription_in_patient.dart +++ b/lib/core/model/Prescriptions/prescription_in_patient.dart @@ -1,100 +1,100 @@ class PrescriotionInPatient { - int admissionNo; - int authorizedBy; + int ?admissionNo; + int ?authorizedBy; dynamic bedNo; - String comments; - int createdBy; - String createdByName; + String? comments; + int ?createdBy; + String ?createdByName; dynamic createdByNameN; - String createdOn; - String direction; - int directionID; + String ?createdOn; + String ?direction; + int ?directionID; dynamic directionN; - String dose; - int editedBy; + String ?dose; + int ?editedBy; dynamic iVDiluentLine; - int iVDiluentType; + int ?iVDiluentType; dynamic iVDiluentVolume; dynamic iVRate; dynamic iVStability; - String itemDescription; - int itemID; - int lineItemNo; - int locationId; - int noOfDoses; - int orderNo; - int patientID; - String pharmacyRemarks; - String prescriptionDatetime; - int prescriptionNo; - String processedBy; - int projectID; - int refillID; - String refillType; + String? itemDescription; + int? itemID; + int? lineItemNo; + int? locationId; + int? noOfDoses; + int? orderNo; + int? patientID; + String ?pharmacyRemarks; + String ?prescriptionDatetime; + int ?prescriptionNo; + String? processedBy; + int ?projectID; + int ?refillID; + String ?refillType; dynamic refillTypeN; - int reviewedPharmacist; + int ?reviewedPharmacist; dynamic roomId; - String route; - int routeId; + String ?route; + int ?routeId; dynamic routeN; dynamic setupID; - String startDatetime; - int status; - String statusDescription; + String ?startDatetime; + int ?status; + String ?statusDescription; dynamic statusDescriptionN; - String stopDatetime; - int unitofMeasurement; - String unitofMeasurementDescription; + String ?stopDatetime; + int ?unitofMeasurement; + String? unitofMeasurementDescription; dynamic unitofMeasurementDescriptionN; PrescriotionInPatient( {this.admissionNo, - this.authorizedBy, - this.bedNo, - this.comments, - this.createdBy, - this.createdByName, - this.createdByNameN, - this.createdOn, - this.direction, - this.directionID, - this.directionN, - this.dose, - this.editedBy, - this.iVDiluentLine, - this.iVDiluentType, - this.iVDiluentVolume, - this.iVRate, - this.iVStability, - this.itemDescription, - this.itemID, - this.lineItemNo, - this.locationId, - this.noOfDoses, - this.orderNo, - this.patientID, - this.pharmacyRemarks, - this.prescriptionDatetime, - this.prescriptionNo, - this.processedBy, - this.projectID, - this.refillID, - this.refillType, - this.refillTypeN, - this.reviewedPharmacist, - this.roomId, - this.route, - this.routeId, - this.routeN, - this.setupID, - this.startDatetime, - this.status, - this.statusDescription, - this.statusDescriptionN, - this.stopDatetime, - this.unitofMeasurement, - this.unitofMeasurementDescription, - this.unitofMeasurementDescriptionN}); + this.authorizedBy, + this.bedNo, + this.comments, + this.createdBy, + this.createdByName, + this.createdByNameN, + this.createdOn, + this.direction, + this.directionID, + this.directionN, + this.dose, + this.editedBy, + this.iVDiluentLine, + this.iVDiluentType, + this.iVDiluentVolume, + this.iVRate, + this.iVStability, + this.itemDescription, + this.itemID, + this.lineItemNo, + this.locationId, + this.noOfDoses, + this.orderNo, + this.patientID, + this.pharmacyRemarks, + this.prescriptionDatetime, + this.prescriptionNo, + this.processedBy, + this.projectID, + this.refillID, + this.refillType, + this.refillTypeN, + this.reviewedPharmacist, + this.roomId, + this.route, + this.routeId, + this.routeN, + this.setupID, + this.startDatetime, + this.status, + this.statusDescription, + this.statusDescriptionN, + this.stopDatetime, + this.unitofMeasurement, + this.unitofMeasurementDescription, + this.unitofMeasurementDescriptionN}); PrescriotionInPatient.fromJson(Map json) { admissionNo = json['AdmissionNo']; diff --git a/lib/core/model/Prescriptions/prescription_model.dart b/lib/core/model/Prescriptions/prescription_model.dart index 92574c66..99fe4532 100644 --- a/lib/core/model/Prescriptions/prescription_model.dart +++ b/lib/core/model/Prescriptions/prescription_model.dart @@ -1,5 +1,5 @@ class PrescriptionModel { - List entityList; + List? entityList; dynamic rowcount; dynamic statusMessage; @@ -7,9 +7,9 @@ class PrescriptionModel { PrescriptionModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -19,7 +19,7 @@ class PrescriptionModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -63,38 +63,38 @@ class EntityList { dynamic mediSpanGPICode; EntityList( {this.appointmentNo, - this.clinicName, - this.createdBy, - this.createdOn, - this.doctorName, - this.doseDailyQuantity, - this.doseDailyUnitID, - this.doseDetail, - this.doseDurationDays, - this.doseTimingID, - this.episodeID, - this.frequencyID, - this.icdCode10ID, - this.indication, - this.isDispensed, - this.isMedicineCovered, - this.isSIG, - this.medicationName, - this.medicationPrice, - this.medicineCode, - this.orderTypeDescription, - this.qty, - this.quantity, - this.remarks, - this.routeID, - this.startDate, - this.status, - this.stopDate, - this.uom, - this.pharmacistRemarks, - this.mediSpanGPICode, - this.pharmacyInervention, - this.refill}); + this.clinicName, + this.createdBy, + this.createdOn, + this.doctorName, + this.doseDailyQuantity, + this.doseDailyUnitID, + this.doseDetail, + this.doseDurationDays, + this.doseTimingID, + this.episodeID, + this.frequencyID, + this.icdCode10ID, + this.indication, + this.isDispensed, + this.isMedicineCovered, + this.isSIG, + this.medicationName, + this.medicationPrice, + this.medicineCode, + this.orderTypeDescription, + this.qty, + this.quantity, + this.remarks, + this.routeID, + this.startDate, + this.status, + this.stopDate, + this.uom, + this.pharmacistRemarks, + this.mediSpanGPICode, + this.pharmacyInervention, + this.refill}); EntityList.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/core/model/Prescriptions/prescription_report.dart b/lib/core/model/Prescriptions/prescription_report.dart index 006a6fad..4b5d574a 100644 --- a/lib/core/model/Prescriptions/prescription_report.dart +++ b/lib/core/model/Prescriptions/prescription_report.dart @@ -1,48 +1,48 @@ class PrescriptionReport { - String address; - dynamic appodynamicmentNo; - String clinic; - String companyName; - dynamic days; - String doctorName; + String? address; + dynamic? appodynamicmentNo; + String? clinic; + String? companyName; + dynamic? days; + String? doctorName; var doseDailyQuantity; - String frequency; - dynamic frequencyNumber; - String image; - String imageExtension; - String imageSRCUrl; - String imageString; - String imageThumbUrl; - String isCovered; - String itemDescription; - dynamic itemID; - String orderDate; - dynamic patientID; - String patientName; - String phoneOffice1; - String prescriptionQR; - dynamic prescriptionTimes; - String productImage; - String productImageBase64; - String productImageString; - dynamic projectID; - String projectName; - String remarks; - String route; - String sKU; - dynamic scaleOffset; - String startDate; + String? frequency; + dynamic? frequencyNumber; + String? image; + String? imageExtension; + String? imageSRCUrl; + String? imageString; + String? imageThumbUrl; + String? isCovered; + String? itemDescription; + dynamic? itemID; + String? orderDate; + dynamic? patientID; + String? patientName; + String? phoneOffice1; + String? prescriptionQR; + dynamic? prescriptionTimes; + String? productImage; + String? productImageBase64; + String? productImageString; + dynamic? projectID; + String? projectName; + String? remarks; + String? route; + String? sKU; + dynamic? scaleOffset; + String? startDate; - String patientAge; - String patientGender; - String phoneOffice; - dynamic doseTimingID; - dynamic frequencyID; - dynamic routeID; - String name; - String itemDescriptionN; - String routeN; - String frequencyN; + String? patientAge; + String? patientGender; + String? phoneOffice; + dynamic? doseTimingID; + dynamic? frequencyID; + dynamic? routeID; + String? name; + String? itemDescriptionN; + String? routeN; + String? frequencyN; PrescriptionReport({ this.address, diff --git a/lib/core/model/Prescriptions/prescription_report_enh.dart b/lib/core/model/Prescriptions/prescription_report_enh.dart index 01b9a5c9..96f811de 100644 --- a/lib/core/model/Prescriptions/prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/prescription_report_enh.dart @@ -1,37 +1,38 @@ class PrescriptionReportEnh { - String address; + String ? address; dynamic appodynamicmentNo; - String clinic; + int ? appointmentNo; + String ? clinic; dynamic companyName; - dynamic days; - String doctorName; - dynamic doseDailyQuantity; - String frequency; - dynamic frequencyNumber; + int ? days; + String ? doctorName; + int ? doseDailyQuantity; + String ? frequency; + int ? frequencyNumber; dynamic image; dynamic imageExtension; - String imageSRCUrl; - dynamic imageString; - String imageThumbUrl; - String isCovered; - String itemDescription; - dynamic itemID; - String orderDate; - dynamic patientID; - String patientName; - String phoneOffice1; + String ? imageSRCUrl; + dynamic imageString ; + String ? imageThumbUrl; + String ? isCovered; + String ? itemDescription; + dynamic ? itemID; + String ? orderDate; + dynamic ? patientID; + String ? patientName; + String ? phoneOffice1; dynamic prescriptionQR; - dynamic prescriptionTimes; + dynamic ? prescriptionTimes; dynamic productImage; dynamic productImageBase64; - String productImageString; - dynamic projectID; - String projectName; - String remarks; - String route; - String sKU; - dynamic scaleOffset; - String startDate; + String ? productImageString; + dynamic ? projectID; + String ? projectName; + String ? remarks; + String ? route; + String ? sKU; + dynamic ? scaleOffset; + String ? startDate; PrescriptionReportEnh( {this.address, diff --git a/lib/core/model/Prescriptions/prescription_req_model.dart b/lib/core/model/Prescriptions/prescription_req_model.dart index a45878d8..1177431d 100644 --- a/lib/core/model/Prescriptions/prescription_req_model.dart +++ b/lib/core/model/Prescriptions/prescription_req_model.dart @@ -1,5 +1,5 @@ class PrescriptionReqModel { - String vidaAuthTokenID; + String ?vidaAuthTokenID; dynamic patientMRN; dynamic appNo; dynamic admissionNo; diff --git a/lib/core/model/Prescriptions/prescriptions_order.dart b/lib/core/model/Prescriptions/prescriptions_order.dart index f51420ec..0f69ffe5 100644 --- a/lib/core/model/Prescriptions/prescriptions_order.dart +++ b/lib/core/model/Prescriptions/prescriptions_order.dart @@ -1,32 +1,32 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionsOrder { - int iD; + int? iD; dynamic patientID; - bool patientOutSA; - bool isOutPatient; - int projectID; - int nearestProjectID; - double longitude; - double latitude; + bool? patientOutSA; + bool? isOutPatient; + int? projectID; + int? nearestProjectID; + double? longitude; + double? latitude; dynamic appointmentNo; dynamic dischargeID; - int lineItemNo; - int status; + int? lineItemNo; + int? status; dynamic description; dynamic descriptionN; - DateTime createdOn; - int serviceID; - int createdBy; - DateTime editedOn; - int editedBy; - int channel; + DateTime? createdOn; + int? serviceID; + int? createdBy; + DateTime? editedOn; + int? editedBy; + int? channel; dynamic clientRequestID; - bool returnedToQueue; + bool? returnedToQueue; dynamic pickupDateTime; dynamic pickupLocationName; dynamic dropoffLocationName; - int realRRTHaveTransactions; + int? realRRTHaveTransactions; dynamic nearestProjectDescription; dynamic nearestProjectDescriptionN; dynamic projectDescription; diff --git a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart index 739bb838..7b453b9b 100644 --- a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart +++ b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart @@ -1,32 +1,32 @@ class RequestGetListPharmacyForPrescriptions { - int latitude; - int longitude; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int itemID; + int? latitude; + int? longitude; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? itemID; RequestGetListPharmacyForPrescriptions( {this.latitude, - this.longitude, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.itemID}); + this.longitude, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.itemID}); - RequestGetListPharmacyForPrescriptions.fromJson(Map json) { + RequestGetListPharmacyForPrescriptions.fromJson(Map json) { latitude = json['Latitude']; longitude = json['Longitude']; versionID = json['VersionID']; diff --git a/lib/core/model/Prescriptions/request_prescription_report.dart b/lib/core/model/Prescriptions/request_prescription_report.dart index c8323740..91e49e3c 100644 --- a/lib/core/model/Prescriptions/request_prescription_report.dart +++ b/lib/core/model/Prescriptions/request_prescription_report.dart @@ -1,23 +1,23 @@ class RequestPrescriptionReport { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int appointmentNo; - String setupID; - int episodeID; - int clinicID; - int projectID; - int dischargeNo; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + int? appointmentNo; + String? setupID; + int? episodeID; + int? clinicID; + int? projectID; + int? dischargeNo; RequestPrescriptionReport( {this.versionID, @@ -40,7 +40,7 @@ class RequestPrescriptionReport { this.projectID, this.dischargeNo}); - RequestPrescriptionReport.fromJson(Map json) { + RequestPrescriptionReport.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; diff --git a/lib/core/model/Prescriptions/request_prescription_report_enh.dart b/lib/core/model/Prescriptions/request_prescription_report_enh.dart index 4905fc2a..07297648 100644 --- a/lib/core/model/Prescriptions/request_prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/request_prescription_report_enh.dart @@ -1,23 +1,23 @@ class RequestPrescriptionReportEnh { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int appointmentNo; - String setupID; - int dischargeNo; - int episodeID; - int clinicID; - int projectID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + int? appointmentNo; + String? setupID; + int? dischargeNo; + int? episodeID; + int? clinicID; + int? projectID; RequestPrescriptionReportEnh( {this.versionID, @@ -37,9 +37,10 @@ class RequestPrescriptionReportEnh { this.setupID, this.episodeID, this.clinicID, - this.projectID,this.dischargeNo}); + this.projectID, + this.dischargeNo}); - RequestPrescriptionReportEnh.fromJson(Map json) { + RequestPrescriptionReportEnh.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; diff --git a/lib/core/model/admissionRequest/admission-request.dart b/lib/core/model/admissionRequest/admission-request.dart index 1ab5a990..94fe46cc 100644 --- a/lib/core/model/admissionRequest/admission-request.dart +++ b/lib/core/model/admissionRequest/admission-request.dart @@ -1,45 +1,45 @@ class AdmissionRequest { - int patientMRN; - int admitToClinic; - bool isPregnant; - int pregnancyWeeks; - int pregnancyType; - int noOfBabies; - int mrpDoctorID; - String admissionDate; - int expectedDays; - int admissionType; - int admissionLocationID; - int roomCategoryID; - int wardID; - bool isSickLeaveRequired; - String sickLeaveComments; - bool isTransport; - String transportComments; - bool isPhysioAppointmentNeeded; - String physioAppointmentComments; - bool isOPDFollowupAppointmentNeeded; - String opdFollowUpComments; - bool isDietType; - int dietType; - String dietRemarks; - bool isPhysicalActivityModification; - String physicalActivityModificationComments; - int orStatus; - String mainLineOfTreatment; - int estimatedCost; - String elementsForImprovement; - bool isPackagePatient; - String complications; - String otherDepartmentInterventions; - String otherProcedures; - String pastMedicalHistory; - String pastSurgicalHistory; - List admissionRequestDiagnoses; - List admissionRequestProcedures; - int appointmentNo; - int episodeID; - int admissionRequestNo; + late int? patientMRN; + late int? admitToClinic; + late bool? isPregnant; + late int pregnancyWeeks; + late int pregnancyType; + late int noOfBabies; + late int? mrpDoctorID; + late String? admissionDate; + late int? expectedDays; + late int? admissionType; + late int admissionLocationID; + late int roomCategoryID; + late int? wardID; + late bool? isSickLeaveRequired; + late String sickLeaveComments; + late bool isTransport; + late String transportComments; + late bool isPhysioAppointmentNeeded; + late String physioAppointmentComments; + late bool isOPDFollowupAppointmentNeeded; + late String opdFollowUpComments; + late bool? isDietType; + late int? dietType; + late String? dietRemarks; + late bool isPhysicalActivityModification; + late String physicalActivityModificationComments; + late int orStatus; + late String? mainLineOfTreatment; + late int? estimatedCost; + late String? elementsForImprovement; + late bool isPackagePatient; + late String complications; + late String otherDepartmentInterventions; + late String otherProcedures; + late String pastMedicalHistory; + late String pastSurgicalHistory; + late List? admissionRequestDiagnoses; + late List? admissionRequestProcedures; + late int? appointmentNo; + late int? episodeID; + late int? admissionRequestNo; AdmissionRequest( {this.patientMRN, @@ -110,8 +110,7 @@ class AdmissionRequest { dietType = json['dietType']; dietRemarks = json['dietRemarks']; isPhysicalActivityModification = json['isPhysicalActivityModification']; - physicalActivityModificationComments = - json['physicalActivityModificationComments']; + physicalActivityModificationComments = json['physicalActivityModificationComments']; orStatus = json['orStatus']; mainLineOfTreatment = json['mainLineOfTreatment']; estimatedCost = json['estimatedCost']; @@ -123,17 +122,17 @@ class AdmissionRequest { pastMedicalHistory = json['pastMedicalHistory']; pastSurgicalHistory = json['pastSurgicalHistory']; if (json['admissionRequestDiagnoses'] != null) { - admissionRequestDiagnoses = new List(); + admissionRequestDiagnoses = []; json['admissionRequestDiagnoses'].forEach((v) { - admissionRequestDiagnoses.add(v); + admissionRequestDiagnoses!.add(v); // admissionRequestDiagnoses // .add(new AdmissionRequestDiagnoses.fromJson(v)); }); } if (json['admissionRequestProcedures'] != null) { - admissionRequestProcedures = new List(); + admissionRequestProcedures = []; json['admissionRequestProcedures'].forEach((v) { - admissionRequestProcedures.add(v); + admissionRequestProcedures!.add(v); // admissionRequestProcedures // .add(new AdmissionRequestProcedures.fromJson(v)); }); @@ -164,16 +163,13 @@ class AdmissionRequest { data['transportComments'] = this.transportComments; data['isPhysioAppointmentNeeded'] = this.isPhysioAppointmentNeeded; data['physioAppointmentComments'] = this.physioAppointmentComments; - data['isOPDFollowupAppointmentNeeded'] = - this.isOPDFollowupAppointmentNeeded; + data['isOPDFollowupAppointmentNeeded'] = this.isOPDFollowupAppointmentNeeded; data['opdFollowUpComments'] = this.opdFollowUpComments; data['isDietType'] = this.isDietType; data['dietType'] = this.dietType; data['dietRemarks'] = this.dietRemarks; - data['isPhysicalActivityModification'] = - this.isPhysicalActivityModification; - data['physicalActivityModificationComments'] = - this.physicalActivityModificationComments; + data['isPhysicalActivityModification'] = this.isPhysicalActivityModification; + data['physicalActivityModificationComments'] = this.physicalActivityModificationComments; data['orStatus'] = this.orStatus; data['mainLineOfTreatment'] = this.mainLineOfTreatment; data['estimatedCost'] = this.estimatedCost; @@ -189,8 +185,7 @@ class AdmissionRequest { // this.admissionRequestDiagnoses.map((v) => v.toJson()).toList(); } if (this.admissionRequestProcedures != null) { - data['admissionRequestProcedures'] = - this.admissionRequestProcedures.map((v) => v.toJson()).toList(); + data['admissionRequestProcedures'] = this.admissionRequestProcedures!.map((v) => v.toJson()).toList(); } data['appointmentNo'] = this.appointmentNo; data['episodeID'] = this.episodeID; diff --git a/lib/core/model/admissionRequest/clinic-model.dart b/lib/core/model/admissionRequest/clinic-model.dart index 05d34645..e5a03264 100644 --- a/lib/core/model/admissionRequest/clinic-model.dart +++ b/lib/core/model/admissionRequest/clinic-model.dart @@ -1,16 +1,16 @@ class Clinic { - int clinicGroupID; - String clinicGroupName; - int clinicID; - String clinicNameArabic; - String clinicNameEnglish; + late int? clinicGroupID; + late String? clinicGroupName; + late int? clinicID; + late String? clinicNameArabic; + late String? clinicNameEnglish; Clinic( {this.clinicGroupID, - this.clinicGroupName, - this.clinicID, - this.clinicNameArabic, - this.clinicNameEnglish}); + this.clinicGroupName, + this.clinicID, + this.clinicNameArabic, + this.clinicNameEnglish}); Clinic.fromJson(Map json) { clinicGroupID = json['clinicGroupID']; @@ -29,5 +29,4 @@ class Clinic { data['clinicNameEnglish'] = this.clinicNameEnglish; return data; } - -} \ No newline at end of file +} diff --git a/lib/core/model/admissionRequest/ward-model.dart b/lib/core/model/admissionRequest/ward-model.dart index 606758d3..8f7b9fe5 100644 --- a/lib/core/model/admissionRequest/ward-model.dart +++ b/lib/core/model/admissionRequest/ward-model.dart @@ -1,9 +1,9 @@ class WardModel{ - String description; - String descriptionN; - int floorID; - bool isActive; + late String ? description; + late String ? descriptionN; + late int ? floorID; + late bool ? isActive; WardModel( {this.description, this.descriptionN, this.floorID, this.isActive}); diff --git a/lib/core/model/auth/activation_Code_req_model.dart b/lib/core/model/auth/activation_Code_req_model.dart index 85d7f1d3..13d64f6a 100644 --- a/lib/core/model/auth/activation_Code_req_model.dart +++ b/lib/core/model/auth/activation_Code_req_model.dart @@ -1,12 +1,12 @@ class ActivationCodeModel { - int channel; - int languageID; - int loginDoctorID; - double versionID; - int memberID; - int facilityId; - String generalid; - String otpSendType; + late int? channel; + late int? loginDoctorID; + late int? languageID; + late double? versionID; + late int? memberID; + late int? facilityId; + late String? generalid; + late String? otpSendType; ActivationCodeModel( {this.channel, diff --git a/lib/core/model/auth/activation_code_for_verification_screen_model.dart b/lib/core/model/auth/activation_code_for_verification_screen_model.dart index dae31f8c..51fb5ab3 100644 --- a/lib/core/model/auth/activation_code_for_verification_screen_model.dart +++ b/lib/core/model/auth/activation_code_for_verification_screen_model.dart @@ -1,18 +1,19 @@ class ActivationCodeForVerificationScreenModel { - int oTPSendType; - String mobileNumber; - String zipCode; - int channel; - int loginDoctorID; - int languageID; - double versionID; - int memberID; - int facilityId; - String generalid; - int isMobileFingerPrint; - String vidaAuthTokenID; - String vidaRefreshTokenID; - String iMEI; + late int? oTPSendType; + late String? mobileNumber; + late String? zipCode; + late int? channel; + late int? loginDoctorID; + late int? languageID; + late double? versionID; + late int? memberID; + late int? facilityId; + late String? generalid; + late int? isMobileFingerPrint; + late String? vidaAuthTokenID; + late String? vidaRefreshTokenID; + late String? iMEI; + ActivationCodeForVerificationScreenModel( {this.oTPSendType, this.mobileNumber, diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index e39518e6..3fa2f69b 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; class CheckActivationCodeForDoctorAppResponseModel { - String authenticationTokenID; - List listDoctorsClinic; - List listDoctorProfile; - MemberInformation memberInformation; - String vidaAuthTokenID; - String vidaRefreshTokenID; + late String? authenticationTokenID; + late List? listDoctorsClinic; + List? listDoctorProfile; + late MemberInformation? memberInformation; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; CheckActivationCodeForDoctorAppResponseModel( {this.authenticationTokenID, @@ -20,16 +20,16 @@ class CheckActivationCodeForDoctorAppResponseModel { Map json) { authenticationTokenID = json['AuthenticationTokenID']; if (json['List_DoctorsClinic'] != null) { - listDoctorsClinic = new List(); + listDoctorsClinic = []; json['List_DoctorsClinic'].forEach((v) { - listDoctorsClinic.add(new ListDoctorsClinic.fromJson(v)); + listDoctorsClinic!.add(new ListDoctorsClinic.fromJson(v)); }); } if (json['List_DoctorProfile'] != null) { - listDoctorProfile = new List(); + listDoctorProfile = []; json['List_DoctorProfile'].forEach((v) { - listDoctorProfile.add(new DoctorProfileModel.fromJson(v)); + listDoctorProfile!.add(new DoctorProfileModel.fromJson(v)); }); } vidaAuthTokenID = json['VidaAuthTokenID']; @@ -45,27 +45,27 @@ class CheckActivationCodeForDoctorAppResponseModel { data['AuthenticationTokenID'] = this.authenticationTokenID; if (this.listDoctorsClinic != null) { data['List_DoctorsClinic'] = - this.listDoctorsClinic.map((v) => v.toJson()).toList(); + this.listDoctorsClinic!.map((v) => v.toJson()).toList(); } if (this.listDoctorProfile != null) { data['List_DoctorProfile'] = - this.listDoctorProfile.map((v) => v.toJson()).toList(); + this.listDoctorProfile!.map((v) => v.toJson()).toList(); } if (this.memberInformation != null) { - data['memberInformation'] = this.memberInformation.toJson(); + data['memberInformation'] = this.memberInformation!.toJson(); } return data; } } class ListDoctorsClinic { - Null setupID; - int projectID; - int doctorID; - int clinicID; - bool isActive; - String clinicName; + late dynamic setupID; + late int? projectID; + late int? doctorID; + late int? clinicID; + late bool? isActive; + late String? clinicName; ListDoctorsClinic( {this.setupID, @@ -97,15 +97,15 @@ class ListDoctorsClinic { } class MemberInformation { - List clinics; - int doctorId; - String email; - int employeeId; - int memberId; - Null memberName; - Null memberNameArabic; - String preferredLanguage; - List roles; + late List? clinics; + late int? doctorId; + late String? email; + late int? employeeId; + late int? memberId; + late dynamic memberName; + late dynamic memberNameArabic; + late String? preferredLanguage; + late List? roles; MemberInformation( {this.clinics, @@ -120,9 +120,9 @@ class MemberInformation { MemberInformation.fromJson(Map json) { if (json['clinics'] != null) { - clinics = new List(); + clinics = []; json['clinics'].forEach((v) { - clinics.add(new Clinics.fromJson(v)); + clinics!.add(new Clinics.fromJson(v)); }); } doctorId = json['doctorId']; @@ -133,9 +133,9 @@ class MemberInformation { memberNameArabic = json['memberNameArabic']; preferredLanguage = json['preferredLanguage']; if (json['roles'] != null) { - roles = new List(); + roles = []; json['roles'].forEach((v) { - roles.add(new Roles.fromJson(v)); + roles!.add(new Roles.fromJson(v)); }); } } @@ -143,7 +143,7 @@ class MemberInformation { Map toJson() { final Map data = new Map(); if (this.clinics != null) { - data['clinics'] = this.clinics.map((v) => v.toJson()).toList(); + data['clinics'] = this.clinics!.map((v) => v.toJson()).toList(); } data['doctorId'] = this.doctorId; data['email'] = this.email; @@ -153,16 +153,16 @@ class MemberInformation { data['memberNameArabic'] = this.memberNameArabic; data['preferredLanguage'] = this.preferredLanguage; if (this.roles != null) { - data['roles'] = this.roles.map((v) => v.toJson()).toList(); + data['roles'] = this.roles!.map((v) => v.toJson()).toList(); } return data; } } class Clinics { - bool defaultClinic; - int id; - String name; + late bool? defaultClinic; + late int? id; + late String? name; Clinics({this.defaultClinic, this.id, this.name}); @@ -182,8 +182,8 @@ class Clinics { } class Roles { - String name; - int roleId; + late String? name; + late int? roleId; Roles({this.name, this.roleId}); diff --git a/lib/core/model/auth/check_activation_code_request_model.dart b/lib/core/model/auth/check_activation_code_request_model.dart index 94502a71..fee596fe 100644 --- a/lib/core/model/auth/check_activation_code_request_model.dart +++ b/lib/core/model/auth/check_activation_code_request_model.dart @@ -1,24 +1,24 @@ class CheckActivationCodeRequestModel { - String mobileNumber; - String zipCode; - int doctorID; - int memberID; - int loginDoctorID; - String password; - String facilityId; - String iPAdress; - int channel; - int languageID; - int projectID; - double versionID; - String generalid; - String logInTokenID; - String activationCode; - String vidaAuthTokenID; - String vidaRefreshTokenID; - String iMEI; - bool isForSilentLogin; - int oTPSendType; + String? mobileNumber; + String? zipCode; + int? doctorID; + int? memberID; + int? loginDoctorID; + String? password; + String? facilityId; + String? iPAdress; + int? channel; + int? languageID; + int? projectID; + double? versionID; + String? generalid; + String? logInTokenID; + String? activationCode; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; + String? iMEI; + bool? isForSilentLogin; + int? oTPSendType; CheckActivationCodeRequestModel( {this.mobileNumber, this.zipCode, diff --git a/lib/core/model/auth/imei_details.dart b/lib/core/model/auth/imei_details.dart index eb37e736..95ff1e74 100644 --- a/lib/core/model/auth/imei_details.dart +++ b/lib/core/model/auth/imei_details.dart @@ -1,33 +1,34 @@ class GetIMEIDetailsModel { - int iD; - String iMEI; - int logInTypeID; - bool outSA; - String mobile; - dynamic identificationNo; - int doctorID; - String doctorName; - String doctorNameN; - int clinicID; - String clinicDescription; - dynamic clinicDescriptionN; - int projectID; - String projectName; - String genderDescription; - dynamic genderDescriptionN; - String titleDescription; - dynamic titleDescriptionN; - dynamic zipCode; - String createdOn; - dynamic createdBy; - String editedOn; - dynamic editedBy; - bool biometricEnabled; - dynamic preferredLanguage; - bool isActive; - String vidaAuthTokenID; - String vidaRefreshTokenID; - String password; + late int? iD; + late String? iMEI; + late int? logInTypeID; + late bool? outSA; + late String? mobile; + late dynamic identificationNo; + late int? doctorID; + late String? doctorName; + late String? doctorNameN; + late int? clinicID; + late String? clinicDescription; + late dynamic clinicDescriptionN; + late int? projectID; + late String? projectName; + late String? genderDescription; + late dynamic genderDescriptionN; + late String? titleDescription; + late dynamic titleDescriptionN; + late dynamic zipCode; + late String? createdOn; + late dynamic createdBy; + late String? editedOn; + late dynamic editedBy; + late bool? biometricEnabled; + late dynamic preferredLanguage; + late bool? isActive; + late String? vidaAuthTokenID; + late String? vidaRefreshTokenID; + late String? password; + GetIMEIDetailsModel( {this.iD, this.iMEI, diff --git a/lib/core/model/auth/insert_imei_model.dart b/lib/core/model/auth/insert_imei_model.dart index 25e22b7a..5e54b127 100644 --- a/lib/core/model/auth/insert_imei_model.dart +++ b/lib/core/model/auth/insert_imei_model.dart @@ -1,37 +1,37 @@ class InsertIMEIDetailsModel { - String iMEI; - int logInTypeID; - dynamic outSA; - String mobile; - dynamic identificationNo; - int doctorID; - String doctorName; - String doctorNameN; - int clinicID; - String clinicDescription; - Null clinicDescriptionN; - String projectName; - String genderDescription; - Null genderDescriptionN; - String titleDescription; - Null titleDescriptionN; - bool bioMetricEnabled; - Null preferredLanguage; - bool isActive; - int editedBy; - int projectID; - String tokenID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String sessionID; - bool isLoginForDoctorApp; - int patientOutSA; - String vidaAuthTokenID; - String vidaRefreshTokenID; - dynamic password; + late String? iMEI; + late int ?logInTypeID; + late dynamic outSA; + late String? mobile; + late dynamic identificationNo; + late int ?doctorID; + late String? doctorName; + late String ?doctorNameN; + late int ?clinicID; + late String ?clinicDescription; + late dynamic clinicDescriptionN; + late String ?projectName; + late String ?genderDescription; + late dynamic genderDescriptionN; + late String ?titleDescription; + late dynamic titleDescriptionN; + late bool ?bioMetricEnabled; + late dynamic preferredLanguage; + late bool ?isActive; + late int ?editedBy; + late int ?projectID; + late String ?tokenID; + late int ?languageID; + late String ?stamp; + late String ?iPAdress; + late double ?versionID; + late int ?channel; + late String ?sessionID; + late bool ?isLoginForDoctorApp; + late int ?patientOutSA; + late String ?vidaAuthTokenID; + late String ?vidaRefreshTokenID; + late dynamic password; InsertIMEIDetailsModel( {this.iMEI, this.logInTypeID, diff --git a/lib/core/model/auth/new_login_information_response_model.dart b/lib/core/model/auth/new_login_information_response_model.dart index 117060e4..c834580b 100644 --- a/lib/core/model/auth/new_login_information_response_model.dart +++ b/lib/core/model/auth/new_login_information_response_model.dart @@ -1,13 +1,13 @@ class NewLoginInformationModel { - int doctorID; - List listMemberInformation; - String logInTokenID; - String mobileNumber; - Null sELECTDeviceIMEIbyIMEIList; - int userID; - String zipCode; - bool isActiveCode; - bool isSMSSent; + late int? doctorID; + late List? listMemberInformation; + late String ?logInTokenID; + late String ?mobileNumber; + late dynamic sELECTDeviceIMEIbyIMEIList; + late int ?userID; + late String ?zipCode; + late bool ?isActiveCode; + late bool ?isSMSSent; NewLoginInformationModel( {this.doctorID, @@ -23,9 +23,9 @@ class NewLoginInformationModel { NewLoginInformationModel.fromJson(Map json) { doctorID = json['DoctorID']; if (json['List_MemberInformation'] != null) { - listMemberInformation = new List(); + listMemberInformation = []; json['List_MemberInformation'].forEach((v) { - listMemberInformation.add(new ListMemberInformation.fromJson(v)); + listMemberInformation!.add(new ListMemberInformation.fromJson(v)); }); } logInTokenID = json['LogInTokenID']; @@ -42,7 +42,7 @@ class NewLoginInformationModel { data['DoctorID'] = this.doctorID; if (this.listMemberInformation != null) { data['List_MemberInformation'] = - this.listMemberInformation.map((v) => v.toJson()).toList(); + this.listMemberInformation!.map((v) => v.toJson()).toList(); } data['LogInTokenID'] = this.logInTokenID; data['MobileNumber'] = this.mobileNumber; @@ -56,17 +56,17 @@ class NewLoginInformationModel { } class ListMemberInformation { - Null setupID; - int memberID; - String memberName; - Null memberNameN; - String preferredLang; - String pIN; - String saltHash; - int referenceID; - int employeeID; - int roleID; - int projectid; + late dynamic setupID; + late int ? memberID; + late String ? memberName; + late dynamic memberNameN; + late String ? preferredLang; + late String ? pIN; + late String ? saltHash; + late int ? referenceID; + late int ? employeeID; + late int ? roleID; + late int ? projectid; ListMemberInformation( {this.setupID, diff --git a/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart index ceaf4c65..db971954 100644 --- a/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart @@ -1,8 +1,8 @@ class SendActivationCodeForDoctorAppResponseModel { - String logInTokenID; - String verificationCode; - String vidaAuthTokenID; - String vidaRefreshTokenID; + String? logInTokenID; + String? verificationCode; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; SendActivationCodeForDoctorAppResponseModel( {this.logInTokenID, diff --git a/lib/core/model/calculate_box_request_model.dart b/lib/core/model/calculate_box_request_model.dart index 80281854..24e75bb7 100644 --- a/lib/core/model/calculate_box_request_model.dart +++ b/lib/core/model/calculate_box_request_model.dart @@ -1,9 +1,9 @@ class CalculateBoxQuantityRequestModel { - int itemCode; - double strength; - int frequency; - int duration; - String vidaAuthTokenID; + int? itemCode; + double? strength; + int? frequency; + int? duration; + String? vidaAuthTokenID; CalculateBoxQuantityRequestModel( {this.itemCode, diff --git a/lib/core/model/diabetic_chart/DiabeticType.dart b/lib/core/model/diabetic_chart/DiabeticType.dart index 26641e61..8a9cfbe1 100644 --- a/lib/core/model/diabetic_chart/DiabeticType.dart +++ b/lib/core/model/diabetic_chart/DiabeticType.dart @@ -1,7 +1,7 @@ class DiabeticType { - int value; - String nameEn; - String nameAr; + int? value; + String? nameEn; + String? nameAr; DiabeticType({this.value, this.nameEn, this.nameAr}); diff --git a/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart b/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart index 7fad3106..34a8e997 100644 --- a/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart @@ -1,22 +1,22 @@ class GetDiabeticChartValuesRequestModel { - int deviceTypeID; - int patientID; - int resultType; - int admissionNo; - String setupID; - bool patientOutSA; - int patientType; - int patientTypeID; + int? deviceTypeID; + int? patientID; + int? resultType; + int? admissionNo; + String? setupID; + bool? patientOutSA; + int? patientType; + int? patientTypeID; GetDiabeticChartValuesRequestModel( {this.deviceTypeID, - this.patientID, - this.resultType, - this.admissionNo, - this.setupID, - this.patientOutSA, - this.patientType, - this.patientTypeID}); + this.patientID, + this.resultType, + this.admissionNo, + this.setupID, + this.patientOutSA, + this.patientType, + this.patientTypeID}); GetDiabeticChartValuesRequestModel.fromJson(Map json) { deviceTypeID = json['DeviceTypeID']; diff --git a/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart index fa2c1ca2..82c10f5e 100644 --- a/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart @@ -1,10 +1,10 @@ class GetDiabeticChartValuesResponseModel { - String resultType; - int admissionNo; - String dateChart; - int resultValue; - int createdBy; - String createdOn; + String? resultType; + int? admissionNo; + String? dateChart; + int? resultValue; + int? createdBy; + String? createdOn; GetDiabeticChartValuesResponseModel( {this.resultType, diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart index 310cfb50..c164d634 100644 --- a/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart @@ -1,9 +1,9 @@ class GetDiagnosisForInPatientRequestModel { - int patientID; - int admissionNo; - String setupID; - int patientType; - int patientTypeID; + int? patientID; + int? admissionNo; + String? setupID; + int? patientType; + int? patientTypeID; GetDiagnosisForInPatientRequestModel( {this.patientID, diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart index 1ec48964..1996fd6a 100644 --- a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart @@ -1,15 +1,15 @@ class GetDiagnosisForInPatientResponseModel { - String iCDCode10ID; - int diagnosisTypeID; - int conditionID; - bool complexDiagnosis; - String asciiDesc; - int createdBy; - String createdOn; - int editedBy; - String editedOn; - String createdByName; - String editedByName; + String? iCDCode10ID; + int? diagnosisTypeID; + int? conditionID; + bool? complexDiagnosis; + String? asciiDesc; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; + String? createdByName; + String? editedByName; GetDiagnosisForInPatientResponseModel( {this.iCDCode10ID, diff --git a/lib/core/model/hospitals/get_hospitals_request_model.dart b/lib/core/model/hospitals/get_hospitals_request_model.dart index 8a5f1bc1..550f8ca8 100644 --- a/lib/core/model/hospitals/get_hospitals_request_model.dart +++ b/lib/core/model/hospitals/get_hospitals_request_model.dart @@ -1,13 +1,13 @@ class GetHospitalsRequestModel { - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - String memberID; + int ?languageID; + String? stamp; + String? iPAdress; + double? versionID; + int ?channel; + String? tokenID; + String? sessionID; + bool ?isLoginForDoctorApp; + String ?memberID; GetHospitalsRequestModel( {this.languageID, diff --git a/lib/core/model/hospitals/get_hospitals_response_model.dart b/lib/core/model/hospitals/get_hospitals_response_model.dart index edbc3fe5..1109b58b 100644 --- a/lib/core/model/hospitals/get_hospitals_response_model.dart +++ b/lib/core/model/hospitals/get_hospitals_response_model.dart @@ -1,7 +1,7 @@ class GetHospitalsResponseModel { - String facilityGroupId; - int facilityId; - String facilityName; + String? facilityGroupId; + int ?facilityId; + String ?facilityName; GetHospitalsResponseModel( {this.facilityGroupId, this.facilityId, this.facilityName}); diff --git a/lib/core/model/hospitals_model.dart b/lib/core/model/hospitals_model.dart index b09807d6..d896b939 100644 --- a/lib/core/model/hospitals_model.dart +++ b/lib/core/model/hospitals_model.dart @@ -1,20 +1,20 @@ class HospitalsModel { - String desciption; + String? desciption; dynamic desciptionN; - int iD; - String legalName; - String legalNameN; - String name; + int? iD; + String? legalName; + String? legalNameN; + String? name; dynamic nameN; - String phoneNumber; - String setupID; - int distanceInKilometers; - bool isActive; - String latitude; - String longitude; - int mainProjectID; + String? phoneNumber; + String? setupID; + int? distanceInKilometers; + bool ?isActive; + String? latitude; + String? longitude; + int? mainProjectID; dynamic projectOutSA; - bool usingInDoctorApp; + bool ?usingInDoctorApp; HospitalsModel({this.desciption, this.desciptionN, diff --git a/lib/core/model/insurance/insurance_approval.dart b/lib/core/model/insurance/insurance_approval.dart index a3717c42..69e88a2e 100644 --- a/lib/core/model/insurance/insurance_approval.dart +++ b/lib/core/model/insurance/insurance_approval.dart @@ -1,11 +1,11 @@ class ApporvalDetails { - int approvalNo; + int? approvalNo; - String procedureName; + String? procedureName; //String procedureNameN; - String status; + String ?status; - String isInvoicedDesc; + String ?isInvoicedDesc; ApporvalDetails( {this.approvalNo, this.procedureName, this.status, this.isInvoicedDesc}); @@ -35,35 +35,35 @@ class ApporvalDetails { } class InsuranceApprovalModel { - List apporvalDetails; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int eXuldAPPNO; - int projectID; - String doctorName; - String clinicName; - String patientDescription; - int approvalNo; - String approvalStatusDescption; - int unUsedCount; - String doctorImage; - String projectName; + List ?apporvalDetails; + double ?versionID; + int ? channel; + int ? languageID; + String ? iPAdress; + String ? generalid; + int ? patientOutSA; + String ? sessionID; + bool ? isDentalAllowedBackend; + int ? deviceTypeID; + int ? patientID; + String ? tokenID; + int ? patientTypeID; + int ? patientType; + int ? eXuldAPPNO; + int ? projectID; + String ? doctorName; + String ? clinicName; + String ? patientDescription; + int ? approvalNo; + String ?approvalStatusDescption; + int ? unUsedCount; + String ? doctorImage; + String ? projectName; //String companyName; - String expiryDate; - String rceiptOn; - int appointmentNo; + String ? expiryDate; + String ? rceiptOn; + int ?appointmentNo; InsuranceApprovalModel( {this.versionID, @@ -126,9 +126,9 @@ class InsuranceApprovalModel { doctorImage = json['DoctorImageURL']; clinicName = json['ClinicName']; if (json['ApporvalDetails'] != null) { - apporvalDetails = new List(); + apporvalDetails =[]; json['ApporvalDetails'].forEach((v) { - apporvalDetails.add(new ApporvalDetails.fromJson(v)); + apporvalDetails!.add(new ApporvalDetails.fromJson(v)); }); } appointmentNo = json['AppointmentNo']; diff --git a/lib/core/model/insurance/insurance_approval_in_patient_model.dart b/lib/core/model/insurance/insurance_approval_in_patient_model.dart index f185a8bf..722d34c7 100644 --- a/lib/core/model/insurance/insurance_approval_in_patient_model.dart +++ b/lib/core/model/insurance/insurance_approval_in_patient_model.dart @@ -1,36 +1,36 @@ class InsuranceApprovalInPatientModel { - String setupID; - int projectID; - int approvalNo; - int status; - String approvalDate; - int patientType; - int patientID; - int companyID; - bool subCategoryID; - int doctorID; - int clinicID; - int approvalType; - int inpatientApprovalSubType; + String? setupID; + int? projectID; + int? approvalNo; + int? status; + String? approvalDate; + int? patientType; + int? patientID; + int? companyID; + bool? subCategoryID; + int? doctorID; + int? clinicID; + int? approvalType; + int? inpatientApprovalSubType; dynamic isApprovalOnGross; - String companyApprovalNo; + String? companyApprovalNo; dynamic progNoteOrderNo; - String submitOn; - String receiptOn; - String expiryDate; - int admissionNo; - int admissionRequestNo; - String approvalStatusDescption; + String? submitOn; + String? receiptOn; + String? expiryDate; + int? admissionNo; + int? admissionRequestNo; + String? approvalStatusDescption; dynamic approvalStatusDescptionN; dynamic remarks; - List apporvalDetails; - String clinicName; + List? apporvalDetails; + String? clinicName; dynamic companyName; - String doctorName; - String projectName; - int totaUnUsedCount; - int unUsedCount; - String doctorImage; + String? doctorName; + String? projectName; + int? totaUnUsedCount; + int? unUsedCount; + String? doctorImage; InsuranceApprovalInPatientModel( {this.setupID, @@ -93,9 +93,9 @@ class InsuranceApprovalInPatientModel { approvalStatusDescptionN = json['ApprovalStatusDescptionN']; remarks = json['Remarks']; if (json['ApporvalDetails'] != null) { - apporvalDetails = new List(); + apporvalDetails = []; json['ApporvalDetails'].forEach((v) { - apporvalDetails.add(new ApporvalDetails.fromJson(v)); + apporvalDetails!.add(new ApporvalDetails.fromJson(v)); }); } clinicName = json['ClinicName']; @@ -135,7 +135,7 @@ class InsuranceApprovalInPatientModel { data['Remarks'] = this.remarks; if (this.apporvalDetails != null) { data['ApporvalDetails'] = - this.apporvalDetails.map((v) => v.toJson()).toList(); + this.apporvalDetails!.map((v) => v.toJson()).toList(); } data['ClinicName'] = this.clinicName; data['CompanyName'] = this.companyName; @@ -148,35 +148,35 @@ class InsuranceApprovalInPatientModel { } class ApporvalDetails { - Null setupID; - Null projectID; - int approvalNo; - Null lineItemNo; - Null orderType; - Null procedureID; - Null toothNo; - Null price; - Null approvedAmount; - Null unapprovedPatientShare; - Null waivedAmount; - Null discountType; - Null discountValue; - Null shareType; - Null patientShareTypeValue; - Null companyShareTypeValue; - Null patientShare; - Null companyShare; - Null deductableAmount; - String disapprovedRemarks; - Null progNoteOrderNo; - Null progNoteLineItemNo; - Null invoiceTransactionType; - Null invoiceNo; - String procedureName; - String procedureNameN; - String status; - Null isInvoiced; - String isInvoicedDesc; + dynamic setupID; + dynamic projectID; + int? approvalNo; + dynamic lineItemNo; + dynamic orderType; + dynamic procedureID; + dynamic toothNo; + dynamic price; + dynamic approvedAmount; + dynamic unapprovedPatientShare; + dynamic waivedAmount; + dynamic discountType; + dynamic discountValue; + dynamic shareType; + dynamic patientShareTypeValue; + dynamic companyShareTypeValue; + dynamic patientShare; + dynamic companyShare; + dynamic deductableAmount; + String? disapprovedRemarks; + dynamic progNoteOrderNo; + dynamic progNoteLineItemNo; + dynamic invoiceTransactionType; + dynamic invoiceNo; + String? procedureName; + String? procedureNameN; + String? status; + dynamic isInvoiced; + String? isInvoicedDesc; ApporvalDetails( {this.setupID, diff --git a/lib/core/model/labs/LabOrderResult.dart b/lib/core/model/labs/LabOrderResult.dart index ecb4ae65..7fc4432f 100644 --- a/lib/core/model/labs/LabOrderResult.dart +++ b/lib/core/model/labs/LabOrderResult.dart @@ -1,23 +1,23 @@ class LabOrderResult { - String description; + String? description; dynamic femaleInterpretativeData; - int gender; - int lineItemNo; + int ?gender; + int? lineItemNo; dynamic maleInterpretativeData; dynamic notes; - String packageID; - int patientID; - String projectID; - String referanceRange; - String resultValue; - String sampleCollectedOn; - String sampleReceivedOn; - String setupID; + String ?packageID; + int ?patientID; + String ? projectID; + String ? referanceRange; + String ? resultValue; + String ? sampleCollectedOn; + String ? sampleReceivedOn; + String ? setupID; dynamic superVerifiedOn; - String testCode; - String uOM; - String verifiedOn; - String verifiedOnDateTime; + String? testCode; + String? uOM; + String? verifiedOn; + String? verifiedOnDateTime; LabOrderResult( {this.description, diff --git a/lib/core/model/labs/LabResultHistory.dart b/lib/core/model/labs/LabResultHistory.dart index 7c4221ca..9c023da7 100644 --- a/lib/core/model/labs/LabResultHistory.dart +++ b/lib/core/model/labs/LabResultHistory.dart @@ -1,28 +1,28 @@ class LabResultHistory { - String description; - String femaleInterpretativeData; - int gender; - bool isCertificateAllowed; - int lineItemNo; - String maleInterpretativeData; - String notes; - int orderLineItemNo; - int orderNo; - String packageID; - int patientID; - String projectID; - String referanceRange; - String resultValue; - int resultValueBasedLineItemNo; - String resultValueFlag; - String sampleCollectedOn; - String sampleReceivedOn; - String setupID; - String superVerifiedOn; - String testCode; - String uOM; - String verifiedOn; - String verifiedOnDateTime; + String? description; + String? femaleInterpretativeData; + int? gender; + bool? isCertificateAllowed; + int? lineItemNo; + String? maleInterpretativeData; + String? notes; + int? orderLineItemNo; + int? orderNo; + String? packageID; + int? patientID; + String? projectID; + String? referanceRange; + String? resultValue; + int? resultValueBasedLineItemNo; + String? resultValueFlag; + String? sampleCollectedOn; + String? sampleReceivedOn; + String? setupID; + String? superVerifiedOn; + String? testCode; + String? uOM; + String? verifiedOn; + String? verifiedOnDateTime; LabResultHistory( {this.description, diff --git a/lib/core/model/labs/all_special_lab_result_model.dart b/lib/core/model/labs/all_special_lab_result_model.dart index ffdc5ee5..a177e16e 100644 --- a/lib/core/model/labs/all_special_lab_result_model.dart +++ b/lib/core/model/labs/all_special_lab_result_model.dart @@ -5,51 +5,51 @@ class AllSpecialLabResultModel { dynamic appointmentDate; dynamic appointmentNo; dynamic appointmentTime; - String clinicDescription; - String clinicDescriptionEnglish; + String? clinicDescription; + String? clinicDescriptionEnglish; dynamic clinicDescriptionN; dynamic clinicID; dynamic createdOn; - double decimalDoctorRate; + double? decimalDoctorRate; dynamic doctorID; - String doctorImageURL; - String doctorName; - String doctorNameEnglish; + String? doctorImageURL; + String? doctorName; + String? doctorNameEnglish; dynamic doctorNameN; dynamic doctorRate; dynamic doctorStarsRate; - String doctorTitle; + String? doctorTitle; dynamic gender; - String genderDescription; - bool inOutPatient; - String invoiceNo; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; + String? genderDescription; + bool? inOutPatient; + String? invoiceNo; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; - bool isLiveCareAppointment; - bool isRead; - bool isSendEmail; - String moduleID; - String nationalityFlagURL; + bool? isLiveCareAppointment; + bool? isRead; + bool? isSendEmail; + String? moduleID; + String? nationalityFlagURL; dynamic noOfPatientsRate; dynamic orderDate; - String orderNo; + String? orderNo; dynamic patientID; - String projectID; - String projectName; + String? projectID; + String? projectName; dynamic projectNameN; - String qR; - String resultData; - String resultDataHTML; + String? qR; + String? resultData; + String? resultDataHTML; dynamic resultDataTxt; - String setupID; + String? setupID; //List speciality; dynamic status; dynamic statusDesc; - String strOrderDate; + String? strOrderDate; AllSpecialLabResultModel( {this.actualDoctorRate, diff --git a/lib/core/model/labs/all_special_lab_result_request.dart b/lib/core/model/labs/all_special_lab_result_request.dart index d5df1405..950f0e96 100644 --- a/lib/core/model/labs/all_special_lab_result_request.dart +++ b/lib/core/model/labs/all_special_lab_result_request.dart @@ -1,18 +1,18 @@ class AllSpecialLabResultRequestModel { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - String tokenID; - int patientTypeID; - int patientType; - int patientID; - int projectID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + String? tokenID; + int? patientTypeID; + int? patientType; + int? patientID; + int? projectID; AllSpecialLabResultRequestModel( {this.versionID, diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index ee9f981d..0cc48aef 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -1,24 +1,24 @@ class LabResult { - String description; + String? description; dynamic femaleInterpretativeData; - int gender; - int lineItemNo; + int? gender; + int? lineItemNo; dynamic maleInterpretativeData; - String notes; - String packageID; - int patientID; - String projectID; - String referanceRange; - String resultValue; - String maxValue; - String minValue; - String sampleCollectedOn; - String sampleReceivedOn; - String setupID; + String? notes; + String? packageID; + int? patientID; + String? projectID; + String? referanceRange; + String? resultValue; + String? sampleCollectedOn; + String? sampleReceivedOn; + String? setupID; + String? maxValue; + String? minValue; dynamic superVerifiedOn; - String testCode; - String uOM; - String verifiedOn; + String? testCode; + String? uOM; + String? verifiedOn; dynamic verifiedOnDateTime; LabResult( @@ -96,9 +96,9 @@ class LabResult { int checkResultStatus() { try { - var max = double.tryParse(maxValue) ?? null; - var min = double.tryParse(minValue) ?? null; - var result = double.tryParse(resultValue) ?? null; + var max = double.tryParse(maxValue!) ?? null; + var min = double.tryParse(minValue!) ?? null; + var result = double.tryParse(resultValue!) ?? null; if (max != null && min != null && result != null) { if (result > max) { return 1; @@ -110,18 +110,17 @@ class LabResult { } else { return 0; } - }catch (e){ + } catch (e) { return 0; } - } } class LabResultList { String filterName = ""; - List patientLabResultList = List(); + List patientLabResultList = []; - LabResultList({this.filterName, LabResult lab}) { + LabResultList({required this.filterName, required LabResult lab}) { patientLabResultList.add(lab); } } diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index af60f86f..08f81f16 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -1,40 +1,40 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatientLabOrders { - int actualDoctorRate; - String clinicDescription; - String clinicDescriptionEnglish; - Null clinicDescriptionN; - int clinicID; - int doctorID; - String doctorImageURL; - String doctorName; - String doctorNameEnglish; - Null doctorNameN; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - String invoiceNo; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isRead; - String nationalityFlagURL; - int noOfPatientsRate; - DateTime orderDate; - String orderNo; - String patientID; - String projectID; - String projectName; - Null projectNameN; - String qR; - String setupID; - List speciality; - bool isLiveCareAppointment; + int ?actualDoctorRate; + String ?clinicDescription; + String ?clinicDescriptionEnglish; + dynamic clinicDescriptionN; + int ?clinicID; + int ?doctorID; + String? doctorImageURL; + String ?doctorName; + String ?doctorNameEnglish; + dynamic doctorNameN; + int ?doctorRate; + String ?doctorTitle; + int ?gender; + String ?genderDescription; + String ?invoiceNo; + bool ?isActiveDoctorProfile; + bool ?isDoctorAllowVedioCall; + bool ?isExecludeDoctor; + bool ?isInOutPatient; + String ?isInOutPatientDescription; + String ?isInOutPatientDescriptionN; + bool ?isRead; + String ?nationalityFlagURL; + int ?noOfPatientsRate; + DateTime? orderDate; + String ?orderNo; + String ?patientID; + String ?projectID; + String ?projectName; + dynamic projectNameN; + String ?qR; + String ?setupID; + List ?speciality; + bool ?isLiveCareAppointment; PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -149,10 +149,10 @@ class PatientLabOrders { class PatientLabOrdersList { String filterName = ""; - List patientLabOrdersList = List(); + List patientLabOrdersList = []; PatientLabOrdersList( - {this.filterName, PatientLabOrders patientDoctorAppointment}) { + {required this.filterName, required PatientLabOrders patientDoctorAppointment}) { patientLabOrdersList.add(patientDoctorAppointment); } } diff --git a/lib/core/model/labs/patient_lab_special_result.dart b/lib/core/model/labs/patient_lab_special_result.dart index 2fbcb832..f86dd56f 100644 --- a/lib/core/model/labs/patient_lab_special_result.dart +++ b/lib/core/model/labs/patient_lab_special_result.dart @@ -1,9 +1,9 @@ class PatientLabSpecialResult { - String invoiceNo; - String moduleID; - String resultData; - String resultDataHTML; - Null resultDataTxt; + String ?invoiceNo; + String ?moduleID; + String ? resultData; + String ? resultDataHTML; + dynamic resultDataTxt; PatientLabSpecialResult( {this.invoiceNo, diff --git a/lib/core/model/labs/request_patient_lab_orders.dart b/lib/core/model/labs/request_patient_lab_orders.dart index ce9263ef..4f746277 100644 --- a/lib/core/model/labs/request_patient_lab_orders.dart +++ b/lib/core/model/labs/request_patient_lab_orders.dart @@ -1,17 +1,17 @@ class RequestPatientLabOrders { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; + double? versionID; + int ?channel; + int ?languageID; + String? iPAdress; + String ?generalid; + int? patientOutSA; + String? sessionID; + bool ?isDentalAllowedBackend; + int ?deviceTypeID; + int ?patientID; + String ?tokenID; + int ?patientTypeID; + int ?patientType; RequestPatientLabOrders( {this.versionID, diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart index b48cf0e1..100f92b5 100644 --- a/lib/core/model/labs/request_patient_lab_special_result.dart +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -1,22 +1,22 @@ class RequestPatientLabSpecialResult { - String invoiceNo; - String orderNo; - String setupID; - String projectID; - int clinicID; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; + String? invoiceNo; + String? orderNo; + String? setupID; + String? projectID; + int ?clinicID; + double? versionID; + int ?channel; + int ?languageID; + String? iPAdress; + String ?generalid; + int ?patientOutSA; + String ?sessionID; + bool ?isDentalAllowedBackend; + int ?deviceTypeID; + int ?patientID; + String? tokenID; + int ?patientTypeID; + int ?patientType; RequestPatientLabSpecialResult( {this.invoiceNo, diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index 118da906..699ddafb 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -1,29 +1,29 @@ class RequestSendLabReportEmail { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - String to; - String dateofBirth; - String patientIditificationNum; - String patientMobileNumber; - String patientName; - String setupID; - String projectName; - String clinicName; - String doctorName; - String projectID; - String invoiceNo; - String orderDate; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + String? to; + String? dateofBirth; + String? patientIditificationNum; + String? patientMobileNumber; + String? patientName; + String? setupID; + String? projectName; + String? clinicName; + String? doctorName; + String? projectID; + String? invoiceNo; + String? orderDate; RequestSendLabReportEmail( {this.versionID, diff --git a/lib/core/model/live_care/AlternativeServicesList.dart b/lib/core/model/live_care/AlternativeServicesList.dart index 11f27b95..28d70805 100644 --- a/lib/core/model/live_care/AlternativeServicesList.dart +++ b/lib/core/model/live_care/AlternativeServicesList.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; class AlternativeService { - int serviceID; - String serviceName; - bool isSelected; + int? serviceID; + String? serviceName; + bool? isSelected; AlternativeService( {this.serviceID, this.serviceName, this.isSelected = false}); @@ -23,7 +23,7 @@ class AlternativeService { } class AlternativeServicesList with ChangeNotifier { - List _alternativeServicesList; + late List _alternativeServicesList; getServicesList(){ return _alternativeServicesList; diff --git a/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart b/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart index dc1f25b3..a99c9649 100644 --- a/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart +++ b/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart @@ -1,7 +1,7 @@ class PendingPatientERForDoctorAppRequestModel { - bool outSA; - int doctorID; - String sErServiceID; + bool ? outSA; + int ? doctorID; + String ? sErServiceID; PendingPatientERForDoctorAppRequestModel( {this.outSA, this.doctorID, this.sErServiceID}); diff --git a/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart b/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart index 1d63e885..a7589c08 100644 --- a/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart +++ b/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart @@ -1,9 +1,9 @@ class AddPatientToDoctorListRequestModel { - int vCID; - String tokenID; - String generalid; - int doctorId; - bool isOutKsa; + int? vCID; + String? tokenID; + String? generalid; + int? doctorId; + bool? isOutKsa; AddPatientToDoctorListRequestModel({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa}); diff --git a/lib/core/model/live_care/live_care_login_reguest_model.dart b/lib/core/model/live_care/live_care_login_reguest_model.dart index e14d4223..90ea0ff1 100644 --- a/lib/core/model/live_care/live_care_login_reguest_model.dart +++ b/lib/core/model/live_care/live_care_login_reguest_model.dart @@ -1,9 +1,9 @@ class LiveCareUserLoginRequestModel { - String tokenID; - String generalid; - int doctorId; - int isOutKsa; - int isLogin; + String? tokenID; + String? generalid; + int? doctorId; + int? isOutKsa; + int? isLogin; LiveCareUserLoginRequestModel({this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.isLogin}); diff --git a/lib/core/model/medical_report/medical_file_model.dart b/lib/core/model/medical_report/medical_file_model.dart index deebb2af..53737499 100644 --- a/lib/core/model/medical_report/medical_file_model.dart +++ b/lib/core/model/medical_report/medical_file_model.dart @@ -1,14 +1,14 @@ class MedicalFileModel { - List entityList; + List? entityList; dynamic statusMessage; MedicalFileModel({this.entityList, this.statusMessage}); MedicalFileModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } statusMessage = json['statusMessage']; @@ -17,7 +17,7 @@ class MedicalFileModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['statusMessage'] = this.statusMessage; return data; @@ -25,15 +25,15 @@ class MedicalFileModel { } class EntityList { - List timelines; + List? timelines; EntityList({this.timelines}); EntityList.fromJson(Map json) { if (json['Timelines'] != null) { - timelines = new List(); + timelines = []; json['Timelines'].forEach((v) { - timelines.add(new Timelines.fromJson(v)); + timelines!.add(new Timelines.fromJson(v)); }); } } @@ -41,25 +41,25 @@ class EntityList { Map toJson() { final Map data = new Map(); if (this.timelines != null) { - data['Timelines'] = this.timelines.map((v) => v.toJson()).toList(); + data['Timelines'] = this.timelines!.map((v) => v.toJson()).toList(); } return data; } } class Timelines { - int clinicId; - String clinicName; - String date; - int doctorId; - String doctorImage; - String doctorName; - int encounterNumber; - String encounterType; - int projectID; - String projectName; - String setupID; - List timeLineEvents; + int? clinicId; + String? clinicName; + String? date; + int? doctorId; + String? doctorImage; + String? doctorName; + int? encounterNumber; + String? encounterType; + int? projectID; + String? projectName; + String? setupID; + List? timeLineEvents; Timelines( {this.clinicId, @@ -88,9 +88,9 @@ class Timelines { projectName = json['ProjectName']; setupID = json['SetupID']; if (json['TimeLineEvents'] != null) { - timeLineEvents = new List(); + timeLineEvents = []; json['TimeLineEvents'].forEach((v) { - timeLineEvents.add(new TimeLineEvents.fromJson(v)); + timeLineEvents!.add(new TimeLineEvents.fromJson(v)); }); } } @@ -110,25 +110,25 @@ class Timelines { data['SetupID'] = this.setupID; if (this.timeLineEvents != null) { data['TimeLineEvents'] = - this.timeLineEvents.map((v) => v.toJson()).toList(); + this.timeLineEvents!.map((v) => v.toJson()).toList(); } return data; } } class TimeLineEvents { - List admissions; - String colorClass; - List consulations; + List? admissions; + String? colorClass; + List? consulations; TimeLineEvents({this.admissions, this.colorClass, this.consulations}); TimeLineEvents.fromJson(Map json) { colorClass = json['ColorClass']; if (json['Consulations'] != null) { - consulations = new List(); + consulations = []; json['Consulations'].forEach((v) { - consulations.add(new Consulations.fromJson(v)); + consulations!.add(new Consulations.fromJson(v)); }); } } @@ -138,38 +138,38 @@ class TimeLineEvents { data['ColorClass'] = this.colorClass; if (this.consulations != null) { - data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); + data['Consulations'] = this.consulations!.map((v) => v.toJson()).toList(); } return data; } } class Consulations { - int admissionNo; - String appointmentDate; - int appointmentNo; - String appointmentType; - String clinicID; - String clinicName; - int doctorID; - String doctorName; - String endTime; - String episodeDate; - int episodeID; - int patientID; - int projectID; - String projectName; - String remarks; - String setupID; - String startTime; - String visitFor; - String visitType; - String dispalyName; - List lstAssessments; - List lstPhysicalExam; - List lstProcedure; - List lstMedicalHistory; - List lstCheifComplaint; + int? admissionNo; + String? appointmentDate; + int? appointmentNo; + String? appointmentType; + String? clinicID; + String? clinicName; + int? doctorID; + String? doctorName; + String? endTime; + String? episodeDate; + int? episodeID; + int? patientID; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? startTime; + String? visitFor; + String? visitType; + String? dispalyName; + List? lstAssessments; + List? lstPhysicalExam; + List? lstProcedure; + List? lstMedicalHistory; + List? lstCheifComplaint; Consulations( {this.admissionNo, @@ -220,33 +220,33 @@ class Consulations { visitType = json['VisitType']; dispalyName = json['dispalyName']; if (json['lstAssessments'] != null) { - lstAssessments = new List(); + lstAssessments = []; json['lstAssessments'].forEach((v) { - lstAssessments.add(new LstAssessments.fromJson(v)); + lstAssessments!.add(new LstAssessments.fromJson(v)); }); } if (json['lstCheifComplaint'] != null) { - lstCheifComplaint = new List(); + lstCheifComplaint = []; json['lstCheifComplaint'].forEach((v) { - lstCheifComplaint.add(new LstCheifComplaint.fromJson(v)); + lstCheifComplaint!.add(new LstCheifComplaint.fromJson(v)); }); } if (json['lstPhysicalExam'] != null) { - lstPhysicalExam = new List(); + lstPhysicalExam = []; json['lstPhysicalExam'].forEach((v) { - lstPhysicalExam.add(new LstPhysicalExam.fromJson(v)); + lstPhysicalExam!.add(new LstPhysicalExam.fromJson(v)); }); } if (json['lstProcedure'] != null) { - lstProcedure = new List(); + lstProcedure = []; json['lstProcedure'].forEach((v) { - lstProcedure.add(new LstProcedure.fromJson(v)); + lstProcedure!.add(new LstProcedure.fromJson(v)); }); } if (json['lstMedicalHistory'] != null) { - lstMedicalHistory = new List(); + lstMedicalHistory = []; json['lstMedicalHistory'].forEach((v) { - lstMedicalHistory.add(new LstMedicalHistory.fromJson(v)); + lstMedicalHistory!.add(new LstMedicalHistory.fromJson(v)); }); } } @@ -275,40 +275,40 @@ class Consulations { data['dispalyName'] = this.dispalyName; if (this.lstAssessments != null) { data['lstAssessments'] = - this.lstAssessments.map((v) => v.toJson()).toList(); + this.lstAssessments!.map((v) => v.toJson()).toList(); } if (this.lstCheifComplaint != null) { data['lstCheifComplaint'] = - this.lstCheifComplaint.map((v) => v.toJson()).toList(); + this.lstCheifComplaint!.map((v) => v.toJson()).toList(); } if (this.lstPhysicalExam != null) { data['lstPhysicalExam'] = - this.lstPhysicalExam.map((v) => v.toJson()).toList(); + this.lstPhysicalExam!.map((v) => v.toJson()).toList(); } if (this.lstProcedure != null) { - data['lstProcedure'] = this.lstProcedure.map((v) => v.toJson()).toList(); + data['lstProcedure'] = this.lstProcedure!.map((v) => v.toJson()).toList(); } if (this.lstMedicalHistory != null) { data['lstMedicalHistory'] = - this.lstMedicalHistory.map((v) => v.toJson()).toList(); + this.lstMedicalHistory!.map((v) => v.toJson()).toList(); } return data; } } class LstCheifComplaint { - int appointmentNo; - String cCDate; - String chiefComplaint; - String currentMedication; - int episodeID; - String hOPI; - int patientID; - String patientType; - int projectID; - String projectName; - String setupID; - String dispalyName; + int? appointmentNo; + String? cCDate; + String? chiefComplaint; + String? currentMedication; + int? episodeID; + String? hOPI; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? setupID; + String? dispalyName; LstCheifComplaint( {this.appointmentNo, @@ -358,19 +358,19 @@ class LstCheifComplaint { } class LstAssessments { - int appointmentNo; - String condition; - String description; - int episodeID; - String iCD10; - int patientID; - String patientType; - int projectID; - String projectName; - String remarks; - String setupID; - String type; - String dispalyName; + int? appointmentNo; + String? condition; + String? description; + int? episodeID; + String? iCD10; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? type; + String? dispalyName; LstAssessments( {this.appointmentNo, @@ -423,19 +423,19 @@ class LstAssessments { } class LstPhysicalExam { - String abnormal; - int appointmentNo; - int episodeID; - String examDesc; - String examID; - String examType; - int patientID; - String patientType; - int projectID; - String projectName; - String remarks; - String setupID; - String dispalyName; + String? abnormal; + int? appointmentNo; + int? episodeID; + String? examDesc; + String? examID; + String? examType; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? dispalyName; LstPhysicalExam( {this.abnormal, @@ -488,17 +488,17 @@ class LstPhysicalExam { } class LstProcedure { - int appointmentNo; - int episodeID; - String orderDate; - int patientID; - String patientType; - String procName; - String procedureId; - int projectID; - String projectName; - String setupID; - String dispalyName; + int? appointmentNo; + int? episodeID; + String? orderDate; + int? patientID; + String? patientType; + String? procName; + String? procedureId; + int? projectID; + String? projectName; + String? setupID; + String? dispalyName; LstProcedure( {this.appointmentNo, @@ -545,17 +545,17 @@ class LstProcedure { } class LstMedicalHistory { - int appointmentNo; - String checked; - int episodeID; - String history; - int patientID; - String patientType; - int projectID; - String projectName; - String remarks; - String setupID; - String dispalyName; + int? appointmentNo; + String? checked; + int? episodeID; + String? history; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? dispalyName; LstMedicalHistory( {this.appointmentNo, diff --git a/lib/core/model/medical_report/medical_file_request_model.dart b/lib/core/model/medical_report/medical_file_request_model.dart index 8703141a..01a2abf2 100644 --- a/lib/core/model/medical_report/medical_file_request_model.dart +++ b/lib/core/model/medical_report/medical_file_request_model.dart @@ -1,7 +1,7 @@ class MedicalFileRequestModel { - int patientMRN; - String vidaAuthTokenID; - String iPAdress; + int ?patientMRN; + String ?vidaAuthTokenID; + String ?iPAdress; MedicalFileRequestModel({this.patientMRN, this.vidaAuthTokenID,this.iPAdress}); diff --git a/lib/core/model/note/CreateNoteModel.dart b/lib/core/model/note/CreateNoteModel.dart index ce076705..5d1709ca 100644 --- a/lib/core/model/note/CreateNoteModel.dart +++ b/lib/core/model/note/CreateNoteModel.dart @@ -1,23 +1,23 @@ class CreateNoteModel { - int visitType; - int admissionNo; - int projectID; - int patientTypeID; - int patientID; - int clinicID; - String notes; - int createdBy; - int editedBy; - String nursingRemarks; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? visitType; + int? admissionNo; + int? projectID; + int? patientTypeID; + int? patientID; + int? clinicID; + String? notes; + int ?createdBy; + int ?editedBy; + String ?nursingRemarks; + int ?languageID; + String? stamp; + String ?iPAdress; + double ?versionID; + int ?channel; + String ?tokenID; + String? sessionID; + bool ?isLoginForDoctorApp; + bool ?patientOutSA; CreateNoteModel( {this.visitType, diff --git a/lib/core/model/note/GetNursingProgressNoteRequestModel.dart b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart index 4335053c..b7fd7aa5 100644 --- a/lib/core/model/note/GetNursingProgressNoteRequestModel.dart +++ b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart @@ -1,14 +1,18 @@ import 'package:doctor_app_flutter/config/config.dart'; class GetNursingProgressNoteRequestModel { - int patientID; - int admissionNo; - int patientTypeID; - int patientType; - String setupID; + int? patientID; + int? admissionNo; + int? patientTypeID; + int? patientType; + String? setupID; GetNursingProgressNoteRequestModel( - {this.patientID, this.admissionNo, this.patientTypeID = 1, this.patientType = 1, this.setupID }); + {this.patientID, + this.admissionNo, + this.patientTypeID = 1, + this.patientType = 1, + this.setupID}); GetNursingProgressNoteRequestModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/core/model/note/GetNursingProgressNoteResposeModel.dart b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart index fb7fbcec..aaf9c7ab 100644 --- a/lib/core/model/note/GetNursingProgressNoteResposeModel.dart +++ b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart @@ -1,14 +1,14 @@ class GetNursingProgressNoteResposeModel { - String notes; + String? notes; dynamic conditionType; - int createdBy; - String createdOn; + int? createdBy; + String? createdOn; dynamic editedBy; dynamic editedOn; - String createdByName; + String? createdByName; - String editedByName; + String? editedByName; GetNursingProgressNoteResposeModel( {this.notes, diff --git a/lib/core/model/note/note_model.dart b/lib/core/model/note/note_model.dart index 797f9b6d..713de924 100644 --- a/lib/core/model/note/note_model.dart +++ b/lib/core/model/note/note_model.dart @@ -1,24 +1,24 @@ class NoteModel { - String setupID; - int projectID; - int patientID; - int patientType; - String admissionNo; - int lineItemNo; - int visitType; - String notes; - String assessmentDate; - String visitTime; - int status; - String nursingRemarks; - String createdOn; - String editedOn; - int createdBy; - int admissionClinicID; - String admissionClinicName; - Null doctorClinicName; - String doctorName; - String visitTypeDesc; + String? setupID; + int ?projectID; + int ?patientID; + int ?patientType; + String ?admissionNo; + int ?lineItemNo; + int ?visitType; + String ?notes; + String ?assessmentDate; + String ?visitTime; + int ?status; + String ?nursingRemarks; + String ?createdOn; + String ?editedOn; + int ?createdBy; + int ?admissionClinicID; + String ?admissionClinicName; + dynamic doctorClinicName; + String ?doctorName; + String ?visitTypeDesc; NoteModel( {this.setupID, diff --git a/lib/core/model/note/update_note_model.dart b/lib/core/model/note/update_note_model.dart index 20fd4b86..5c59cc77 100644 --- a/lib/core/model/note/update_note_model.dart +++ b/lib/core/model/note/update_note_model.dart @@ -1,21 +1,21 @@ class UpdateNoteReqModel { - int projectID; - int createdBy; - int admissionNo; - int lineItemNo; - String notes; - bool verifiedNote; - bool cancelledNote; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? projectID; + int? createdBy; + int? admissionNo; + int? lineItemNo; + String? notes; + bool? verifiedNote; + bool? cancelledNote; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; UpdateNoteReqModel( {this.projectID, diff --git a/lib/core/model/patient_muse/PatientMuseResultsModel.dart b/lib/core/model/patient_muse/PatientMuseResultsModel.dart index 401fd1a7..970d48cb 100644 --- a/lib/core/model/patient_muse/PatientMuseResultsModel.dart +++ b/lib/core/model/patient_muse/PatientMuseResultsModel.dart @@ -1,19 +1,19 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatientMuseResultsModel { - int rowID; - String setupID; - int projectID; - String orderNo; - int lineItemNo; - int patientType; - int patientID; - String procedureID; + int ?rowID; + String? setupID; + int ?projectID; + String? orderNo; + int? lineItemNo; + int? patientType; + int? patientID; + String ?procedureID; dynamic reportData; - String imageURL; - String createdBy; - String createdOn; - DateTime createdOnDateTime; + String? imageURL; + String? createdBy; + String? createdOn; + DateTime? createdOnDateTime; PatientMuseResultsModel( {this.rowID, diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index dcb9b31c..c2c1bab8 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -1,19 +1,19 @@ class PatientSearchRequestModel { - int doctorID; - String firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int searchType; - int projectID; - String mobileNo; - String identificationNo; - int nursingStationID; - int clinicID = 0; + int? doctorID; + String? firstName; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; + String? from; + String? to; + int? searchType; + int? projectID; + String? mobileNo; + String? identificationNo; + int? nursingStationID; + int? clinicID = 0; PatientSearchRequestModel( {this.doctorID, diff --git a/lib/core/model/procedure/ControlsModel.dart b/lib/core/model/procedure/ControlsModel.dart index b3e8ae9c..e14c7768 100644 --- a/lib/core/model/procedure/ControlsModel.dart +++ b/lib/core/model/procedure/ControlsModel.dart @@ -1,6 +1,6 @@ class Controls { - String code; - String controlValue; + String ?code; + String ?controlValue; Controls({this.code, this.controlValue}); diff --git a/lib/core/model/procedure/Procedure_template_request_model.dart b/lib/core/model/procedure/Procedure_template_request_model.dart index 698178e3..26e3a271 100644 --- a/lib/core/model/procedure/Procedure_template_request_model.dart +++ b/lib/core/model/procedure/Procedure_template_request_model.dart @@ -1,31 +1,31 @@ class ProcedureTempleteRequestModel { - int doctorID; - String firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int searchType; - String mobileNo; - String identificationNo; - int editedBy; - int projectID; - int clinicID; - String tokenID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - String vidaAuthTokenID; - String vidaRefreshTokenID; - int deviceTypeID; + int? doctorID; + String? firstName; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; + String? from; + String? to; + int? searchType; + String? mobileNo; + String? identificationNo; + int? editedBy; + int? projectID; + int? clinicID; + String? tokenID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; + int? deviceTypeID; ProcedureTempleteRequestModel( {this.doctorID, diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart index 9e6f847f..e7580062 100644 --- a/lib/core/model/procedure/categories_procedure.dart +++ b/lib/core/model/procedure/categories_procedure.dart @@ -1,26 +1,26 @@ class CategoriseProcedureModel { - List entityList; - int rowcount; + List ?entityList; + int ?rowcount; dynamic statusMessage; CategoriseProcedureModel( - {this.entityList, this.rowcount, this.statusMessage}); + {this.entityList, this.rowcount, this.statusMessage}); - CategoriseProcedureModel.fromJson(Map json) { + CategoriseProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; statusMessage = json['statusMessage']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,38 +29,38 @@ class CategoriseProcedureModel { } class EntityList { - bool allowedClinic; - String category; - String categoryID; - String genderValidation; - String group; - String orderedValidation; + bool ?allowedClinic; + String ? category; + String ? categoryID; + String ? genderValidation; + String ? group; + String ? orderedValidation; dynamic price; - String procedureId; - String procedureName; - String specialPermission; - String subGroup; - String template; - String remarks; - String type; + String ? procedureId; + String ? procedureName; + String ? specialPermission; + String ? subGroup; + String ? template; + String ? remarks; + String ? type; EntityList( {this.allowedClinic, - this.category, - this.categoryID, - this.genderValidation, - this.group, - this.orderedValidation, - this.price, - this.procedureId, - this.procedureName, - this.specialPermission, - this.subGroup, - this.template, - this.remarks, - this.type}); + this.category, + this.categoryID, + this.genderValidation, + this.group, + this.orderedValidation, + this.price, + this.procedureId, + this.procedureName, + this.specialPermission, + this.subGroup, + this.template, + this.remarks, + this.type}); - EntityList.fromJson(Map json) { + EntityList.fromJson(Map json) { allowedClinic = json['allowedClinic']; category = json['category']; categoryID = json['categoryID']; @@ -75,8 +75,8 @@ class EntityList { template = json['template']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['allowedClinic'] = this.allowedClinic; data['category'] = this.category; data['categoryID'] = this.categoryID; diff --git a/lib/core/model/procedure/get_ordered_procedure_model.dart b/lib/core/model/procedure/get_ordered_procedure_model.dart index c3c7718f..721faccb 100644 --- a/lib/core/model/procedure/get_ordered_procedure_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_model.dart @@ -1,26 +1,26 @@ class GetOrderedProcedureModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; GetOrderedProcedureModel( {this.entityList, this.rowcount, this.statusMessage}); - GetOrderedProcedureModel.fromJson(Map json) { + GetOrderedProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; statusMessage = json['statusMessage']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,60 +29,60 @@ class GetOrderedProcedureModel { } class EntityList { - String achiCode; - String appointmentDate; - int appointmentNo; - int categoryID; - String clinicDescription; - String cptCode; - int createdBy; - String createdOn; - String doctorName; - bool isApprovalCreated; - bool isApprovalRequired; - bool isCovered; - bool isInvoiced; - bool isReferralInvoiced; - bool isUncoveredByDoctor; - int lineItemNo; - String orderDate; - int orderNo; - int orderType; - String procedureId; - String procedureName; - String remarks; - String status; - String template; - int doctorID; + String? achiCode; + String? appointmentDate; + int? appointmentNo; + int? categoryID; + String? clinicDescription; + String? cptCode; + int? createdBy; + String? createdOn; + String? doctorName; + bool? isApprovalCreated; + bool? isApprovalRequired; + bool? isCovered; + bool? isInvoiced; + bool? isReferralInvoiced; + bool? isUncoveredByDoctor; + int? lineItemNo; + String? orderDate; + int? orderNo; + int? orderType; + String? procedureId; + String? procedureName; + String? remarks; + String? status; + String? template; + int? doctorID; EntityList( {this.achiCode, - this.appointmentDate, - this.appointmentNo, - this.categoryID, - this.clinicDescription, - this.cptCode, - this.createdBy, - this.createdOn, - this.doctorName, - this.isApprovalCreated, - this.isApprovalRequired, - this.isCovered, - this.isInvoiced, - this.isReferralInvoiced, - this.isUncoveredByDoctor, - this.lineItemNo, - this.orderDate, - this.orderNo, - this.orderType, - this.procedureId, - this.procedureName, - this.remarks, - this.status, - this.template, - this.doctorID}); + this.appointmentDate, + this.appointmentNo, + this.categoryID, + this.clinicDescription, + this.cptCode, + this.createdBy, + this.createdOn, + this.doctorName, + this.isApprovalCreated, + this.isApprovalRequired, + this.isCovered, + this.isInvoiced, + this.isReferralInvoiced, + this.isUncoveredByDoctor, + this.lineItemNo, + this.orderDate, + this.orderNo, + this.orderType, + this.procedureId, + this.procedureName, + this.remarks, + this.status, + this.template, + this.doctorID}); - EntityList.fromJson(Map json) { + EntityList.fromJson(Map json) { achiCode = json['achiCode']; doctorID = json['doctorID']; appointmentDate = json['appointmentDate']; @@ -110,8 +110,8 @@ class EntityList { template = json['template']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['achiCode'] = this.achiCode; data['doctorID'] = this.doctorID; data['appointmentDate'] = this.appointmentDate; diff --git a/lib/core/model/procedure/get_ordered_procedure_request_model.dart b/lib/core/model/procedure/get_ordered_procedure_request_model.dart index 5178ab14..dbfb75cd 100644 --- a/lib/core/model/procedure/get_ordered_procedure_request_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_request_model.dart @@ -1,9 +1,10 @@ class GetOrderedProcedureRequestModel { - String vidaAuthTokenID; - int patientMRN; - int appointmentNo; + String? vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; - GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN, this.appointmentNo}); + GetOrderedProcedureRequestModel( + {this.vidaAuthTokenID, this.patientMRN, this.appointmentNo}); GetOrderedProcedureRequestModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; diff --git a/lib/core/model/procedure/get_procedure_model.dart b/lib/core/model/procedure/get_procedure_model.dart index 5c83b49b..732def33 100644 --- a/lib/core/model/procedure/get_procedure_model.dart +++ b/lib/core/model/procedure/get_procedure_model.dart @@ -1,25 +1,25 @@ class GetProcedureModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; GetProcedureModel({this.entityList, this.rowcount, this.statusMessage}); - GetProcedureModel.fromJson(Map json) { + GetProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; statusMessage = json['statusMessage']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -28,34 +28,34 @@ class GetProcedureModel { } class EntityList { - bool allowedClinic; - String category; - String categoryID; - String genderValidation; - String group; - String orderedValidation; + bool? allowedClinic; + String? category; + String? categoryID; + String? genderValidation; + String? group; + String? orderedValidation; dynamic price; - String procedureId; - String procedureName; - String specialPermission; - String subGroup; - String template; + String? procedureId; + String? procedureName; + String? specialPermission; + String? subGroup; + String? template; EntityList( {this.allowedClinic, - this.category, - this.categoryID, - this.genderValidation, - this.group, - this.orderedValidation, - this.price, - this.procedureId, - this.procedureName, - this.specialPermission, - this.subGroup, - this.template}); + this.category, + this.categoryID, + this.genderValidation, + this.group, + this.orderedValidation, + this.price, + this.procedureId, + this.procedureName, + this.specialPermission, + this.subGroup, + this.template}); - EntityList.fromJson(Map json) { + EntityList.fromJson(Map json) { allowedClinic = json['allowedClinic']; category = json['category']; categoryID = json['categoryID']; @@ -70,8 +70,8 @@ class EntityList { template = json['template']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['allowedClinic'] = this.allowedClinic; data['category'] = this.category; data['categoryID'] = this.categoryID; diff --git a/lib/core/model/procedure/get_procedure_req_model.dart b/lib/core/model/procedure/get_procedure_req_model.dart index 6202a520..3fae7396 100644 --- a/lib/core/model/procedure/get_procedure_req_model.dart +++ b/lib/core/model/procedure/get_procedure_req_model.dart @@ -1,20 +1,20 @@ class GetProcedureReqModel { - int clinicId; - int patientMRN; - int pageSize; - int pageIndex; - List search; + int? clinicId; + int? patientMRN; + int? pageSize; + int? pageIndex; + List ?search; dynamic category; - String vidaAuthTokenID; + String ?vidaAuthTokenID; GetProcedureReqModel( {this.clinicId, - this.patientMRN, - this.pageSize, - this.pageIndex, - this.search, - this.category, - this.vidaAuthTokenID}); + this.patientMRN, + this.pageSize, + this.pageIndex, + this.search, + this.category, + this.vidaAuthTokenID}); GetProcedureReqModel.fromJson(Map json) { clinicId = json['ClinicId']; diff --git a/lib/core/model/procedure/post_procedure_req_model.dart b/lib/core/model/procedure/post_procedure_req_model.dart index b12563f8..7534da58 100644 --- a/lib/core/model/procedure/post_procedure_req_model.dart +++ b/lib/core/model/procedure/post_procedure_req_model.dart @@ -1,27 +1,27 @@ import 'ControlsModel.dart'; class PostProcedureReqModel { - int patientMRN; - int appointmentNo; - int episodeID; - List procedures; - String vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; + int? episodeID; + List ?procedures; + String ?vidaAuthTokenID; PostProcedureReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.procedures, - this.vidaAuthTokenID}); + this.appointmentNo, + this.episodeID, + this.procedures, + this.vidaAuthTokenID}); PostProcedureReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeID = json['EpisodeID']; if (json['Procedures'] != null) { - procedures = new List(); + procedures = []; json['Procedures'].forEach((v) { - procedures.add(new Procedures.fromJson(v)); + procedures!.add(new Procedures.fromJson(v)); }); } vidaAuthTokenID = json['VidaAuthTokenID']; @@ -33,7 +33,7 @@ class PostProcedureReqModel { data['AppointmentNo'] = this.appointmentNo; data['EpisodeID'] = this.episodeID; if (this.procedures != null) { - data['Procedures'] = this.procedures.map((v) => v.toJson()).toList(); + data['Procedures'] = this.procedures!.map((v) => v.toJson()).toList(); } data['VidaAuthTokenID'] = this.vidaAuthTokenID; return data; @@ -41,9 +41,9 @@ class PostProcedureReqModel { } class Procedures { - String procedure; - String category; - List controls; + String ?procedure; + String ?category; + List ?controls; Procedures({this.procedure, this.category, this.controls}); @@ -51,9 +51,9 @@ class Procedures { procedure = json['Procedure']; category = json['Category']; if (json['Controls'] != null) { - controls = new List(); + controls = []; json['Controls'].forEach((v) { - controls.add(new Controls.fromJson(v)); + controls!.add(new Controls.fromJson(v)); }); } } @@ -63,7 +63,7 @@ class Procedures { data['Procedure'] = this.procedure; data['Category'] = this.category; if (this.controls != null) { - data['Controls'] = this.controls.map((v) => v.toJson()).toList(); + data['Controls'] = this.controls!.map((v) => v.toJson()).toList(); } return data; } diff --git a/lib/core/model/procedure/procedure_category_list_model.dart b/lib/core/model/procedure/procedure_category_list_model.dart index 849e84e5..50048080 100644 --- a/lib/core/model/procedure/procedure_category_list_model.dart +++ b/lib/core/model/procedure/procedure_category_list_model.dart @@ -1,6 +1,6 @@ class ProcedureCategoryListModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; ProcedureCategoryListModel( @@ -8,9 +8,9 @@ class ProcedureCategoryListModel { ProcedureCategoryListModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -20,7 +20,7 @@ class ProcedureCategoryListModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,8 +29,8 @@ class ProcedureCategoryListModel { } class EntityList { - int categoryId; - String categoryName; + int? categoryId; + String? categoryName; EntityList({this.categoryId, this.categoryName}); diff --git a/lib/core/model/procedure/procedure_templateModel.dart b/lib/core/model/procedure/procedure_templateModel.dart index 3b12d646..38a05693 100644 --- a/lib/core/model/procedure/procedure_templateModel.dart +++ b/lib/core/model/procedure/procedure_templateModel.dart @@ -1,13 +1,13 @@ class ProcedureTempleteModel { - String setupID; - int projectID; - int clinicID; - int doctorID; - int templateID; - String templateName; - bool isActive; - int createdBy; - String createdOn; + String? setupID; + int? projectID; + int? clinicID; + int? doctorID; + int? templateID; + String? templateName; + bool? isActive; + int? createdBy; + String? createdOn; dynamic editedBy; dynamic editedOn; diff --git a/lib/core/model/procedure/procedure_template_details_model.dart b/lib/core/model/procedure/procedure_template_details_model.dart index 1fc797ae..6dec310f 100644 --- a/lib/core/model/procedure/procedure_template_details_model.dart +++ b/lib/core/model/procedure/procedure_template_details_model.dart @@ -1,58 +1,58 @@ class ProcedureTempleteDetailsModel { - String setupID; - int projectID; - int clinicID; - int doctorID; - int templateID; - String templateName; - String procedureID; - bool isActive; - int createdBy; - String createdOn; + String? setupID; + int? projectID; + int? clinicID; + int? doctorID; + int? templateID; + String? templateName; + String? procedureID; + bool ?isActive; + int? createdBy; + String? createdOn; dynamic editedBy; dynamic editedOn; - String procedureName; - String procedureNameN; - String alias; - String aliasN; - String categoryID; - String subGroupID; - String categoryDescription; - String categoryDescriptionN; - String categoryAlias; + String? procedureName; + String? procedureNameN; + String? alias; + String? aliasN; + String? categoryID; + String? subGroupID; + String? categoryDescription; + String? categoryDescriptionN; + String? categoryAlias; dynamic riskCategoryID; - String type = "1"; - String remarks; - int selectedType = 0; + String? type = "1"; + String? remarks; + int? selectedType = 0; ProcedureTempleteDetailsModel( {this.setupID, - this.projectID, - this.clinicID, - this.doctorID, - this.templateID, - this.procedureID, - this.isActive, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, - this.procedureName, - this.procedureNameN, - this.alias, - this.aliasN, - this.categoryID, - this.subGroupID, - this.riskCategoryID, - this.templateName, - this.categoryDescription, - this.categoryDescriptionN, - this.categoryAlias, - this.remarks, - this.type = "1", - this.selectedType = 0}); + this.projectID, + this.clinicID, + this.doctorID, + this.templateID, + this.procedureID, + this.isActive, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.procedureName, + this.procedureNameN, + this.alias, + this.aliasN, + this.categoryID, + this.subGroupID, + this.riskCategoryID, + this.templateName, + this.categoryDescription, + this.categoryDescriptionN, + this.categoryAlias, + this.remarks, + this.type = "1", + this.selectedType = 0}); - ProcedureTempleteDetailsModel.fromJson(Map json) { + ProcedureTempleteDetailsModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; clinicID = json['ClinicID']; @@ -77,8 +77,8 @@ class ProcedureTempleteDetailsModel { categoryAlias = json['CategoryAlias']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['ClinicID'] = this.clinicID; @@ -105,12 +105,12 @@ class ProcedureTempleteDetailsModel { } } class ProcedureTempleteDetailsModelList { - List procedureTemplate = List(); - String templateName; - int templateId; + List procedureTemplate =[]; + String? templateName; + int? templateId; ProcedureTempleteDetailsModelList( - {this.templateName, this.templateId, ProcedureTempleteDetailsModel template}) { + {this.templateName, this.templateId, required ProcedureTempleteDetailsModel template}) { procedureTemplate.add(template); } } diff --git a/lib/core/model/procedure/procedure_template_details_request_model.dart b/lib/core/model/procedure/procedure_template_details_request_model.dart index 6df6fc73..99c9f814 100644 --- a/lib/core/model/procedure/procedure_template_details_request_model.dart +++ b/lib/core/model/procedure/procedure_template_details_request_model.dart @@ -1,32 +1,32 @@ class ProcedureTempleteDetailsRequestModel { - int doctorID; - String firstName; - int templateID; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int searchType; - String mobileNo; - String identificationNo; - int editedBy; - int projectID; - int clinicID; - String tokenID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - String vidaAuthTokenID; - String vidaRefreshTokenID; - int deviceTypeID; + int? doctorID; + String? firstName; + int? templateID; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; + String? from; + String? to; + int? searchType; + String? mobileNo; + String? identificationNo; + int? editedBy; + int? projectID; + int? clinicID; + String? tokenID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; + int? deviceTypeID; ProcedureTempleteDetailsRequestModel( {this.doctorID, diff --git a/lib/core/model/procedure/procedure_valadate_model.dart b/lib/core/model/procedure/procedure_valadate_model.dart index 3a3e23cf..431d369a 100644 --- a/lib/core/model/procedure/procedure_valadate_model.dart +++ b/lib/core/model/procedure/procedure_valadate_model.dart @@ -1,6 +1,6 @@ class ProcedureValadteModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; dynamic success; @@ -9,9 +9,9 @@ class ProcedureValadteModel { ProcedureValadteModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -22,7 +22,7 @@ class ProcedureValadteModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -32,8 +32,8 @@ class ProcedureValadteModel { } class EntityList { - String procedureId; - List warringMessages; + String? procedureId; + List? warringMessages; EntityList({this.procedureId, this.warringMessages}); diff --git a/lib/core/model/procedure/procedure_valadate_request_model.dart b/lib/core/model/procedure/procedure_valadate_request_model.dart index 0b872b93..581ff41f 100644 --- a/lib/core/model/procedure/procedure_valadate_request_model.dart +++ b/lib/core/model/procedure/procedure_valadate_request_model.dart @@ -1,9 +1,9 @@ class ProcedureValadteRequestModel { - String vidaAuthTokenID; - int patientMRN; - int appointmentNo; - int episodeID; - List procedure; + String? vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; + int? episodeID; + List? procedure; ProcedureValadteRequestModel( {this.vidaAuthTokenID, diff --git a/lib/core/model/procedure/update_procedure_request_model.dart b/lib/core/model/procedure/update_procedure_request_model.dart index aee39879..a6b92d16 100644 --- a/lib/core/model/procedure/update_procedure_request_model.dart +++ b/lib/core/model/procedure/update_procedure_request_model.dart @@ -1,13 +1,13 @@ import 'ControlsModel.dart'; class UpdateProcedureRequestModel { - int orderNo; - int patientMRN; - int appointmentNo; - int episodeID; - int lineItemNo; - ProcedureDetail procedureDetail; - String vidaAuthTokenID; + int? orderNo; + int? patientMRN; + int? appointmentNo; + int? episodeID; + int? lineItemNo; + ProcedureDetail? procedureDetail; + String? vidaAuthTokenID; UpdateProcedureRequestModel( {this.orderNo, @@ -38,7 +38,7 @@ class UpdateProcedureRequestModel { data['EpisodeID'] = this.episodeID; data['LineItemNo'] = this.lineItemNo; if (this.procedureDetail != null) { - data['procedureDetail'] = this.procedureDetail.toJson(); + data['procedureDetail'] = this.procedureDetail!.toJson(); } data['VidaAuthTokenID'] = this.vidaAuthTokenID; return data; @@ -46,9 +46,9 @@ class UpdateProcedureRequestModel { } class ProcedureDetail { - String procedure; - String category; - List controls; + String? procedure; + String? category; + List? controls; ProcedureDetail({this.procedure, this.category, this.controls}); @@ -56,9 +56,9 @@ class ProcedureDetail { procedure = json['Procedure']; category = json['Category']; if (json['Controls'] != null) { - controls = new List(); + controls = []; json['Controls'].forEach((v) { - controls.add(new Controls.fromJson(v)); + controls!.add(new Controls.fromJson(v)); }); } } @@ -68,7 +68,7 @@ class ProcedureDetail { data['Procedure'] = this.procedure; data['Category'] = this.category; if (this.controls != null) { - data['Controls'] = this.controls.map((v) => v.toJson()).toList(); + data['Controls'] = this.controls!.map((v) => v.toJson()).toList(); } return data; } diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index e09f269a..ae307fdb 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -8,17 +8,17 @@ class FinalRadiology { dynamic invoiceNo; dynamic doctorID; dynamic clinicID; - DateTime orderDate; - DateTime reportDate; + DateTime? orderDate; + DateTime ?reportDate; dynamic reportData; dynamic imageURL; dynamic procedureID; dynamic appodynamicmentNo; dynamic dIAPacsURL; - bool isRead; + bool? isRead; dynamic readOn; var admissionNo; - bool isInOutPatient; + bool ?isInOutPatient; dynamic actualDoctorRate; dynamic clinicDescription; dynamic dIAPACSURL; @@ -28,8 +28,8 @@ class FinalRadiology { dynamic doctorTitle; dynamic gender; dynamic genderDescription; - bool isActiveDoctorProfile; - bool isExecludeDoctor; + bool? isActiveDoctorProfile; + bool ?isExecludeDoctor; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; dynamic nationalityFlagURL; @@ -39,53 +39,53 @@ class FinalRadiology { dynamic qR; dynamic reportDataHTML; dynamic reportDataTextdynamic; - List speciality; - bool isCVI; - bool isRadMedicalReport; - bool isLiveCareAppodynamicment; + List? speciality; + bool ?isCVI; + bool ?isRadMedicalReport; + bool ?isLiveCareAppodynamicment; FinalRadiology( {this.setupID, - this.projectID, - this.patientID, - this.invoiceLineItemNo, - this.invoiceNo, - this.doctorID, - this.clinicID, - this.orderDate, - this.reportDate, - this.reportData, - this.imageURL, - this.procedureID, - this.appodynamicmentNo, - this.dIAPacsURL, - this.isRead, - this.readOn, - this.admissionNo, - this.isInOutPatient, - this.actualDoctorRate, - this.clinicDescription, - this.dIAPACSURL, - this.doctorImageURL, - this.doctorName, - this.doctorRate, - this.doctorTitle, - this.gender, - this.genderDescription, - this.isActiveDoctorProfile, - this.isExecludeDoctor, - this.isInOutPatientDescription, - this.isInOutPatientDescriptionN, - this.nationalityFlagURL, - this.noOfPatientsRate, - this.orderNo, - this.projectName, - this.qR, - this.reportDataHTML, - this.reportDataTextdynamic, - this.speciality, - this.isCVI, - this.isRadMedicalReport,this.isLiveCareAppodynamicment}); + this.projectID, + this.patientID, + this.invoiceLineItemNo, + this.invoiceNo, + this.doctorID, + this.clinicID, + this.orderDate, + this.reportDate, + this.reportData, + this.imageURL, + this.procedureID, + this.appodynamicmentNo, + this.dIAPacsURL, + this.isRead, + this.readOn, + this.admissionNo, + this.isInOutPatient, + this.actualDoctorRate, + this.clinicDescription, + this.dIAPACSURL, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isExecludeDoctor, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.orderNo, + this.projectName, + this.qR, + this.reportDataHTML, + this.reportDataTextdynamic, + this.speciality, + this.isCVI, + this.isRadMedicalReport,this.isLiveCareAppodynamicment}); FinalRadiology.fromJson(Map json) { try { @@ -128,7 +128,7 @@ class FinalRadiology { isLiveCareAppodynamicment = json['IsLiveCareAppointment']; reportDataHTML = json['ReportDataHTML']; reportDataTextdynamic = json['ReportDataTextdynamic']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); isCVI = json['isCVI']; isRadMedicalReport = json['isRadMedicalReport']; @@ -186,9 +186,9 @@ class FinalRadiology { class FinalRadiologyList { dynamic filterName = ""; - List finalRadiologyList = List(); + List finalRadiologyList = []; - FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) { + FinalRadiologyList({this.filterName, required FinalRadiology finalRadiology}) { finalRadiologyList.add(finalRadiology); } } diff --git a/lib/core/model/radiology/request_patient_rad_orders_details.dart b/lib/core/model/radiology/request_patient_rad_orders_details.dart index 9e3458d5..7f39ee25 100644 --- a/lib/core/model/radiology/request_patient_rad_orders_details.dart +++ b/lib/core/model/radiology/request_patient_rad_orders_details.dart @@ -1,24 +1,24 @@ class RequestPatientRadOrdersDetails { - int projectID; - int orderNo; - int invoiceNo; - String setupID; - String procedureID; - bool isMedicalReport; - bool isCVI; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; + int? projectID; + int? orderNo; + int? invoiceNo; + String? setupID; + String? procedureID; + bool? isMedicalReport; + bool? isCVI; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; RequestPatientRadOrdersDetails( {this.projectID, diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart index 6d68653d..3b9e961a 100644 --- a/lib/core/model/radiology/request_send_rad_report_email.dart +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -1,30 +1,30 @@ class RequestSendRadReportEmail { - int channel; - String clinicName; - String dateofBirth; - int deviceTypeID; - String doctorName; - String generalid; - int invoiceNo; - String iPAdress; - bool isDentalAllowedBackend; - int languageID; - String orderDate; - int patientID; - String patientIditificationNum; - String patientMobileNumber; - String patientName; - int patientOutSA; - int patientType; - int patientTypeID; - int projectID; - String projectName; - String radResult; - String sessionID; - String setupID; - String to; - String tokenID; - double versionID; + int? channel; + String? clinicName; + String? dateofBirth; + int? deviceTypeID; + String? doctorName; + String? generalid; + int? invoiceNo; + String? iPAdress; + bool ?isDentalAllowedBackend; + int? languageID; + String? orderDate; + int? patientID; + String? patientIditificationNum; + String? patientMobileNumber; + String? patientName; + int? patientOutSA; + int? patientType; + int? patientTypeID; + int? projectID; + String? projectName; + String? radResult; + String? sessionID; + String? setupID; + String? to; + String? tokenID; + double? versionID; RequestSendRadReportEmail( {this.channel, @@ -54,7 +54,7 @@ class RequestSendRadReportEmail { this.tokenID, this.versionID}); - RequestSendRadReportEmail.fromJson(Map json) { + RequestSendRadReportEmail.fromJson(Map json) { channel = json['Channel']; clinicName = json['ClinicName']; dateofBirth = json['DateofBirth']; @@ -83,8 +83,8 @@ class RequestSendRadReportEmail { versionID = json['VersionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Channel'] = this.channel; data['ClinicName'] = this.clinicName; data['DateofBirth'] = this.dateofBirth; diff --git a/lib/core/model/referral/DischargeReferralPatient.dart b/lib/core/model/referral/DischargeReferralPatient.dart index dff63bfc..d104ccae 100644 --- a/lib/core/model/referral/DischargeReferralPatient.dart +++ b/lib/core/model/referral/DischargeReferralPatient.dart @@ -2,56 +2,56 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class DischargeReferralPatient { dynamic rowID; - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; dynamic doctorNameN; - String firstName; - String middleName; - String lastName; + String? firstName; + String? middleName; + String? lastName; dynamic firstNameN; dynamic middleNameN; dynamic lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; dynamic nursingStationID; dynamic description; - String nationalityName; + String? nationalityName; dynamic nationalityNameN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - DateTime referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - String mAXResponseTime; - String dischargeDate; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + DateTime ?referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + String? mAXResponseTime; + String? dischargeDate; dynamic clinicID; - String age; - String clinicDescription; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; + String? age; + String? clinicDescription; + String? frequencyDescription; + String? genderDescription; + bool?isDoctorLate; + bool? isDoctorResponse; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referringDoctorName; DischargeReferralPatient( {this.rowID, @@ -106,7 +106,7 @@ class DischargeReferralPatient { this.referringClinicDescription, this.referringDoctorName}); - DischargeReferralPatient.fromJson(Map json) { + DischargeReferralPatient.fromJson(Map json) { rowID = json['RowID']; projectID = json['ProjectID']; lineItemNo = json['LineItemNo']; @@ -160,8 +160,8 @@ class DischargeReferralPatient { referringDoctorName = json['ReferringDoctorName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RowID'] = this.rowID; data['ProjectID'] = this.projectID; data['LineItemNo'] = this.lineItemNo; diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index 4f00f455..094c0701 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -2,140 +2,149 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class MyReferralPatientModel { dynamic rowID; - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; dynamic doctorNameN; - String firstName; - String middleName; - String lastName; + String? firstName; + String? middleName; + String? lastName; dynamic firstNameN; dynamic middleNameN; dynamic lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; dynamic nursingStationID; dynamic description; - String nationalityName; + String? nationalityName; dynamic nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - DateTime referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - String mAXResponseTime; - int episodeID; - int appointmentNo; - String appointmentDate; - int appointmentType; - int patientMRN; - String createdOn; - int clinicID; - String nationalityID; - String age; - String doctorImageURL; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nationalityFlagURL; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; - int referalStatus; - String sourceSetupID; - int sourceProjectId; - String targetSetupID; - int targetProjectId; - int targetClinicID; - int targetDoctorID; - int sourceAppointmentNo; - int targetAppointmentNo; - String remarksFromSource; + String? clinicDescription; + String? clinicDescriptionN; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + DateTime? referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + String? mAXResponseTime; + int? episodeID; + int? appointmentNo; + String? appointmentDate; + int? appointmentType; + int? patientMRN; + String? createdOn; + int? clinicID; + String? nationalityID; + String? age; + String? doctorImageURL; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nationalityFlagURL; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referringDoctorName; + int? referalStatus; + String? sourceSetupID; + int? sourceProjectId; + String? targetSetupID; + int? targetProjectId; + int? targetClinicID; + int? targetDoctorID; + int? sourceAppointmentNo; + int? targetAppointmentNo; + String? remarksFromSource; MyReferralPatientModel( {this.rowID, - this.projectID, - this.lineItemNo, - this.doctorID, - this.patientID, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomID, - this.bedID, - this.nursingStationID, - this.description, - this.nationalityName, - this.nationalityNameN, - this.clinicDescription, - this.clinicDescriptionN, - this.referralDoctor, - this.referringDoctor, - this.referralClinic, - this.referringClinic, - this.referralStatus, - this.referralDate, - this.referringDoctorRemarks, - this.referredDoctorRemarks, - this.referralResponseOn, - this.priority, - this.frequency, - this.mAXResponseTime, - this.episodeID, - this.appointmentNo, - this.appointmentDate, - this.appointmentType, - this.patientMRN, - this.createdOn, - this.clinicID, - this.nationalityID, - this.age, - this.doctorImageURL, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nationalityFlagURL, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName, - this.referalStatus, this.sourceSetupID, this.sourceAppointmentNo, this.sourceProjectId, this.targetProjectId, this.targetAppointmentNo, this.targetClinicID, this.targetSetupID, this.targetDoctorID, this.remarksFromSource}); + this.projectID, + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.episodeID, + this.appointmentNo, + this.appointmentDate, + this.appointmentType, + this.patientMRN, + this.createdOn, + this.clinicID, + this.nationalityID, + this.age, + this.doctorImageURL, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nationalityFlagURL, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName, + this.referalStatus, + this.sourceSetupID, + this.sourceAppointmentNo, + this.sourceProjectId, + this.targetProjectId, + this.targetAppointmentNo, + this.targetClinicID, + this.targetSetupID, + this.targetDoctorID, + this.remarksFromSource}); - MyReferralPatientModel.fromJson(Map json) { + MyReferralPatientModel.fromJson(Map json) { rowID = json['RowID']; referalStatus = json['ReferalStatus']; projectID = json['ProjectID']; @@ -172,10 +181,10 @@ class MyReferralPatientModel { referringClinic = json['ReferringClinic']; referralStatus = json["ReferralStatus"] is String ? json['ReferralStatus'] == "Accepted" - ? 46 - : json['ReferralStatus'] == "Pending" - ? 1 - : 0 + ? 46 + : json['ReferralStatus'] == "Pending" + ? 1 + : 0 : json["ReferralStatus"]; try { referralDate = AppDateUtils.getDateTimeFromString(json['ReferralDate']); @@ -219,11 +228,10 @@ class MyReferralPatientModel { sourceAppointmentNo = json['SourceAppointmentNo']; targetAppointmentNo = json['TargetAppointmentNo']; remarksFromSource = json['RemarksFromSource']; - } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RowID'] = this.rowID; data['ReferalStatus'] = this.referalStatus; data['ProjectID'] = this.projectID; @@ -298,6 +306,6 @@ class MyReferralPatientModel { } get patientName { - return this.firstName + " " + this.lastName; + return this.firstName! + " " + this.lastName!; } } diff --git a/lib/core/model/referral/MyReferralPatientRequestModel.dart b/lib/core/model/referral/MyReferralPatientRequestModel.dart index 08b98a99..885653a1 100644 --- a/lib/core/model/referral/MyReferralPatientRequestModel.dart +++ b/lib/core/model/referral/MyReferralPatientRequestModel.dart @@ -1,27 +1,27 @@ class MyReferralPatientRequestModel { - int channel; - int clinicID; - int doctorID; - int editedBy; - String firstName; - String from; - String iPAdress; - bool isLoginForDoctorApp; - int languageID; - String lastName; - String middleName; - int patientID; - String patientIdentificationID; - String patientMobileNumber; - bool patientOutSA; - int patientTypeID; - int projectID; - String sessionID; - String stamp; - String to; - String tokenID; - double versionID; - String vidaAuthTokenID; + int? channel; + int? clinicID; + int? doctorID; + int? editedBy; + String? firstName; + String? from; + String? iPAdress; + bool? isLoginForDoctorApp; + int? languageID; + String? lastName; + String? middleName; + int? patientID; + String? patientIdentificationID; + String? patientMobileNumber; + bool? patientOutSA; + int? patientTypeID; + int? projectID; + String? sessionID; + String? stamp; + String? to; + String? tokenID; + double? versionID; + String? vidaAuthTokenID; MyReferralPatientRequestModel( {this.channel, diff --git a/lib/core/model/referral/ReferralRequest.dart b/lib/core/model/referral/ReferralRequest.dart index b3ad1f03..e88b0e9b 100644 --- a/lib/core/model/referral/ReferralRequest.dart +++ b/lib/core/model/referral/ReferralRequest.dart @@ -1,28 +1,28 @@ class ReferralRequest { - String roomID; - String referralClinic; - String referralDoctor; - int createdBy; - int editedBy; - int patientID; - int patientTypeID; - int referringClinic; - int referringDoctor; - int projectID; - int admissionNo; - String referringDoctorRemarks; - String priority; - String frequency; - String extension; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + String? roomID; + String? referralClinic; + String? referralDoctor; + int? createdBy; + int? editedBy; + int? patientID; + int? patientTypeID; + int? referringClinic; + int? referringDoctor; + int? projectID; + int? admissionNo; + String? referringDoctorRemarks; + String? priority; + String? frequency; + String? extension; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; ReferralRequest( {this.roomID, diff --git a/lib/core/model/referral/add_referred_remarks_request.dart b/lib/core/model/referral/add_referred_remarks_request.dart index 14089513..5b7edbc6 100644 --- a/lib/core/model/referral/add_referred_remarks_request.dart +++ b/lib/core/model/referral/add_referred_remarks_request.dart @@ -1,19 +1,19 @@ class AddReferredRemarksRequestModel { - int projectID; - int admissionNo; - int lineItemNo; - String referredDoctorRemarks; - int editedBy; - int referalStatus; - bool isLoginForDoctorApp; - String iPAdress; - bool patientOutSA; - String tokenID; - int languageID; - double versionID; - int channel; - String sessionID; - int deviceTypeID; + int? projectID; + int? admissionNo; + int? lineItemNo; + String? referredDoctorRemarks; + int? editedBy; + int? referalStatus; + bool? isLoginForDoctorApp; + String? iPAdress; + bool? patientOutSA; + String? tokenID; + int? languageID; + double? versionID; + int? channel; + String? sessionID; + int? deviceTypeID; AddReferredRemarksRequestModel( {this.projectID, diff --git a/lib/core/model/search_drug/get_medication_response_model.dart b/lib/core/model/search_drug/get_medication_response_model.dart index a42a8b47..24079b5e 100644 --- a/lib/core/model/search_drug/get_medication_response_model.dart +++ b/lib/core/model/search_drug/get_medication_response_model.dart @@ -1,13 +1,13 @@ class GetMedicationResponseModel { - String description; - String genericName; - int itemId; - String keywords; + String? description; + String? genericName; + int ?itemId; + String? keywords; dynamic price; dynamic quantity; dynamic mediSpanGPICode; - bool isNarcotic; - String uom; + bool ?isNarcotic; + String? uom; GetMedicationResponseModel( {this.description, this.genericName, @@ -19,7 +19,7 @@ class GetMedicationResponseModel { this.uom, this.mediSpanGPICode}); - GetMedicationResponseModel.fromJson(Map json) { + GetMedicationResponseModel.fromJson(Map json) { description = json['Description']; genericName = json['GenericName']; itemId = json['ItemId']; @@ -31,8 +31,8 @@ class GetMedicationResponseModel { uom = json['uom']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Description'] = this.description; data['GenericName'] = this.genericName; data['ItemId'] = this.itemId; diff --git a/lib/core/model/search_drug/item_by_medicine_model.dart b/lib/core/model/search_drug/item_by_medicine_model.dart index 0a93a4f1..a95988db 100644 --- a/lib/core/model/search_drug/item_by_medicine_model.dart +++ b/lib/core/model/search_drug/item_by_medicine_model.dart @@ -1,27 +1,27 @@ class ItemByMedicineModel { - List frequencies; - List routes; - List strengths; + List? frequencies; + List ?routes; + List? strengths; ItemByMedicineModel({this.frequencies, this.routes, this.strengths}); ItemByMedicineModel.fromJson(Map json) { if (json['frequencies'] != null) { - frequencies = new List(); + frequencies = []; json['frequencies'].forEach((v) { - frequencies.add(new Frequencies.fromJson(v)); + frequencies!.add(new Frequencies.fromJson(v)); }); } if (json['routes'] != null) { - routes = new List(); + routes = []; json['routes'].forEach((v) { - routes.add(new Routes.fromJson(v)); + routes!.add(new Routes.fromJson(v)); }); } if (json['strengths'] != null) { - strengths = new List(); + strengths = []; json['strengths'].forEach((v) { - strengths.add(new Strengths.fromJson(v)); + strengths!.add(new Strengths.fromJson(v)); }); } } @@ -29,22 +29,22 @@ class ItemByMedicineModel { Map toJson() { final Map data = new Map(); if (this.frequencies != null) { - data['frequencies'] = this.frequencies.map((v) => v.toJson()).toList(); + data['frequencies'] = this.frequencies!.map((v) => v.toJson()).toList(); } if (this.routes != null) { - data['routes'] = this.routes.map((v) => v.toJson()).toList(); + data['routes'] = this.routes!.map((v) => v.toJson()).toList(); } if (this.strengths != null) { - data['strengths'] = this.strengths.map((v) => v.toJson()).toList(); + data['strengths'] = this.strengths!.map((v) => v.toJson()).toList(); } return data; } } class Frequencies { - String description; - bool isDefault; - int parameterCode; + String? description; + bool? isDefault; + int ?parameterCode; Frequencies({this.description, this.isDefault, this.parameterCode}); @@ -64,9 +64,9 @@ class Frequencies { } class Strengths { - String description; - bool isDefault; - int parameterCode; + String? description; + bool ?isDefault; + int ?parameterCode; Strengths({this.description, this.isDefault, this.parameterCode}); @@ -86,9 +86,9 @@ class Strengths { } class Routes { - String description; - bool isDefault; - int parameterCode; + String ?description; + bool ?isDefault; + int ?parameterCode; Routes({this.description, this.isDefault, this.parameterCode}); diff --git a/lib/core/model/search_drug/item_by_medicine_request_model.dart b/lib/core/model/search_drug/item_by_medicine_request_model.dart index 7460044b..7ec3e21e 100644 --- a/lib/core/model/search_drug/item_by_medicine_request_model.dart +++ b/lib/core/model/search_drug/item_by_medicine_request_model.dart @@ -1,6 +1,6 @@ class ItemByMedicineRequestModel { - String vidaAuthTokenID; - int medicineCode; + String ?vidaAuthTokenID; + int ?medicineCode; ItemByMedicineRequestModel({this.vidaAuthTokenID, this.medicineCode}); diff --git a/lib/core/model/search_drug/search_drug_model.dart b/lib/core/model/search_drug/search_drug_model.dart index 396526c1..aa7739a2 100644 --- a/lib/core/model/search_drug/search_drug_model.dart +++ b/lib/core/model/search_drug/search_drug_model.dart @@ -1,15 +1,15 @@ class SearchDrugModel { - List entityList; - int rowcount; + List? entityList; + int ?rowcount; dynamic statusMessage; SearchDrugModel({this.entityList, this.rowcount, this.statusMessage}); SearchDrugModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -19,7 +19,7 @@ class SearchDrugModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; diff --git a/lib/core/model/search_drug/search_drug_request_model.dart b/lib/core/model/search_drug/search_drug_request_model.dart index b64e7d18..8c725c86 100644 --- a/lib/core/model/search_drug/search_drug_request_model.dart +++ b/lib/core/model/search_drug/search_drug_request_model.dart @@ -1,5 +1,5 @@ class SearchDrugRequestModel { - List search; + List ?search; // String vidaAuthTokenID; SearchDrugRequestModel({this.search}); diff --git a/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart b/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart index 26bb76bd..8087481c 100644 --- a/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart @@ -1,12 +1,16 @@ class GetSickLeaveDoctorRequestModel { - int patientMRN; - String appointmentNo; - int status; - String vidaAuthTokenID; - String vidaRefreshTokenID; + int? patientMRN; + String? appointmentNo; + int? status; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; GetSickLeaveDoctorRequestModel( - {this.patientMRN, this.appointmentNo, this.status, this.vidaAuthTokenID, this.vidaRefreshTokenID}); + {this.patientMRN, + this.appointmentNo, + this.status, + this.vidaAuthTokenID, + this.vidaRefreshTokenID}); GetSickLeaveDoctorRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/core/model/sick_leave/sick_leave_patient_model.dart b/lib/core/model/sick_leave/sick_leave_patient_model.dart index 1e79833c..aed6a216 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_model.dart @@ -21,13 +21,13 @@ class SickLeavePatientModel { dynamic doctorTitle; dynamic gender; dynamic genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; - bool isLiveCareAppointment; + bool? isLiveCareAppointment; dynamic noOfPatientsRate; dynamic patientName; dynamic projectName; diff --git a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart index 69b18f41..ba2a399c 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart @@ -1,17 +1,17 @@ class SickLeavePatientRequestModel { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - int deviceTypeID; - int patientType; - int patientTypeID; - String tokenID; - int patientID; - int patientMRN; - String sessionID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + int? deviceTypeID; + int? patientType; + int? patientTypeID; + String? tokenID; + int? patientID; + int? patientMRN; + String? sessionID; SickLeavePatientRequestModel( {this.versionID, diff --git a/lib/core/service/AnalyticsService.dart b/lib/core/service/AnalyticsService.dart index 8f74debb..b73a4217 100644 --- a/lib/core/service/AnalyticsService.dart +++ b/lib/core/service/AnalyticsService.dart @@ -6,7 +6,7 @@ class AnalyticsService { FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: _analytics); - Future logEvent({@required String eventCategory, @required String eventAction}) async { + Future logEvent({required String eventCategory, required String eventAction}) async { await _analytics.logEvent(name: 'event', parameters: { "eventCategory": eventCategory, "eventAction": eventAction, diff --git a/lib/core/service/NavigationService.dart b/lib/core/service/NavigationService.dart index 5690c01e..182adb6c 100644 --- a/lib/core/service/NavigationService.dart +++ b/lib/core/service/NavigationService.dart @@ -3,24 +3,24 @@ import 'package:flutter/material.dart'; class NavigationService { final GlobalKey navigatorKey = new GlobalKey(); - Future navigateTo(String routeName,{Object arguments}) { - return navigatorKey.currentState.pushNamed(routeName,arguments: arguments); + Future navigateTo(String routeName,{required Object arguments}) { + return navigatorKey.currentState!.pushNamed(routeName,arguments: arguments); } - Future pushReplacementNamed(String routeName,{Object arguments}) { - return navigatorKey.currentState.pushReplacementNamed(routeName,arguments: arguments); + Future pushReplacementNamed(String routeName,{required Object arguments}) { + return navigatorKey.currentState!.pushReplacementNamed(routeName,arguments: arguments); } Future pushNamedAndRemoveUntil(String routeName) { - return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false); + return navigatorKey.currentState!.pushNamedAndRemoveUntil(routeName,(asd)=>false); } Future pushAndRemoveUntil(Route newRoute) { - return navigatorKey.currentState.pushAndRemoveUntil(newRoute,(asd)=>false); + return navigatorKey.currentState!.pushAndRemoveUntil(newRoute,(asd)=>false); } pop() { - return navigatorKey.currentState.pop(); + return navigatorKey.currentState!.pop(); } } \ No newline at end of file diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart index 236bcd42..5f29325a 100644 --- a/lib/core/service/PatientRegistrationService.dart +++ b/lib/core/service/PatientRegistrationService.dart @@ -9,8 +9,8 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; class PatientRegistrationService extends BaseService { - GetPatientInfoResponseModel getPatientInfoResponseModel; - String logInTokenID; + late GetPatientInfoResponseModel getPatientInfoResponseModel; + late String logInTokenID; checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { @@ -39,13 +39,12 @@ class PatientRegistrationService extends BaseService { } sendActivationCodeByOTPNotificationType( - {SendActivationCodeByOTPNotificationTypeForRegistrationModel - registrationModel, - int otpType, - PatientRegistrationViewModel model, - CheckPatientForRegistrationModel + { + required int otpType, + required PatientRegistrationViewModel model, + required CheckPatientForRegistrationModel checkPatientForRegistrationModel}) async { - registrationModel = + SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel( oTPSendType: otpType, patientIdentificationID: checkPatientForRegistrationModel diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 31cc2cd6..ab275456 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -16,17 +16,17 @@ import '../../locator.dart'; import '../../routes.dart'; import 'NavigationService.dart'; -class VideoCallService extends BaseService { - StartCallRes startCallRes; - PatiantInformtion patient; - LiveCarePatientServices _liveCarePatientServices = - locator(); +class VideoCallService extends BaseService{ + + late StartCallRes startCallRes; + late PatiantInformtion patient; + LiveCarePatientServices _liveCarePatientServices = locator(); openVideo(StartCallRes startModel, PatiantInformtion patientModel, bool isRecording,VoidCallback onCallConnected, VoidCallback onCallDisconnected) async { this.startCallRes = startModel; this.patient = patientModel; - DoctorProfileModel doctorProfile = + DoctorProfileModel? doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( // TODO MOSA TEST @@ -36,7 +36,7 @@ class VideoCallService extends BaseService { // kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGUyZjgxMjFlYTFkNzU5NjcxNDY2ZTM2ZjM3YTVhNTI2NGY0NTI2NzpzZXNzaW9uX2lkPTJfTVg0ME56STBOemsxTkg1LU1UWXlOVGN5TmpnMk5qZzNOMzQ1YUhCcGRtcDFXbVpDTDFkNE1qbDRkWFY2TTA4cmIySi1mZyZjcmVhdGVfdGltZT0xNjI1NzI2ODg5Jm5vbmNlPTAuNjc2Nzc4OTQxNjA1MTMxNSZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNjI4MzE4ODg4JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9", // kSessionId: "2_MX40NzI0Nzk1NH5-MTYyNTcyNjg2Njg3N345aHBpdmp1WmZCL1d4Mjl4dXV6M08rb2J-fg", // kApiKey:'47247954', - vcId: patient.vcId, + vcId: patient.vcId!, isRecording: isRecording, patientName: patient.fullName ?? (patient.firstName != null @@ -44,23 +44,23 @@ class VideoCallService extends BaseService { : "-"), tokenID: await sharedPref.getString(TOKEN), generalId: GENERAL_ID, - doctorId: doctorProfile.doctorID, + doctorId: doctorProfile!.doctorID!, onFailure: (String error) { DrAppToastMsg.showErrorToast(error); }, onCallConnected: onCallConnected, onCallDisconnected: onCallDisconnected, onCallEnd: () { - WidgetsBinding.instance.addPostFrameCallback((_) async { + WidgetsBinding.instance!.addPostFrameCallback((_) async { GifLoaderDialogUtils.showMyDialog( - locator().navigatorKey.currentContext); + locator().navigatorKey.currentContext!); endCall( - patient.vcId, + patient.vcId!, false, ).then((value) { GifLoaderDialogUtils.hideDialog( - locator().navigatorKey.currentContext); + locator().navigatorKey.currentContext!); if (hasError) { DrAppToastMsg.showErrorToast(error); } else @@ -72,15 +72,15 @@ class VideoCallService extends BaseService { }); }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { - WidgetsBinding.instance.addPostFrameCallback((_) { + WidgetsBinding.instance!.addPostFrameCallback((_) { GifLoaderDialogUtils.showMyDialog( - locator().navigatorKey.currentContext); + locator().navigatorKey.currentContext!); endCall( - patient.vcId, + patient.vcId!, sessionStatusModel.sessionStatus == 3, ).then((value) { GifLoaderDialogUtils.hideDialog( - locator().navigatorKey.currentContext); + locator().navigatorKey.currentContext!); if (hasError) { DrAppToastMsg.showErrorToast(error); } else { @@ -98,13 +98,13 @@ class VideoCallService extends BaseService { hasError = false; await getDoctorProfile(isGetProfile: true); EndCallReq endCallReq = new EndCallReq(); - endCallReq.doctorId = doctorProfile.doctorID; + endCallReq.doctorId = doctorProfile!.doctorID; endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; await _liveCarePatientServices.endCall(endCallReq); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; } } } diff --git a/lib/core/service/authentication_service.dart b/lib/core/service/authentication_service.dart index 49e89881..ca8c5715 100644 --- a/lib/core/service/authentication_service.dart +++ b/lib/core/service/authentication_service.dart @@ -49,7 +49,7 @@ class AuthenticationService extends BaseService { }, body: {"IMEI": imei, "TokenID": "@dm!n"}); } catch (error) { hasError = true; - super.error = error; + super.error = error as String; } } @@ -66,9 +66,8 @@ class AuthenticationService extends BaseService { }, body: userInfo.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String; } - } Future sendActivationCodeVerificationScreen(ActivationCodeForVerificationScreenModel activationCodeModel) async { @@ -84,7 +83,7 @@ class AuthenticationService extends BaseService { }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String; } } @@ -102,7 +101,7 @@ class AuthenticationService extends BaseService { }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String; } } @@ -119,7 +118,7 @@ class AuthenticationService extends BaseService { }, body: checkActivationCodeRequestModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String; } } @@ -139,7 +138,7 @@ class AuthenticationService extends BaseService { }, body: insertIMEIDetailsModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String; } } @@ -158,7 +157,7 @@ class AuthenticationService extends BaseService { }, body: profileReqModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String; } } } diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 58526da7..7b1dc4da 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,15 +1,16 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; class BaseService { - String error; + String error =''; bool hasError = false; BaseAppClient baseAppClient = BaseAppClient(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - DoctorProfileModel doctorProfile; + DoctorProfileModel ?doctorProfile; List patientArrivalList = []; @@ -18,24 +19,20 @@ class BaseService { } //TODO add the user login model when we need it - Future getDoctorProfile({bool isGetProfile = false}) async { + Future ? getDoctorProfile({bool isGetProfile = false}) async { if(isGetProfile) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; - } + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile!; } } if (doctorProfile == null) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; - } + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile!; } return null; } else { @@ -43,5 +40,38 @@ class BaseService { } } + Future getPatientArrivalList(String date,{String? fromDate, int patientMrn = -1, int appointmentNo = -1}) async{ + hasError = false; + Map body = Map(); + body['From'] = fromDate == null ? date : fromDate; + body['To'] = date; + body['PageIndex'] = 0; + body['PageSize'] = 0; + if(patientMrn != -1){ + body['PatientMRN'] = patientMrn; + } + if(appointmentNo != -1){ + body['AppointmentNo'] = appointmentNo; + } + + await baseAppClient.post( + ARRIVED_PATIENT_URL, + onSuccess: (dynamic response, int statusCode) { + patientArrivalList.clear(); + + if(response['patientArrivalList']['entityList'] != null){ + response['patientArrivalList']['entityList'].forEach((v) { + PatiantInformtion item = PatiantInformtion.fromJson(v); + patientArrivalList.add(item); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + this.error = error; + }, + body: body, + ); + } } diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index ad3ec887..5516923a 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -9,7 +9,7 @@ class DashboardService extends BaseService { bool hasVirtualClinic = false; - String sServiceID; + String ?sServiceID; Future getDashboard() async { hasError = false; diff --git a/lib/core/service/home/scan_qr_service.dart b/lib/core/service/home/scan_qr_service.dart index b21768f9..a06a8974 100644 --- a/lib/core/service/home/scan_qr_service.dart +++ b/lib/core/service/home/scan_qr_service.dart @@ -4,15 +4,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class ScanQrService extends BaseService { - List myInPatientList = List(); - List inPatientList = List(); + List myInPatientList = []; + List inPatientList = []; Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; await getDoctorProfile(); // if (isMyInpatient) { - // requestModel.doctorID = doctorProfile.doctorID; + // requestModel.doctorID = doctorProfile!.doctorID!; // } else { requestModel.doctorID = 0; //} @@ -26,7 +26,7 @@ class ScanQrService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if (patient.doctorId == doctorProfile.doctorID) { + if (patient.doctorId == doctorProfile!.doctorID!) { myInPatientList.add(patient); } }); diff --git a/lib/core/service/hospitals/hospitals_service.dart b/lib/core/service/hospitals/hospitals_service.dart index f8a7579d..efa24209 100644 --- a/lib/core/service/hospitals/hospitals_service.dart +++ b/lib/core/service/hospitals/hospitals_service.dart @@ -4,8 +4,7 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class HospitalsService extends BaseService { - -List hospitals =List(); + List hospitals = []; Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { hasError = false; diff --git a/lib/core/service/patient/DischargedPatientService.dart b/lib/core/service/patient/DischargedPatientService.dart index 2b353016..6566a57d 100644 --- a/lib/core/service/patient/DischargedPatientService.dart +++ b/lib/core/service/patient/DischargedPatientService.dart @@ -4,15 +4,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class DischargedPatientService extends BaseService { - List myDischargedPatients = List(); + List myDischargedPatients = []; - List myDischargeReferralPatients = List(); + List myDischargeReferralPatients = []; Future getDischargedPatient() async { hasError = false; Map body = Map(); await getDoctorProfile(isGetProfile: true); - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; @@ -28,8 +28,7 @@ class DischargedPatientService extends BaseService { body['PatientTypeID'] = 1; hasError = false; myDischargedPatients.clear(); - await baseAppClient.post(GET_DISCHARGE_PATIENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_DISCHARGE_PATIENT, onSuccess: (dynamic response, int statusCode) { if (response['List_MyDischargePatient'] != null) { response['List_MyDischargePatient'].forEach((v) { myDischargedPatients.add(PatiantInformtion.fromJson(v)); @@ -45,7 +44,7 @@ class DischargedPatientService extends BaseService { hasError = false; Map body = Map(); await getDoctorProfile(isGetProfile: true); - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; @@ -61,8 +60,7 @@ class DischargedPatientService extends BaseService { body['PatientTypeID'] = 1; hasError = false; myDischargeReferralPatients.clear(); - await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, onSuccess: (dynamic response, int statusCode) { if (response['List_MyDischargeReferralPatient'] != null) { response['List_MyDischargeReferralPatient'].forEach((v) { myDischargeReferralPatients.add(DischargeReferralPatient.fromJson(v)); diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index 10af0ea2..3ef3c548 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -30,8 +30,7 @@ class LiveCarePatientServices extends BaseService { var transferToAdminResponse = {}; var isLoginResponse = {}; - StartCallRes _startCallRes; - + late StartCallRes _startCallRes; StartCallRes get startCallRes => _startCallRes; Future getPendingPatientERForDoctorApp( @@ -48,7 +47,7 @@ class LiveCarePatientServices extends BaseService { /// add new items. localPatientList.forEach((element) { - if ((_patientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { + if ((_patientList.singleWhere((it) => it.patientId == element.patientId)) == null) { _patientList.add(element); } }); @@ -56,7 +55,7 @@ class LiveCarePatientServices extends BaseService { /// remove items. List removedPatientList = []; _patientList.forEach((element) { - if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { + if ((localPatientList.singleWhere((it) => it.patientId == element.patientId)) == null) { removedPatientList.add(element); } }); @@ -127,10 +126,10 @@ class LiveCarePatientServices extends BaseService { }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive); } - Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async { + Future isLogin({LiveCareUserLoginRequestModel? isLoginRequestModel, int? loginStatus}) async { hasError = false; await getDoctorProfile(); - isLoginRequestModel.doctorId = super.doctorProfile.doctorID; + isLoginRequestModel!.doctorId = super.doctorProfile!.doctorID!; await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async { isLoginResponse = response; }, onFailure: (String error, int statusCode) { @@ -153,12 +152,12 @@ class LiveCarePatientServices extends BaseService { }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive); } - Future addPatientToDoctorList({int vcID}) async { + Future addPatientToDoctorList({required int vcID}) async { hasError = false; await getDoctorProfile(); AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel(); - addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID; + addPatientToDoctorListRequestModel.doctorId = super.doctorProfile!.doctorID!; addPatientToDoctorListRequestModel.vCID = vcID; addPatientToDoctorListRequestModel.isOutKsa = false; addPatientToDoctorListRequestModel.generalid = GENERAL_ID; @@ -171,11 +170,11 @@ class LiveCarePatientServices extends BaseService { }, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive); } - Future removePatientFromDoctorList({int vcID}) async { + Future removePatientFromDoctorList({required int vcID}) async { hasError = false; AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel(); await getDoctorProfile(); - addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID; + addPatientToDoctorListRequestModel.doctorId = super.doctorProfile!.doctorID!; addPatientToDoctorListRequestModel.vCID = vcID; addPatientToDoctorListRequestModel.isOutKsa = false; addPatientToDoctorListRequestModel.generalid = GENERAL_ID; diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index 35729def..32c7b5dd 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -6,14 +6,14 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; class MyReferralInPatientService extends BaseService { - List myReferralPatients = List(); + List myReferralPatients = []; Future getMyReferralPatientService() async { hasError = false; await getDoctorProfile(); MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( - doctorID: doctorProfile.doctorID, + doctorID: doctorProfile!.doctorID, firstName: "0", middleName: "0", lastName: "0", @@ -48,7 +48,7 @@ class MyReferralInPatientService extends BaseService { await getDoctorProfile(); MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( - doctorID: doctorProfile.doctorID, + doctorID: doctorProfile!.doctorID!, firstName: "0", middleName: "0", lastName: "0", @@ -82,13 +82,13 @@ class MyReferralInPatientService extends BaseService { hasError = false; await getDoctorProfile(); RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); - _requestAddReferredDoctorRemarks.projectID = referral.projectID; + _requestAddReferredDoctorRemarks.projectID = referral.projectID!; _requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString(); - _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; + _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo!; _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; - _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; - _requestAddReferredDoctorRemarks.patientID = referral.patientID; - _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID!; + _requestAddReferredDoctorRemarks.patientID = referral.patientID!; + _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor!; await baseAppClient.post( ADD_REFERRED_DOCTOR_REMARKS, body: _requestAddReferredDoctorRemarks.toJson(), @@ -104,17 +104,17 @@ class MyReferralInPatientService extends BaseService { hasError = false; await getDoctorProfile(); AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = AddReferredRemarksRequestModel( - editedBy: doctorProfile.doctorID, - projectID: doctorProfile.projectID, + editedBy: doctorProfile!.doctorID!, + projectID: doctorProfile!.projectID!, referredDoctorRemarks: referredDoctorRemarks, referalStatus: referralStatus); - _requestAddReferredDoctorRemarks.projectID = referral.projectID; + _requestAddReferredDoctorRemarks.projectID = referral.projectID!; //TODO Check this in case out patient - _requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo); - _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; + _requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo!); + _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo!; _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; - _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID!; _requestAddReferredDoctorRemarks.referalStatus = referralStatus; // _requestAddReferredDoctorRemarks.patientID = referral.patientID; diff --git a/lib/core/service/patient/PatientMuseService.dart b/lib/core/service/patient/PatientMuseService.dart index c34de9e0..d93995de 100644 --- a/lib/core/service/patient/PatientMuseService.dart +++ b/lib/core/service/patient/PatientMuseService.dart @@ -3,9 +3,9 @@ import 'package:doctor_app_flutter/core/model/patient_muse/PatientMuseResultsMod import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class PatientMuseService extends BaseService { - List patientMuseResultsModelList = List(); + List patientMuseResultsModelList = []; - getECGPatient({int patientType, int patientOutSA, int patientID}) async { + getECGPatient({int? patientType, int? patientOutSA, int? patientID}) async { Map body = Map(); body['PatientType'] = patientType == 7 ? 1 : patientType; body['PatientOutSA'] = patientOutSA; diff --git a/lib/core/service/patient/ReferralService.dart b/lib/core/service/patient/ReferralService.dart index 69e2a810..25469dc2 100644 --- a/lib/core/service/patient/ReferralService.dart +++ b/lib/core/service/patient/ReferralService.dart @@ -4,16 +4,16 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ReferralService extends BaseService { Future referralPatient( - {int admissionNo, - String roomID, - int referralClinic, - int referralDoctor, - int patientID, - int patientTypeID, - int priority, - int frequency, - String referringDoctorRemarks, - String extension}) async { + {int? admissionNo, + String? roomID, + int? referralClinic, + int? referralDoctor, + int? patientID, + int? patientTypeID, + int? priority, + int? frequency, + String? referringDoctorRemarks, + String? extension}) async { await getDoctorProfile(); ReferralRequest referralRequest = ReferralRequest(); referralRequest.admissionNo = admissionNo; @@ -25,11 +25,11 @@ class ReferralService extends BaseService { referralRequest.priority = priority.toString(); referralRequest.frequency = frequency.toString(); referralRequest.referringDoctorRemarks = referringDoctorRemarks; - referralRequest.referringClinic = doctorProfile.clinicID; - referralRequest.referringDoctor = doctorProfile.doctorID; + referralRequest.referringClinic = doctorProfile!.clinicID; + referralRequest.referringDoctor = doctorProfile!.doctorID; referralRequest.extension = extension; - referralRequest.editedBy = doctorProfile.doctorID; - referralRequest.createdBy = doctorProfile.doctorID; + referralRequest.editedBy = doctorProfile!.doctorID; + referralRequest.createdBy = doctorProfile!.doctorID; referralRequest.patientOutSA = false; await baseAppClient.post( diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index 5b659631..a7d4159e 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -15,7 +15,7 @@ import '../base/lookup-service.dart'; class PatientReferralService extends LookupService { List projectsList = []; List clinicsList = []; - List doctorsList = List(); + List doctorsList = []; List listMyReferredPatientModel = []; List pendingReferralList = []; List patientReferralList = []; @@ -57,8 +57,7 @@ class PatientReferralService extends LookupService { Map body = Map(); body['isSameBranch'] = false; - await baseAppClient.post(GET_REFERRAL_FACILITIES, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_REFERRAL_FACILITIES, onSuccess: (response, statusCode) async { projectsList = response['ProjectInfo']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -85,8 +84,7 @@ class PatientReferralService extends LookupService { Future getClinicsList(int projectId) async { hasError = false; - ClinicByProjectIdRequest _clinicByProjectIdRequest = - ClinicByProjectIdRequest(); + ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); _clinicByProjectIdRequest.projectID = projectId; await baseAppClient.post( @@ -104,11 +102,9 @@ class PatientReferralService extends LookupService { ); } - Future getDoctorsList( - PatiantInformtion patient, int clinicId, int branchId) async { + Future getDoctorsList(PatiantInformtion patient, int clinicId, int branchId) async { hasError = false; - DoctorsByClinicIdRequest _doctorsByClinicIdRequest = - DoctorsByClinicIdRequest(); + DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); _doctorsByClinicIdRequest.projectID = branchId; _doctorsByClinicIdRequest.clinicID = clinicId; @@ -129,9 +125,8 @@ class PatientReferralService extends LookupService { Future getMyReferredPatient() async { hasError = false; - RequestMyReferralPatientModel _requestMyReferralPatient = - RequestMyReferralPatientModel(); - DoctorProfileModel doctorProfile = await getDoctorProfile(); + RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); await baseAppClient.post( GET_MY_REFERRED_PATIENT, @@ -141,8 +136,7 @@ class PatientReferralService extends LookupService { response['List_MyReferredPatient'].forEach((v) { MyReferredPatientModel item = MyReferredPatientModel.fromJson(v); if (doctorProfile != null) { - item.isReferralDoctorSameBranch = - doctorProfile.projectID == item.projectID; + item.isReferralDoctorSameBranch = doctorProfile.projectID == item.projectID; } else { item.isReferralDoctorSameBranch = false; } @@ -162,7 +156,7 @@ class PatientReferralService extends LookupService { hasError = false; RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); await baseAppClient.post( GET_MY_REFERRED_OUT_PATIENT, @@ -190,10 +184,10 @@ class PatientReferralService extends LookupService { Future getPendingReferralList() async { hasError = false; - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); Map body = Map(); // body['ClinicID'] = 0; - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; await baseAppClient.post( GET_PENDING_REFERRAL_PATIENT, @@ -202,8 +196,7 @@ class PatientReferralService extends LookupService { response['PendingReferralList'].forEach((v) { PendingReferral item = PendingReferral.fromJson(v); - item.isReferralDoctorSameBranch = - item.targetProjectId == item.sourceProjectId; + item.isReferralDoctorSameBranch = item.targetProjectId == item.sourceProjectId; pendingReferralList.add(item); }); }, @@ -228,8 +221,7 @@ class PatientReferralService extends LookupService { response['ReferralList']['entityList'].forEach((v) { PendingReferral item = PendingReferral.fromJson(v); - item.isReferralDoctorSameBranch = - item.targetProjectId == item.sourceProjectId; + item.isReferralDoctorSameBranch = item.targetProjectId == item.sourceProjectId; patientReferralList.add(item); }); }, @@ -242,10 +234,9 @@ class PatientReferralService extends LookupService { ); } - Future responseReferral( - MyReferralPatientModel referralPatient, bool isAccepted) async { + Future responseReferral(MyReferralPatientModel referralPatient, bool isAccepted) async { hasError = false; - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); Map body = Map(); body['PatientMRN'] = referralPatient.patientID; @@ -255,7 +246,7 @@ class PatientReferralService extends LookupService { body['IsAccepted'] = isAccepted; body['PatientName'] = referralPatient.patientName; body['ReferralResponse'] = referralPatient.remarksFromSource; - body['DoctorName'] = doctorProfile.doctorName; + body['DoctorName'] = doctorProfile!.doctorName; await baseAppClient.post( RESPONSE_PENDING_REFERRAL_PATIENT, @@ -327,8 +318,7 @@ class PatientReferralService extends LookupService { ); } - Future verifyReferralDoctorRemarks( - MyReferredPatientModel referredPatient) async { + Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async { hasError = false; Map body = Map(); diff --git a/lib/core/service/patient/patientInPatientService.dart b/lib/core/service/patient/patientInPatientService.dart index bc7f1283..32b27ae1 100644 --- a/lib/core/service/patient/patientInPatientService.dart +++ b/lib/core/service/patient/patientInPatientService.dart @@ -4,16 +4,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class PatientInPatientService extends BaseService { - List inPatientList = List(); - List myInPatientList = List(); + List inPatientList = []; + List myInPatientList = []; - Future getInPatientList( - PatientSearchRequestModel requestModel, bool isMyInpatient) async { + Future getInPatientList(PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; await getDoctorProfile(isGetProfile: true); if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; + requestModel.doctorID = doctorProfile!.doctorID; } else { requestModel.doctorID = 0; } @@ -27,7 +26,7 @@ class PatientInPatientService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if(patient.doctorId == doctorProfile.doctorID){ + if (patient.doctorId == doctorProfile!.doctorID) { myInPatientList.add(patient); } }); diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index f79e342c..25873e5e 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -30,8 +30,8 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_mode class PatientService extends BaseService { List _patientVitalSignList = []; List patientVitalSignOrderdSubList = []; - List inPatientList = List(); - List myInPatientList = List(); + List inPatientList = []; + List myInPatientList = []; List get patientVitalSignList => _patientVitalSignList; @@ -99,7 +99,7 @@ class PatientService extends BaseService { DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); STPReferralFrequencyRequest _referralFrequencyRequest = STPReferralFrequencyRequest(); ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); - ReferToDoctorRequest _referToDoctorRequest; + ReferToDoctorRequest? _referToDoctorRequest; Future getPatientList(patient, patientType, {isView}) async { hasError = false; @@ -157,7 +157,7 @@ class PatientService extends BaseService { await getDoctorProfile(); if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; + requestModel.doctorID = doctorProfile!.doctorID!; } else { requestModel.doctorID = 0; } @@ -171,7 +171,7 @@ class PatientService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if (patient.doctorId == doctorProfile.doctorID) { + if (patient.doctorId == doctorProfile!.doctorID!) { myInPatientList.add(patient); } }); @@ -420,39 +420,39 @@ class PatientService extends BaseService { // TODO send the total model insted of each parameter Future referToDoctor( - {String selectedDoctorID, - String selectedClinicID, - int admissionNo, - String extension, - String priority, - String frequency, - String referringDoctorRemarks, - int patientID, - int patientTypeID, - String roomID, - int projectID}) async { + {String? selectedDoctorID, + String? selectedClinicID, + int? admissionNo, + String? extension, + String? priority, + String? frequency, + String? referringDoctorRemarks, + int? patientID, + int? patientTypeID, + String? roomID, + int? projectID}) async { hasError = false; // TODO Change it to use it when we implement authentication user - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - int doctorID = doctorProfile.doctorID; - int clinicId = doctorProfile.clinicID; + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel? doctorProfile = new DoctorProfileModel.fromJson(profile); + int? doctorID = doctorProfile.doctorID; + int? clinicId = doctorProfile.clinicID; _referToDoctorRequest = ReferToDoctorRequest( - projectID: projectID, - admissionNo: admissionNo, - roomID: roomID, + projectID: projectID!, + admissionNo: admissionNo!, + roomID: roomID!, referralClinic: selectedClinicID.toString(), referralDoctor: selectedDoctorID.toString(), - createdBy: doctorID, + createdBy: doctorID!, editedBy: doctorID, - patientID: patientID, - patientTypeID: patientTypeID, - referringClinic: clinicId, + patientID: patientID!, + patientTypeID: patientTypeID!, + referringClinic: clinicId!, referringDoctor: doctorID, - referringDoctorRemarks: referringDoctorRemarks, - priority: priority, - frequency: frequency, - extension: extension, + referringDoctorRemarks: referringDoctorRemarks!, + priority: priority!, + frequency: frequency!, + extension: extension!, ); await baseAppClient.post( PATIENT_PROGRESS_NOTE_URL, @@ -461,7 +461,7 @@ class PatientService extends BaseService { hasError = true; super.error = error; }, - body: _referToDoctorRequest.toJson(), + body: _referToDoctorRequest!.toJson(), ); } diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart index a92ef0eb..782e220f 100644 --- a/lib/core/service/patient/profile/discharge_summary_servive.dart +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -18,7 +18,8 @@ class DischargeSummaryService extends BaseService { _allDischargeSummaryList; Future getPendingDischargeSummary( - {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { + {required GetDischargeSummaryReqModel + getDischargeSummaryReqModel}) async { hasError = false; await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY, onSuccess: (dynamic response, int statusCode) { @@ -36,7 +37,7 @@ class DischargeSummaryService extends BaseService { } Future getAllDischargeSummary( - {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { + {GetDischargeSummaryReqModel? getDischargeSummaryReqModel}) async { hasError = false; await baseAppClient.post(GET_ALL_DISCHARGE_SUMMARY, onSuccess: (dynamic response, int statusCode) { @@ -49,6 +50,6 @@ class DischargeSummaryService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: getDischargeSummaryReqModel.toJson()); + }, body: getDischargeSummaryReqModel!.toJson()); } } diff --git a/lib/core/service/patient/profile/operation_report_servive.dart b/lib/core/service/patient/profile/operation_report_servive.dart index 7ac4ade7..3a39a4b8 100644 --- a/lib/core/service/patient/profile/operation_report_servive.dart +++ b/lib/core/service/patient/profile/operation_report_servive.dart @@ -11,12 +11,11 @@ class OperationReportService extends BaseService { List get reservationList => _reservationList; List _operationDetailsList = []; - List get operationDetailsList => _operationDetailsList; + List get operationDetailsList => + _operationDetailsList; - Future getReservations( - {GetReservationsRequestModel getReservationsRequestModel, - int patientId}) async { - getReservationsRequestModel = + Future getReservations({required int patientId}) async { + GetReservationsRequestModel getReservationsRequestModel = GetReservationsRequestModel(patientID: patientId, doctorID: ""); hasError = false; @@ -35,10 +34,9 @@ class OperationReportService extends BaseService { }, body: getReservationsRequestModel.toJson()); } - Future getOperationReportDetails( - {GetOperationDetailsRequestModel getOperationReportRequestModel, - }) async { - + Future getOperationReportDetails({ + required GetOperationDetailsRequestModel getOperationReportRequestModel, + }) async { hasError = false; await baseAppClient.post(GET_OPERATION_DETAILS, onSuccess: (dynamic response, int statusCode) { @@ -46,7 +44,8 @@ class OperationReportService extends BaseService { _operationDetailsList.clear(); response['List_OperationDetails'].forEach( (v) { - _operationDetailsList.add(GetOperationDetailsResponseModel.fromJson(v)); + _operationDetailsList + .add(GetOperationDetailsResponseModel.fromJson(v)); }, ); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart index 2bb9dac7..69b87e4f 100644 --- a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart +++ b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart @@ -16,17 +16,16 @@ class InsuranceCardService extends BaseService { _insuranceApprovalInPatientRequestModel = InsuranceApprovalInPatientRequestModel(); - List _insuranceApproval = List(); + List _insuranceApproval = []; List get insuranceApproval => _insuranceApproval; - List _insuranceApprovalInPatient = List(); + List _insuranceApprovalInPatient = []; List get insuranceApprovalInPatient => _insuranceApprovalInPatient; - Future getInsuranceApprovalInPatient({int mrn}) async { - _insuranceApprovalInPatientRequestModel = - InsuranceApprovalInPatientRequestModel( - patientID: mrn, + Future getInsuranceApprovalInPatient({int? mrn}) async { + _insuranceApprovalInPatientRequestModel = InsuranceApprovalInPatientRequestModel( + patientID: mrn!, patientTypeID: 1, ); hasError = false; @@ -45,8 +44,7 @@ class InsuranceCardService extends BaseService { }, body: _insuranceApprovalInPatientRequestModel.toJson()); } - Future getInsuranceApproval(PatiantInformtion patient, - {int appointmentNo, int projectId}) async { + Future getInsuranceApproval(PatiantInformtion patient, {int? appointmentNo, int? projectId}) async { hasError = false; // _cardList.clear(); // if (appointmentNo != null) { diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index 0a10eb31..84861d5b 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -13,8 +13,8 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import '../../base/base_service.dart'; class LabsService extends BaseService { - List patientLabOrdersList = List(); - List _allSpecialLab = List(); + List patientLabOrdersList = []; + List _allSpecialLab = []; List get allSpecialLab => _allSpecialLab; AllSpecialLabResultRequestModel _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel(); @@ -25,7 +25,7 @@ class LabsService extends BaseService { String url = ""; if (isInpatient) { await getDoctorProfile(); - body['ProjectID'] = doctorProfile.projectID; + body['ProjectID'] = doctorProfile!.projectID; url = GET_PATIENT_LAB_OREDERS; } else { body['isDentalAllowedBackend'] = false; @@ -53,17 +53,17 @@ class LabsService extends BaseService { RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult(); - List patientLabSpecialResult = List(); - List labResultList = List(); - List labOrdersResultsList = List(); - List labOrdersResultHistoryList = List(); + List patientLabSpecialResult = []; + List labResultList = []; + List labOrdersResultsList = []; + List labOrdersResultHistoryList = []; Future getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo, - PatiantInformtion patient, + {String? projectID, + int? clinicID, + String? invoiceNo, + String? orderNo, + PatiantInformtion? patient, bool isInpatient = false}) async { hasError = false; @@ -74,7 +74,7 @@ class LabsService extends BaseService { _requestPatientLabSpecialResult.orderNo = orderNo; body = _requestPatientLabSpecialResult.toJson(); - await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient, + await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient!, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); @@ -87,25 +87,25 @@ class LabsService extends BaseService { }, body: body); } - Future getPatientLabResult({PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { + Future getPatientLabResult({PatientLabOrders? patientLabOrder, PatiantInformtion? patient, bool? isInpatient}) async { hasError = false; String url = ""; - if (isInpatient) { + if (isInpatient!) { url = GET_PATIENT_LAB_RESULTS; } else { url = GET_Patient_LAB_RESULT; } Map body = Map(); - body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['InvoiceNo'] = patientLabOrder!.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID ?? 0; - await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient!, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult = []; labResultList = []; @@ -128,7 +128,7 @@ class LabsService extends BaseService { } Future getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { + {PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -140,7 +140,7 @@ class LabsService extends BaseService { } body['isDentalAllowedBackend'] = false; body['Procedure'] = procedure; - await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, patient: patient, + await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, patient: patient!, onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { @@ -154,7 +154,7 @@ class LabsService extends BaseService { RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); - Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { + Future sendLabReportEmail({PatientLabOrders? patientLabOrder}) async { // _requestSendLabReportEmail.projectID = patientLabOrder.projectID; // _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; // _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; @@ -179,7 +179,7 @@ class LabsService extends BaseService { } Future getPatientLabOrdersResultHistoryByDescription( - {PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async { + {required PatientLabOrders patientLabOrder, required String procedureDescription, required PatiantInformtion patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -201,7 +201,7 @@ class LabsService extends BaseService { }, body: body); } - Future getAllSpecialLabResult({int mrn}) async { + Future getAllSpecialLabResult({required int mrn}) async { _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel( patientID: mrn, patientType: 1, diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index dfb9c3ae..01b48d0f 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -13,10 +13,11 @@ class PatientMedicalReportService extends BaseService { Map body = Map(); await getDoctorProfile(); body['AdmissionNo'] = patient.admissionNo; - body['SetupID'] = doctorProfile.setupID; - body['ProjectID'] = doctorProfile.projectID; + body['SetupID'] = doctorProfile!.setupID; + body['ProjectID'] = doctorProfile!.projectID; medicalReportList = []; await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) { + if (response['DAPP_ListMedicalReportList'] != null) { response['DAPP_ListMedicalReportList'].forEach((v) { medicalReportList.add(MedicalReportModel.fromJson(v)); @@ -93,7 +94,7 @@ class PatientMedicalReportService extends BaseService { ? body['SetupID'] : SETUP_ID : SETUP_ID; - body['AdmissionNo'] = int.parse(patient.admissionNo); + body['AdmissionNo'] = int.parse(patient.admissionNo!); body['MedicalReportHTML'] = htmlText; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; diff --git a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart index 42cdafc6..3f8bdf82 100644 --- a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart +++ b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/medical_report/medical_file_reques import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class MedicalFileService extends BaseService { - List _medicalFileList = List(); + List _medicalFileList = []; List get medicalFileList => _medicalFileList; MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel( @@ -13,7 +13,7 @@ class MedicalFileService extends BaseService { "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU", ); - Future getMedicalFile({int mrn}) async { + Future getMedicalFile({int? mrn}) async { _fileRequestModel = MedicalFileRequestModel(patientMRN: mrn); _fileRequestModel.iPAdress = "9.9.9.9"; hasError = false; diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index ffbcae9b..d590cd59 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -16,9 +16,9 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionService extends LookupService { - List _prescriptionList = List(); + List _prescriptionList = []; List get prescriptionList => _prescriptionList; - List _drugsList = List(); + List _drugsList = []; List get drugsList => _drugsList; List doctorsList = []; List allMedicationList = []; @@ -44,9 +44,8 @@ class PrescriptionService extends LookupService { PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel(); - Future getItem({int itemID}) async { - _itemByMedicineRequestModel = - ItemByMedicineRequestModel(medicineCode: itemID); + Future getItem({int? itemID}) async { + _itemByMedicineRequestModel = ItemByMedicineRequestModel(medicineCode: itemID); hasError = false; @@ -78,7 +77,7 @@ class PrescriptionService extends LookupService { }, body: getAssessmentReqModel.toJson()); } - Future getPrescription({int mrn}) async { + Future getPrescription({int? mrn}) async { _prescriptionReqModel = PrescriptionReqModel( patientMRN: mrn, ); @@ -94,8 +93,8 @@ class PrescriptionService extends LookupService { }, body: _prescriptionReqModel.toJson()); } - Future getDrugs({String drugName}) async { - _drugRequestModel = SearchDrugRequestModel(search: [drugName]); + Future getDrugs({String? drugName}) async { + _drugRequestModel = SearchDrugRequestModel(search: [drugName!]); hasError = false; @@ -219,7 +218,7 @@ class PrescriptionService extends LookupService { "objPatientInfo": { "Gender": patient.gender == 1 ? 'Male' : 'Female', "Age": AppDateUtils.convertDateFromServerFormat( - patient.dateofBirth, 'dd/MM/yyyy') + patient.dateofBirth!, 'dd/MM/yyyy') }, "objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg}, "objPrescriptionItems": prescription, @@ -242,13 +241,9 @@ class PrescriptionService extends LookupService { }, body: request); } - Future calculateBoxQuantity( - {int freq, int duration, int itemCode, double strength}) async { - _boxQuantityRequestModel = CalculateBoxQuantityRequestModel( - frequency: freq, - duration: duration, - itemCode: itemCode, - strength: strength); + Future calculateBoxQuantity({int? freq, int? duration, int? itemCode, double? strength}) async { + _boxQuantityRequestModel = + CalculateBoxQuantityRequestModel(frequency: freq, duration: duration, itemCode: itemCode, strength: strength); hasError = false; diff --git a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart index 06de5a74..dd49cd43 100644 --- a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart @@ -17,16 +17,16 @@ import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; class PrescriptionsService extends BaseService { - List prescriptionsList = List(); - List medicationForInPatient = List(); - List prescriptionsOrderList = List(); - List prescriptionInPatientList = List(); + List prescriptionsList = []; + List medicationForInPatient = []; + List prescriptionsOrderList = []; + List prescriptionInPatientList = []; InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel(); GetMedicationForInPatientRequestModel _getMedicationForInPatientRequestModel = GetMedicationForInPatientRequestModel(); - Future getPrescriptionInPatient({int mrn, String adn}) async { + Future getPrescriptionInPatient({int? mrn, String? adn}) async { _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel( patientMRN: mrn, admissionNo: adn, @@ -62,11 +62,11 @@ class PrescriptionsService extends BaseService { RequestPrescriptionReport _requestPrescriptionReport = RequestPrescriptionReport(appointmentNo: 0, isDentalAllowedBackend: false); - List prescriptionReportList = List(); + List prescriptionReportList = []; - Future getPrescriptionReport({Prescriptions prescriptions, @required PatiantInformtion patient}) async { + Future getPrescriptionReport({Prescriptions? prescriptions, @required PatiantInformtion? patient}) async { hasError = false; - _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; + _requestPrescriptionReport.dischargeNo = prescriptions!.dischargeNo; _requestPrescriptionReport.projectID = prescriptions.projectID; _requestPrescriptionReport.clinicID = prescriptions.clinicID; _requestPrescriptionReport.setupID = prescriptions.setupID; @@ -74,11 +74,11 @@ class PrescriptionsService extends BaseService { _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; await baseAppClient.postPatient( - prescriptions.isInOutPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, onSuccess: (dynamic response, int statusCode) { + prescriptions.isInOutPatient! ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, + patient: patient!, onSuccess: (dynamic response, int statusCode) { prescriptionReportList.clear(); prescriptionReportEnhList.clear(); - if (prescriptions.isInOutPatient) { + if (prescriptions.isInOutPatient!) { response['ListPRM'].forEach((prescriptions) { prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); @@ -100,12 +100,12 @@ class PrescriptionsService extends BaseService { longitude: 0, isDentalAllowedBackend: false, ); - List pharmacyPrescriptionsList = List(); + List pharmacyPrescriptionsList = []; - Future getListPharmacyForPrescriptions({int itemId, @required PatiantInformtion patient}) async { + Future getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { hasError = false; requestGetListPharmacyForPrescriptions.itemID = itemId; - await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient!, onSuccess: (dynamic response, int statusCode) { pharmacyPrescriptionsList.clear(); response['PharmList'].forEach((prescriptions) { pharmacyPrescriptionsList.add(PharmacyPrescriptions.fromJson(prescriptions)); @@ -120,13 +120,13 @@ class PrescriptionsService extends BaseService { isDentalAllowedBackend: false, ); - List prescriptionReportEnhList = List(); + List prescriptionReportEnhList = []; - Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async { + Future getPrescriptionReportEnh({PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { ///This logic copy from the old app from class [order-history.component.ts] in line 45 bool isInPatient = false; prescriptionsList.forEach((element) { - if (prescriptionsOrder.appointmentNo == "0") { + if (prescriptionsOrder!.appointmentNo == "0") { if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; _requestPrescriptionReportEnh.clinicID = element.clinicID; @@ -134,7 +134,7 @@ class PrescriptionsService extends BaseService { _requestPrescriptionReportEnh.episodeID = element.episodeID; _requestPrescriptionReportEnh.setupID = element.setupID; _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; - isInPatient = element.isInOutPatient; + isInPatient = element.isInOutPatient!; } } else { if (int.parse(prescriptionsOrder.appointmentNo) == element.appointmentNo) { @@ -144,7 +144,7 @@ class PrescriptionsService extends BaseService { _requestPrescriptionReportEnh.episodeID = element.episodeID; _requestPrescriptionReportEnh.setupID = element.setupID; _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; - isInPatient = element.isInOutPatient; + isInPatient = element.isInOutPatient!; ///call inpGetPrescriptionReport } @@ -192,9 +192,9 @@ class PrescriptionsService extends BaseService { hasError = false; _getMedicationForInPatientRequestModel = GetMedicationForInPatientRequestModel( isDentalAllowedBackend: false, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient!.admissionNo!), tokenID: "@dm!n", - projectID: patient.projectId, + projectID: patient!.projectId!, ); await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, patient: patient, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index 56a92de5..3ce2375e 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -14,20 +14,20 @@ import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ProcedureService extends BaseService { - List _procedureList = List(); + List _procedureList = []; List get procedureList => _procedureList; - List _valadteProcedureList = List(); + List _valadteProcedureList = []; List get valadteProcedureList => _valadteProcedureList; - List _categoriesList = List(); + List _categoriesList = []; List get categoriesList => _categoriesList; - List procedureslist = List(); + List procedureslist = []; List categoryList = []; - // List _templateList = List(); + // List _templateList = []; // List get templateList => _templateList; - List templateList = List(); + List templateList = []; - List _templateDetailsList = List(); + List _templateDetailsList = []; List get templateDetailsList => _templateDetailsList; GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(); @@ -59,7 +59,7 @@ class ProcedureService extends BaseService { //search: ["DENTAL"], ); - Future getProcedureTemplate({int doctorId, int projectId, int clinicId, String categoryID}) async { + Future getProcedureTemplate({int? doctorId, int? projectId, int? clinicId, String? categoryID}) async { _procedureTempleteRequestModel = ProcedureTempleteRequestModel( // tokenID: "@dm!n", patientID: 0, @@ -72,7 +72,7 @@ class ProcedureService extends BaseService { templateList.clear(); response['DAPP_TemplateGetList'].forEach((template) { ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template); - if (categoryID != null) { + if (categoryID != null ) { if (categoryID == templateElement.categoryID) { templateList.add(templateElement); } @@ -89,7 +89,7 @@ class ProcedureService extends BaseService { }, body: _procedureTempleteRequestModel.toJson()); } - Future getProcedureTemplateDetails({int doctorId, int projectId, int clinicId, int templateId}) async { + Future getProcedureTemplateDetails({int? doctorId, int? projectId, int? clinicId, int? templateId}) async { _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0); hasError = false; @@ -107,7 +107,7 @@ class ProcedureService extends BaseService { }, body: _procedureTempleteDetailsRequestModel.toJson()); } - Future getProcedure({int mrn, int appointmentNo}) async { + Future getProcedure({int? mrn, required int appointmentNo}) async { _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel( patientMRN: mrn, ); @@ -133,7 +133,7 @@ class ProcedureService extends BaseService { }, body: Map()); } - Future getProcedureCategory({String categoryName, String categoryID, patientId}) async { + Future getProcedureCategory({String? categoryName, String? categoryID, patientId}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( search: ["$categoryName"], patientMRN: patientId, diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index f10f2253..7ebbd348 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -6,17 +6,17 @@ import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; class RadiologyService extends BaseService { - List finalRadiologyList = List(); + List finalRadiologyList = []; String url = ''; - Future getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { + Future getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, @required PatiantInformtion? patient}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; - await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient!, onSuccess: (dynamic response, int statusCode) { url = response['Data']; }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 070fd862..6efeba18 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -18,7 +18,7 @@ class SickLeaveService extends BaseService { List get getReasons => reasonse; List reasonse = []; List get getAllSickLeave => _getAllsickLeave; - List _getAllsickLeave = List(); + List _getAllsickLeave = []; List get coveringDoctorsList => _coveringDoctors; List _coveringDoctors = []; @@ -29,8 +29,8 @@ class SickLeaveService extends BaseService { dynamic _postReschedule; - List getAllSickLeavePatient = List(); - List getAllSickLeaveDoctor = List(); + List getAllSickLeavePatient = []; + List getAllSickLeaveDoctor = []; SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel(); GetSickLeaveDoctorRequestModel _sickLeaveDoctorRequestModel = GetSickLeaveDoctorRequestModel(); @@ -164,7 +164,7 @@ class SickLeaveService extends BaseService { _getReScheduleLeave.sort((a, b) { var adate = a.dateTimeFrom; //before -> var adate = a.date; var bdate = b.dateTimeFrom; //var bdate = b.date; - return -adate.compareTo(bdate); + return -adate!.compareTo(bdate!); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index ec127f8b..c21187ab 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -34,7 +34,7 @@ class SOAPService extends LookupService { List patientProgressNoteList = []; List patientAssessmentList = []; - int episodeID; + int? episodeID; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, @@ -80,12 +80,11 @@ class SOAPService extends LookupService { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { hasError = false; - await baseAppClient.post(POST_ALLERGY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_ALLERGY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = super.error+ "\n"+error; + super.error = super.error!+ "\n"+error; }, body: postAllergyRequestModel.toJson()); } @@ -97,12 +96,11 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error =super.error + "\n"+error; + super.error =super.error! + "\n"+error; }, body: postHistoriesRequestModel.toJson()); } - Future postChiefComplaint( - PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { + Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { hasError = false; super.error =""; await baseAppClient.post(POST_CHIEF_COMPLAINT, @@ -114,8 +112,7 @@ class SOAPService extends LookupService { }, body: postChiefComplaintRequestModel.toJson()); } - Future postPhysicalExam( - PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { hasError = false; await baseAppClient.post(POST_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { @@ -170,7 +167,7 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = super.error +"\n"+error; + super.error = super.error!+"\n"+error; }, body: patchHistoriesRequestModel.toJson()); } diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index 53fa257e..6db51f1e 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -8,11 +8,11 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class UcafService extends LookupService { - List patientChiefComplaintList; - List patientVitalSignsHistory; + late List patientChiefComplaintList; + late List patientVitalSignsHistory; List patientAssessmentList = []; List orderProcedureList = []; - PrescriptionModel prescriptionList; + PrescriptionModel? prescriptionList; Future getPatientChiefComplaint(PatiantInformtion patient) async { hasError = false; @@ -22,14 +22,13 @@ class UcafService extends LookupService { body['EpisodeID'] = patient.episodeNo; body['DoctorID'] = ""; - patientChiefComplaintList = null; - await baseAppClient.post(GET_CHIEF_COMPLAINT, - onSuccess: (dynamic response, int statusCode) { + patientChiefComplaintList = []; + await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); if (patientChiefComplaintList != null) { patientChiefComplaintList.clear(); } else { - patientChiefComplaintList = new List(); + patientChiefComplaintList = []; } response['List_ChiefComplaint']['entityList'].forEach((v) { patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); @@ -52,14 +51,14 @@ class UcafService extends LookupService { body['InOutPatientType'] = 2; } - patientVitalSignsHistory = null; + patientVitalSignsHistory = []; await baseAppClient.post( GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { if (patientVitalSignsHistory != null) { patientVitalSignsHistory.clear(); } else { - patientVitalSignsHistory = new List(); + patientVitalSignsHistory = []; } if (response['List_DoctorPatientVitalSign'] != null) { response['List_DoctorPatientVitalSign'].forEach((v) { @@ -89,14 +88,14 @@ class UcafService extends LookupService { body['From'] = fromDate; body['To'] = toDate; - patientVitalSignsHistory = null; + patientVitalSignsHistory = []; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, onSuccess: (dynamic response, int statusCode) { if (patientVitalSignsHistory != null) { patientVitalSignsHistory.clear(); } else { - patientVitalSignsHistory = new List(); + patientVitalSignsHistory = []; } if (response['VitalSignsHistory'] != null) { response['VitalSignsHistory'].forEach((v) { diff --git a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart index 1c07aa48..f49d062a 100644 --- a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart +++ b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class VitalSignsService extends BaseService { - VitalSignData patientVitalSigns; + VitalSignData? patientVitalSigns; List patientVitalSignsHistory = []; Future getPatientVitalSign(PatiantInformtion patient) async { diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index e6f35bb8..527f3d20 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -6,17 +6,17 @@ import 'package:doctor_app_flutter/models/pending_orders/pending_order_request_m import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart'; class PendingOrderService extends BaseService { - List _pendingOrderList = List(); + List _pendingOrderList = []; List get pendingOrderList => _pendingOrderList; - List _admissionOrderList = List(); + List _admissionOrderList = []; List get admissionOrderList => _admissionOrderList; Future getPendingOrders( - {PendingOrderRequestModel pendingOrderRequestModel, - int patientId, - int admissionNo}) async { - pendingOrderRequestModel = PendingOrderRequestModel( + { + required int patientId, + required int admissionNo}) async { + PendingOrderRequestModel pendingOrderRequestModel = PendingOrderRequestModel( patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, @@ -40,10 +40,10 @@ class PendingOrderService extends BaseService { } Future getAdmissionOrders( - {AdmissionOrdersRequestModel admissionOrdersRequestModel, - int patientId, - int admissionNo}) async { - admissionOrdersRequestModel = AdmissionOrdersRequestModel( + { + required int patientId, + required int admissionNo}) async { + AdmissionOrdersRequestModel admissionOrdersRequestModel = AdmissionOrdersRequestModel( patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 9df347e2..4d1ea631 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -6,11 +6,9 @@ import '../../locator.dart'; import 'base_view_model.dart'; class DischargedPatientViewModel extends BaseViewModel { - DischargedPatientService _dischargedPatientService = - locator(); + DischargedPatientService _dischargedPatientService = locator(); - List get myDischargedPatient => - _dischargedPatientService.myDischargedPatients; + List get myDischargedPatient => _dischargedPatientService.myDischargedPatients; List filterData = []; @@ -19,9 +17,9 @@ class DischargedPatientViewModel extends BaseViewModel { if (strExist) { filterData = []; for (var i = 0; i < myDischargedPatient.length; i++) { - String firstName = myDischargedPatient[i].firstName.toUpperCase(); - String lastName = myDischargedPatient[i].lastName.toUpperCase(); - String mobile = myDischargedPatient[i].mobileNumber.toUpperCase(); + String firstName = myDischargedPatient[i].firstName!.toUpperCase(); + String lastName = myDischargedPatient[i].lastName!.toUpperCase(); + String mobile = myDischargedPatient[i].mobileNumber!.toUpperCase(); String patientID = myDischargedPatient[i].patientId.toString(); if (firstName.contains(str.toUpperCase()) || @@ -42,7 +40,7 @@ class DischargedPatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargedPatientService.getDischargedPatient(); if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error; + error = _dischargedPatientService.error!; setState(ViewState.Error); } else { filterData = myDischargedPatient; @@ -54,7 +52,7 @@ class DischargedPatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargedPatientService.gtMyDischargeReferralPatient(); if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error; + error = _dischargedPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart index 46f48d35..edc57abd 100644 --- a/lib/core/viewModel/InsuranceViewModel.dart +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -16,12 +16,12 @@ class InsuranceViewModel extends BaseViewModel { _insuranceCardService.insuranceApprovalInPatient; Future getInsuranceApproval(PatiantInformtion patient, - {int appointmentNo, int projectId}) async { + {int ? appointmentNo, int? projectId}) async { error = ""; setState(ViewState.Busy); if (appointmentNo != null) await _insuranceCardService.getInsuranceApproval(patient, - appointmentNo: appointmentNo, projectId: projectId); + appointmentNo: appointmentNo, projectId: projectId!); else await _insuranceCardService.getInsuranceApproval(patient); if (_insuranceCardService.hasError) { @@ -31,13 +31,13 @@ class InsuranceViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getInsuranceInPatient({int mrn}) async { + Future getInsuranceInPatient({required int mrn}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _insuranceCardService.getInsuranceApprovalInPatient(mrn: mrn); if (_insuranceCardService.hasError) { - error = _insuranceCardService.error; + error = _insuranceCardService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 53feedd1..9bba7e61 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -35,7 +35,7 @@ class LiveCarePatientViewModel extends BaseViewModel { PendingPatientERForDoctorAppRequestModel(sErServiceID: _dashboardService.sServiceID, outSA: false); await _liveCarePatientServices.getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { @@ -47,7 +47,7 @@ class LiveCarePatientViewModel extends BaseViewModel { Future endCall(int vCID, bool isPatient) async { await getDoctorProfile(isGetProfile: true); EndCallReq endCallReq = new EndCallReq(); - endCallReq.doctorId = doctorProfile.doctorID; + endCallReq.doctorId = doctorProfile!.doctorID; endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; @@ -55,7 +55,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.endCall(endCallReq); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -67,24 +67,24 @@ class LiveCarePatientViewModel extends BaseViewModel { return token; } - Future startCall({int vCID, bool isReCall}) async { + Future startCall({required int vCID, required bool isReCall}) async { StartCallReq startCallReq = new StartCallReq(); await getDoctorProfile(); - startCallReq.clinicId = super.doctorProfile.clinicID; + startCallReq.clinicId = super.doctorProfile!.clinicID!; startCallReq.vCID = vCID; //["VC_ID"]; startCallReq.isrecall = isReCall; - startCallReq.doctorId = doctorProfile.doctorID; + startCallReq.doctorId = doctorProfile!.doctorID!; startCallReq.isOutKsa = false; //["IsOutKSA"]; - startCallReq.projectName = doctorProfile.projectName; - startCallReq.docotrName = doctorProfile.doctorName; - startCallReq.clincName = doctorProfile.clinicDescription; - startCallReq.docSpec = doctorProfile.doctorTitleForProfile; + startCallReq.projectName = doctorProfile!.projectName!; + startCallReq.docotrName = doctorProfile!.doctorName!; + startCallReq.clincName = doctorProfile!.clinicDescription!; + startCallReq.docSpec = doctorProfile!.doctorTitleForProfile!; startCallReq.generalid = 'Cs2020@2016\$2958'; setState(ViewState.BusyLocal); await _liveCarePatientServices.startCall(startCallReq); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -107,7 +107,7 @@ class LiveCarePatientViewModel extends BaseViewModel { await _liveCarePatientServices.endCallWithCharge(vcID, selectedServices); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); @@ -116,10 +116,10 @@ class LiveCarePatientViewModel extends BaseViewModel { } List getSelectedAlternativeServices() { - List selectedServices = List(); + List selectedServices = []; for (AlternativeService service in alternativeServicesList) { - if (service.isSelected) { - selectedServices.add(service.serviceID); + if (service.isSelected!) { + selectedServices.add(service.serviceID!); } } return selectedServices; @@ -129,7 +129,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.getAlternativeServices(vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -140,7 +140,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.transferToAdmin(vcID, notes); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); @@ -152,7 +152,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.sendSMSInstruction(vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); @@ -165,9 +165,9 @@ class LiveCarePatientViewModel extends BaseViewModel { if (strExist) { filterData = []; for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) { - String fullName = _liveCarePatientServices.patientList[i].fullName.toUpperCase(); + String fullName = _liveCarePatientServices.patientList[i].fullName!.toUpperCase(); String patientID = _liveCarePatientServices.patientList[i].patientId.toString(); - String mobile = _liveCarePatientServices.patientList[i].mobileNumber.toUpperCase(); + String mobile = _liveCarePatientServices.patientList[i].mobileNumber!.toUpperCase(); if (fullName.contains(str.toUpperCase()) || patientID.contains(str) || mobile.contains(str)) { filterData.add(_liveCarePatientServices.patientList[i]); @@ -184,14 +184,14 @@ class LiveCarePatientViewModel extends BaseViewModel { await getDoctorProfile(isGetProfile: true); LiveCareUserLoginRequestModel userLoginRequestModel = new LiveCareUserLoginRequestModel(); - userLoginRequestModel.isOutKsa = (doctorProfile.projectID == 2 || doctorProfile.projectID == 3) ? 1 : 0; + userLoginRequestModel.isOutKsa = (doctorProfile!.projectID! == 2 || doctorProfile!.projectID! == 3) ? 1 : 0; userLoginRequestModel.isLogin = loginStatus; userLoginRequestModel.generalid = "Cs2020@2016\$2958"; setState(ViewState.BusyLocal); await _liveCarePatientServices.isLogin(loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -235,7 +235,7 @@ class LiveCarePatientViewModel extends BaseViewModel { ); } - updateInCallPatient({PatiantInformtion patient, appointmentNo}) { + updateInCallPatient({required PatiantInformtion patient, appointmentNo}) { _liveCarePatientServices.patientList.forEach((e) { if (e.patientId == patient.patientId) { e.episodeNo = 0; @@ -252,7 +252,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.addPatientToDoctorList(vcID: vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -264,7 +264,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.removePatientFromDoctorList(vcID: vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index e7d343b4..9648292f 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -18,7 +18,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.getMedicalReportList(patient); if (_service.hasError) { - error = _service.error; + error = _service.error!; setState(ViewState.ErrorLocal); // ViewState.Error } else setState(ViewState.Idle); @@ -28,7 +28,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.getMedicalReportTemplate(); if (_service.hasError) { - error = _service.error; + error = _service.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -38,7 +38,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.insertMedicalReport(patient, htmlText); if (_service.hasError) { - error = _service.error; + error = _service.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -48,7 +48,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.verifyMedicalReport(patient, medicalReport); if (_service.hasError) { - error = _service.error; + error = _service.error!; setState(ViewState.ErrorLocal); } else await getMedicalReportList(patient); @@ -59,7 +59,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.addMedicalReport(patient, htmlText); if (_service.hasError) { - error = _service.error; + error = _service.error!; await getMedicalReportList(patient); setState(ViewState.ErrorLocal); } else @@ -68,11 +68,11 @@ class PatientMedicalReportViewModel extends BaseViewModel { } } - Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async { + Future updateMedicalReport(PatiantInformtion patient, String htmlText, dynamic limitNumber, String? invoiceNumber) async { setState(ViewState.Busy); - await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber); + await _service.updateMedicalReport(patient, htmlText, limitNumber!, invoiceNumber!); if (_service.hasError) { - error = _service.error; + error = _service.error!; await getMedicalReportList(patient); setState(ViewState.ErrorLocal); } else diff --git a/lib/core/viewModel/PatientMuseViewModel.dart b/lib/core/viewModel/PatientMuseViewModel.dart index 312d6ebb..b954a66b 100644 --- a/lib/core/viewModel/PatientMuseViewModel.dart +++ b/lib/core/viewModel/PatientMuseViewModel.dart @@ -11,14 +11,14 @@ class PatientMuseViewModel extends BaseViewModel { List get patientMuseResultsModelList => _patientMuseService.patientMuseResultsModelList; - getECGPatient({int patientType, int patientOutSA, int patientID}) async { + getECGPatient({int? patientType, int? patientOutSA, int? patientID}) async { setState(ViewState.Busy); await _patientMuseService.getECGPatient( patientID: patientID, patientOutSA: patientOutSA, patientType: patientType); if (_patientMuseService.hasError) { - error = _patientMuseService.error; + error = _patientMuseService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 5acc6f07..b54bdce0 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -25,8 +25,8 @@ class PatientSearchViewModel extends BaseViewModel { List filterData = []; - DateTime selectedFromDate; - DateTime selectedToDate; + DateTime? selectedFromDate; + DateTime? selectedToDate; int firstSubsetIndex = 0; int inPatientPageSize = 20; @@ -40,11 +40,11 @@ class PatientSearchViewModel extends BaseViewModel { filterData = []; for (var i = 0; i < _outPatientService.patientList.length; i++) { String firstName = - _outPatientService.patientList[i].firstName.toUpperCase(); + _outPatientService.patientList[i].firstName!.toUpperCase(); String lastName = - _outPatientService.patientList[i].lastName.toUpperCase(); + _outPatientService.patientList[i].lastName!.toUpperCase(); String mobile = - _outPatientService.patientList[i].mobileNumber.toUpperCase(); + _outPatientService.patientList[i].mobileNumber!.toUpperCase(); String patientID = _outPatientService.patientList[i].patientId.toString(); @@ -70,10 +70,10 @@ class PatientSearchViewModel extends BaseViewModel { setState(ViewState.Busy); } await getDoctorProfile(isGetProfile: true); - patientSearchRequestModel.doctorID = doctorProfile.doctorID; + patientSearchRequestModel.doctorID = doctorProfile!.doctorID; await _outPatientService.getOutPatient(patientSearchRequestModel); if (_outPatientService.hasError) { - error = _outPatientService.error; + error = _outPatientService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -99,7 +99,7 @@ class PatientSearchViewModel extends BaseViewModel { await _outPatientService .getPatientFileInformation(patientSearchRequestModel); if (_outPatientService.hasError) { - error = _outPatientService.error; + error = _outPatientService.error!; setState(ViewState.Error); } else { filterData = _outPatientService.patientList; @@ -109,10 +109,10 @@ class PatientSearchViewModel extends BaseViewModel { getPatientBasedOnDate( {item, - PatientSearchRequestModel patientSearchRequestModel, - PatientType selectedPatientType, - bool isSearchWithKeyInfo, - OutPatientFilterType outPatientFilterType}) async { + PatientSearchRequestModel? patientSearchRequestModel, + PatientType? selectedPatientType, + bool? isSearchWithKeyInfo, + OutPatientFilterType? outPatientFilterType}) async { String dateTo; String dateFrom; if (OutPatientFilterType.Previous == outPatientFilterType) { @@ -120,9 +120,9 @@ class PatientSearchViewModel extends BaseViewModel { DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); selectedToDate = DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); - dateTo = AppDateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); + dateTo = AppDateUtils.convertDateToFormat(selectedToDate!, 'yyyy-MM-dd'); dateFrom = - AppDateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); + AppDateUtils.convertDateToFormat(selectedFromDate!, 'yyyy-MM-dd'); } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { dateTo = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, @@ -144,7 +144,7 @@ class PatientSearchViewModel extends BaseViewModel { 'yyyy-MM-dd'); } PatientSearchRequestModel currentModel = PatientSearchRequestModel(); - currentModel.patientID = patientSearchRequestModel.patientID; + currentModel.patientID = patientSearchRequestModel!.patientID; currentModel.firstName = patientSearchRequestModel.firstName; currentModel.lastName = patientSearchRequestModel.lastName; currentModel.middleName = patientSearchRequestModel.middleName; @@ -163,8 +163,8 @@ class PatientSearchViewModel extends BaseViewModel { List get myIinPatientList => _inPatientService.myInPatientList; - List filteredInPatientItems = List(); - List filteredMyInPatientItems = List(); + List filteredInPatientItems = []; + List filteredMyInPatientItems = []; Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false, bool isLocalBusy = false}) async { @@ -177,7 +177,7 @@ class PatientSearchViewModel extends BaseViewModel { if (inPatientList.length == 0) await _inPatientService.getInPatientList(requestModel, false); if (_inPatientService.hasError) { - error = _inPatientService.error; + error = _inPatientService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -190,7 +190,10 @@ class PatientSearchViewModel extends BaseViewModel { } } - sortInPatient({bool isDes = false, bool isAllClinic, bool isMyInPatient}) { + sortInPatient( + {bool isDes = false, + required bool isAllClinic, + required bool isMyInPatient}) { if (isMyInPatient ? myIinPatientList.length > 0 : isAllClinic @@ -203,12 +206,12 @@ class PatientSearchViewModel extends BaseViewModel { : [...filteredInPatientItems]; if (isDes) localInPatient.sort((PatiantInformtion a, PatiantInformtion b) => b - .admissionDateWithDateTimeForm - .compareTo(a.admissionDateWithDateTimeForm)); + .admissionDateWithDateTimeForm! + .compareTo(a.admissionDateWithDateTimeForm!)); else localInPatient.sort((PatiantInformtion a, PatiantInformtion b) => a - .admissionDateWithDateTimeForm - .compareTo(b.admissionDateWithDateTimeForm)); + .admissionDateWithDateTimeForm! + .compareTo(b.admissionDateWithDateTimeForm!)); if (isMyInPatient) { filteredMyInPatientItems.clear(); filteredMyInPatientItems.addAll(localInPatient); @@ -253,7 +256,7 @@ class PatientSearchViewModel extends BaseViewModel { InpatientClinicList.clear(); inPatientList.forEach((element) { if (!InpatientClinicList.contains(element.clinicDescription)) { - InpatientClinicList.add(element.clinicDescription); + InpatientClinicList.add(element!.clinicDescription!); } }); } @@ -281,7 +284,7 @@ class PatientSearchViewModel extends BaseViewModel { } } - filterByHospital({int hospitalId}) { + filterByHospital({required int hospitalId}) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { if (inPatientList[i].projectId == hospitalId) { @@ -291,7 +294,7 @@ class PatientSearchViewModel extends BaseViewModel { notifyListeners(); } - filterByClinic({String clinicName}) { + filterByClinic({required String clinicName}) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { if (inPatientList[i].clinicDescription == clinicName) { @@ -307,7 +310,7 @@ class PatientSearchViewModel extends BaseViewModel { } void filterSearchResults(String query, - {bool isAllClinic, bool isMyInPatient}) { + {required bool isAllClinic, required bool isMyInPatient}) { var strExist = query.length > 0 ? true : false; if (isMyInPatient) { @@ -319,13 +322,13 @@ class PatientSearchViewModel extends BaseViewModel { filteredMyInPatientItems.clear(); for (var i = 0; i < localFilteredMyInPatientItems.length; i++) { String firstName = - localFilteredMyInPatientItems[i].firstName.toUpperCase(); + localFilteredMyInPatientItems[i].firstName!.toUpperCase(); String lastName = - localFilteredMyInPatientItems[i].lastName.toUpperCase(); + localFilteredMyInPatientItems[i].lastName!.toUpperCase(); String mobile = - localFilteredMyInPatientItems[i].mobileNumber.toUpperCase(); + localFilteredMyInPatientItems[i].mobileNumber!.toUpperCase(); String patientID = - localFilteredMyInPatientItems[i].patientId.toString(); + localFilteredMyInPatientItems[i].patientId!.toString(); if (firstName.contains(query.toUpperCase()) || lastName.contains(query.toUpperCase()) || @@ -345,9 +348,9 @@ class PatientSearchViewModel extends BaseViewModel { if (strExist) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { - String firstName = inPatientList[i].firstName.toUpperCase(); - String lastName = inPatientList[i].lastName.toUpperCase(); - String mobile = inPatientList[i].mobileNumber.toUpperCase(); + String firstName = inPatientList[i].firstName!.toUpperCase(); + String lastName = inPatientList[i].lastName!.toUpperCase(); + String mobile = inPatientList[i].mobileNumber!.toUpperCase(); String patientID = inPatientList[i].patientId.toString(); if (firstName.contains(query.toUpperCase()) || @@ -372,11 +375,11 @@ class PatientSearchViewModel extends BaseViewModel { filteredInPatientItems.clear(); for (var i = 0; i < localFilteredInPatientItems.length; i++) { String firstName = - localFilteredInPatientItems[i].firstName.toUpperCase(); + localFilteredInPatientItems[i].firstName!.toUpperCase(); String lastName = - localFilteredInPatientItems[i].lastName.toUpperCase(); + localFilteredInPatientItems[i].lastName!.toUpperCase(); String mobile = - localFilteredInPatientItems[i].mobileNumber.toUpperCase(); + localFilteredInPatientItems[i].mobileNumber!.toUpperCase(); String patientID = localFilteredInPatientItems[i].patientId.toString(); @@ -407,7 +410,7 @@ class PatientSearchViewModel extends BaseViewModel { } await _specialClinicsService.getSpecialClinicalCareMappingList(clinicId); if (_specialClinicsService.hasError) { - error = _specialClinicsService.error; + error = _specialClinicsService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 8785fda2..a104985d 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -94,7 +94,7 @@ class SOAPViewModel extends BaseViewModel { List get patientAssessmentList => _SOAPService.patientAssessmentList; - int get episodeID => _SOAPService.episodeID; + int? get episodeID => _SOAPService.episodeID; bool isAddProgress = true; bool isAddExamInProgress = true; @@ -114,7 +114,7 @@ class SOAPViewModel extends BaseViewModel { List get allMedicationList => _prescriptionService.allMedicationList; - SubjectiveCallBack subjectiveCallBack; + late SubjectiveCallBack subjectiveCallBack; setSubjectiveCallBack(SubjectiveCallBack callBack) { this.subjectiveCallBack = callBack; @@ -124,7 +124,7 @@ class SOAPViewModel extends BaseViewModel { subjectiveCallBack.nextFunction(model); } - ObjectiveCallBack objectiveCallBack; + late ObjectiveCallBack objectiveCallBack; setObjectiveCallBack(ObjectiveCallBack callBack) { this.objectiveCallBack = callBack; @@ -134,7 +134,7 @@ class SOAPViewModel extends BaseViewModel { objectiveCallBack.nextFunction(model); } - AssessmentCallBack assessmentCallBack; + late AssessmentCallBack assessmentCallBack; setAssessmentCallBack(AssessmentCallBack callBack) { this.assessmentCallBack = callBack; @@ -144,7 +144,7 @@ class SOAPViewModel extends BaseViewModel { assessmentCallBack.nextFunction(model); } - PlanCallBack planCallBack; + late PlanCallBack planCallBack; setPlanCallBack(PlanCallBack callBack) { this.planCallBack = callBack; @@ -158,7 +158,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Busy); await _SOAPService.getAllergies(getAllergiesRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); @@ -172,7 +173,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Busy); await _SOAPService.getMasterLookup(masterKeys); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -182,7 +183,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.postEpisode(postEpisodeReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -195,7 +196,7 @@ class SOAPViewModel extends BaseViewModel { await _SOAPService.postEpisodeForInPatient( postEpisodeForInpatientRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -206,7 +207,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -217,7 +218,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.postProgressNote(postProgressNoteRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -228,7 +229,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.postAssessment(postAssessmentRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -239,7 +240,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -250,7 +251,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.patchProgressNote(patchProgressNoteRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -261,7 +262,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.patchAssessment(patchAssessmentRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -275,7 +276,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Busy); await _SOAPService.getPatientAllergy(generalGetReqForSOAP); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else @@ -287,21 +288,16 @@ class SOAPViewModel extends BaseViewModel { String getAllergicNames(isArabic) { String allergiesString = ''; patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); - if (selectedAllergy != null && element.isChecked) - allergiesString += - (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + - ' , '; + MasterKeyModel? selectedAllergy = getOneMasterKey( + masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); + if (selectedAllergy != null && element.isChecked!) + allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , '; }); return allergiesString; } - Future getPatientPhysicalExam( - PatiantInformtion patientInfo, + Future getPatientPhysicalExam(PatiantInformtion patientInfo, ) async { GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( patientMRN: patientInfo.patientMRN, @@ -314,36 +310,34 @@ class SOAPViewModel extends BaseViewModel { patientInfo.appointmentNo.toString(), ), ); - if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty) - getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo); + if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty) + getPhysicalExamReqModel.admissionNo = int.parse(patientInfo!.admissionNo!); else getPhysicalExamReqModel.admissionNo = 0; setState(ViewState.Busy); await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientProgressNote( - GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { + Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientAssessment( - GetAssessmentReqModel getAssessmentReqModel) async { + Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientAssessment(getAssessmentReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -353,7 +347,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMedicationList(); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -364,11 +358,11 @@ class SOAPViewModel extends BaseViewModel { GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel( patientID: patient.patientId, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient!.admissionNo!), patientTypeID: 1); await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else { patient.episodeNo = _SOAPService.episodeID; @@ -377,13 +371,11 @@ class SOAPViewModel extends BaseViewModel { } // ignore: missing_return - MasterKeyModel getOneMasterKey( - {@required MasterKeysService masterKeys, dynamic id, int typeId}) { + MasterKeyModel? getOneMasterKey({@required MasterKeysService? masterKeys, dynamic id, int? typeId}) { switch (masterKeys) { case MasterKeysService.Allergies: List result = allergiesList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -392,8 +384,7 @@ class SOAPViewModel extends BaseViewModel { case MasterKeysService.HistoryFamily: List result = historyFamilyList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -401,8 +392,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistoryMedical: List result = historyMedicalList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -410,8 +400,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySocial: List result = historySocialList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -419,8 +408,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySports: List result = historySocialList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -436,8 +424,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.PhysicalExamination: List result = physicalExaminationList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -445,8 +432,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.AllergySeverity: List result = allergySeverityList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -461,8 +447,7 @@ class SOAPViewModel extends BaseViewModel { case MasterKeysService.DiagnosisType: List result = listOfDiagnosisType.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -470,8 +455,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.DiagnosisCondition: List result = listOfDiagnosisCondition.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -504,10 +488,9 @@ class SOAPViewModel extends BaseViewModel { GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( admissionNo: - patientInfo - .admissionNo != + patientInfo!.admissionNo != null - ? int.parse(patientInfo.admissionNo) + ? int.parse(patientInfo!.admissionNo!) : null, patientMRN: patientInfo.patientMRN, appointmentNo: patientInfo.appointmentNo != null @@ -608,7 +591,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -668,7 +651,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (_SOAPService.hasError || _prescriptionService.hasError) { - error = _SOAPService.error + _prescriptionService.error; + error = _SOAPService.error + _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -708,7 +691,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (allowSetState) { if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -732,7 +715,7 @@ class SOAPViewModel extends BaseViewModel { } if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -740,11 +723,11 @@ class SOAPViewModel extends BaseViewModel { postSubjectServices( {patientInfo, - String complaintsText, - String medicationText, - String illnessText, - List myHistoryList, - List myAllergiesList}) async { + required String complaintsText, + required String medicationText, + required String illnessText, + required List myHistoryList, + required List myAllergiesList}) async { var services; PostChiefComplaintRequestModel postChiefComplaintRequestModel = @@ -790,7 +773,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -798,9 +781,9 @@ class SOAPViewModel extends BaseViewModel { PostChiefComplaintRequestModel createPostChiefComplaintRequestModel( {patientInfo, - String complaintsText, - String medicationText, - String illnessText}) { + required String complaintsText, + required String medicationText, + required String illnessText}) { return new PostChiefComplaintRequestModel( admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) @@ -818,13 +801,13 @@ class SOAPViewModel extends BaseViewModel { } PostHistoriesRequestModel createPostHistoriesRequestModel( - {patientInfo, List myHistoryList}) { + {patientInfo, required List myHistoryList}) { PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); myHistoryList.forEach((history) { if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; - postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( + postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM( patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: patientInfo.appointmentNo, @@ -846,7 +829,7 @@ class SOAPViewModel extends BaseViewModel { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add( ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseType: allergy.selectedAllergy.typeId, @@ -855,9 +838,9 @@ class SOAPViewModel extends BaseViewModel { appointmentNo: patientInfo.appointmentNo, severity: allergy.selectedAllergySeverity.id, remarks: allergy.remark, - createdBy: allergy.createdBy ?? doctorProfile.doctorID, + createdBy: allergy.createdBy ?? doctorProfile!.doctorID, createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, + editedBy: doctorProfile!.doctorID, editedOn: DateTime.now().toIso8601String(), isChecked: allergy.isChecked, isUpdatedByNurse: false)); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index cad5fa87..d353f882 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -26,9 +26,7 @@ import 'package:doctor_app_flutter/root_page.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; @@ -59,20 +57,20 @@ class AuthenticationViewModel extends BaseViewModel { get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; - NewLoginInformationModel loggedUser; - GetIMEIDetailsModel user; + NewLoginInformationModel? loggedUser; + GetIMEIDetailsModel? user; UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); - List _availableBiometrics; - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); + late List _availableBiometrics; + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; bool isLogin = false; bool unverified = false; bool isFromLogin = false; APP_STATUS appStatus = APP_STATUS.LOADING; - String localToken =""; - AuthenticationViewModel({bool checkDeviceInfo = false}) { + String localToken = ""; + AuthenticationViewModel() { getDeviceInfoFromFirebase(); getDoctorProfile(); } @@ -92,118 +90,137 @@ class AuthenticationViewModel extends BaseViewModel { profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; profileInfo['MobileNo'] = - loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; - InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); - insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; - insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; - insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; + loggedIn != null ? loggedIn['MobileNumber'] : user!.mobile; + InsertIMEIDetailsModel insertIMEIDetailsModel = + InsertIMEIDetailsModel.fromJson(profileInfo); + insertIMEIDetailsModel.genderDescription = + profileInfo['Gender_Description']; + insertIMEIDetailsModel.genderDescriptionN = + profileInfo['Gender_DescriptionN']; + insertIMEIDetailsModel.genderDescriptionN = + profileInfo['Gender_DescriptionN']; insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; - insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; + insertIMEIDetailsModel.titleDescriptionN = + profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] - : user.doctorID; - insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; - insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - insertIMEIDetailsModel.vidaRefreshTokenID =await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + : user!.doctorID; + insertIMEIDetailsModel.outSA = + loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA; + insertIMEIDetailsModel.vidaAuthTokenID = + await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + insertIMEIDetailsModel.vidaRefreshTokenID = + await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = userInfo.password; await _authService.insertDeviceImei(insertIMEIDetailsModel); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - /// first step login Future login(UserModel userInfo) async { setState(ViewState.BusyLocal); await _authService.login(userInfo); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { - sharedPref.setInt(PROJECT_ID, userInfo.projectID); + sharedPref.setInt(PROJECT_ID, userInfo.projectID!); loggedUser = loginInfo; saveObjToString(LOGGED_IN_USER, loginInfo); sharedPref.remove(LAST_LOGIN_USER); - sharedPref.setString(TOKEN, loginInfo.logInTokenID); + sharedPref.setString(TOKEN, loginInfo.logInTokenID!); setState(ViewState.Idle); } } /// send activation code for for msg methods - Future sendActivationCodeVerificationScreen( AuthMethodTypes authMethodType) async { + Future sendActivationCodeVerificationScreen( + AuthMethodTypes authMethodType) async { setState(ViewState.BusyLocal); ActivationCodeForVerificationScreenModel activationCodeModel = - ActivationCodeForVerificationScreenModel( - iMEI: user.iMEI, - facilityId: user.projectID, - memberID: user.doctorID, - loginDoctorID: int.parse(user.editedBy.toString()), - zipCode: user.outSA == true ? '971' : '966', - mobileNumber: user.mobile, - oTPSendType: authMethodType.getTypeIdService(), - isMobileFingerPrint: 1, - vidaAuthTokenID: user.vidaAuthTokenID, - vidaRefreshTokenID: user.vidaRefreshTokenID); - await _authService.sendActivationCodeVerificationScreen(activationCodeModel); + ActivationCodeForVerificationScreenModel( + iMEI: user!.iMEI, + facilityId: user!.projectID, + memberID: user!.doctorID, + loginDoctorID: int.parse(user!.editedBy.toString()), + zipCode: user!.outSA == true ? '971' : '966', + mobileNumber: user!.mobile, + oTPSendType: authMethodType.getTypeIdService(), + isMobileFingerPrint: 1, + vidaAuthTokenID: user!.vidaAuthTokenID, + vidaRefreshTokenID: user!.vidaRefreshTokenID); + await _authService + .sendActivationCodeVerificationScreen(activationCodeModel); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } /// send activation code for silent login - Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password }) async { + Future sendActivationCodeForDoctorApp( + {required AuthMethodTypes authMethodType, + required String password}) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( - facilityId: projectID, - memberID: loggedUser.listMemberInformation[0].memberID, - loginDoctorID: loggedUser.listMemberInformation[0].employeeID, - otpSendType: authMethodType.getTypeIdService().toString(), - ); + facilityId: projectID, + memberID: loggedUser!.listMemberInformation![0].memberID, + loginDoctorID: loggedUser!.listMemberInformation![0].employeeID, + otpSendType: authMethodType.getTypeIdService().toString(), + ); await _authService.sendActivationCodeForDoctorApp(activationCodeModel); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { - await sharedPref.setString(TOKEN, - _authService.activationCodeForDoctorAppRes.logInTokenID); + await sharedPref.setString( + TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID!); setState(ViewState.Idle); } } /// check activation code for sms and whats app - Future checkActivationCodeForDoctorApp({String activationCode,bool isSilentLogin = false}) async { + Future checkActivationCodeForDoctorApp( + {required String activationCode, bool isSilentLogin = false}) async { setState(ViewState.BusyLocal); CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = - new CheckActivationCodeRequestModel( - zipCode: - loggedUser != null ? loggedUser.zipCode :user.zipCode, - mobileNumber: - loggedUser != null ? loggedUser.mobileNumber : user.mobile, - projectID: await sharedPref.getInt(PROJECT_ID) != null - ? await sharedPref.getInt(PROJECT_ID) - : user.projectID, - logInTokenID: await sharedPref.getString(TOKEN), - activationCode: activationCode ?? '0000', - memberID:userInfo.userID!=null? int.parse(userInfo.userID):user.doctorID , - password: userInfo.password, - facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user.projectID.toString(), - oTPSendType: await sharedPref.getInt(OTP_TYPE), - iMEI: localToken, - loginDoctorID:userInfo.userID!=null? int.parse(userInfo.userID):user.editedBy,// loggedUser.listMemberInformation[0].employeeID, - isForSilentLogin:isSilentLogin, - generalid: "Cs2020@2016\$2958"); - await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); + new CheckActivationCodeRequestModel( + zipCode: loggedUser != null ? loggedUser!.zipCode : user!.zipCode, + mobileNumber: + loggedUser != null ? loggedUser!.mobileNumber : user!.mobile, + projectID: await sharedPref.getInt(PROJECT_ID) != null + ? await sharedPref.getInt(PROJECT_ID) + : user!.projectID, + logInTokenID: await sharedPref.getString(TOKEN), + activationCode: activationCode, + memberID: userInfo.userID != null + ? int.parse(userInfo!.userID!) + : user!.doctorID, + password: userInfo.password, + facilityId: userInfo.projectID != null + ? userInfo.projectID.toString() + : user!.projectID.toString(), + oTPSendType: await sharedPref.getInt(OTP_TYPE), + iMEI: localToken, + loginDoctorID: userInfo.userID != null + ? int.parse(userInfo!.userID!) + : user! + .editedBy, // loggedUser.listMemberInformation[0].employeeID, + isForSilentLogin: isSilentLogin, + generalid: "Cs2020@2016\$2958"); + await _authService + .checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes); @@ -213,11 +230,12 @@ class AuthenticationViewModel extends BaseViewModel { /// get list of Hospitals Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel =GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel = + GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { - error = _hospitalsService.error; + error = _hospitalsService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -252,14 +270,16 @@ class AuthenticationViewModel extends BaseViewModel { } /// add  token to shared preferences in case of send activation code is success - setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel)async { - // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - await sharedPref.setString(VIDA_AUTH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); - await sharedPref.setString(TOKEN, - sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); + setDataAfterSendActivationSuccess( + CheckActivationCodeForDoctorAppResponseModel + sendActivationCodeForDoctorAppResponseModel) async { + // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, + sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, + sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); + await sharedPref.setString(TOKEN, + sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!); } saveObjToString(String key, value) async { @@ -297,10 +317,12 @@ class AuthenticationViewModel extends BaseViewModel { clinicID: clinicInfo.clinicID, license: true, projectID: clinicInfo.projectID, - languageID: 2);///TODO change the lan + languageID: 2); + + ///TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { localSetDoctorProfile(doctorProfilesList.first); @@ -311,32 +333,26 @@ class AuthenticationViewModel extends BaseViewModel { /// add some logic in case of check activation code is success onCheckActivationCodeSuccess({bool isSilentLogin = false}) async { sharedPref.setString( - TOKEN, - checkActivationCodeForDoctorAppRes.authenticationTokenID); + TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!); if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && - checkActivationCodeForDoctorAppRes.listDoctorProfile - .isNotEmpty) { + checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) { localSetDoctorProfile( - checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); + checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); } else { sharedPref.setObj( - CLINIC_NAME, - checkActivationCodeForDoctorAppRes.listDoctorsClinic); + CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); ClinicModel clinic = ClinicModel.fromJson( - checkActivationCodeForDoctorAppRes.listDoctorsClinic[0] - .toJson()); + checkActivationCodeForDoctorAppRes.listDoctorsClinic![0].toJson()); await getDoctorProfileBasedOnClinic(clinic); } } /// check specific biometric if it available or not - Future checkIfBiometricAvailable(BiometricType biometricType) async { + Future checkIfBiometricAvailable(BiometricType biometricType) async { bool isAvailable = false; await _getAvailableBiometrics(); - if (_availableBiometrics != null) { - for (var i = 0; i < _availableBiometrics.length; i++) { - if (biometricType == _availableBiometrics[i]) isAvailable = true; - } + for (var i = 0; i < _availableBiometrics.length; i++) { + if (biometricType == _availableBiometrics[i]) isAvailable = true; } return isAvailable; } @@ -354,26 +370,26 @@ class AuthenticationViewModel extends BaseViewModel { getDeviceInfoFromFirebase() async { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - _firebaseMessaging.requestNotificationPermissions(); + _firebaseMessaging.requestPermission(); } - setState(ViewState.Busy); + setState(ViewState.Busy); var token = await _firebaseMessaging.getToken(); if (localToken == "") { - localToken = token; + localToken = token!; await _authService.selectDeviceImei(localToken); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { if (_authService.dashboardItemsList.length > 0) { - user =_authService.dashboardItemsList[0]; + user = _authService.dashboardItemsList[0]; sharedPref.setObj( LAST_LOGIN_USER, _authService.dashboardItemsList[0]); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - user.vidaRefreshTokenID); - await sharedPref.setString(VIDA_AUTH_TOKEN_ID, - user.vidaAuthTokenID); + await sharedPref.setString( + VIDA_REFRESH_TOKEN_ID, user!.vidaRefreshTokenID!); + await sharedPref.setString( + VIDA_AUTH_TOKEN_ID, user!.vidaAuthTokenID!); this.unverified = true; } setState(ViewState.Idle); @@ -388,9 +404,9 @@ class AuthenticationViewModel extends BaseViewModel { if (state == ViewState.Busy) { appStatus = APP_STATUS.LOADING; } else { - if(this.doctorProfile !=null) + if (this.doctorProfile != null) appStatus = APP_STATUS.AUTHENTICATED; - else if (this.unverified) { + else if (this.unverified) { appStatus = APP_STATUS.UNVERIFIED; } else if (this.isLogin) { appStatus = APP_STATUS.AUTHENTICATED; @@ -405,7 +421,7 @@ class AuthenticationViewModel extends BaseViewModel { notifyListeners(); } - setUnverified(bool unverified,{bool isFromLogin = false}){ + setUnverified(bool unverified, {bool isFromLogin = false}) { this.unverified = unverified; this.isFromLogin = isFromLogin; notifyListeners(); @@ -413,21 +429,19 @@ class AuthenticationViewModel extends BaseViewModel { /// logout function logout({bool isFromLogin = false}) async { - - localToken = ""; - String lang = await sharedPref.getString(APP_Language); - await Helpers.clearSharedPref(); - doctorProfile = null; - sharedPref.setString(APP_Language, lang); - deleteUser(); - await getDeviceInfoFromFirebase(); - this.isFromLogin = isFromLogin; - appStatus = APP_STATUS.UNAUTHENTICATED; - setState(ViewState.Idle); + String lang = await sharedPref.getString(APP_Language); + await Helpers.clearSharedPref(); + doctorProfile = null; + sharedPref.setString(APP_Language, lang); + deleteUser(); + await getDeviceInfoFromFirebase(); + this.isFromLogin = isFromLogin; + appStatus = APP_STATUS.UNAUTHENTICATED; + setState(ViewState.Idle); } - deleteUser(){ + deleteUser() { user = null; unverified = false; isLogin = false; diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index d50a8d5a..f55aca90 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; class BaseViewModel extends ChangeNotifier { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - DoctorProfileModel doctorProfile; + DoctorProfileModel ? doctorProfile; ViewState _state = ViewState.Idle; bool isInternetConnection = true; @@ -22,26 +22,22 @@ class BaseViewModel extends ChangeNotifier { void setState(ViewState viewState) { _state = viewState; - notifyListeners(); + notifyListeners(); } - Future getDoctorProfile({bool isGetProfile = false}) async { + Future ?getDoctorProfile({bool isGetProfile = false}) async { if (isGetProfile) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; - } + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; } } if (doctorProfile == null) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; - } + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; } return null; } else { @@ -51,13 +47,13 @@ class BaseViewModel extends ChangeNotifier { void getIsolateDoctorProfile(bool isGetProfile) async { if (isGetProfile) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { doctorProfile = DoctorProfileModel.fromJson(profile); } } if (doctorProfile == null) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { doctorProfile = DoctorProfileModel.fromJson(profile); } diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 04e63dd9..2da6969b 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -13,7 +13,7 @@ import 'base_view_model.dart'; class DashboardViewModel extends BaseViewModel { - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; DashboardService _dashboardService = locator(); SpecialClinicsService _specialClinicsService = locator(); @@ -24,15 +24,14 @@ class DashboardViewModel extends BaseViewModel { bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; - String get sServiceID => _dashboardService.sServiceID; + String? get sServiceID => _dashboardService.sServiceID; int get notRepliedCount => _doctorReplyService.notRepliedCount; - List get specialClinicalCareList => +List get specialClinicalCareList => _specialClinicsService.specialClinicalCareList; - Future startHomeScreenServices(ProjectViewModel projectsProvider, - AuthenticationViewModel authProvider) async { + Future startHomeScreenServices(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { setState(ViewState.Busy); await getDoctorProfile(isGetProfile: true); @@ -44,7 +43,7 @@ class DashboardViewModel extends BaseViewModel { ]); if (_dashboardService.hasError) { - error = _dashboardService.error; + error = _dashboardService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -53,17 +52,11 @@ class DashboardViewModel extends BaseViewModel { } Future setFirebaseNotification(AuthenticationViewModel authProvider) async { - _firebaseMessaging.requestNotificationPermissions( - const IosNotificationSettings( - sound: true, badge: true, alert: true, provisional: true)); - _firebaseMessaging.onIosSettingsRegistered - .listen((IosNotificationSettings settings) { - print("Settings registered: $settings"); - }); + _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); - _firebaseMessaging.getToken().then((String token) async { + _firebaseMessaging.getToken().then((String? token) async { if (token != '') { - // DEVICE_TOKEN = token; + // DEVICE_TOKEN = token!; authProvider.insertDeviceImei(token); } }); @@ -83,36 +76,35 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Busy); await _specialClinicsService.getSpecialClinicalCareList(); // if (_specialClinicsService.hasError) { - // error = _specialClinicsService.error; + // error = _specialClinicsService.error!; // setState(ViewState.Error); // } else // setState(ViewState.Idle); } - Future changeClinic( - int clinicId, AuthenticationViewModel authProvider) async { + Future changeClinic(var clinicId, AuthenticationViewModel authProvider) async { setState(ViewState.BusyLocal); await getDoctorProfile(); ClinicModel clinicModel = ClinicModel( - doctorID: doctorProfile.doctorID, + doctorID: doctorProfile!.doctorID, clinicID: clinicId, - projectID: doctorProfile.projectID, + projectID: doctorProfile!.projectID, ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if (authProvider.state == ViewState.ErrorLocal) { - error = authProvider.error; + error = authProvider.error!; } } getPatientCount(DashboardModel inPatientCount) { int value = 0; - inPatientCount.summaryoptions.forEach((result) => {value += result.value}); + inPatientCount.summaryoptions!.forEach((result) => {value += result.value!}); return value.toString(); } - GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId) { - GetSpecialClinicalCareListResponseModel special; + GetSpecialClinicalCareListResponseModel? getSpecialClinic(clinicId) { + GetSpecialClinicalCareListResponseModel? special; specialClinicalCareList.forEach((element) { if (element.clinicID == clinicId) { special = element; @@ -127,7 +119,7 @@ class DashboardViewModel extends BaseViewModel { await getDoctorProfile(); await _doctorReplyService.getNotRepliedCount(); if (_doctorReplyService.hasError) { - error = _doctorReplyService.error; + error = _doctorReplyService.error!; setState(ViewState.ErrorLocal); } else { notifyListeners(); diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 707fb805..de03c6e3 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -34,7 +34,7 @@ class DoctorReplayViewModel extends BaseViewModel { await _doctorReplyService.getDoctorReply(_requestDoctorReply, clearData: !isLocalBusy, isGettingNotReply: isGettingNotReply); if (_doctorReplyService.hasError) { - error = _doctorReplyService.error; + error = _doctorReplyService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -52,13 +52,13 @@ class DoctorReplayViewModel extends BaseViewModel { transactionNo: model.transactionNo.toString(), doctorResponse: response, infoStatus: 6, - createdBy: this.doctorProfile.doctorID, - infoEnteredBy: this.doctorProfile.doctorID, + createdBy: this.doctorProfile!.doctorID!, + infoEnteredBy: this.doctorProfile!.doctorID!, setupID: "010266"); setState(ViewState.BusyLocal); await _doctorReplyService.createDoctorResponse(createDoctorResponseModel); if (_doctorReplyService.hasError) { - error = _doctorReplyService.error; + error = _doctorReplyService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/hospitals_view_model.dart b/lib/core/viewModel/hospitals_view_model.dart index c0ce1bc4..4e75a87a 100644 --- a/lib/core/viewModel/hospitals_view_model.dart +++ b/lib/core/viewModel/hospitals_view_model.dart @@ -19,7 +19,7 @@ class HospitalViewModel extends BaseViewModel { setState(ViewState.Busy); await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { - error = _hospitalsService.error; + error = _hospitalsService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index d83aee2a..05393f33 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -20,8 +20,8 @@ class LabsViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; List get allSpecialLabList => _labsService.allSpecialLab; - List _patientLabOrdersListClinic = List(); - List _patientLabOrdersListHospital = List(); + List _patientLabOrdersListClinic = []; + List _patientLabOrdersListHospital = []; List get patientLabOrdersList => filterType == FilterType.Clinic ? _patientLabOrdersListClinic : _patientLabOrdersListHospital; @@ -32,7 +32,7 @@ class LabsViewModel extends BaseViewModel { setState(ViewState.Busy); await _labsService.getPatientLabOrdersList(patient, true); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { _labsService.patientLabOrdersList.forEach((element) { @@ -46,7 +46,7 @@ class LabsViewModel extends BaseViewModel { .add(element); } else { _patientLabOrdersListClinic - .add(PatientLabOrdersList(filterName: element.clinicDescription, patientDoctorAppointment: element)); + .add(PatientLabOrdersList(filterName: element.clinicDescription!, patientDoctorAppointment: element)); } // doctor list sort via project @@ -62,7 +62,7 @@ class LabsViewModel extends BaseViewModel { .add(element); } else { _patientLabOrdersListHospital - .add(PatientLabOrdersList(filterName: element.projectName, patientDoctorAppointment: element)); + .add(PatientLabOrdersList(filterName: element.projectName!, patientDoctorAppointment: element)); } }); @@ -79,19 +79,19 @@ class LabsViewModel extends BaseViewModel { List get labResultList => _labsService.labResultList; - List labResultLists = List(); + List labResultLists = []; List get labResultListsCoustom { return labResultLists; } getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo, - PatiantInformtion patient, - bool isInpatient}) async { + {required String projectID, + required int clinicID, + required String invoiceNo, + required String orderNo, + required PatiantInformtion patient, + required bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult( invoiceNo: invoiceNo, @@ -101,19 +101,21 @@ class LabsViewModel extends BaseViewModel { patient: patient, isInpatient: isInpatient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - getPatientLabResult({PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { + getPatientLabResult({required PatientLabOrders patientLabOrder, + required PatiantInformtion patient, + required bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getPatientLabResult( patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -128,23 +130,25 @@ class LabsViewModel extends BaseViewModel { if (patientLabOrdersClinic.length != 0) { labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element); } else { - labResultLists.add(LabResultList(filterName: element.testCode, lab: element)); + labResultLists.add(LabResultList(filterName: element.testCode!, lab: element)); } }); } - getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { + getPatientLabOrdersResults({required PatientLabOrders patientLabOrder, + required String procedure, + required PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults( patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { bool isShouldClear = false; if (_labsService.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) + if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) isShouldClear = true; }); } @@ -154,31 +158,31 @@ class LabsViewModel extends BaseViewModel { } getPatientLabResultHistoryByDescription( - {PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async { + {required PatientLabOrders patientLabOrder, required String procedureDescription, required PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResultHistoryByDescription( patientLabOrder: patientLabOrder, procedureDescription: procedureDescription, patient: patient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { + sendLabReportEmail({required PatientLabOrders patientLabOrder, required String mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; } else DrAppToastMsg.showSuccesToast(mes); } - Future getAllSpecialLabResult({int patientId}) async { + Future getAllSpecialLabResult({required int patientId}) async { setState(ViewState.Busy); await _labsService.getAllSpecialLabResult(mrn: patientId); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/leave_rechdule_response.dart b/lib/core/viewModel/leave_rechdule_response.dart index 555e19cf..78dd5cbb 100644 --- a/lib/core/viewModel/leave_rechdule_response.dart +++ b/lib/core/viewModel/leave_rechdule_response.dart @@ -1,16 +1,16 @@ class GetRescheduleLeavesResponse { - int clinicId; + int? clinicId; var coveringDoctorId; - String date; - String dateTimeFrom; - String dateTimeTo; - int doctorId; - int reasonId; - int requisitionNo; - int requisitionType; - int status; - String createdOn; - String statusDescription; + String? date; + String? dateTimeFrom; + String? dateTimeTo; + int? doctorId; + int? reasonId; + int? requisitionNo; + int? requisitionType; + int? status; + String? createdOn; + String? statusDescription; GetRescheduleLeavesResponse( {this.clinicId, this.coveringDoctorId, diff --git a/lib/core/viewModel/livecare_view_model.dart b/lib/core/viewModel/livecare_view_model.dart index de586e1e..eb96e687 100644 --- a/lib/core/viewModel/livecare_view_model.dart +++ b/lib/core/viewModel/livecare_view_model.dart @@ -16,7 +16,7 @@ class LiveCareViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); List liveCarePendingList = []; - StartCallRes inCallResponse; + late StartCallRes inCallResponse; var transferToAdmin = {}; var endCallResponse = {}; bool isFinished = true; diff --git a/lib/core/viewModel/medical_file_view_model.dart b/lib/core/viewModel/medical_file_view_model.dart index 08e8ce90..406a4617 100644 --- a/lib/core/viewModel/medical_file_view_model.dart +++ b/lib/core/viewModel/medical_file_view_model.dart @@ -11,13 +11,13 @@ class MedicalFileViewModel extends BaseViewModel { List get medicalFileList => _medicalFileService.medicalFileList; - Future getMedicalFile({int mrn}) async { + Future getMedicalFile({required int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _medicalFileService.getMedicalFile(mrn: mrn); if (_medicalFileService.hasError) { - error = _medicalFileService.error; + error = _medicalFileService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 8ccf1a70..f95702a5 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -18,7 +18,7 @@ class MedicineViewModel extends BaseViewModel { ProcedureService _procedureService = locator(); PrescriptionService _prescriptionService = locator(); List get procedureTemplate => _procedureService.templateList; - List templateList = List(); + List templateList = []; get pharmacyItemsList => _medicineService.pharmacyItemsList; get searchText => _medicineService.searchText; get pharmaciesList => _medicineService.pharmaciesList; @@ -42,13 +42,13 @@ class MedicineViewModel extends BaseViewModel { List get itemMedicineListRoute => _prescriptionService.itemMedicineListRoute; List get itemMedicineListUnit => _prescriptionService.itemMedicineListUnit; - Future getItem({int itemID}) async { + Future getItem({required int itemID}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -70,12 +70,12 @@ class MedicineViewModel extends BaseViewModel { print(templateList.length.toString()); } - Future getProcedureTemplate({String categoryID}) async { + Future getProcedureTemplate({required String categoryID}) async { hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureTemplate(categoryID: categoryID); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { setTemplateListDependOnId(); @@ -83,13 +83,13 @@ class MedicineViewModel extends BaseViewModel { } } - Future getPrescription({int mrn}) async { + Future getPrescription({required int mrn}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.getPrescription(mrn: mrn); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -99,17 +99,17 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _medicineService.getMedicineItem(itemName); if (_medicineService.hasError) { - error = _medicineService.error; + error = _medicineService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getMedicationList({String drug}) async { + Future getMedicationList({String? drug}) async { setState(ViewState.Busy); - await _prescriptionService.getMedicationList(drug: drug); + await _prescriptionService.getMedicationList(drug: drug!); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -119,7 +119,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getPatientAssessment(getAssessmentReqModel); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -129,7 +129,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationStrength); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -139,7 +139,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationRoute); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -149,7 +149,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationIndications); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -159,7 +159,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationDoseTime); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -169,7 +169,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationFrequency); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -179,18 +179,19 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationDuration); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getBoxQuantity({int itemCode, int duration, double strength, int freq}) async { + Future getBoxQuantity( + {required int itemCode, required int duration, required double strength, required int freq}) async { setState(ViewState.Busy); await _prescriptionService.calculateBoxQuantity( strength: strength, itemCode: itemCode, duration: duration, freq: freq); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -200,7 +201,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _medicineService.getPharmaciesList(itemId); if (_medicineService.hasError) { - error = _medicineService.error; + error = _medicineService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 0868b601..8e1cbca0 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -39,7 +39,7 @@ class AdmissionRequestViewModel extends BaseViewModel { List get listOfDiagnosisSelectionTypes => _admissionRequestService.listOfDiagnosisSelectionTypes; - AdmissionRequest admissionRequestData; + late AdmissionRequest admissionRequestData; Future getSpecialityList() async { await getMasterLookup(MasterKeysService.Speciality); @@ -53,7 +53,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getClinics(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -63,7 +63,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getDoctorsList(clinicId); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -73,7 +73,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getFloors(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -83,7 +83,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getWardList(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -93,7 +93,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getRoomCategories(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -103,7 +103,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getDiagnosisTypesList(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -120,7 +120,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getDietTypesList(patientMrn); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -130,7 +130,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getICDCodes(patientMrn); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -140,7 +140,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.Busy); await _admissionRequestService.makeAdmissionRequest(admissionRequestData); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -150,7 +150,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getMasterLookup(keysService); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 93635629..01fec57f 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -54,7 +54,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getPatientReferral(patient); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else { if (patientReferral.length == 0) { @@ -69,7 +69,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getMasterLookup(masterKeys); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else await getBranches(); @@ -79,7 +79,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getReferralFacilities(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -91,7 +91,7 @@ class PatientReferralViewModel extends BaseViewModel { await _referralPatientService.getClinicsList(projectId); await _referralPatientService.getProjectInfo(projectId); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -101,7 +101,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getDoctorsList(patient, clinicId, branchId); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else { doctorsList.clear(); @@ -113,7 +113,7 @@ class PatientReferralViewModel extends BaseViewModel { } Future getDoctorBranch() async { - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); if (doctorProfile != null) { dynamic _selectedBranch = {"facilityId": doctorProfile.projectID, "facilityName": doctorProfile.projectName}; return _selectedBranch; @@ -128,7 +128,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getMyReferredPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -141,7 +141,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getMyReferredOutPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -155,7 +155,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getPendingReferralList(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -168,7 +168,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.getMyReferralPatientService(); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; if (localBusy) setState(ViewState.ErrorLocal); else @@ -184,7 +184,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.getMyReferralOutPatientService(); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; if (localBusy) setState(ViewState.ErrorLocal); else @@ -197,7 +197,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.replay(referredDoctorRemarks, referral); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; setState(ViewState.ErrorLocal); } else getMyReferralPatientService(); @@ -207,7 +207,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.responseReferral(referralPatient, isAccepted); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -218,7 +218,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -226,21 +226,21 @@ class PatientReferralViewModel extends BaseViewModel { } Future makeInPatientReferral( - {PatiantInformtion patient, - int projectID, - int clinicID, - int doctorID, - int frequencyCode, - int priority, - String referralDate, - String remarks, - String ext}) async { + {required PatiantInformtion patient, + required int projectID, + required int clinicID, + required int doctorID, + required int frequencyCode, + required int priority, + required String referralDate, + required String remarks, + required String ext}) async { setState(ViewState.Busy); await _referralService.referralPatient( patientID: patient.patientId, roomID: patient.roomId, referralClinic: clinicID, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient.admissionNo!), referralDoctor: doctorID, patientTypeID: patient.patientType, referringDoctorRemarks: remarks, @@ -249,7 +249,7 @@ class PatientReferralViewModel extends BaseViewModel { extension: ext, ); if (_referralService.hasError) { - error = _referralService.error; + error = _referralService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -262,7 +262,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getReferralFrequencyList(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -272,7 +272,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.verifyReferralDoctorRemarks(referredPatient); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else { getMyReferredPatient(); @@ -284,7 +284,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargedPatientService.gtMyDischargeReferralPatient(); if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error; + error = _dischargedPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -293,15 +293,15 @@ class PatientReferralViewModel extends BaseViewModel { String getReferralStatusNameByCode(int statusCode, BuildContext context) { switch (statusCode) { case 1: - return TranslationBase.of(context).referralStatusHold /*pending*/; + return TranslationBase.of(context).referralStatusHold! /*pending*/; case 2: - return TranslationBase.of(context).referralStatusActive /* accepted*/; + return TranslationBase.of(context).referralStatusActive! /* accepted*/; case 4: - return TranslationBase.of(context).referralStatusCancelled /*rejected*/; + return TranslationBase.of(context).referralStatusCancelled! /*rejected*/; case 46: - return TranslationBase.of(context).referralStatusCompleted /*accepted*/; + return TranslationBase.of(context).referralStatusCompleted! /*accepted*/; case 63: - return TranslationBase.of(context).rejected /*referralStatusNotSeen*/; + return TranslationBase.of(context).rejected! /*referralStatusNotSeen*/; default: return "-"; } @@ -389,7 +389,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.replayReferred(referredDoctorRemarks, referral, referralStatus); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; setState(ViewState.ErrorLocal); } else getMyReferralPatientService(); diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 809c154f..ea8e737a 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -29,16 +29,15 @@ class UcafViewModel extends BaseViewModel { List get diagnosisTypes => _ucafService.listOfDiagnosisType; - List get diagnosisConditions => - _ucafService.listOfDiagnosisCondition; + List get diagnosisConditions => _ucafService.listOfDiagnosisCondition; - PrescriptionModel get prescriptionList => _ucafService.prescriptionList; + PrescriptionModel? get prescriptionList => _ucafService.prescriptionList; List get orderProcedures => _ucafService.orderProcedureList; - Function saveUCAFOnTap; + late Function saveUCAFOnTap; - String selectedLanguage; + late String selectedLanguage; String heightCm = "0"; String weightKg = "0"; String bodyMax = "0"; @@ -49,8 +48,8 @@ class UcafViewModel extends BaseViewModel { resetDataInFirst({bool firstPage = true}) { if(firstPage){ - _ucafService.patientVitalSignsHistory = null; - _ucafService.patientChiefComplaintList = null; + _ucafService.patientVitalSignsHistory = []; + _ucafService.patientChiefComplaintList = []; } _ucafService.patientAssessmentList = []; _ucafService.orderProcedureList = []; @@ -66,48 +65,39 @@ class UcafViewModel extends BaseViewModel { String from; String to; - if (from == null || from == "0") { - from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); - } - if (to == null || to == "0") { - to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); - } + + from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + + to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); // await _ucafService.getPatientVitalSignsHistory(patient, from, to); await _ucafService.getInPatientVitalSignHistory(patient, false); await _ucafService.getPatientChiefComplaint(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else { patientVitalSignsHistory.forEach((element) { - if (heightCm == "0" || heightCm == null || heightCm == 'null') { + if (heightCm == "0" || heightCm == 'null') { heightCm = element.heightCm.toString(); } - if (weightKg == "0" || weightKg == null || weightKg == 'null') { + if (weightKg == "0" || weightKg == 'null') { weightKg = element.weightKg.toString(); } - if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { + if (bodyMax == "0" || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } - if (temperatureCelcius == "0" || - temperatureCelcius == null || - temperatureCelcius == 'null') { + if (temperatureCelcius == "0" || temperatureCelcius == 'null') { temperatureCelcius = element.temperatureCelcius.toString(); } if (hartRat == "0" || hartRat == null || hartRat == 'null') { hartRat = element.pulseBeatPerMinute.toString(); } - if (respirationBeatPerMinute == "0" || - respirationBeatPerMinute == null || - respirationBeatPerMinute == 'null') { - respirationBeatPerMinute = - element.respirationBeatPerMinute.toString(); + if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') { + respirationBeatPerMinute = element.respirationBeatPerMinute.toString(); } - if (bloodPressure == "0 / 0" || - bloodPressure == null || - bloodPressure == 'null') { + if (bloodPressure == "0 / 0" || bloodPressure == null || bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } }); @@ -121,19 +111,18 @@ class UcafViewModel extends BaseViewModel { // setState(ViewState.Busy); await _ucafService.getPatientAssessment(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else { if (patientAssessmentList.isNotEmpty) { if (diagnosisConditions.length == 0) { - await _ucafService - .getMasterLookup(MasterKeysService.DiagnosisCondition); + await _ucafService.getMasterLookup(MasterKeysService.DiagnosisCondition); } if (diagnosisTypes.length == 0) { await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType); } if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -148,7 +137,7 @@ class UcafViewModel extends BaseViewModel { // setState(ViewState.Busy); await _ucafService.getOrderProcedures(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -161,7 +150,7 @@ class UcafViewModel extends BaseViewModel { // setState(ViewState.Busy); await _ucafService.getPrescription(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -169,13 +158,11 @@ class UcafViewModel extends BaseViewModel { } } - MasterKeyModel findMasterDataById( - {@required MasterKeysService masterKeys, dynamic id}) { + MasterKeyModel? findMasterDataById({required MasterKeysService masterKeys, dynamic id}) { switch (masterKeys) { case MasterKeysService.DiagnosisCondition: List result = diagnosisConditions.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -183,8 +170,7 @@ class UcafViewModel extends BaseViewModel { return null; case MasterKeysService.DiagnosisType: List result = diagnosisTypes.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -199,7 +185,7 @@ class UcafViewModel extends BaseViewModel { // setState(ViewState.Busy); await _ucafService.postUCAF(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); // but with empty list diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index bab2ff9f..0b05698c 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -11,7 +11,7 @@ import '../../locator.dart'; class VitalSignsViewModel extends BaseViewModel { VitalSignsService _vitalSignService = locator(); - VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; + VitalSignData? get patientVitalSigns => _vitalSignService.patientVitalSigns; List get patientVitalSignsHistory => _vitalSignService.patientVitalSignsHistory; @@ -35,7 +35,7 @@ class VitalSignsViewModel extends BaseViewModel { setState(ViewState.Busy); await _vitalSignService.getPatientVitalSign(patient); if (_vitalSignService.hasError) { - error = _vitalSignService.error; + error = _vitalSignService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -59,7 +59,7 @@ class VitalSignsViewModel extends BaseViewModel { } if (_vitalSignService.hasError) { - error = _vitalSignService.error; + error = _vitalSignService.error!; setState(ViewState.Error); } else { patientVitalSignsHistory.forEach((element) { @@ -150,7 +150,7 @@ class VitalSignsViewModel extends BaseViewModel { } } - String getTempratureMethod(int temperatureCelciusMethod) { + String? getTempratureMethod(int temperatureCelciusMethod) { // temperatureCelciusMethod ( vital sign response field )- master 2005 if (temperatureCelciusMethod == 1) { return "Oral"; diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 1d5f087a..96fa5c0d 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -83,7 +83,7 @@ class PatientViewModel extends BaseViewModel { isView: isView); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -95,7 +95,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getLabResultOrders(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -105,7 +105,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getOutPatientPrescriptions(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -115,7 +115,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getInPatientPrescriptions(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -125,7 +125,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPrescriptionReport(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -135,7 +135,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPatientRadiology(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -145,7 +145,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getLabResult(labOrdersResModel); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -155,7 +155,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPatientInsuranceApprovals(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -170,7 +170,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getPatientProgressNote(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -184,7 +184,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientService.updatePatientProgressNote(req); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -194,7 +194,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientService.createPatientProgressNote(req); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -204,7 +204,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getClinicsList(); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else { { @@ -218,7 +218,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientService.getDoctorsList(clinicId); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else { { @@ -246,7 +246,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getReferralFrequancyList(); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -260,17 +260,17 @@ class PatientViewModel extends BaseViewModel { } Future referToDoctor( - {String selectedDoctorID, - String selectedClinicID, - int admissionNo, - String extension, - String priority, - String frequency, - String referringDoctorRemarks, - int patientID, - int patientTypeID, - String roomID, - int projectID}) async { + {required String selectedDoctorID, + required String selectedClinicID, + required int admissionNo, + required String extension, + required String priority, + required String frequency, + required String referringDoctorRemarks, + required int patientID, + required int patientTypeID, + required String roomID, + required int projectID}) async { setState(ViewState.BusyLocal); await _patientService.referToDoctor( selectedClinicID: selectedClinicID, @@ -285,7 +285,7 @@ class PatientViewModel extends BaseViewModel { roomID: roomID, projectID: projectID); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -295,7 +295,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getArrivedList(); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -308,7 +308,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getInPatient(requestModel, false); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else { // setDefaultInPatientList(); @@ -323,7 +323,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getNursingProgressNote(requestModel); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -337,7 +337,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getDiagnosisForInPatient(requestModel); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -355,14 +355,14 @@ class PatientViewModel extends BaseViewModel { GetDiabeticChartValuesRequestModel requestModel = GetDiabeticChartValuesRequestModel( patientID: patient.patientId, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient.admissionNo!), patientTypeID: 1, patientType: 1, resultType: resultType, setupID: "010266"); await _patientService.getDiabeticChartValues(requestModel); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; if (isLocalBusy) setState(ViewState.ErrorLocal); else diff --git a/lib/core/viewModel/pednding_orders_view_model.dart b/lib/core/viewModel/pednding_orders_view_model.dart index 3f3e92be..e89345ee 100644 --- a/lib/core/viewModel/pednding_orders_view_model.dart +++ b/lib/core/viewModel/pednding_orders_view_model.dart @@ -15,26 +15,26 @@ class PendingOrdersViewModel extends BaseViewModel { List get admissionOrderList => _pendingOrderService.admissionOrderList; - Future getPendingOrders({int patientId, int admissionNo}) async { + Future getPendingOrders({required int patientId, required int admissionNo}) async { hasError = false; setState(ViewState.Busy); await _pendingOrderService.getPendingOrders( patientId: patientId, admissionNo: admissionNo); if (_pendingOrderService.hasError) { - error = _pendingOrderService.error; + error = _pendingOrderService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - Future getAdmissionOrders({int patientId, int admissionNo}) async { + Future getAdmissionOrders({required int patientId, required int admissionNo}) async { hasError = false; setState(ViewState.Busy); await _pendingOrderService.getAdmissionOrders( patientId: patientId, admissionNo: admissionNo); if (_pendingOrderService.hasError) { - error = _pendingOrderService.error; + error = _pendingOrderService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 96645618..53b95099 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -38,8 +38,8 @@ class PrescriptionViewModel extends BaseViewModel { List get itemMedicineList => _prescriptionService.itemMedicineList; PrescriptionsService _prescriptionsService = locator(); - List _prescriptionsOrderListClinic = List(); - List _prescriptionsOrderListHospital = List(); + List _prescriptionsOrderListClinic = []; + List _prescriptionsOrderListHospital = []; List get prescriptionReportList => _prescriptionsService.prescriptionReportList; @@ -68,25 +68,25 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getItem({int itemID}) async { + Future getItem({int? itemID}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getPrescription({int mrn}) async { + Future getPrescription({int? mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.getPrescription(mrn: mrn); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -98,7 +98,7 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.postPrescription(postProcedureReqModel); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else { await getPrescription(mrn: mrn); @@ -106,11 +106,11 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getMedicationList({String drug}) async { + Future getMedicationList({String? drug}) async { setState(ViewState.Busy); - await _prescriptionService.getMedicationList(drug: drug); + await _prescriptionService.getMedicationList(drug: drug!); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -122,7 +122,7 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.updatePrescription(updatePrescriptionReqModel); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else { await getPrescription(mrn: mrn); @@ -130,13 +130,13 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getDrugs({String drugName}) async { + Future getDrugs({String? drugName}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _prescriptionService.getDrugs(drugName: drugName); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -148,7 +148,7 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getDrugToDrug(vital, lstAssessments, allergy, patient, prescription); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -159,22 +159,22 @@ class PrescriptionViewModel extends BaseViewModel { notifyListeners(); } - getPrescriptionReport({Prescriptions prescriptions, @required PatiantInformtion patient}) async { + getPrescriptionReport({Prescriptions? prescriptions, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getListPharmacyForPrescriptions({int itemId, @required PatiantInformtion patient}) async { + getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -214,11 +214,11 @@ class PrescriptionViewModel extends BaseViewModel { }); } - getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async { + getPrescriptionReportEnh({PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -228,18 +228,18 @@ class PrescriptionViewModel extends BaseViewModel { _getPrescriptionsOrders() async { await _prescriptionsService.getPrescriptionsOrders(); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getPrescriptions(PatiantInformtion patient, {String patientType}) async { + getPrescriptions(PatiantInformtion patient, {String? patientType}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptions(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; if (patientType == "7") setState(ViewState.ErrorLocal); else @@ -256,7 +256,7 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionsService.getMedicationForInPatient(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart index 2548a59c..b1a23a14 100644 --- a/lib/core/viewModel/prescriptions_view_model.dart +++ b/lib/core/viewModel/prescriptions_view_model.dart @@ -17,8 +17,8 @@ class PrescriptionsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; PrescriptionsService _prescriptionsService = locator(); - List _prescriptionsOrderListClinic = List(); - List _prescriptionsOrderListHospital = List(); + List _prescriptionsOrderListClinic = []; + List _prescriptionsOrderListHospital = []; List get prescriptionReportList => _prescriptionsService.prescriptionReportList; @@ -32,13 +32,13 @@ class PrescriptionsViewModel extends BaseViewModel { List get medicationForInPatient => _prescriptionsService.medicationForInPatient; - List _medicationForInPatient = List(); + List _medicationForInPatient = []; getPrescriptions(PatiantInformtion patient) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptions(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { _filterList(); @@ -51,7 +51,7 @@ class PrescriptionsViewModel extends BaseViewModel { _getPrescriptionsOrders() async { await _prescriptionsService.getPrescriptionsOrders(); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -96,33 +96,33 @@ class PrescriptionsViewModel extends BaseViewModel { notifyListeners(); } - getPrescriptionReport({Prescriptions prescriptions, @required PatiantInformtion patient}) async { + getPrescriptionReport({Prescriptions? prescriptions, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getListPharmacyForPrescriptions({int itemId, @required PatiantInformtion patient}) async { + getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async { + getPrescriptionReportEnh({PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -132,7 +132,7 @@ class PrescriptionsViewModel extends BaseViewModel { getMedicationForInPatient(PatiantInformtion patient) async { await _prescriptionsService.getMedicationForInPatient(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index b576b7a4..4de6bbe3 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -40,8 +40,8 @@ class ProcedureViewModel extends BaseViewModel { List get categoryList => _procedureService.categoryList; RadiologyService _radiologyService = locator(); LabsService _labsService = locator(); - List _finalRadiologyListClinic = List(); - List _finalRadiologyListHospital = List(); + List _finalRadiologyListClinic = []; + List _finalRadiologyListHospital = []; List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; @@ -53,22 +53,22 @@ class ProcedureViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; List get procedureTemplate => _procedureService.templateList; - List templateList = List(); + List templateList = []; List get procedureTemplateDetails => _procedureService.templateDetailsList; - List _patientLabOrdersListClinic = List(); - List _patientLabOrdersListHospital = List(); + List _patientLabOrdersListClinic = []; + List _patientLabOrdersListHospital = []; - Future getProcedure({int mrn, String patientType, int appointmentNo}) async { + Future getProcedure({int? mrn, String? patientType, int? appointmentNo}) async { hasError = false; await getDoctorProfile(); //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo); + await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo!); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; if (patientType == "7") setState(ViewState.ErrorLocal); else @@ -77,14 +77,14 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureCategory({String categoryName, String categoryID, patientId}) async { + Future getProcedureCategory({String? categoryName, String? categoryID, patientId}) async { if (categoryName == null) return; hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureCategory( categoryName: categoryName, categoryID: categoryID, patientId: patientId); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -96,18 +96,18 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.getCategory(); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getProcedureTemplate({String categoryID}) async { + Future getProcedureTemplate({String? categoryID}) async { hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureTemplate(categoryID: categoryID); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { setTemplateListDependOnId(); @@ -133,14 +133,14 @@ class ProcedureViewModel extends BaseViewModel { int tempId = 0; - Future getProcedureTemplateDetails({int templateId}) async { - tempId = templateId; + Future getProcedureTemplateDetails({int? templateId}) async { + tempId = templateId!; hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _procedureService.getProcedureTemplateDetails(templateId: templateId); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -152,10 +152,10 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.postProcedure(postProcedureReqModel); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { - await getProcedure(mrn: mrn); + await getProcedure(mrn: mrn, appointmentNo: null); setState(ViewState.Idle); } } @@ -166,31 +166,31 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.valadteProcedure(procedureValadteRequestModel); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn}) async { + Future updateProcedure({UpdateProcedureRequestModel? updateProcedureRequestModel, int? mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.updateProcedure(updateProcedureRequestModel); + await _procedureService.updateProcedure(updateProcedureRequestModel!); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); //await getProcedure(mrn: mrn); } - void getPatientRadOrders(PatiantInformtion patient, {String patientType, bool isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, {String? patientType, bool isInPatient = false}) async { setState(ViewState.Busy); await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); if (_radiologyService.hasError) { - error = _radiologyService.error; + error = _radiologyService.error!; if (patientType == "7") setState(ViewState.ErrorLocal); else @@ -232,12 +232,12 @@ class ProcedureViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { + getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL( invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); if (_radiologyService.hasError) { - error = _radiologyService.error; + error = _radiologyService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -252,7 +252,7 @@ class ProcedureViewModel extends BaseViewModel { List get labResultList => _labsService.labResultList; - List labResultLists = List(); + List labResultLists = []; List get labResultListsCoustom { return labResultLists; @@ -262,7 +262,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _labsService.getPatientLabOrdersList(patient, isInpatient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -270,30 +270,30 @@ class ProcedureViewModel extends BaseViewModel { } getLaboratoryResult( - {String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async { + {String? projectID, int? clinicID, String? invoiceNo, String? orderNo, PatiantInformtion? patient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult( invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { + getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults( patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { bool isShouldClear = false; if (_labsService.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) + if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) isShouldClear = true; }); } @@ -302,35 +302,35 @@ class ProcedureViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { + sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; } else DrAppToastMsg.showSuccesToast(mes); } Future preparePostProcedure( - {String remarks, - String orderType, - PatiantInformtion patient, - List entityList, - ProcedureType procedureType}) async { + {String? remarks, + String? orderType, + PatiantInformtion? patient, + List? entityList, + ProcedureType? procedureType}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); - procedureValadteRequestModel.patientMRN = patient.patientMRN; + procedureValadteRequestModel.patientMRN = patient!.patientMRN; procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; - entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + entityList!.forEach((element) { + procedureValadteRequestModel.procedure = [element.procedureId!]; + List controls = []; controls.add( Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), ); @@ -344,8 +344,8 @@ class ProcedureViewModel extends BaseViewModel { postProcedureReqModel.procedures = controlsProcedure; await valadteProcedure(procedureValadteRequestModel); if (state == ViewState.Idle) { - if (valadteProcedureList[0].entityList.length == 0) { - await postProcedure(postProcedureReqModel, patient.patientMRN); + if (valadteProcedureList[0].entityList!.length == 0) { + await postProcedure(postProcedureReqModel, patient.patientMRN!); if (state == ViewState.ErrorLocal) { Helpers.showErrorToast(error); @@ -358,7 +358,7 @@ class ProcedureViewModel extends BaseViewModel { Helpers.showErrorToast(error); getProcedure(mrn: patient.patientMRN); } else if (state == ViewState.Idle) { - Helpers.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages); + Helpers.showErrorToast(valadteProcedureList[0].entityList![0].warringMessages); } } } else { diff --git a/lib/core/viewModel/profile/discharge_summary_view_model.dart b/lib/core/viewModel/profile/discharge_summary_view_model.dart index 9db5a6dd..79e1e62e 100644 --- a/lib/core/viewModel/profile/discharge_summary_view_model.dart +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -14,33 +14,41 @@ class DischargeSummaryViewModel extends BaseViewModel { List get pendingDischargeSummaryList => _dischargeSummaryService.pendingDischargeSummaryList; - List get allDisChargeSummaryList => _dischargeSummaryService.allDischargeSummaryList; - - Future getPendingDischargeSummary({int patientId, int admissionNo, }) async { - GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); + Future getPendingDischargeSummary({ + required int patientId, + required int admissionNo, + }) async { + GetDischargeSummaryReqModel getDischargeSummaryReqModel = + GetDischargeSummaryReqModel( + admissionNo: admissionNo, patientID: patientId); hasError = false; setState(ViewState.Busy); - await _dischargeSummaryService.getPendingDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); + await _dischargeSummaryService.getPendingDischargeSummary( + getDischargeSummaryReqModel: getDischargeSummaryReqModel); if (_dischargeSummaryService.hasError) { - error = _dischargeSummaryService.error; + error = _dischargeSummaryService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - - - Future getAllDischargeSummary({int patientId, int admissionNo, }) async { - GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); + Future getAllDischargeSummary({ + int? patientId, + int? admissionNo, + }) async { + GetDischargeSummaryReqModel getDischargeSummaryReqModel = + GetDischargeSummaryReqModel( + admissionNo: admissionNo!, patientID: patientId!); hasError = false; setState(ViewState.Busy); - await _dischargeSummaryService.getAllDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); + await _dischargeSummaryService.getAllDischargeSummary( + getDischargeSummaryReqModel: getDischargeSummaryReqModel); if (_dischargeSummaryService.hasError) { - error = _dischargeSummaryService.error; + error = _dischargeSummaryService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/profile/operation_report_view_model.dart b/lib/core/viewModel/profile/operation_report_view_model.dart index e3f4f430..1d37bc16 100644 --- a/lib/core/viewModel/profile/operation_report_view_model.dart +++ b/lib/core/viewModel/profile/operation_report_view_model.dart @@ -23,7 +23,7 @@ class OperationReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _operationReportService.getReservations(patientId: patientId); if (_operationReportService.hasError) { - error = _operationReportService.error; + error = _operationReportService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -36,7 +36,7 @@ class OperationReportViewModel extends BaseViewModel { GetOperationDetailsRequestModel getOperationReportRequestModel = GetOperationDetailsRequestModel(reservationNo:reservation.oTReservationID, patientID: reservation.patientID, setupID: "010266" ); await _operationReportService.getOperationReportDetails(getOperationReportRequestModel:getOperationReportRequestModel); if (_operationReportService.hasError) { - error = _operationReportService.error; + error = _operationReportService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -51,7 +51,7 @@ class OperationReportViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _operationReportService.updateOperationReport(createUpdateOperationReport); if (_operationReportService.hasError) { - error = _operationReportService.error; + error = _operationReportService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index b363800f..9acc6913 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -52,7 +52,7 @@ class ProjectViewModel with ChangeNotifier { void loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getString(APP_Language); - _appLocale = Locale(currentLanguage ?? 'en'); + _appLocale = Locale(currentLanguage); _isArabic = currentLanguage == 'ar' ? true : false; @@ -111,7 +111,7 @@ class ProjectViewModel with ChangeNotifier { void getProfile() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile.doctorID,clinicID: doctorProfile.clinicID, projectID: doctorProfile.projectID,); + ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile!.doctorID,clinicID: doctorProfile!.clinicID, projectID: doctorProfile!.projectID,); await Provider.of(AppGlobal.CONTEX, listen: false) .getDoctorProfileBasedOnClinic(clinicModel); diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index d656de6c..0a30f9f2 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -12,8 +12,8 @@ class RadiologyViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; RadiologyService _radiologyService = locator(); - List _finalRadiologyListClinic = List(); - List _finalRadiologyListHospital = List(); + List _finalRadiologyListClinic = []; + List _finalRadiologyListHospital = []; List get finalRadiologyList => filterType == FilterType.Clinic @@ -26,7 +26,7 @@ class RadiologyViewModel extends BaseViewModel { await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); if (_radiologyService.hasError) { - error = _radiologyService.error; + error = _radiologyService.error!; setState(ViewState.Error); } else { _radiologyService.finalRadiologyList.forEach((element) { @@ -72,11 +72,7 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL( invoiceNo: invoiceNo, @@ -84,7 +80,7 @@ class RadiologyViewModel extends BaseViewModel { projectId: projectId, patient: patient); if (_radiologyService.hasError) { - error = _radiologyService.error; + error = _radiologyService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/referral_view_model.dart b/lib/core/viewModel/referral_view_model.dart index 892284e2..11d37aa6 100644 --- a/lib/core/viewModel/referral_view_model.dart +++ b/lib/core/viewModel/referral_view_model.dart @@ -16,7 +16,7 @@ class ReferralPatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getMyReferralPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -27,7 +27,7 @@ class ReferralPatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.replay(referredDoctorRemarks, model); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/scan_qr_view_model.dart b/lib/core/viewModel/scan_qr_view_model.dart index b49078c7..02f98ef7 100644 --- a/lib/core/viewModel/scan_qr_view_model.dart +++ b/lib/core/viewModel/scan_qr_view_model.dart @@ -15,7 +15,7 @@ class ScanQrViewModel extends BaseViewModel { await _scanQrService.getInPatient(requestModel, isMyInpatient); if (_scanQrService.hasError) { - error = _scanQrService.error; + error = _scanQrService.error!; setState(ViewState.ErrorLocal); } else { diff --git a/lib/core/viewModel/schedule_view_model.dart b/lib/core/viewModel/schedule_view_model.dart index 3ee64c9b..051ef80c 100644 --- a/lib/core/viewModel/schedule_view_model.dart +++ b/lib/core/viewModel/schedule_view_model.dart @@ -15,7 +15,7 @@ class ScheduleViewModel extends BaseViewModel { setState(ViewState.Busy); await _scheduleService.getDoctorSchedule(); if (_scheduleService.hasError) { - error = _scheduleService.error; + error = _scheduleService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 7a7f4575..598c6c2f 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -39,7 +39,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _sickLeaveService.addSickLeave(addSickLeaveRequest); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -49,7 +49,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _sickLeaveService.extendSickLeave(extendSickLeaveRequest); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -59,7 +59,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getStatistics(appoNo, patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -69,7 +69,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getSickLeave(patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -82,7 +82,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getSickLeavePatient(patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.ErrorLocal); } else @@ -99,7 +99,7 @@ class SickLeaveViewModel extends BaseViewModel { final results = await Future.wait(services); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; // if (isLocalBusy) setState(ViewState.ErrorLocal); // else @@ -113,7 +113,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getSickLeaveDoctor(patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -123,7 +123,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getRescheduleLeave(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -133,7 +133,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getOffTime(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -143,7 +143,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getReasonsByID(id: id); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -153,7 +153,7 @@ class SickLeaveViewModel extends BaseViewModel { //setState(ViewState.Busy); await _sickLeaveService.getCoveringDoctors(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; // setState(ViewState.Error); } //else @@ -165,7 +165,7 @@ class SickLeaveViewModel extends BaseViewModel { await _sickLeaveService.addReschedule(request); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -175,7 +175,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.updateReschedule(request); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index a73be2e3..293f8f2d 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -23,8 +23,8 @@ import 'package:flutter/widgets.dart'; class DoctorApp { DoctorApp._(); - static const _kFontFam = 'DoctorApp'; - static const String _kFontPkg = null; + static const _kFontFam = 'DoctorApp'; + static const String? _kFontPkg = null; static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); diff --git a/lib/landing_page.dart b/lib/landing_page.dart index fcdb1eff..84b424ab 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -8,7 +8,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -21,7 +20,7 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State { int currentTab = 0; - PageController pageController; + late PageController pageController; _changeCurrentTab(int tab) { setState(() { @@ -113,7 +112,7 @@ class MyAppbar extends StatelessWidget with PreferredSizeWidget { @override final Size preferredSize; - MyAppbar({Key key}) + MyAppbar({Key ? key}) : preferredSize = Size.fromHeight(0.0), super(key: key); @override diff --git a/lib/models/SOAP/Allergy_model.dart b/lib/models/SOAP/Allergy_model.dart index c3493832..b86aca46 100644 --- a/lib/models/SOAP/Allergy_model.dart +++ b/lib/models/SOAP/Allergy_model.dart @@ -1,16 +1,16 @@ class AllergyModel { - int allergyDiseaseId; - String allergyDiseaseName; - int allergyDiseaseType; - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - int episodeID; - bool isChecked; - bool isUpdatedByNurse; - int severity; - String severityName; + int? allergyDiseaseId; + String? allergyDiseaseName; + int? allergyDiseaseType; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + int? episodeID; + bool? isChecked; + bool? isUpdatedByNurse; + int? severity; + String? severityName; AllergyModel( {this.allergyDiseaseId, diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index f04fd8d4..c964b8ce 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -1,10 +1,10 @@ class GetChiefComplaintReqModel { - int patientMRN; - int appointmentNo; - int episodeId; - int episodeID; + int? patientMRN; + int? appointmentNo; + int? episodeId; + int? episodeID; dynamic doctorID; - int admissionNo; + int? admissionNo; GetChiefComplaintReqModel( {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo}); diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart index 85ada324..f43572fb 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart @@ -1,16 +1,16 @@ class GetChiefComplaintResModel { - int appointmentNo; - String ccdate; - String chiefComplaint; - String clinicDescription; - int clinicID; - String currentMedication; - int doctorID; - String doctorName; - int episodeId; - String hopi; - int patientMRN; - int status; + int? appointmentNo; + String? ccdate; + String? chiefComplaint; + String? clinicDescription; + int? clinicID; + String? currentMedication; + int? doctorID; + String? doctorName; + int? episodeId; + String? hopi; + int? patientMRN; + int? status; GetChiefComplaintResModel( {this.appointmentNo, diff --git a/lib/models/SOAP/GeneralGetReqForSOAP.dart b/lib/models/SOAP/GeneralGetReqForSOAP.dart index 70e76313..65ba7d6b 100644 --- a/lib/models/SOAP/GeneralGetReqForSOAP.dart +++ b/lib/models/SOAP/GeneralGetReqForSOAP.dart @@ -1,7 +1,7 @@ class GeneralGetReqForSOAP { - int patientMRN; - int appointmentNo; - int episodeId; + int? patientMRN; + int? appointmentNo; + int? episodeId; dynamic editedBy; dynamic doctorID; diff --git a/lib/models/SOAP/GetAllergiesResModel.dart b/lib/models/SOAP/GetAllergiesResModel.dart index 1eeca63e..bda08928 100644 --- a/lib/models/SOAP/GetAllergiesResModel.dart +++ b/lib/models/SOAP/GetAllergiesResModel.dart @@ -1,17 +1,17 @@ class GetAllergiesResModel { - int allergyDiseaseId; - String allergyDiseaseName; - int allergyDiseaseType; - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - int episodeID; - bool isChecked; - bool isUpdatedByNurse; - int severity; - String severityName; - String remarks; + int? allergyDiseaseId; + String? allergyDiseaseName; + int? allergyDiseaseType; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + int? episodeID; + bool? isChecked; + bool? isUpdatedByNurse; + int? severity; + String? severityName; + String? remarks; GetAllergiesResModel( {this.allergyDiseaseId, diff --git a/lib/models/SOAP/GetAssessmentReqModel.dart b/lib/models/SOAP/GetAssessmentReqModel.dart index 965382b5..0cef8abc 100644 --- a/lib/models/SOAP/GetAssessmentReqModel.dart +++ b/lib/models/SOAP/GetAssessmentReqModel.dart @@ -1,10 +1,10 @@ class GetAssessmentReqModel { - int patientMRN; - int appointmentNo; - String episodeID; - String from; - String to; - int clinicID; + int? patientMRN; + int? appointmentNo; + String? episodeID; + String? from; + String? to; + int? clinicID; dynamic doctorID; dynamic editedBy; diff --git a/lib/models/SOAP/GetAssessmentResModel.dart b/lib/models/SOAP/GetAssessmentResModel.dart index 4d1b1b68..689ab00d 100644 --- a/lib/models/SOAP/GetAssessmentResModel.dart +++ b/lib/models/SOAP/GetAssessmentResModel.dart @@ -1,19 +1,19 @@ class GetAssessmentResModel { - int appointmentNo; - String asciiDesc; - String clinicDescription; - int clinicID; - bool complexDiagnosis; - int conditionID; - int createdBy; - String createdOn; - int diagnosisTypeID; - int doctorID; - String doctorName; - int episodeId; - String icdCode10ID; - int patientMRN; - String remarks; + int? appointmentNo; + String? asciiDesc; + String? clinicDescription; + int? clinicID; + bool? complexDiagnosis; + int? conditionID; + int? createdBy; + String? createdOn; + int? diagnosisTypeID; + int? doctorID; + String? doctorName; + int? episodeId; + String? icdCode10ID; + int? patientMRN; + String? remarks; GetAssessmentResModel( {this.appointmentNo, diff --git a/lib/models/SOAP/GetGetProgressNoteReqModel.dart b/lib/models/SOAP/GetGetProgressNoteReqModel.dart index 1da4a8bf..1ca1244e 100644 --- a/lib/models/SOAP/GetGetProgressNoteReqModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteReqModel.dart @@ -1,10 +1,10 @@ class GetGetProgressNoteReqModel { - int patientMRN; - int appointmentNo; - String episodeID; - String from; - String to; - int clinicID; + int? patientMRN; + int? appointmentNo; + String? episodeID; + String? from; + String? to; + int? clinicID; dynamic doctorID; dynamic editedBy; diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/models/SOAP/GetGetProgressNoteResModel.dart index 4ae7ed8c..f670b2f3 100644 --- a/lib/models/SOAP/GetGetProgressNoteResModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteResModel.dart @@ -1,15 +1,15 @@ -class GetPatientProgressNoteResModel { - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - String dName; - String editedByName; - String editedOn; - int episodeId; - String mName; - int patientMRN; - String planNote; +class GetPatientProgressNoteResModel { + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + String? dName; + String? editedByName; + String? editedOn; + int? episodeId; + String? mName; + int? patientMRN; + String? planNote; GetPatientProgressNoteResModel( {this.appointmentNo, diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/models/SOAP/GetHistoryReqModel.dart index 720b6342..a9cc3d0f 100644 --- a/lib/models/SOAP/GetHistoryReqModel.dart +++ b/lib/models/SOAP/GetHistoryReqModel.dart @@ -1,11 +1,11 @@ class GetHistoryReqModel { - int patientMRN; - int historyType; - String episodeID; - String from; - String to; - int clinicID; - int appointmentNo; + int? patientMRN; + int? historyType; + String? episodeID; + String? from; + String? to; + int? clinicID; + int? appointmentNo; dynamic editedBy; dynamic doctorID; diff --git a/lib/models/SOAP/GetHistoryResModel.dart b/lib/models/SOAP/GetHistoryResModel.dart index c4b4f129..e8473a43 100644 --- a/lib/models/SOAP/GetHistoryResModel.dart +++ b/lib/models/SOAP/GetHistoryResModel.dart @@ -1,11 +1,11 @@ class GetHistoryResModel { - int appointmentNo; - int episodeId; - int historyId; - int historyType; - bool isChecked; - int patientMRN; - String remarks; + int? appointmentNo; + int? episodeId; + int? historyId; + int? historyType; + bool? isChecked; + int? patientMRN; + String? remarks; GetHistoryResModel( {this.appointmentNo, diff --git a/lib/models/SOAP/GetPhysicalExamListResModel.dart b/lib/models/SOAP/GetPhysicalExamListResModel.dart index c97189b1..33b4d18e 100644 --- a/lib/models/SOAP/GetPhysicalExamListResModel.dart +++ b/lib/models/SOAP/GetPhysicalExamListResModel.dart @@ -1,23 +1,23 @@ class GetPhysicalExamResModel { - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - Null editedBy; - String editedByName; - String editedOn; - int episodeId; - int examId; - String examName; - int examType; - int examinationType; - String examinationTypeName; - bool isAbnormal; - bool isNew; - bool isNormal; - bool notExamined; - int patientMRN; - String remarks; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + dynamic editedBy; + String? editedByName; + String? editedOn; + int? episodeId; + int? examId; + String? examName; + int? examType; + int? examinationType; + String? examinationTypeName; + bool? isAbnormal; + bool? isNew; + bool? isNormal; + bool? notExamined; + int? patientMRN; + String? remarks; GetPhysicalExamResModel( {this.appointmentNo, diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index 710dafd1..ea2d8f97 100644 --- a/lib/models/SOAP/GetPhysicalExamReqModel.dart +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -1,10 +1,10 @@ class GetPhysicalExamReqModel { - int patientMRN; - int appointmentNo; - int admissionNo; - String episodeID; - String from; - String to; + int? patientMRN; + int? appointmentNo; + int? admissionNo; + String? episodeID; + String? from; + String? to; dynamic editedBy; dynamic doctorID; diff --git a/lib/models/SOAP/PatchAssessmentReqModel.dart b/lib/models/SOAP/PatchAssessmentReqModel.dart index 8cbf5cb7..f37683a4 100644 --- a/lib/models/SOAP/PatchAssessmentReqModel.dart +++ b/lib/models/SOAP/PatchAssessmentReqModel.dart @@ -1,13 +1,13 @@ class PatchAssessmentReqModel { - int patientMRN; - int appointmentNo; - int episodeID; - String icdcode10Id; - String prevIcdCode10ID; - int conditionId; - int diagnosisTypeId; - bool complexDiagnosis; - String remarks; + int? patientMRN; + int? appointmentNo; + int? episodeID; + String? icdcode10Id; + String? prevIcdCode10ID; + int? conditionId; + int? diagnosisTypeId; + bool? complexDiagnosis; + String? remarks; PatchAssessmentReqModel( {this.patientMRN, diff --git a/lib/models/SOAP/PostEpisodeReqModel.dart b/lib/models/SOAP/PostEpisodeReqModel.dart index 6d3ee45a..c0f7dec1 100644 --- a/lib/models/SOAP/PostEpisodeReqModel.dart +++ b/lib/models/SOAP/PostEpisodeReqModel.dart @@ -1,8 +1,8 @@ class PostEpisodeReqModel { - int appointmentNo; - int patientMRN; - int doctorID; - String vidaAuthTokenID; + int? appointmentNo; + int? patientMRN; + int? doctorID; + String? vidaAuthTokenID; PostEpisodeReqModel( {this.appointmentNo, diff --git a/lib/models/SOAP/get_Allergies_request_model.dart b/lib/models/SOAP/get_Allergies_request_model.dart index 7676d530..d5b9972e 100644 --- a/lib/models/SOAP/get_Allergies_request_model.dart +++ b/lib/models/SOAP/get_Allergies_request_model.dart @@ -1,9 +1,9 @@ class GetAllergiesRequestModel { - String vidaAuthTokenID; - int patientMRN; - int appointmentNo; - int episodeId; - String doctorID; + String? vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; + int? episodeId; + String? doctorID; GetAllergiesRequestModel( {this.vidaAuthTokenID, diff --git a/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart b/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart index 2b49066e..4d5efc98 100644 --- a/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart +++ b/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart @@ -1,7 +1,7 @@ class GetEpisodeForInpatientReqModel { - int patientID; - int patientTypeID; - int admissionNo; + int? patientID; + int? patientTypeID; + int? admissionNo; GetEpisodeForInpatientReqModel( {this.patientID, this.patientTypeID, this.admissionNo}); diff --git a/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart b/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart index 2dff7a60..b9ea104e 100644 --- a/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart +++ b/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart @@ -1,7 +1,7 @@ class PostEpisodeForInpatientRequestModel { - int admissionNo; - int patientID; - int patientTypeID; + int? admissionNo; + int? patientID; + int? patientTypeID; PostEpisodeForInpatientRequestModel( {this.admissionNo, this.patientID, this.patientTypeID = 1}); diff --git a/lib/models/SOAP/master_key_model.dart b/lib/models/SOAP/master_key_model.dart index a1c32039..acbdee64 100644 --- a/lib/models/SOAP/master_key_model.dart +++ b/lib/models/SOAP/master_key_model.dart @@ -1,6 +1,6 @@ class MasterKeyModel { - String alias; - String aliasN; + String? alias; + String? aliasN; dynamic code; dynamic description; dynamic detail1; @@ -8,13 +8,13 @@ class MasterKeyModel { dynamic detail3; dynamic detail4; dynamic detail5; - int groupID; - int id; - String nameAr; - String nameEn; + int? groupID; + int? id; + String? nameAr; + String? nameEn; dynamic remarks; - int typeId; - String valueList; + int? typeId; + String? valueList; MasterKeyModel( {this.alias, diff --git a/lib/models/SOAP/order-procedure.dart b/lib/models/SOAP/order-procedure.dart index 4e134a07..6bc27d32 100644 --- a/lib/models/SOAP/order-procedure.dart +++ b/lib/models/SOAP/order-procedure.dart @@ -1,29 +1,28 @@ class OrderProcedure { - - String achiCode; - String appointmentDate; - int appointmentNo; - int categoryID; - String clinicDescription; - String cptCode; - int createdBy; - String createdOn; - String doctorName; - bool isApprovalCreated; - bool isApprovalRequired; - bool isCovered; - bool isInvoiced; - bool isReferralInvoiced; - bool isUncoveredByDoctor; - int lineItemNo; - String orderDate; - int orderNo; - int orderType; - String procedureId; - String procedureName; - String remarks; - String status; - String template; + String? achiCode; + String? appointmentDate; + int? appointmentNo; + int? categoryID; + String? clinicDescription; + String? cptCode; + int? createdBy; + String? createdOn; + String? doctorName; + bool? isApprovalCreated; + bool? isApprovalRequired; + bool? isCovered; + bool? isInvoiced; + bool? isReferralInvoiced; + bool? isUncoveredByDoctor; + int? lineItemNo; + String? orderDate; + int? orderNo; + int? orderType; + String? procedureId; + String? procedureName; + String? remarks; + String? status; + String? template; OrderProcedure( {this.achiCode, diff --git a/lib/models/SOAP/post_allergy_request_model.dart b/lib/models/SOAP/post_allergy_request_model.dart index 6783d885..2c965da1 100644 --- a/lib/models/SOAP/post_allergy_request_model.dart +++ b/lib/models/SOAP/post_allergy_request_model.dart @@ -1,16 +1,13 @@ class PostAllergyRequestModel { - List - listHisProgNotePatientAllergyDiseaseVM; + List? listHisProgNotePatientAllergyDiseaseVM; PostAllergyRequestModel({this.listHisProgNotePatientAllergyDiseaseVM}); PostAllergyRequestModel.fromJson(Map json) { if (json['listHisProgNotePatientAllergyDiseaseVM'] != null) { - listHisProgNotePatientAllergyDiseaseVM = - new List(); + listHisProgNotePatientAllergyDiseaseVM = []; json['listHisProgNotePatientAllergyDiseaseVM'].forEach((v) { - listHisProgNotePatientAllergyDiseaseVM - .add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); + listHisProgNotePatientAllergyDiseaseVM!.add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); }); } } @@ -18,29 +15,27 @@ class PostAllergyRequestModel { Map toJson() { final Map data = new Map(); if (this.listHisProgNotePatientAllergyDiseaseVM != null) { - data['listHisProgNotePatientAllergyDiseaseVM'] = this - .listHisProgNotePatientAllergyDiseaseVM - .map((v) => v.toJson()) - .toList(); + data['listHisProgNotePatientAllergyDiseaseVM'] = + this.listHisProgNotePatientAllergyDiseaseVM!.map((v) => v.toJson()).toList(); } return data; } } class ListHisProgNotePatientAllergyDiseaseVM { - int patientMRN; - int allergyDiseaseType; - int allergyDiseaseId; - int episodeId; - int appointmentNo; - int severity; - bool isChecked; - bool isUpdatedByNurse; - String remarks; - int createdBy; - String createdOn; - int editedBy; - String editedOn; + int? patientMRN; + int? allergyDiseaseType; + int? allergyDiseaseId; + int? episodeId; + int? appointmentNo; + int? severity; + bool? isChecked; + bool? isUpdatedByNurse; + String? remarks; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; ListHisProgNotePatientAllergyDiseaseVM( {this.patientMRN, diff --git a/lib/models/SOAP/post_assessment_request_model.dart b/lib/models/SOAP/post_assessment_request_model.dart index af577671..3222f248 100644 --- a/lib/models/SOAP/post_assessment_request_model.dart +++ b/lib/models/SOAP/post_assessment_request_model.dart @@ -1,23 +1,19 @@ class PostAssessmentRequestModel { - int patientMRN; - int appointmentNo; - int episodeId; - List icdCodeDetails; + int? patientMRN; + int? appointmentNo; + int? episodeId; + List? icdCodeDetails; - PostAssessmentRequestModel( - {this.patientMRN, - this.appointmentNo, - this.episodeId, - this.icdCodeDetails}); + PostAssessmentRequestModel({this.patientMRN, this.appointmentNo, this.episodeId, this.icdCodeDetails}); PostAssessmentRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeID']; if (json['icdCodeDetails'] != null) { - icdCodeDetails = new List(); + icdCodeDetails = []; json['icdCodeDetails'].forEach((v) { - icdCodeDetails.add(new IcdCodeDetails.fromJson(v)); + icdCodeDetails!.add(new IcdCodeDetails.fromJson(v)); }); } } @@ -28,26 +24,20 @@ class PostAssessmentRequestModel { data['AppointmentNo'] = this.appointmentNo; data['EpisodeID'] = this.episodeId; if (this.icdCodeDetails != null) { - data['icdCodeDetails'] = - this.icdCodeDetails.map((v) => v.toJson()).toList(); + data['icdCodeDetails'] = this.icdCodeDetails!.map((v) => v.toJson()).toList(); } return data; } } class IcdCodeDetails { - String icdcode10Id; - int conditionId; - int diagnosisTypeId; - bool complexDiagnosis; - String remarks; + String? icdcode10Id; + int? conditionId; + int? diagnosisTypeId; + bool? complexDiagnosis; + String? remarks; - IcdCodeDetails( - {this.icdcode10Id, - this.conditionId, - this.diagnosisTypeId, - this.complexDiagnosis, - this.remarks}); + IcdCodeDetails({this.icdcode10Id, this.conditionId, this.diagnosisTypeId, this.complexDiagnosis, this.remarks}); IcdCodeDetails.fromJson(Map json) { icdcode10Id = json['icdcode10Id']; diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index 682342df..56b97a92 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -1,14 +1,14 @@ class PostChiefComplaintRequestModel { - int appointmentNo; - int episodeID; - int patientMRN; - int admissionNo; - String chiefComplaint; - String hopi; - String currentMedication; - bool ispregnant; - bool isLactation; - int numberOfWeeks; + int? appointmentNo; + int? episodeID; + int? patientMRN; + int? admissionNo; + String? chiefComplaint; + String? hopi; + String? currentMedication; + bool? ispregnant; + bool? isLactation; + int? numberOfWeeks; dynamic doctorID; dynamic editedBy; diff --git a/lib/models/SOAP/post_histories_request_model.dart b/lib/models/SOAP/post_histories_request_model.dart index d8be3fb2..689e4e57 100644 --- a/lib/models/SOAP/post_histories_request_model.dart +++ b/lib/models/SOAP/post_histories_request_model.dart @@ -1,14 +1,14 @@ class PostHistoriesRequestModel { - List listMedicalHistoryVM; + List? listMedicalHistoryVM; dynamic doctorID; PostHistoriesRequestModel({this.listMedicalHistoryVM, this.doctorID}); PostHistoriesRequestModel.fromJson(Map json) { if (json['listMedicalHistoryVM'] != null) { - listMedicalHistoryVM = new List(); + listMedicalHistoryVM = []; json['listMedicalHistoryVM'].forEach((v) { - listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v)); + listMedicalHistoryVM!.add(new ListMedicalHistoryVM.fromJson(v)); }); } doctorID = json['DoctorID']; @@ -17,8 +17,7 @@ class PostHistoriesRequestModel { Map toJson() { final Map data = new Map(); if (this.listMedicalHistoryVM != null) { - data['listMedicalHistoryVM'] = - this.listMedicalHistoryVM.map((v) => v.toJson()).toList(); + data['listMedicalHistoryVM'] = this.listMedicalHistoryVM!.map((v) => v.toJson()).toList(); } data['DoctorID'] = this.doctorID; return data; @@ -26,13 +25,13 @@ class PostHistoriesRequestModel { } class ListMedicalHistoryVM { - int patientMRN; - int historyType; - int historyId; - int episodeId; - int appointmentNo; - bool isChecked; - String remarks; + int? patientMRN; + int? historyType; + int? historyId; + int? episodeId; + int? appointmentNo; + bool? isChecked; + String? remarks; ListMedicalHistoryVM( {this.patientMRN, diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index f056f168..e8281db5 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -1,16 +1,15 @@ class PostPhysicalExamRequestModel { List - listHisProgNotePhysicalExaminationVM; + ? listHisProgNotePhysicalExaminationVM; PostPhysicalExamRequestModel({this.listHisProgNotePhysicalExaminationVM}); PostPhysicalExamRequestModel.fromJson(Map json) { if (json['listHisProgNotePhysicalExaminationVM'] != null) { listHisProgNotePhysicalExaminationVM = - new List(); + []; json['listHisProgNotePhysicalExaminationVM'].forEach((v) { - listHisProgNotePhysicalExaminationVM - .add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); + listHisProgNotePhysicalExaminationVM!.add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); }); } } @@ -20,7 +19,7 @@ class PostPhysicalExamRequestModel { if (this.listHisProgNotePhysicalExaminationVM != null) { data['listHisProgNotePhysicalExaminationVM'] = this .listHisProgNotePhysicalExaminationVM - .map((v) => v.toJson()) + !.map((v) => v.toJson()) .toList(); } return data; @@ -28,55 +27,52 @@ class PostPhysicalExamRequestModel { } class ListHisProgNotePhysicalExaminationVM { - int episodeId; - int appointmentNo; - int admissionNo; - int examType; - int examId; - int patientMRN; - bool isNormal; - bool isAbnormal; - bool notExamined; - String examName; - String examinationTypeName; - int examinationType; - String remarks; - bool isNew; - int createdBy; - String createdOn; - String createdByName; - int editedBy; - String editedOn; - String editedByName; + int? episodeId; + int? appointmentNo; + int? admissionNo; + int? examType; + int? examId; + int? patientMRN; + bool? isNormal; + bool? isAbnormal; + bool? notExamined; + String? examName; + String? examinationTypeName; + int? examinationType; + String? remarks; + bool? isNew; + int? createdBy; + String? createdOn; + String? createdByName; + int? editedBy; + String? editedOn; + String? editedByName; ListHisProgNotePhysicalExaminationVM( {this.episodeId, - this.appointmentNo, - this.admissionNo, - this.examType, - this.examId, - this.patientMRN, - this.isNormal, - this.isAbnormal, - this.notExamined, - this.examName, - this.examinationTypeName, - this.examinationType, - this.remarks, - this.isNew, - this.createdBy, - this.createdOn, - this.createdByName, - this.editedBy, - this.editedOn, - this.editedByName}); + this.appointmentNo, + this.admissionNo,this.examType, + this.examId, + this.patientMRN, + this.isNormal, + this.isAbnormal, + this.notExamined, + this.examName, + this.examinationTypeName, + this.examinationType, + this.remarks, + this.isNew, + this.createdBy, + this.createdOn, + this.createdByName, + this.editedBy, + this.editedOn, + this.editedByName}); ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { episodeId = json['episodeId']; appointmentNo = json['appointmentNo']; - admissionNo = json['AdmissionNo']; - - examType = json['examType']; + admissionNo = json['AdmissionNo'];examType = json['examType']; examId = json['examId']; patientMRN = json['patientMRN']; isNormal = json['isNormal']; @@ -99,8 +95,7 @@ class ListHisProgNotePhysicalExaminationVM { final Map data = new Map(); data['episodeId'] = this.episodeId; data['appointmentNo'] = this.appointmentNo; - data['admissionNo'] = this.admissionNo; - data['examType'] = this.examType; + data['admissionNo'] = this.admissionNo;data['examType'] = this.examType; data['examId'] = this.examId; data['patientMRN'] = this.patientMRN; data['isNormal'] = this.isNormal; diff --git a/lib/models/SOAP/post_progress_note_request_model.dart b/lib/models/SOAP/post_progress_note_request_model.dart index 2925819d..a96a9fcb 100644 --- a/lib/models/SOAP/post_progress_note_request_model.dart +++ b/lib/models/SOAP/post_progress_note_request_model.dart @@ -1,8 +1,8 @@ class PostProgressNoteRequestModel { - int appointmentNo; - int episodeId; - int patientMRN; - String planNote; + int? appointmentNo; + int? episodeId; + int? patientMRN; + String? planNote; dynamic doctorID; dynamic editedBy; diff --git a/lib/models/SOAP/selected_items/my_selected_allergy.dart b/lib/models/SOAP/selected_items/my_selected_allergy.dart index 512a4f64..588247f6 100644 --- a/lib/models/SOAP/selected_items/my_selected_allergy.dart +++ b/lib/models/SOAP/selected_items/my_selected_allergy.dart @@ -1,14 +1,14 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedAllergy { - MasterKeyModel selectedAllergySeverity; - MasterKeyModel selectedAllergy; - String remark; - bool isChecked; - bool isExpanded; - bool isLocal; - int createdBy; - bool hasValidationError; + MasterKeyModel? selectedAllergySeverity; + MasterKeyModel? selectedAllergy; + String? remark; + bool? isChecked; + bool? isExpanded; + bool? isLocal; + int? createdBy; + bool? hasValidationError; MySelectedAllergy( {this.selectedAllergySeverity, diff --git a/lib/models/SOAP/selected_items/my_selected_assement.dart b/lib/models/SOAP/selected_items/my_selected_assement.dart index 01572e6d..13a95905 100644 --- a/lib/models/SOAP/selected_items/my_selected_assement.dart +++ b/lib/models/SOAP/selected_items/my_selected_assement.dart @@ -1,16 +1,16 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedAssessment { - MasterKeyModel selectedICD; - MasterKeyModel selectedDiagnosisCondition; - MasterKeyModel selectedDiagnosisType; - String remark; - int appointmentId; - int createdBy; - String createdOn; - int doctorID; - String doctorName; - String icdCode10ID; + MasterKeyModel? selectedICD; + MasterKeyModel? selectedDiagnosisCondition; + MasterKeyModel? selectedDiagnosisType; + String? remark; + int? appointmentId; + int? createdBy; + String? createdOn; + int? doctorID; + String? doctorName; + String? icdCode10ID; MySelectedAssessment( {this.selectedICD, diff --git a/lib/models/admisson_orders/admission_orders_model.dart b/lib/models/admisson_orders/admission_orders_model.dart index a0891a02..01539342 100644 --- a/lib/models/admisson_orders/admission_orders_model.dart +++ b/lib/models/admisson_orders/admission_orders_model.dart @@ -1,15 +1,15 @@ class AdmissionOrdersModel { - int procedureID; - String procedureName; - String procedureNameN; - int orderNo; - int doctorID; - int clinicID; - String createdOn; - int createdBy; - String editedOn; - int editedBy; - String createdByName; + int? procedureID; + String? procedureName; + String? procedureNameN; + int? orderNo; + int? doctorID; + int? clinicID; + String? createdOn; + int? createdBy; + String? editedOn; + int? editedBy; + String? createdByName; AdmissionOrdersModel( {this.procedureID, diff --git a/lib/models/admisson_orders/admission_orders_request_model.dart b/lib/models/admisson_orders/admission_orders_request_model.dart index 897bb8f8..4b6296e5 100644 --- a/lib/models/admisson_orders/admission_orders_request_model.dart +++ b/lib/models/admisson_orders/admission_orders_request_model.dart @@ -1,20 +1,20 @@ class AdmissionOrdersRequestModel { - bool isDentalAllowedBackend; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int deviceTypeID; - String tokenID; - int patientID; - int admissionNo; - String sessionID; - int projectID; - String setupID; - bool patientOutSA; - int patientType; - int patientTypeID; + bool? isDentalAllowedBackend; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? deviceTypeID; + String? tokenID; + int? patientID; + int? admissionNo; + String? sessionID; + int? projectID; + String? setupID; + bool? patientOutSA; + int? patientType; + int? patientTypeID; AdmissionOrdersRequestModel( {this.isDentalAllowedBackend, diff --git a/lib/models/countriesModel.dart b/lib/models/countriesModel.dart index 89797fab..79ba027e 100644 --- a/lib/models/countriesModel.dart +++ b/lib/models/countriesModel.dart @@ -16,10 +16,10 @@ // } class Countries { - String name; - String nameAr; - String code; - String countryCode; + String? name; + String? nameAr; + String? code; + String? countryCode; Countries({this.name, this.nameAr, this.code, this.countryCode}); diff --git a/lib/models/dashboard/dashboard_model.dart b/lib/models/dashboard/dashboard_model.dart index 0e03e899..88d90078 100644 --- a/lib/models/dashboard/dashboard_model.dart +++ b/lib/models/dashboard/dashboard_model.dart @@ -1,7 +1,7 @@ class DashboardModel { - String kPIName; - int displaySequence; - List summaryoptions; + String? kPIName; + int? displaySequence; + List? summaryoptions; DashboardModel({this.kPIName, this.displaySequence, this.summaryoptions}); @@ -9,9 +9,9 @@ class DashboardModel { kPIName = json['KPIName']; displaySequence = json['displaySequence']; if (json['summaryoptions'] != null) { - summaryoptions = new List(); + summaryoptions = []; json['summaryoptions'].forEach((v) { - summaryoptions.add(new Summaryoptions.fromJson(v)); + summaryoptions!.add(new Summaryoptions.fromJson(v)); }); } } @@ -21,30 +21,29 @@ class DashboardModel { data['KPIName'] = this.kPIName; data['displaySequence'] = this.displaySequence; if (this.summaryoptions != null) { - data['summaryoptions'] = - this.summaryoptions.map((v) => v.toJson()).toList(); + data['summaryoptions'] = this.summaryoptions!.map((v) => v.toJson()).toList(); } return data; } } class Summaryoptions { - String kPIParameter; - String captionColor; - bool isCaptionBold; - bool isValueBold; - int order; - int value; - String valueColor; + String? kPIParameter; + String? captionColor; + bool? isCaptionBold; + bool? isValueBold; + int? order; + int? value; + String? valueColor; Summaryoptions( {this.kPIParameter, - this.captionColor, - this.isCaptionBold, - this.isValueBold, - this.order, - this.value, - this.valueColor}); + this.captionColor, + this.isCaptionBold, + this.isValueBold, + this.order, + this.value, + this.valueColor}); Summaryoptions.fromJson(Map json) { kPIParameter = json['KPIParameter']; diff --git a/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart b/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart index ec19abb0..c732fa71 100644 --- a/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart +++ b/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart @@ -1,9 +1,9 @@ class GetSpecialClinicalCareListResponseModel { - int projectID; - int clinicID; - String clinicDescription; - String clinicDescriptionN; - bool isActive; + int? projectID; + int? clinicID; + String? clinicDescription; + String? clinicDescriptionN; + bool? isActive; GetSpecialClinicalCareListResponseModel( {this.projectID, diff --git a/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart b/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart index 287f40f1..a69f812f 100644 --- a/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart +++ b/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart @@ -1,10 +1,10 @@ class GetSpecialClinicalCareMappingListResponseModel { - int mappingProjectID; - int clinicID; - int nursingStationID; - bool isActive; - int projectID; - String description; + int? mappingProjectID; + int? clinicID; + int? nursingStationID; + bool? isActive; + int? projectID; + String? description; GetSpecialClinicalCareMappingListResponseModel( {this.mappingProjectID, diff --git a/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart b/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart index 2d2c14ad..cc643e3f 100644 --- a/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart +++ b/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart @@ -1,11 +1,14 @@ class GetDischargeSummaryReqModel { - int patientID; - int admissionNo; - int patientType; - int patientTypeID; + int? patientID; + int? admissionNo; + int? patientType; + int? patientTypeID; GetDischargeSummaryReqModel( - {this.patientID, this.admissionNo, this.patientType = 1, this.patientTypeID=1}); + {this.patientID, + this.admissionNo, + this.patientType = 1, + this.patientTypeID = 1}); GetDischargeSummaryReqModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart index 10ddab00..214acc97 100644 --- a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart +++ b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart @@ -1,33 +1,33 @@ class GetDischargeSummaryResModel { - String setupID; - int projectID; - int dischargeNo; - String dischargeDate; - int admissionNo; - int assessmentNo; - int patientType; - int patientID; - int clinicID; - int doctorID; - String finalDiagnosis; - String persentation; - String pastHistory; - String planOfCare; - String investigations; - String followupPlan; - String conditionOnDischarge; - String significantFindings; - String planedProcedure; - int daysStayed; - String remarks; - String eRCare; - int status; - bool isActive; - int createdBy; - String createdOn; - int editedBy; - String editedOn; - bool isPatientDied; + String? setupID; + int? projectID; + int? dischargeNo; + String? dischargeDate; + int? admissionNo; + int? assessmentNo; + int? patientType; + int? patientID; + int? clinicID; + int? doctorID; + String? finalDiagnosis; + String? persentation; + String? pastHistory; + String? planOfCare; + String? investigations; + String? followupPlan; + String? conditionOnDischarge; + String? significantFindings; + String? planedProcedure; + int? daysStayed; + String? remarks; + String? eRCare; + int? status; + bool? isActive; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; + bool? isPatientDied; dynamic isMedicineApproved; dynamic isOpenBillDischarge; dynamic activatedDate; @@ -36,16 +36,16 @@ class GetDischargeSummaryResModel { dynamic patientCodition; dynamic others; dynamic reconciliationInstruction; - String dischargeInstructions; - String reason; + String? dischargeInstructions; + String? reason; dynamic dischargeDisposition; dynamic hospitalID; - String createdByName; + String? createdByName; dynamic createdByNameN; - String editedByName; + String? editedByName; dynamic editedByNameN; - String clinicName; - String projectName; + String? clinicName; + String? projectName; GetDischargeSummaryResModel( {this.setupID, diff --git a/lib/models/doctor/clinic_model.dart b/lib/models/doctor/clinic_model.dart index e5eb8eee..690837fe 100644 --- a/lib/models/doctor/clinic_model.dart +++ b/lib/models/doctor/clinic_model.dart @@ -6,20 +6,14 @@ *@desc: Clinic Model */ class ClinicModel { - Null setupID; - int projectID; - int doctorID; - int clinicID; - bool isActive; - String clinicName; + dynamic setupID; + int? projectID; + int? doctorID; + int? clinicID; + bool? isActive; + String? clinicName; - ClinicModel( - {this.setupID, - this.projectID, - this.doctorID, - this.clinicID, - this.isActive, - this.clinicName}); + ClinicModel({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); ClinicModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/doctor/doctor_profile_model.dart b/lib/models/doctor/doctor_profile_model.dart index c2f5b0dd..f0221c34 100644 --- a/lib/models/doctor/doctor_profile_model.dart +++ b/lib/models/doctor/doctor_profile_model.dart @@ -1,45 +1,45 @@ class DoctorProfileModel { - int doctorID; - String doctorName; - Null doctorNameN; - int clinicID; - String clinicDescription; - Null clinicDescriptionN; - Null licenseExpiry; - int employmentType; + int? doctorID; + String? doctorName; + dynamic doctorNameN; + int? clinicID; + String? clinicDescription; + dynamic clinicDescriptionN; + dynamic licenseExpiry; + int? employmentType; dynamic setupID; - int projectID; - String projectName; - String nationalityID; - String nationalityName; - Null nationalityNameN; - int gender; - String genderDescription; - Null genderDescriptionN; - Null doctorTitle; - Null projectNameN; - bool isAllowWaitList; - String titleDescription; - Null titleDescriptionN; - Null isRegistered; - Null isDoctorDummy; - bool isActive; - Null isDoctorAppointmentDisplayed; - bool doctorClinicActive; - Null isbookingAllowed; - String doctorCases; - Null doctorPicture; - String doctorProfileInfo; - List specialty; - int actualDoctorRate; - String doctorImageURL; - int doctorRate; - String doctorTitleForProfile; - bool isAppointmentAllowed; - String nationalityFlagURL; - int noOfPatientsRate; - String qR; - int serviceID; + int? projectID; + String? projectName; + String? nationalityID; + String? nationalityName; + dynamic nationalityNameN; + int? gender; + String? genderDescription; + dynamic genderDescriptionN; + dynamic doctorTitle; + dynamic projectNameN; + bool? isAllowWaitList; + String? titleDescription; + dynamic titleDescriptionN; + dynamic isRegistered; + dynamic isDoctorDummy; + bool? isActive; + dynamic isDoctorAppointmentDisplayed; + bool? doctorClinicActive; + dynamic isbookingAllowed; + String? doctorCases; + dynamic doctorPicture; + String? doctorProfileInfo; + List? specialty; + int? actualDoctorRate; + String? doctorImageURL; + int? doctorRate; + String? doctorTitleForProfile; + bool? isAppointmentAllowed; + String? nationalityFlagURL; + int? noOfPatientsRate; + String? qR; + int? serviceID; DoctorProfileModel( {this.doctorID, @@ -84,7 +84,7 @@ class DoctorProfileModel { this.qR, this.serviceID}); - DoctorProfileModel.fromJson(Map json) { + DoctorProfileModel.fromJson(Map json) { doctorID = json['DoctorID']; doctorName = json['DoctorName']; doctorNameN = json['DoctorNameN']; @@ -110,26 +110,26 @@ class DoctorProfileModel { isRegistered = json['IsRegistered']; isDoctorDummy = json['IsDoctorDummy']; isActive = json['IsActive']; - isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed']; + isDoctorAppointmentDisplayed = json['IsDoctorAppoint?mentDisplayed']; doctorClinicActive = json['DoctorClinicActive']; isbookingAllowed = json['IsbookingAllowed']; doctorCases = json['DoctorCases']; doctorPicture = json['DoctorPicture']; doctorProfileInfo = json['DoctorProfileInfo']; - specialty = json['Specialty'].cast(); + specialty = json['Specialty'].cast(); actualDoctorRate = json['ActualDoctorRate']; doctorImageURL = json['DoctorImageURL']; doctorRate = json['DoctorRate']; doctorTitleForProfile = json['DoctorTitleForProfile']; - isAppointmentAllowed = json['IsAppointmentAllowed']; + isAppointmentAllowed = json['IsAppoint?mentAllowed']; nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; qR = json['QR']; serviceID = json['ServiceID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorID'] = this.doctorID; data['DoctorName'] = this.doctorName; data['DoctorNameN'] = this.doctorNameN; @@ -155,7 +155,7 @@ class DoctorProfileModel { data['IsRegistered'] = this.isRegistered; data['IsDoctorDummy'] = this.isDoctorDummy; data['IsActive'] = this.isActive; - data['IsDoctorAppointmentDisplayed'] = this.isDoctorAppointmentDisplayed; + data['IsDoctorAppoint?mentDisplayed'] = this.isDoctorAppointmentDisplayed; data['DoctorClinicActive'] = this.doctorClinicActive; data['IsbookingAllowed'] = this.isbookingAllowed; data['DoctorCases'] = this.doctorCases; @@ -166,7 +166,7 @@ class DoctorProfileModel { data['DoctorImageURL'] = this.doctorImageURL; data['DoctorRate'] = this.doctorRate; data['DoctorTitleForProfile'] = this.doctorTitleForProfile; - data['IsAppointmentAllowed'] = this.isAppointmentAllowed; + data['IsAppoint?mentAllowed'] = this.isAppointmentAllowed; data['NationalityFlagURL'] = this.nationalityFlagURL; data['NoOfPatientsRate'] = this.noOfPatientsRate; data['QR'] = this.qR; diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/models/doctor/list_doctor_working_hours_table_model.dart index 4712d285..fa6f53a6 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -1,12 +1,11 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class ListDoctorWorkingHoursTable { - DateTime date; - String dayName; - String workingHours; - String projectName; - String clinicName; - + DateTime? date; + String? dayName; + String? workingHours; + String? projectName; + String? clinicName; ListDoctorWorkingHoursTable({ this.date, @@ -35,7 +34,7 @@ class ListDoctorWorkingHoursTable { } class WorkingHours { - String from; - String to; + String? from; + String? to; WorkingHours({this.from, this.to}); } diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/models/doctor/list_gt_my_patients_question_model.dart index 656a43dd..0e630c5f 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -1,74 +1,75 @@ class ListGtMyPatientsQuestions { + Null rowID; - String setupID; - int projectID; - int transactionNo; - int patientType; - int patientID; - int doctorID; - int requestType; - String requestDate; - String requestTime; - String remarks; - int status; - int createdBy; - String createdOn; - int editedBy; - String editedOn; - String patientName; + String? setupID; + int? projectID; + int? transactionNo; + int? patientType; + int? patientID; + int? doctorID; + int? requestType; + String? requestDate; + String? requestTime; + String? remarks; + int? status; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; + String? patientName; Null patientNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - int infoStatus; - String infoDesc; - String doctorResponse; - dynamic responseDate; - int memberID; - String memberName; - String memberNameN; - String age; - String genderDescription; - bool isVidaCall; - String requestTypeDescription; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + int? infoStatus; + String? infoDesc; + String? doctorResponse; + dynamic? responseDate; + int? memberID; + String? memberName; + String? memberNameN; + String? age; + String? genderDescription; + bool? isVidaCall; + String? requestTypeDescription; ListGtMyPatientsQuestions( {this.rowID, this.setupID, - this.projectID, - this.transactionNo, - this.patientType, - this.patientID, - this.doctorID, - this.requestType, - this.requestDate, - this.requestTime, - this.remarks, - this.status, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, - this.patientName, - this.patientNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.infoStatus, + this.projectID, + this.transactionNo, + this.patientType, + this.patientID, + this.doctorID, + this.requestType, + this.requestDate, + this.requestTime, + this.remarks, + this.status, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.patientName, + this.patientNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.infoStatus, this.infoDesc, this.doctorResponse, this.responseDate, this.memberID, - this.memberName, - this.memberNameN, - this.age, - this.genderDescription, - this.isVidaCall, + this.memberName, + this.memberNameN, + this.age, + this.genderDescription, + this.isVidaCall, this.requestTypeDescription}); - ListGtMyPatientsQuestions.fromJson(Map json) { + ListGtMyPatientsQuestions.fromJson(Map json) { rowID = json['RowID']; setupID = json['SetupID']; projectID = json['ProjectID']; @@ -104,8 +105,8 @@ class ListGtMyPatientsQuestions { requestTypeDescription = json['RequestTypeDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RowID'] = this.rowID; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/models/doctor/profile_req_Model.dart index 115f389d..20e1b225 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -6,34 +6,34 @@ *@desc: ProfileReqModel */ class ProfileReqModel { - int projectID; - int clinicID; - int doctorID; - bool isRegistered; - bool license; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; + int? projectID; + int? clinicID; + int? doctorID; + bool? isRegistered; + bool? license; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; ProfileReqModel( {this.projectID, - this.clinicID, - this.doctorID, - this.isRegistered = true, - this.license, - this.languageID, - this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress = '11.11.11.11', - // this.versionID=5.5, - this.channel = 9, - this.sessionID = 'E2bsEeYEJo', - this.tokenID, - this.isLoginForDoctorApp = true}); + this.clinicID, + this.doctorID, + this.isRegistered = true, + this.license, + this.languageID, + this.stamp = '2020-04-26T09:32:18.317Z', + this.iPAdress = '11.11.11.11', + // this.versionID = 5.5, + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', + this.tokenID, + this.isLoginForDoctorApp = true}); ProfileReqModel.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/doctor/replay/request_create_doctor_response.dart b/lib/models/doctor/replay/request_create_doctor_response.dart index 49e421d9..0544ef05 100644 --- a/lib/models/doctor/replay/request_create_doctor_response.dart +++ b/lib/models/doctor/replay/request_create_doctor_response.dart @@ -1,24 +1,24 @@ class CreateDoctorResponseModel { - String setupID; - int projectID; - String transactionNo; - int infoEnteredBy; - int infoStatus; - int createdBy; - int editedBy; - String doctorResponse; - int doctorID; + String? setupID; + int? projectID; + String? transactionNo; + int? infoEnteredBy; + int? infoStatus; + int? createdBy; + int? editedBy; + String? doctorResponse; + int? doctorID; CreateDoctorResponseModel( {this.setupID, - this.projectID, - this.transactionNo, - this.infoEnteredBy, - this.infoStatus, - this.createdBy, - this.editedBy, - this.doctorResponse, - this.doctorID}); + this.projectID, + this.transactionNo, + this.infoEnteredBy, + this.infoStatus, + this.createdBy, + this.editedBy, + this.doctorResponse, + this.doctorID}); CreateDoctorResponseModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/doctor/replay/request_doctor_reply.dart b/lib/models/doctor/replay/request_doctor_reply.dart index 82384586..a3013185 100644 --- a/lib/models/doctor/replay/request_doctor_reply.dart +++ b/lib/models/doctor/replay/request_doctor_reply.dart @@ -1,21 +1,21 @@ import 'package:doctor_app_flutter/config/config.dart'; class RequestDoctorReply { - int projectID; - int doctorID; - int transactionNo; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int pageIndex; - int pageSize; - int infoStatus; + int? projectID; + int? doctorID; + int? transactionNo; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? pageIndex; + int? pageSize; + int? infoStatus; RequestDoctorReply( {this.projectID, diff --git a/lib/models/doctor/request_add_referred_doctor_remarks.dart b/lib/models/doctor/request_add_referred_doctor_remarks.dart index b396c47f..b2b954c4 100644 --- a/lib/models/doctor/request_add_referred_doctor_remarks.dart +++ b/lib/models/doctor/request_add_referred_doctor_remarks.dart @@ -1,23 +1,22 @@ import 'package:doctor_app_flutter/config/config.dart'; class RequestAddReferredDoctorRemarks { - int projectID; - String admissionNo; - int lineItemNo; - String referredDoctorRemarks; - int editedBy; - int patientID; - int referringDoctor; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - + int? projectID; + String? admissionNo; + int? lineItemNo; + String? referredDoctorRemarks; + int? editedBy; + int? patientID; + int? referringDoctor; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestAddReferredDoctorRemarks( {this.projectID, @@ -31,7 +30,7 @@ class RequestAddReferredDoctorRemarks { this.stamp = STAMP, this.iPAdress = IP_ADDRESS, this.versionID = VERSION_ID, - this.channel= CHANNEL, + this.channel = CHANNEL, this.tokenID, this.sessionID = SESSION_ID, this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, diff --git a/lib/models/doctor/request_schedule.dart b/lib/models/doctor/request_schedule.dart index ae7b80aa..decd97e6 100644 --- a/lib/models/doctor/request_schedule.dart +++ b/lib/models/doctor/request_schedule.dart @@ -1,20 +1,18 @@ - - class RequestSchedule { - int projectID; - int clinicID; - int doctorID; - int doctorWorkingHoursDays; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? projectID; + int? clinicID; + int? doctorID; + int? doctorWorkingHoursDays; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; RequestSchedule( {this.projectID, diff --git a/lib/models/doctor/statstics_for_certain_doctor_request.dart b/lib/models/doctor/statstics_for_certain_doctor_request.dart index 08fa03f3..8b810fe0 100644 --- a/lib/models/doctor/statstics_for_certain_doctor_request.dart +++ b/lib/models/doctor/statstics_for_certain_doctor_request.dart @@ -1,18 +1,13 @@ class StatsticsForCertainDoctorRequest { - bool outSA; - int doctorID; - String tokenID; - int channel; - int projectID; - String generalid; + bool? outSA; + int? doctorID; + String? tokenID; + int? channel; + int? projectID; + String? generalid; StatsticsForCertainDoctorRequest( - {this.outSA, - this.doctorID, - this.tokenID, - this.channel, - this.projectID, - this.generalid}); + {this.outSA, this.doctorID, this.tokenID, this.channel, this.projectID, this.generalid}); StatsticsForCertainDoctorRequest.fromJson(Map json) { outSA = json['OutSA']; diff --git a/lib/models/doctor/user_model.dart b/lib/models/doctor/user_model.dart index 95035f8d..66768c8a 100644 --- a/lib/models/doctor/user_model.dart +++ b/lib/models/doctor/user_model.dart @@ -1,16 +1,16 @@ class UserModel { - String userID; - String password; - int projectID; - int languageID; - String iPAdress; - double versionID; - int channel; - String sessionID; - String tokenID; - String stamp; - bool isLoginForDoctorApp; - int patientOutSA; + String? userID; + String? password; + int? projectID; + int? languageID; + String? iPAdress; + double? versionID; + int? channel; + String? sessionID; + String? tokenID; + String? stamp; + bool? isLoginForDoctorApp; + int? patientOutSA; UserModel( {this.userID, diff --git a/lib/models/doctor/verify_referral_doctor_remarks.dart b/lib/models/doctor/verify_referral_doctor_remarks.dart index b9bfce0a..97c00390 100644 --- a/lib/models/doctor/verify_referral_doctor_remarks.dart +++ b/lib/models/doctor/verify_referral_doctor_remarks.dart @@ -1,54 +1,54 @@ import 'package:doctor_app_flutter/config/config.dart'; class VerifyReferralDoctorRemarks { - int projectID; - String admissionNo; - int lineItemNo; - String referredDoctorRemarks; - int editedBy; - int patientID; - int referringDoctor; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - String firstName; + int? projectID; + String? admissionNo; + int? lineItemNo; + String? referredDoctorRemarks; + int? editedBy; + int? patientID; + int? referringDoctor; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + String? firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; - VerifyReferralDoctorRemarks( - {this.projectID, - this.admissionNo, - this.lineItemNo, - this.referredDoctorRemarks, - this.editedBy, - this.patientID, - this.referringDoctor, - this.languageID = LANGUAGE_ID, - this.stamp = STAMP, - this.iPAdress = IP_ADDRESS, - this.versionID = VERSION_ID, - this.channel= CHANNEL, - this.tokenID, - this.sessionID = SESSION_ID, - this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, - this.patientOutSA = PATIENT_OUT_SA, - this.firstName, - this.middleName, - this.lastName, - this.patientMobileNumber, - this.patientIdentificationID, - }); + VerifyReferralDoctorRemarks({ + this.projectID, + this.admissionNo, + this.lineItemNo, + this.referredDoctorRemarks, + this.editedBy, + this.patientID, + this.referringDoctor, + this.languageID = LANGUAGE_ID, + this.stamp = STAMP, + this.iPAdress = IP_ADDRESS, + this.versionID = VERSION_ID, + this.channel = CHANNEL, + this.tokenID, + this.sessionID = SESSION_ID, + this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, + this.patientOutSA = PATIENT_OUT_SA, + this.firstName, + this.middleName, + this.lastName, + this.patientMobileNumber, + this.patientIdentificationID, + }); - VerifyReferralDoctorRemarks.fromJson(Map json) { + VerifyReferralDoctorRemarks.fromJson(Map json) { projectID = json['ProjectID']; admissionNo = json['AdmissionNo']; lineItemNo = json['LineItemNo']; @@ -65,18 +65,15 @@ class VerifyReferralDoctorRemarks { sessionID = json['SessionID']; isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; - firstName= json["FirstName"]; - middleName= json["MiddleName"]; - lastName= json["LastName"]; - patientMobileNumber= json["PatientMobileNumber"]; - patientIdentificationID = json["PatientIdentificationID"]; - - - + firstName = json["FirstName"]; + middleName = json["MiddleName"]; + lastName = json["LastName"]; + patientMobileNumber = json["PatientMobileNumber"]; + patientIdentificationID = json["PatientIdentificationID"]; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.projectID; data['AdmissionNo'] = this.admissionNo; data['LineItemNo'] = this.lineItemNo; diff --git a/lib/models/livecare/end_call_req.dart b/lib/models/livecare/end_call_req.dart index 7a1ae8eb..e3cc2722 100644 --- a/lib/models/livecare/end_call_req.dart +++ b/lib/models/livecare/end_call_req.dart @@ -1,12 +1,11 @@ class EndCallReq { - int vCID; - String tokenID; - String generalid; - int doctorId; - bool isDestroy; + int? vCID; + String? tokenID; + String? generalid; + int? doctorId; + bool? isDestroy; - EndCallReq( - {this.vCID, this.tokenID, this.generalid, this.doctorId, this.isDestroy}); + EndCallReq({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isDestroy}); EndCallReq.fromJson(Map json) { vCID = json['VC_ID']; diff --git a/lib/models/livecare/get_panding_req_list.dart b/lib/models/livecare/get_panding_req_list.dart index 719b9134..2ed2638a 100644 --- a/lib/models/livecare/get_panding_req_list.dart +++ b/lib/models/livecare/get_panding_req_list.dart @@ -1,16 +1,11 @@ class LiveCarePendingListRequest { - PatientData patientData; - int doctorID; - String sErServiceID; - int projectID; - int sourceID; - - LiveCarePendingListRequest( - {this.patientData, - this.doctorID, - this.sErServiceID, - this.projectID, - this.sourceID}); + PatientData? patientData; + int? doctorID; + String? sErServiceID; + int? projectID; + int? sourceID; + + LiveCarePendingListRequest({this.patientData, this.doctorID, this.sErServiceID, this.projectID, this.sourceID}); LiveCarePendingListRequest.fromJson(Map json) { patientData = new PatientData.fromJson(json['PatientData']); @@ -23,7 +18,7 @@ class LiveCarePendingListRequest { Map toJson() { final Map data = new Map(); - data['PatientData'] = this.patientData.toJson(); + data['PatientData'] = this.patientData!.toJson(); data['DoctorID'] = this.doctorID; data['SErServiceID'] = this.sErServiceID; data['ProjectID'] = this.projectID; @@ -33,9 +28,9 @@ class LiveCarePendingListRequest { } class PatientData { - bool isOutKSA; + bool? isOutKSA; - PatientData({this.isOutKSA}); + PatientData({required this.isOutKSA}); PatientData.fromJson(Map json) { isOutKSA = json['IsOutKSA']; diff --git a/lib/models/livecare/get_pending_res_list.dart b/lib/models/livecare/get_pending_res_list.dart index b45c53b9..7a1740de 100644 --- a/lib/models/livecare/get_pending_res_list.dart +++ b/lib/models/livecare/get_pending_res_list.dart @@ -1,90 +1,90 @@ class LiveCarePendingListResponse { dynamic acceptedBy; dynamic acceptedOn; - int age; + int? age; dynamic appointmentNo; - String arrivalTime; - String arrivalTimeD; - int callStatus; - String clientRequestID; - String clinicName; + String? arrivalTime; + String? arrivalTimeD; + int? callStatus; + String? clientRequestID; + String? clinicName; dynamic consoltationEnd; dynamic consultationNotes; dynamic createdOn; - String dateOfBirth; - String deviceToken; - String deviceType; + String? dateOfBirth; + String? deviceToken; + String? deviceType; dynamic doctorName; - String editOn; - String gender; - bool isFollowUP; + String? editOn; + String? gender; + bool? isFollowUP; dynamic isFromVida; - int isLoginB; - bool isOutKSA; - int isRejected; - String language; - double latitude; - double longitude; - String mobileNumber; + int? isLoginB; + bool? isOutKSA; + int? isRejected; + String? language; + double? latitude; + double? longitude; + String? mobileNumber; dynamic openSession; dynamic openTokenID; - String patientID; - String patientName; - int patientStatus; - String preferredLanguage; - int projectID; - double scoring; - int serviceID; + String? patientID; + String? patientName; + int? patientStatus; + String? preferredLanguage; + int? projectID; + double? scoring; + int? serviceID; dynamic tokenID; - int vCID; - String voipToken; + int? vCID; + String? voipToken; LiveCarePendingListResponse( {this.acceptedBy, - this.acceptedOn, - this.age, - this.appointmentNo, - this.arrivalTime, - this.arrivalTimeD, - this.callStatus, - this.clientRequestID, - this.clinicName, - this.consoltationEnd, - this.consultationNotes, - this.createdOn, - this.dateOfBirth, - this.deviceToken, - this.deviceType, - this.doctorName, - this.editOn, - this.gender, - this.isFollowUP, - this.isFromVida, - this.isLoginB, - this.isOutKSA, - this.isRejected, - this.language, - this.latitude, - this.longitude, - this.mobileNumber, - this.openSession, - this.openTokenID, - this.patientID, - this.patientName, - this.patientStatus, - this.preferredLanguage, - this.projectID, - this.scoring, - this.serviceID, - this.tokenID, - this.vCID, - this.voipToken}); + this.acceptedOn, + this.age, + this.appointmentNo, + this.arrivalTime, + this.arrivalTimeD, + this.callStatus, + this.clientRequestID, + this.clinicName, + this.consoltationEnd, + this.consultationNotes, + this.createdOn, + this.dateOfBirth, + this.deviceToken, + this.deviceType, + this.doctorName, + this.editOn, + this.gender, + this.isFollowUP, + this.isFromVida, + this.isLoginB, + this.isOutKSA, + this.isRejected, + this.language, + this.latitude, + this.longitude, + this.mobileNumber, + this.openSession, + this.openTokenID, + this.patientID, + this.patientName, + this.patientStatus, + this.preferredLanguage, + this.projectID, + this.scoring, + this.serviceID, + this.tokenID, + this.vCID, + this.voipToken}); - LiveCarePendingListResponse.fromJson(Map json) { + LiveCarePendingListResponse.fromJson(Map json) { acceptedBy = json['AcceptedBy']; acceptedOn = json['AcceptedOn']; age = json['Age']; - appointmentNo = json['AppointmentNo']; + appointmentNo = json['Appoint?mentNo']; arrivalTime = json['ArrivalTime']; arrivalTimeD = json['ArrivalTimeD']; callStatus = json['CallStatus']; @@ -122,12 +122,12 @@ class LiveCarePendingListResponse { voipToken = json['VoipToken']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['AcceptedBy'] = this.acceptedBy; data['AcceptedOn'] = this.acceptedOn; data['Age'] = this.age; - data['AppointmentNo'] = this.appointmentNo; + data['Appoint?mentNo'] = this.appointmentNo; data['ArrivalTime'] = this.arrivalTime; data['ArrivalTimeD'] = this.arrivalTimeD; data['CallStatus'] = this.callStatus; diff --git a/lib/models/livecare/session_status_model.dart b/lib/models/livecare/session_status_model.dart index 7e7a3e43..18d5ae6b 100644 --- a/lib/models/livecare/session_status_model.dart +++ b/lib/models/livecare/session_status_model.dart @@ -1,14 +1,10 @@ class SessionStatusModel { - bool isAuthenticated; - int messageStatus; - String result; - int sessionStatus; + bool? isAuthenticated; + int? messageStatus; + String? result; + int? sessionStatus; - SessionStatusModel( - {this.isAuthenticated, - this.messageStatus, - this.result, - this.sessionStatus}); + SessionStatusModel({this.isAuthenticated, this.messageStatus, this.result, this.sessionStatus}); SessionStatusModel.fromJson(Map json) { isAuthenticated = json['IsAuthenticated']; diff --git a/lib/models/livecare/start_call_req.dart b/lib/models/livecare/start_call_req.dart index b3ceabb5..cdc8c924 100644 --- a/lib/models/livecare/start_call_req.dart +++ b/lib/models/livecare/start_call_req.dart @@ -1,15 +1,15 @@ class StartCallReq { - String clincName; - int clinicId; - String docSpec; - String docotrName; - int doctorId; - String generalid; - bool isOutKsa; - bool isrecall; - String projectName; - String tokenID; - int vCID; + String ?clincName; + int ?clinicId; + String ?docSpec; + String? docotrName; + int ?doctorId; + String? generalid; + bool? isOutKsa; + bool ? isrecall; + String? projectName; + String ?tokenID; + int ?vCID; StartCallReq( {this.clincName, diff --git a/lib/models/livecare/start_call_res.dart b/lib/models/livecare/start_call_res.dart index 44921d5f..c4b0d224 100644 --- a/lib/models/livecare/start_call_res.dart +++ b/lib/models/livecare/start_call_res.dart @@ -1,21 +1,21 @@ class StartCallRes { - String result; - String openSessionID; - String openTokenID; - bool isAuthenticated; - int messageStatus; - String appointmentNo; - bool isRecording; + String? result; + String? openSessionID; + String? openTokenID; + bool? isAuthenticated; + int? messageStatus; + String? appointmentNo; + bool? isRecording; - StartCallRes( - {this.result, - this.openSessionID, - this.openTokenID, - this.isAuthenticated, - this.appointmentNo, - this.messageStatus, - this.isRecording = true, - }); + StartCallRes({ + this.result, + this.openSessionID, + this.openTokenID, + this.isAuthenticated, + this.appointmentNo, + this.messageStatus, + this.isRecording = true, + }); StartCallRes.fromJson(Map json) { result = json['Result']; diff --git a/lib/models/livecare/transfer_to_admin.dart b/lib/models/livecare/transfer_to_admin.dart index 841f5e7d..291528b9 100644 --- a/lib/models/livecare/transfer_to_admin.dart +++ b/lib/models/livecare/transfer_to_admin.dart @@ -1,18 +1,12 @@ class TransferToAdminReq { - int vCID; - String tokenID; - String generalid; - int doctorId; - bool isOutKsa; - String notes; + int? vCID; + String? tokenID; + String? generalid; + int? doctorId; + bool? isOutKsa; + String? notes; - TransferToAdminReq( - {this.vCID, - this.tokenID, - this.generalid, - this.doctorId, - this.isOutKsa, - this.notes}); + TransferToAdminReq({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.notes}); TransferToAdminReq.fromJson(Map json) { vCID = json['VC_ID']; diff --git a/lib/models/operation_report/create_update_operation_report_request_model.dart b/lib/models/operation_report/create_update_operation_report_request_model.dart index f6d72b1b..da716dd4 100644 --- a/lib/models/operation_report/create_update_operation_report_request_model.dart +++ b/lib/models/operation_report/create_update_operation_report_request_model.dart @@ -1,28 +1,28 @@ class CreateUpdateOperationReportRequestModel { - String setupID; - int patientID; - int reservationNo; - int admissionNo; - String preOpDiagmosis; - String postOpDiagmosis; - String surgeon; - String assistant; - String anasthetist; - String operation; - String inasion; - String finding; - String surgeryProcedure; - String postOpInstruction; - int createdBy; - int editedBy; - String complicationDetails; - String bloodLossDetail; - String histopathSpecimen; - String microbiologySpecimen; - String otherSpecimen; - String scrubNurse; - String circulatingNurse; - String bloodTransfusedDetail; + String? setupID; + int? patientID; + int? reservationNo; + int? admissionNo; + String? preOpDiagmosis; + String? postOpDiagmosis; + String? surgeon; + String? assistant; + String? anasthetist; + String? operation; + String? inasion; + String? finding; + String? surgeryProcedure; + String? postOpInstruction; + int? createdBy; + int? editedBy; + String? complicationDetails; + String? bloodLossDetail; + String? histopathSpecimen; + String? microbiologySpecimen; + String? otherSpecimen; + String? scrubNurse; + String? circulatingNurse; + String? bloodTransfusedDetail; CreateUpdateOperationReportRequestModel( {this.setupID, diff --git a/lib/models/operation_report/get_operation_details_request_modle.dart b/lib/models/operation_report/get_operation_details_request_modle.dart index 7e23b503..fd7be8a4 100644 --- a/lib/models/operation_report/get_operation_details_request_modle.dart +++ b/lib/models/operation_report/get_operation_details_request_modle.dart @@ -1,34 +1,34 @@ class GetOperationDetailsRequestModel { - bool isDentalAllowedBackend; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int deviceTypeID; - String tokenID; - int patientID; - int reservationNo; - String sessionID; - int projectID; - String setupID; - bool patientOutSA; + bool? isDentalAllowedBackend; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? deviceTypeID; + String? tokenID; + int? patientID; + int? reservationNo; + String? sessionID; + int? projectID; + String? setupID; + bool? patientOutSA; GetOperationDetailsRequestModel( {this.isDentalAllowedBackend = false, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.deviceTypeID, - this.tokenID, - this.patientID, - this.reservationNo, - this.sessionID, - this.projectID, - this.setupID, - this.patientOutSA}); + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.reservationNo, + this.sessionID, + this.projectID, + this.setupID, + this.patientOutSA}); GetOperationDetailsRequestModel.fromJson(Map json) { isDentalAllowedBackend = json['isDentalAllowedBackend']; diff --git a/lib/models/operation_report/get_operation_details_response_modle.dart b/lib/models/operation_report/get_operation_details_response_modle.dart index 04540ea6..10b36e7e 100644 --- a/lib/models/operation_report/get_operation_details_response_modle.dart +++ b/lib/models/operation_report/get_operation_details_response_modle.dart @@ -1,35 +1,35 @@ class GetOperationDetailsResponseModel { - String setupID; - int projectID; - int reservationNo; - int patientID; - int admissionID; + String? setupID; + int? projectID; + int? reservationNo; + int? patientID; + int? admissionID; dynamic surgeryDate; - String preOpDiagnosis; - String postOpDiagnosis; - String surgeon; - String assistant; - String anasthetist; - String operation; - String inasion; - String finding; - String surgeryProcedure; - String postOpInstruction; - bool isActive; - int createdBy; - String createdName; + String? preOpDiagnosis; + String? postOpDiagnosis; + String? surgeon; + String? assistant; + String? anasthetist; + String? operation; + String? inasion; + String? finding; + String? surgeryProcedure; + String? postOpInstruction; + bool? isActive; + int? createdBy; + String? createdName; dynamic createdNameN; - String createdOn; + String? createdOn; dynamic editedBy; dynamic editedByName; dynamic editedByNameN; dynamic editedOn; dynamic oRBookStatus; - String complicationDetail; - String bloodLossDetail; - String histopathSpecimen; - String microbiologySpecimen; - String otherSpecimen; + String? complicationDetail; + String? bloodLossDetail; + String? histopathSpecimen; + String? microbiologySpecimen; + String? otherSpecimen; dynamic scrubNurse; dynamic circulatingNurse; dynamic bloodTransfusedDetail; diff --git a/lib/models/operation_report/get_reservations_request_model.dart b/lib/models/operation_report/get_reservations_request_model.dart index 06425254..8de0bbf3 100644 --- a/lib/models/operation_report/get_reservations_request_model.dart +++ b/lib/models/operation_report/get_reservations_request_model.dart @@ -1,17 +1,17 @@ class GetReservationsRequestModel { - int patientID; - int projectID; - String doctorID; - int clinicID; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - bool patientOutSA; - int deviceTypeID; - String tokenID; - String sessionID; + int? patientID; + int? projectID; + String? doctorID; + int? clinicID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + bool? patientOutSA; + int? deviceTypeID; + String? tokenID; + String? sessionID; GetReservationsRequestModel( {this.patientID, diff --git a/lib/models/operation_report/get_reservations_response_model.dart b/lib/models/operation_report/get_reservations_response_model.dart index 3bebdc8b..b6191353 100644 --- a/lib/models/operation_report/get_reservations_response_model.dart +++ b/lib/models/operation_report/get_reservations_response_model.dart @@ -1,38 +1,38 @@ class GetReservationsResponseModel { - String setupID; - int projectID; - int oTReservationID; - String oTReservationDate; - String oTReservationDateN; - int oTID; - int admissionRequestNo; - int admissionNo; - int primaryDoctorID; - int patientType; - int patientID; - int patientStatusType; - int clinicID; - int doctorID; - String operationDate; - int operationType; - String endDate; - String timeStart; - String timeEnd; + String? setupID; + int? projectID; + int? oTReservationID; + String? oTReservationDate; + String? oTReservationDateN; + int? oTID; + int? admissionRequestNo; + int? admissionNo; + int? primaryDoctorID; + int? patientType; + int? patientID; + int? patientStatusType; + int? clinicID; + int? doctorID; + String? operationDate; + int? operationType; + String? endDate; + String? timeStart; + String? timeEnd; dynamic remarks; - int status; - int createdBy; - String createdOn; - int editedBy; - String editedOn; - String patientName; + int? status; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; + String? patientName; Null patientNameN; Null gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String doctorName; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? doctorName; Null doctorNameN; - String clinicDescription; + String? clinicDescription; Null clinicDescriptionN; GetReservationsResponseModel( diff --git a/lib/models/patient/MedicalReport/MedicalReportTemplate.dart b/lib/models/patient/MedicalReport/MedicalReportTemplate.dart index f00e84a0..989554e0 100644 --- a/lib/models/patient/MedicalReport/MedicalReportTemplate.dart +++ b/lib/models/patient/MedicalReport/MedicalReportTemplate.dart @@ -1,30 +1,30 @@ class MedicalReportTemplate { - String setupID; - int projectID; - int templateID; - String procedureID; - int reportType; - String templateName; - String templateNameN; - String templateText; - String templateTextN; - bool isActive; - String templateTextHtml; - String templateTextNHtml; + String? setupID; + int? projectID; + int? templateID; + String? procedureID; + int? reportType; + String? templateName; + String? templateNameN; + String? templateText; + String? templateTextN; + bool? isActive; + String? templateTextHtml; + String? templateTextNHtml; MedicalReportTemplate( {this.setupID, - this.projectID, - this.templateID, - this.procedureID, - this.reportType, - this.templateName, - this.templateNameN, - this.templateText, - this.templateTextN, - this.isActive, - this.templateTextHtml, - this.templateTextNHtml}); + this.projectID, + this.templateID, + this.procedureID, + this.reportType, + this.templateName, + this.templateNameN, + this.templateText, + this.templateTextN, + this.isActive, + this.templateTextHtml, + this.templateTextNHtml}); MedicalReportTemplate.fromJson(Map json) { setupID = json['SetupID']; @@ -41,8 +41,8 @@ class MedicalReportTemplate { templateTextNHtml = json['TemplateTextNHtml']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['TemplateID'] = this.templateID; diff --git a/lib/models/patient/MedicalReport/MeidcalReportModel.dart b/lib/models/patient/MedicalReport/MeidcalReportModel.dart index 74ee53a5..e1e31f85 100644 --- a/lib/models/patient/MedicalReport/MeidcalReportModel.dart +++ b/lib/models/patient/MedicalReport/MeidcalReportModel.dart @@ -1,30 +1,30 @@ class MedicalReportModel { - String reportData; - String setupID; - int projectID; - String projectName; - String projectNameN; - int patientID; - String invoiceNo; - int status; - String verifiedOn; + String? reportData; + String? setupID; + int? projectID; + String? projectName; + String? projectNameN; + int? patientID; + String? invoiceNo; + int? status; + String? verifiedOn; dynamic verifiedBy; - String editedOn; - int editedBy; - int lineItemNo; - String createdOn; - int templateID; - int doctorID; - int doctorGender; - String doctorGenderDescription; - String doctorGenderDescriptionN; - String doctorImageURL; - String doctorName; - String doctorNameN; - int clinicID; - String clinicName; - String clinicNameN; - String reportDataHtml; + String? editedOn; + int? editedBy; + int? lineItemNo; + String? createdOn; + int? templateID; + int? doctorID; + int? doctorGender; + String? doctorGenderDescription; + String? doctorGenderDescriptionN; + String? doctorImageURL; + String? doctorName; + String? doctorNameN; + int? clinicID; + String? clinicName; + String? clinicNameN; + String? reportDataHtml; MedicalReportModel( {this.reportData, diff --git a/lib/models/patient/PatientArrivalEntity.dart b/lib/models/patient/PatientArrivalEntity.dart index 54622cd7..e6e5c807 100644 --- a/lib/models/patient/PatientArrivalEntity.dart +++ b/lib/models/patient/PatientArrivalEntity.dart @@ -1,22 +1,22 @@ class PatientArrivalEntity { - String age; - String appointmentDate; - int appointmentNo; - String appointmentType; - String arrivedOn; - String companyName; - String endTime; - int episodeNo; - int fallRiskScore; - String gender; - int medicationOrders; - String mobileNumber; - String nationality; - int patientMRN; - String patientName; - int rowCount; - String startTime; - String visitType; + String? age; + String? appointmentDate; + int? appointmentNo; + String? appointmentType; + String? arrivedOn; + String? companyName; + String? endTime; + int? episodeNo; + int? fallRiskScore; + String? gender; + int? medicationOrders; + String? mobileNumber; + String? nationality; + int? patientMRN; + String? patientName; + int? rowCount; + String? startTime; + String? visitType; PatientArrivalEntity( {this.age, diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/models/patient/get_clinic_by_project_id_request.dart index 47122bf1..4e4b41bf 100644 --- a/lib/models/patient/get_clinic_by_project_id_request.dart +++ b/lib/models/patient/get_clinic_by_project_id_request.dart @@ -1,6 +1,5 @@ class ClinicByProjectIdRequest { - - /* + /* *@author: Ibrahim Albitar *@Date:03/06/2020 *@param: @@ -8,17 +7,17 @@ class ClinicByProjectIdRequest { *@desc: ClinicByProjectIdRequest */ - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; /* { "ProjectID": 21, diff --git a/lib/models/patient/get_doctor_by_clinic_id_request.dart b/lib/models/patient/get_doctor_by_clinic_id_request.dart index 9504fc35..3f696f70 100644 --- a/lib/models/patient/get_doctor_by_clinic_id_request.dart +++ b/lib/models/patient/get_doctor_by_clinic_id_request.dart @@ -1,17 +1,16 @@ class DoctorsByClinicIdRequest { - - int clinicID; - int projectID; - bool continueDentalPlan; - bool isSearchAppointmnetByClinicID; - int patientID; - int gender; - bool isGetNearAppointment; - bool isVoiceCommand; - int latitude; - int longitude; - bool license; - bool isDentalAllowedBackend; + int? clinicID; + int? projectID; + bool? continueDentalPlan; + bool? isSearchAppointmnetByClinicID; + int? patientID; + int? gender; + bool? isGetNearAppointment; + bool? isVoiceCommand; + int? latitude; + int? longitude; + bool? license; + bool? isDentalAllowedBackend; DoctorsByClinicIdRequest( diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/models/patient/get_list_stp_referral_frequency_request.dart index edae9f18..e0bede54 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -1,6 +1,5 @@ class STPReferralFrequencyRequest { - -/* +/* *@author: Ibrahim Albitar *@Date:03/06/2020 *@param: @@ -8,16 +7,16 @@ class STPReferralFrequencyRequest { *@desc: */ - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; /* { "LanguageID": 2, diff --git a/lib/models/patient/get_pending_patient_er_model.dart b/lib/models/patient/get_pending_patient_er_model.dart index e1b50a81..55d33757 100644 --- a/lib/models/patient/get_pending_patient_er_model.dart +++ b/lib/models/patient/get_pending_patient_er_model.dart @@ -7,9 +7,10 @@ */ import 'dart:convert'; -ListPendingPatientListModel listPendingPatientListModelFromJson(String str) => ListPendingPatientListModel.fromJson(json.decode(str)); +ListPendingPatientListModel listPendingPatientListModelFromJson(String? str) => + ListPendingPatientListModel.fromJson(json.decode(str!)); -String listPendingPatientListModelToJson(ListPendingPatientListModel data) => json.encode(data.toJson()); +String? listPendingPatientListModelToJson(ListPendingPatientListModel data) => json.encode(data.toJson()); class ListPendingPatientListModel { ListPendingPatientListModel({ @@ -56,45 +57,45 @@ class ListPendingPatientListModel { dynamic acceptedBy; dynamic acceptedOn; - int age; + int? age; dynamic appointmentNo; - String arrivalTime; - String arrivalTimeD; - int callStatus; - String clientRequestId; - String clinicName; + String? arrivalTime; + String? arrivalTimeD; + int? callStatus; + String? clientRequestId; + String? clinicName; dynamic consoltationEnd; dynamic consultationNotes; dynamic createdOn; - DateTime dateOfBirth; - String deviceToken; - String deviceType; + DateTime? dateOfBirth; + String? deviceToken; + String? deviceType; dynamic doctorName; - String editOn; - String gender; - bool isFollowUp; + String? editOn; + String? gender; + bool? isFollowUp; dynamic isFromVida; - int isLoginB; - bool isOutKsa; - int isRejected; - String language; - double latitude; - double longitude; - String mobileNumber; + int? isLoginB; + bool? isOutKsa; + int? isRejected; + String? language; + double? latitude; + double? longitude; + String? mobileNumber; dynamic openSession; dynamic openTokenId; - String patientId; - String patientName; - int patientStatus; - String preferredLanguage; - int projectId; - int scoring; - int serviceId; + String? patientId; + String? patientName; + int? patientStatus; + String? preferredLanguage; + int? projectId; + int? scoring; + int? serviceId; dynamic tokenId; - int vcId; - String voipToken; + int? vcId; + String? voipToken; - factory ListPendingPatientListModel.fromJson(Map json) => ListPendingPatientListModel( + factory ListPendingPatientListModel.fromJson(Map json) => ListPendingPatientListModel( acceptedBy: json["AcceptedBy"], acceptedOn: json["AcceptedOn"], age: json["Age"], @@ -136,7 +137,7 @@ class ListPendingPatientListModel { voipToken: json["VoipToken"], ); - Map toJson() => { + Map toJson() => { "AcceptedBy": acceptedBy, "AcceptedOn": acceptedOn, "Age": age, @@ -149,7 +150,8 @@ class ListPendingPatientListModel { "ConsoltationEnd": consoltationEnd, "ConsultationNotes": consultationNotes, "CreatedOn": createdOn, - "DateOfBirth": "${dateOfBirth.year.toString().padLeft(4, '0')}-${dateOfBirth.month.toString().padLeft(2, '0')}-${dateOfBirth.day.toString().padLeft(2, '0')}", + "DateOfBirth": + "${dateOfBirth!.year.toString().padLeft(4, '0')}-${dateOfBirth!.month.toString().padLeft(2, '0')}-${dateOfBirth!.day.toString().padLeft(2, '0')}", "DeviceToken": deviceToken, "DeviceType": deviceType, "DoctorName": doctorName, diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart index 2d3ac663..9946e9f6 100644 --- a/lib/models/patient/insurance_aprovals_request.dart +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -21,19 +21,19 @@ *@desc: */ class InsuranceAprovalsRequest { - int exuldAppNO; - int patientID; - int channel; - int projectID; - int languageID; - String stamp; - String ipAdress; - double versionID; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? exuldAppNO; + int? patientID; + int? channel; + int? projectID; + int? languageID; + String? stamp; + String? ipAdress; + double? versionID; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; InsuranceAprovalsRequest( { diff --git a/lib/models/patient/lab_orders/lab_orders_req_model.dart b/lib/models/patient/lab_orders/lab_orders_req_model.dart index a97f4093..0f8ea846 100644 --- a/lib/models/patient/lab_orders/lab_orders_req_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_req_model.dart @@ -1,24 +1,23 @@ - -/* - *@author: Elham Rababah - *@Date:6/5/2020 - *@param: +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: *@return:LabOrdersReqModel *@desc: LabOrdersReqModel class */ class LabOrdersReqModel { - int patientID; - int patientTypeID; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? patientID; + int? patientTypeID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; LabOrdersReqModel( {this.patientID, diff --git a/lib/models/patient/lab_orders/lab_orders_res_model.dart b/lib/models/patient/lab_orders/lab_orders_res_model.dart index 7f463933..9d85afef 100644 --- a/lib/models/patient/lab_orders/lab_orders_res_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_res_model.dart @@ -3,27 +3,27 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class LabOrdersResModel { - String setupID; - int projectID; - int patientID; - int patientType; - int orderNo; - String orderDate; - int invoiceTransactionType; - int invoiceNo; - int clinicId; - int doctorId; - int status; - String createdBy; - Null createdByN; - DateTime createdOn; - String editedBy; - Null editedByN; - String editedOn; - String clinicName; - String doctorImageURL; - String doctorName; - String projectName; + String? setupID; + int? projectID; + int? patientID; + int? patientType; + int? orderNo; + String? orderDate; + int? invoiceTransactionType; + int? invoiceNo; + int? clinicId; + int? doctorId; + int? status; + String? createdBy; + dynamic createdByN; + DateTime? createdOn; + String? editedBy; + dynamic editedByN; + String? editedOn; + String? clinicName; + String? doctorImageURL; + String? doctorName; + String? projectName; LabOrdersResModel( {this.setupID, diff --git a/lib/models/patient/lab_result/lab_result.dart b/lib/models/patient/lab_result/lab_result.dart index ca753f2d..6e740e16 100644 --- a/lib/models/patient/lab_result/lab_result.dart +++ b/lib/models/patient/lab_result/lab_result.dart @@ -1,64 +1,64 @@ class LabResult { - String setupID; - int projectID; - int orderNo; - int lineItemNo; - int packageID; - int testID; - String description; - String resultValue; - String referenceRange; - Null convertedResultValue; - Null convertedReferenceRange; - Null resultValueFlag; - int status; - String createdBy; - Null createdByN; - String createdOn; - String editedBy; - Null editedByN; - String editedOn; - String verifiedBy; - Null verifiedByN; - String verifiedOn; + String? setupID; + int? projectID; + int? orderNo; + int? lineItemNo; + int? packageID; + int? testID; + String? description; + String? resultValue; + String? referenceRange; + dynamic convertedResultValue; + dynamic convertedReferenceRange; + dynamic resultValueFlag; + int? status; + String? createdBy; + dynamic createdByN; + String? createdOn; + String? editedBy; + dynamic editedByN; + String? editedOn; + String? verifiedBy; + dynamic verifiedByN; + String? verifiedOn; Null patientID; - int gender; - Null maleInterpretativeData; - Null femaleInterpretativeData; - String testCode; - String statusDescription; + int? gender; + dynamic maleinterpretativeData; + dynamic femaleinterpretativeData; + String? testCode; + String? statusDescription; LabResult( {this.setupID, - this.projectID, - this.orderNo, - this.lineItemNo, - this.packageID, - this.testID, - this.description, - this.resultValue, - this.referenceRange, - this.convertedResultValue, - this.convertedReferenceRange, - this.resultValueFlag, - this.status, - this.createdBy, - this.createdByN, - this.createdOn, - this.editedBy, - this.editedByN, - this.editedOn, - this.verifiedBy, - this.verifiedByN, - this.verifiedOn, - this.patientID, - this.gender, - this.maleInterpretativeData, - this.femaleInterpretativeData, - this.testCode, - this.statusDescription}); + this.projectID, + this.orderNo, + this.lineItemNo, + this.packageID, + this.testID, + this.description, + this.resultValue, + this.referenceRange, + this.convertedResultValue, + this.convertedReferenceRange, + this.resultValueFlag, + this.status, + this.createdBy, + this.createdByN, + this.createdOn, + this.editedBy, + this.editedByN, + this.editedOn, + this.verifiedBy, + this.verifiedByN, + this.verifiedOn, + this.patientID, + this.gender, + this.maleinterpretativeData, + this.femaleinterpretativeData, + this.testCode, + this.statusDescription}); - LabResult.fromJson(Map json) { + LabResult.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; orderNo = json['OrderNo']; @@ -83,14 +83,14 @@ class LabResult { verifiedOn = json['VerifiedOn']; patientID = json['PatientID']; gender = json['Gender']; - maleInterpretativeData = json['MaleInterpretativeData']; - femaleInterpretativeData = json['FemaleInterpretativeData']; + maleinterpretativeData = json['Maleint?erpretativeData']; + femaleinterpretativeData = json['Femaleint?erpretativeData']; testCode = json['TestCode']; statusDescription = json['StatusDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['OrderNo'] = this.orderNo; @@ -115,8 +115,8 @@ class LabResult { data['VerifiedOn'] = this.verifiedOn; data['PatientID'] = this.patientID; data['Gender'] = this.gender; - data['MaleInterpretativeData'] = this.maleInterpretativeData; - data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Maleint?erpretativeData'] = this.maleinterpretativeData; + data['Femaleint?erpretativeData'] = this.femaleinterpretativeData; data['TestCode'] = this.testCode; data['StatusDescription'] = this.statusDescription; return data; diff --git a/lib/models/patient/lab_result/lab_result_req_model.dart b/lib/models/patient/lab_result/lab_result_req_model.dart index 5e58a4a5..91510d38 100644 --- a/lib/models/patient/lab_result/lab_result_req_model.dart +++ b/lib/models/patient/lab_result/lab_result_req_model.dart @@ -1,36 +1,36 @@ class RequestLabResult { - int projectID; - String setupID; - int orderNo; - int invoiceNo; - int patientTypeID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + String? setupID; + int? orderNo; + int? invoiceNo; + int? patientTypeID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestLabResult( {this.projectID, - this.setupID, - this.orderNo, - this.invoiceNo, - this.patientTypeID, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.setupID, + this.orderNo, + this.invoiceNo, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); - RequestLabResult.fromJson(Map json) { + RequestLabResult.fromJson(Map json) { projectID = json['ProjectID']; setupID = json['SetupID']; orderNo = json['OrderNo']; diff --git a/lib/models/patient/my_referral/PendingReferral.dart b/lib/models/patient/my_referral/PendingReferral.dart index 6d3f0b83..ee790e2a 100644 --- a/lib/models/patient/my_referral/PendingReferral.dart +++ b/lib/models/patient/my_referral/PendingReferral.dart @@ -1,37 +1,37 @@ import '../patiant_info_model.dart'; class PendingReferral { - PatiantInformtion patientDetails; - String doctorImageUrl; - String nationalityFlagUrl; - String responded; - String answerFromTarget; - String createdOn; - int data; - int isSameBranch; - String editedOn; - int interBranchReferral; - int patientID; - String patientName; - int patientType; - int referralNo; - String referralStatus; - String referredByDoctorInfo; - String referredFromBranchName; - String referredOn; - String referredType; - String remarksFromSource; - String respondedOn; - int sourceAppointmentNo; - int sourceProjectId; - String sourceSetupID; - String startDate; - int targetAppointmentNo; - String targetClinicID; - String targetDoctorID; - int targetProjectId; - String targetSetupID; - bool isReferralDoctorSameBranch; + PatiantInformtion? patientDetails; + String? doctorImageUrl; + String? nationalityFlagUrl; + String? responded; + String? answerFromTarget; + String? createdOn; + int? data; + int? isSameBranch; + String? editedOn; + int? interBranchReferral; + int? patientID; + String? patientName; + int? patientType; + int? referralNo; + String? referralStatus; + String? referredByDoctorInfo; + String? referredFromBranchName; + String? referredOn; + String? referredType; + String? remarksFromSource; + String? respondedOn; + int? sourceAppointmentNo; + int? sourceProjectId; + String? sourceSetupID; + String? startDate; + int? targetAppointmentNo; + String? targetClinicID; + String? targetDoctorID; + int? targetProjectId; + String? targetSetupID; + bool? isReferralDoctorSameBranch; PendingReferral({ this.patientDetails, diff --git a/lib/models/patient/my_referral/clinic-doctor.dart b/lib/models/patient/my_referral/clinic-doctor.dart index 843f636c..9d08992a 100644 --- a/lib/models/patient/my_referral/clinic-doctor.dart +++ b/lib/models/patient/my_referral/clinic-doctor.dart @@ -1,43 +1,43 @@ class ClinicDoctor { - int clinicID; - String clinicName; - String doctorTitle; - int iD; - String name; - int projectID; - String projectName; - int actualDoctorRate; - int clinicRoomNo; - String date; - String dayName; - int doctorID; - String doctorImageURL; - String doctorProfile; - String doctorProfileInfo; - int doctorRate; - int gender; - String genderDescription; - bool isAppointmentAllowed; - bool isDoctorAllowVedioCall; - bool isDoctorDummy; - bool isLiveCare; - String latitude; - String longitude; - String nationalityFlagURL; - String nationalityID; - String nationalityName; - String nearestFreeSlot; - int noOfPatientsRate; - String originalClinicID; - int personRate; - int projectDistanceInKiloMeters; - String qR; - String qRString; - int rateNumber; - String serviceID; - String setupID; - List speciality; - String workingHours; + int? clinicID; + String? clinicName; + String? doctorTitle; + int? iD; + String? name; + int? projectID; + String? projectName; + int? actualDoctorRate; + int? clinicRoomNo; + String? date; + String? dayName; + int? doctorID; + String? doctorImageURL; + String? doctorProfile; + String? doctorProfileInfo; + int? doctorRate; + int? gender; + String? genderDescription; + bool? isAppointmentAllowed; + bool? isDoctorAllowVedioCall; + bool? isDoctorDummy; + bool? isLiveCare; + String? latitude; + String? longitude; + String? nationalityFlagURL; + String? nationalityID; + String? nationalityName; + String? nearestFreeSlot; + int? noOfPatientsRate; + String? originalClinicID; + int? personRate; + int? projectDistanceInKiloMeters; + String? qR; + String? qRString; + int? rateNumber; + String? serviceID; + String? setupID; + List? speciality; + String? workingHours; ClinicDoctor( {this.clinicID, diff --git a/lib/models/patient/my_referral/my_referral_patient_model.dart b/lib/models/patient/my_referral/my_referral_patient_model.dart index f1506f8e..f79a57c3 100644 --- a/lib/models/patient/my_referral/my_referral_patient_model.dart +++ b/lib/models/patient/my_referral/my_referral_patient_model.dart @@ -1,108 +1,108 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class MyReferralPatientModel { - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; - String nursingStationID; - String description; - String nationalityName; - String nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - String referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - DateTime mAXResponseTime; - String age; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; + String? doctorNameN; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; + String? nursingStationID; + String? description; + String? nationalityName; + String? nationalityNameN; + String? clinicDescription; + String? clinicDescriptionN; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + String? referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + DateTime? mAXResponseTime; + String? age; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referringDoctorName; MyReferralPatientModel( {this.projectID, - this.lineItemNo, - this.doctorID, - this.patientID, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomID, - this.bedID, - this.nursingStationID, - this.description, - this.nationalityName, - this.nationalityNameN, - this.clinicDescription, - this.clinicDescriptionN, - this.referralDoctor, - this.referringDoctor, - this.referralClinic, - this.referringClinic, - this.referralStatus, - this.referralDate, - this.referringDoctorRemarks, - this.referredDoctorRemarks, - this.referralResponseOn, - this.priority, - this.frequency, - this.mAXResponseTime, - this.age, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName}); + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.age, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName}); - MyReferralPatientModel.fromJson(Map json) { + MyReferralPatientModel.fromJson(Map json) { projectID = json['ProjectID']; lineItemNo = json['LineItemNo']; doctorID = json['DoctorID']; @@ -154,8 +154,8 @@ class MyReferralPatientModel { referringDoctorName = json['ReferringDoctorName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.projectID; data['LineItemNo'] = this.lineItemNo; data['DoctorID'] = this.doctorID; diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/models/patient/my_referral/my_referred_patient_model.dart index b353e587..d80c6241 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -1,70 +1,68 @@ - - class MyReferredPatientModel { - String rowID; - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; - String nursingStationID; - String description; - String nationalityName; - String nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - String referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - String mAXResponseTime; - int episodeID; - int appointmentNo; - String appointmentDate; - int appointmentType; - int patientMRN; - String createdOn; - int clinicID; - String nationalityID; - String age; - String doctorImageURL; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nationalityFlagURL; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referralDoctorName; - String referralClinicDescription; - String referringDoctorName; - bool isReferralDoctorSameBranch; - String referralStatusDesc; + String? rowID; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; + String? doctorNameN; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; + String? nursingStationID; + String? description; + String? nationalityName; + String? nationalityNameN; + String? clinicDescription; + String? clinicDescriptionN; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + String? referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + String? mAXResponseTime; + int? episodeID; + int? appointmentNo; + String? appointmentDate; + int? appointmentType; + int? patientMRN; + String? createdOn; + int? clinicID; + String? nationalityID; + String? age; + String? doctorImageURL; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nationalityFlagURL; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referralDoctorName; + String? referralClinicDescription; + String? referringDoctorName; + bool? isReferralDoctorSameBranch; + String? referralStatusDesc; MyReferredPatientModel({ this.rowID, diff --git a/lib/models/patient/orders_request.dart b/lib/models/patient/orders_request.dart index 1372cfd6..3ff2d3f3 100644 --- a/lib/models/patient/orders_request.dart +++ b/lib/models/patient/orders_request.dart @@ -23,36 +23,36 @@ */ class OrdersRequest { - int visitType; - int admissionNo; - int projectID; - int languageID; - String stamp; - String iPAdress; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - double versionID; + int? visitType; + int? admissionNo; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; + double? versionID; OrdersRequest( - {this.visitType , + {this.visitType, this.admissionNo, this.projectID = 12, this.stamp = '2020-04-23T21:01:21.492Z', this.languageID = 2, this.iPAdress = '11.11.11.11', this.channel = 9, - this.tokenID , + this.tokenID, this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, this.versionID = 5.5, this.patientOutSA = false}); - OrdersRequest.fromJson(Map json) { + OrdersRequest.fromJson(Map json) { visitType = json['VisitType']; admissionNo = json['AdmissionNo']; projectID = json['ProjectID']; diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index df966f03..21dcc90c 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -3,81 +3,81 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatiantInformtion { - PatiantInformtion patientDetails; - int genderInt; + PatiantInformtion? patientDetails; + int? genderInt; dynamic age; - String appointmentDate; - DateTime appointmentDateWithDateTimeForm; + String? appointmentDate; + DateTime? appointmentDateWithDateTimeForm; dynamic appointmentNo; dynamic appointmentType; - String arrivalTime; - String arrivalTimeD; - int callStatus; + String? arrivalTime; + String? arrivalTimeD; + int? callStatus; dynamic callStatusDisc; - int callTypeID; - String clientRequestID; - String clinicName; - String consoltationEnd; - String consultationNotes; - int appointmentTypeId; - String arrivedOn; - int clinicGroupId; - String companyName; + int? callTypeID; + String? clientRequestID; + String? clinicName; + String? consoltationEnd; + String? consultationNotes; + int? appointmentTypeId; + String? arrivedOn; + int? clinicGroupId; + String? companyName; dynamic dischargeStatus; dynamic doctorDetails; - int doctorId; - String endTime; - int episodeNo; - int fallRiskScore; - bool isSigned; - int medicationOrders; - String mobileNumber; - String nationality; - int projectId; - int clinicId; + int? doctorId; + String? endTime; + int? episodeNo; + int? fallRiskScore; + bool? isSigned; + int? medicationOrders; + String? mobileNumber; + String? nationality; + int? projectId; + int? clinicId; dynamic patientId; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - String fullName; - String fullNameN; - int gender; - String dateofBirth; - String nationalityId; - String emailAddress; - String patientIdentificationNo; - int patientType; - int patientMRN; - String admissionNo; - String admissionDate; - DateTime admissionDateWithDateTimeForm; - String createdOn; - String roomId; - String bedId; - String nursingStationId; - String description; - String clinicDescription; - String clinicDescriptionN; - String nationalityName; - String nationalityNameN; - String genderDescription; - String nursingStationName; - String startTime; - String visitType; - String nationalityFlagURL; - int patientStatus; - int patientStatusType; - int visitTypeId; - String startTimes; - String dischargeDate; - int status; - int vcId; - String voipToken; + String? doctorName; + String? doctorNameN; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + String? fullName; + String? fullNameN; + int? gender; + String? dateofBirth; + String? nationalityId; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + int? patientMRN; + String? admissionNo; + String? admissionDate; + DateTime? admissionDateWithDateTimeForm; + String? createdOn; + String? roomId; + String? bedId; + String? nursingStationId; + String? description; + String? clinicDescription; + String? clinicDescriptionN; + String? nationalityName; + String? nationalityNameN; + String? genderDescription; + String? nursingStationName; + String? startTime; + String? visitType; + String? nationalityFlagURL; + int? patientStatus; + int? patientStatusType; + int? visitTypeId; + String? startTimes; + String? dischargeDate; + int? status; + int? vcId; + String? voipToken; PatiantInformtion( {this.patientDetails, @@ -158,7 +158,9 @@ class PatiantInformtion { PatiantInformtion.fromJson(Map json) { { - patientDetails = json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null; + patientDetails = json['patientDetails'] != null + ? new PatiantInformtion.fromJson(json['patientDetails']) + : null; projectId = json["ProjectID"] ?? json["projectID"]; clinicId = json["ClinicID"] ?? json["clinicID"]; doctorId = json["DoctorID"] ?? json["doctorID"]; @@ -196,10 +198,16 @@ class PatiantInformtion { bedId = json["BedID"] ?? json["bedID"]; nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; description = json["Description"] ?? json["description"]; - clinicDescription = json["ClinicDescription"] ?? json["clinicDescription"]; - clinicDescriptionN = json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; - nationalityName = json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName']; - nationalityNameN = json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN']; + clinicDescription = + json["ClinicDescription"] ?? json["clinicDescription"]; + clinicDescriptionN = + json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; + nationalityName = json["NationalityName"] ?? + json["nationalityName"] ?? + json['NationalityName']; + nationalityNameN = json["NationalityNameN"] ?? + json["nationalityNameN"] ?? + json['NationalityNameN']; age = json["Age"] ?? json["age"]; genderDescription = json["GenderDescription"]; nursingStationName = json["NursingStationName"]; @@ -207,7 +215,8 @@ class PatiantInformtion { startTime = json["startTime"] ?? json['StartTime']; appointmentNo = json['appointmentNo'] ?? json['AppointmentNo']; appointmentType = json['appointmentType']; - appointmentTypeId = json['appointmentTypeId'] ?? json['appointmentTypeid']; + appointmentTypeId = + json['appointmentTypeId'] ?? json['appointmentTypeid']; arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn']; clinicGroupId = json['clinicGroupId']; companyName = json['companyName']; @@ -229,9 +238,12 @@ class PatiantInformtion { ? int?.parse(json["patientId"].toString()) : ''); visitType = json['visitType'] ?? json['visitType'] ?? json['visitType']; - nationalityFlagURL = json['NationalityFlagURL'] ?? json['NationalityFlagURL']; - patientStatusType = json['patientStatusType'] ?? json['PatientStatusType']; - visitTypeId = json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; + nationalityFlagURL = + json['NationalityFlagURL'] ?? json['NationalityFlagURL']; + patientStatusType = + json['patientStatusType'] ?? json['PatientStatusType']; + visitTypeId = + json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; startTimes = json['StartTime'] ?? json['StartTime']; dischargeDate = json['DischargeDate']; status = json['Status']; @@ -254,8 +266,9 @@ class PatiantInformtion { ? AppDateUtils.convertStringToDate(json["admissionDate"]) : null; - appointmentDateWithDateTimeForm = - json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) : null; + appointmentDateWithDateTimeForm = json["AppointmentDate"] != null + ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) + : null; } } @@ -303,7 +316,8 @@ class PatiantInformtion { data["gender"] = this.gender; data['Age'] = this.age; - data['AppointmentDate'] = this.appointmentDate.isNotEmpty ? this.appointmentDate : null; + data['AppointmentDate'] = + this.appointmentDate!.isNotEmpty ? this.appointmentDate : null; data['AppointmentNo'] = this.appointmentNo; data['ArrivalTime'] = this.arrivalTime; diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart index 1d0da9c5..ce401222 100644 --- a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart +++ b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -1,12 +1,12 @@ class GetPatientArrivalListRequestModel { - String vidaAuthTokenID; - String from; - String to; - String doctorID; - int pageIndex; - int pageSize; - int clinicID; - int patientMRN; + String? vidaAuthTokenID; + String? from; + String? to; + String? doctorID; + int? pageIndex; + int? pageSize; + int? clinicID; + int? patientMRN; GetPatientArrivalListRequestModel( {this.vidaAuthTokenID, diff --git a/lib/models/patient/patient_model.dart b/lib/models/patient/patient_model.dart index 7368c538..7c4cc17f 100644 --- a/lib/models/patient/patient_model.dart +++ b/lib/models/patient/patient_model.dart @@ -7,142 +7,140 @@ *@desc: */ class PatientModel { - int ProjectID; - int ClinicID; - int DoctorID; - String FirstName; + int? ProjectID; + int? ClinicID; + int? DoctorID; + String? FirstName; - String MiddleName; - String LastName; - String PatientMobileNumber; - String PatientIdentificationID; - int PatientID; - String From; - String To; - int LanguageID; - String stamp; - String IPAdress; - double VersionID; - int Channel; - String TokenID; - String SessionID; - bool IsLoginForDoctorApp; - bool PatientOutSA; - int Searchtype; - String IdentificationNo; - String MobileNo; - int get getProjectID => ProjectID; + String? MiddleName; + String? LastName; + String? PatientMobileNumber; + String? PatientIdentificationID; + int? PatientID; + String? From; + String? To; + int? LanguageID; + String? stamp; + String? IPAdress; + double? VersionID; + int? Channel; + String? TokenID; + String? SessionID; + bool? IsLoginForDoctorApp; + bool? PatientOutSA; + int? Searchtype; + String? IdentificationNo; + String? MobileNo; + int? get getProjectID => ProjectID; - set setProjectID(int ProjectID) => this.ProjectID = ProjectID; + set setProjectID(int? ProjectID) => this.ProjectID = ProjectID; - int get getClinicID => ClinicID; + int? get getClinicID => ClinicID; - set setClinicID(int ClinicID) => this.ClinicID = ClinicID; + set setClinicID(int? ClinicID) => this.ClinicID = ClinicID; - int get getDoctorID => DoctorID; + int? get getDoctorID => DoctorID; - set setDoctorID(int DoctorID) => this.DoctorID = DoctorID; - String get getFirstName => FirstName; + set setDoctorID(int? DoctorID) => this.DoctorID = DoctorID; + String? get getFirstName => FirstName; - set setFirstName(String FirstName) => this.FirstName = FirstName; + set setFirstName(String? FirstName) => this.FirstName = FirstName; - String get getMiddleName => MiddleName; + String? get getMiddleName => MiddleName; - set setMiddleName(String MiddleName) => this.MiddleName = MiddleName; + set setMiddleName(String? MiddleName) => this.MiddleName = MiddleName; - String get getLastName => LastName; + String? get getLastName => LastName; - set setLastName(String LastName) => this.LastName = LastName; + set setLastName(String? LastName) => this.LastName = LastName; - String get getPatientMobileNumber => PatientMobileNumber; + String? get getPatientMobileNumber => PatientMobileNumber; - set setPatientMobileNumber(String PatientMobileNumber) => - this.PatientMobileNumber = PatientMobileNumber; + set setPatientMobileNumber(String? PatientMobileNumber) => this.PatientMobileNumber = PatientMobileNumber; -// String get getPatientIdentificationID => PatientIdentificationID; +// String? get getPatientIdentificationID => PatientIdentificationID; -// set setPatientIdentificationID(String PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID; +// set setPatientIdentificationID(String? PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID; - int get getPatientID => PatientID; + int? get getPatientID => PatientID; - set setPatientID(int PatientID) => this.PatientID = PatientID; + set setPatientID(int? PatientID) => this.PatientID = PatientID; - String get getFrom => From; + String? get getFrom => From; - set setFrom(String From) => this.From = From; + set setFrom(String? From) => this.From = From; - String get getTo => To; + String? get getTo => To; - set setTo(String To) => this.To = To; + set setTo(String? To) => this.To = To; - int get getLanguageID => LanguageID; + int? get getLanguageID => LanguageID; - set setLanguageID(int LanguageID) => this.LanguageID = LanguageID; + set setLanguageID(int? LanguageID) => this.LanguageID = LanguageID; - String get getStamp => stamp; + String? get getStamp => stamp; - set setStamp(String stamp) => this.stamp = stamp; + set setStamp(String? stamp) => this.stamp = stamp; - String get getIPAdress => IPAdress; + String? get getIPAdress => IPAdress; - set setIPAdress(String IPAdress) => this.IPAdress = IPAdress; + set setIPAdress(String? IPAdress) => this.IPAdress = IPAdress; - double get getVersionID => VersionID; + double? get getVersionID => VersionID; - set setVersionID(double VersionID) => this.VersionID = VersionID; + set setVersionID(double? VersionID) => this.VersionID = VersionID; - int get getChannel => Channel; + int? get getChannel => Channel; - set setChannel(int Channel) => this.Channel = Channel; + set setChannel(int? Channel) => this.Channel = Channel; - String get getTokenID => TokenID; + String? get getTokenID => TokenID; - set setTokenID(String TokenID) => this.TokenID = TokenID; + set setTokenID(String? TokenID) => this.TokenID = TokenID; - String get getSessionID => SessionID; + String? get getSessionID => SessionID; - set setSessionID(String SessionID) => this.SessionID = SessionID; + set setSessionID(String? SessionID) => this.SessionID = SessionID; - bool get getIsLoginForDoctorApp => IsLoginForDoctorApp; + bool? get getIsLoginForDoctorApp => IsLoginForDoctorApp; - set setIsLoginForDoctorApp(bool IsLoginForDoctorApp) => - this.IsLoginForDoctorApp = IsLoginForDoctorApp; + set setIsLoginForDoctorApp(bool? IsLoginForDoctorApp) => this.IsLoginForDoctorApp = IsLoginForDoctorApp; - bool get getPatientOutSA => PatientOutSA; + bool? get getPatientOutSA => PatientOutSA; - set setPatientOutSA(bool PatientOutSA) => this.PatientOutSA = PatientOutSA; + set setPatientOutSA(bool? PatientOutSA) => this.PatientOutSA = PatientOutSA; PatientModel( {this.ProjectID, - this.ClinicID, - this.DoctorID, - this.FirstName, - this.MiddleName, - this.LastName, - this.PatientMobileNumber, - this.PatientIdentificationID, - this.PatientID, - this.From, - this.To, - this.LanguageID, - this.stamp, - this.IPAdress, - this.VersionID, - this.Channel, - this.TokenID, - this.SessionID, - this.IsLoginForDoctorApp, - this.PatientOutSA, - this.Searchtype, - this.IdentificationNo, - this.MobileNo}); - - factory PatientModel.fromJson(Map json) => PatientModel( - FirstName: json["FirstName"], - LastName: json["LasttName"], - ); - Map toJson() { - final Map data = new Map(); + this.ClinicID, + this.DoctorID, + this.FirstName, + this.MiddleName, + this.LastName, + this.PatientMobileNumber, + this.PatientIdentificationID, + this.PatientID, + this.From, + this.To, + this.LanguageID, + this.stamp, + this.IPAdress, + this.VersionID, + this.Channel, + this.TokenID, + this.SessionID, + this.IsLoginForDoctorApp, + this.PatientOutSA, + this.Searchtype, + this.IdentificationNo, + this.MobileNo}); + + factory PatientModel.fromJson(Map json) => PatientModel( + FirstName: json["FirstName"], + LastName: json["LasttName"], + ); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.ProjectID; data['ClinicID'] = this.ClinicID; data['DoctorID'] = this.DoctorID; diff --git a/lib/models/patient/prescription/prescription_report.dart b/lib/models/patient/prescription/prescription_report.dart index 05d28bdc..added64a 100644 --- a/lib/models/patient/prescription/prescription_report.dart +++ b/lib/models/patient/prescription/prescription_report.dart @@ -1,36 +1,36 @@ class PrescriptionReport { - String address; - int appointmentNo; - String clinic; - String companyName; - int days; - String doctorName; - int doseDailyQuantity; - String frequency; - int frequencyNumber; + String? address; + int? appointmentNo; + String? clinic; + String? companyName; + int? days; + String? doctorName; + int? doseDailyQuantity; + String? frequency; + int? frequencyNumber; Null imageExtension; Null imageSRCUrl; Null imageString; Null imageThumbUrl; - String isCovered; - String itemDescription; - int itemID; - String orderDate; - int patientID; - String patientName; - String phoneOffice1; + String? isCovered; + String? itemDescription; + int? itemID; + String? orderDate; + int? patientID; + String? patientName; + String? phoneOffice1; Null prescriptionQR; - int prescriptionTimes; + int? prescriptionTimes; Null productImage; - String productImageBase64; - String productImageString; - int projectID; - String projectName; - String remarks; - String route; - String sKU; - int scaleOffset; - String startDate; + String? productImageBase64; + String? productImageString; + int? projectID; + String? projectName; + String? remarks; + String? route; + String? sKU; + int? scaleOffset; + String? startDate; PrescriptionReport( {this.address, diff --git a/lib/models/patient/prescription/prescription_report_for_in_patient.dart b/lib/models/patient/prescription/prescription_report_for_in_patient.dart index 21cb13b1..a20cc77b 100644 --- a/lib/models/patient/prescription/prescription_report_for_in_patient.dart +++ b/lib/models/patient/prescription/prescription_report_for_in_patient.dart @@ -1,52 +1,52 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionReportForInPatient { - int admissionNo; - int authorizedBy; + int? admissionNo; + int? authorizedBy; Null bedNo; - String comments; - int createdBy; - String createdByName; + String? comments; + int? createdBy; + String? createdByName; Null createdByNameN; - String createdOn; - String direction; - int directionID; + String? createdOn; + String? direction; + int? directionID; Null directionN; - String dose; - int editedBy; + String? dose; + int? editedBy; Null iVDiluentLine; - int iVDiluentType; + int? iVDiluentType; Null iVDiluentVolume; Null iVRate; Null iVStability; - String itemDescription; - int itemID; - int lineItemNo; - int locationId; - int noOfDoses; - int orderNo; - int patientID; - String pharmacyRemarks; - DateTime prescriptionDatetime; - int prescriptionNo; - String processedBy; - int projectID; - int refillID; - String refillType; + String? itemDescription; + int? itemID; + int? lineItemNo; + int? locationId; + int? noOfDoses; + int? orderNo; + int? patientID; + String? pharmacyRemarks; + DateTime? prescriptionDatetime; + int? prescriptionNo; + String? processedBy; + int? projectID; + int? refillID; + String? refillType; Null refillTypeN; - int reviewedPharmacist; + int? reviewedPharmacist; Null roomId; - String route; - int routeId; + String? route; + int? routeId; Null routeN; Null setupID; - DateTime startDatetime; - int status; - String statusDescription; + DateTime? startDatetime; + int? status; + String? statusDescription; Null statusDescriptionN; - DateTime stopDatetime; - int unitofMeasurement; - String unitofMeasurementDescription; + DateTime? stopDatetime; + int? unitofMeasurement; + String? unitofMeasurementDescription; Null unitofMeasurementDescriptionN; PrescriptionReportForInPatient( @@ -98,7 +98,7 @@ class PrescriptionReportForInPatient { this.unitofMeasurementDescription, this.unitofMeasurementDescriptionN}); - PrescriptionReportForInPatient.fromJson(Map json) { + PrescriptionReportForInPatient.fromJson(Map json) { admissionNo = json['AdmissionNo']; authorizedBy = json['AuthorizedBy']; bedNo = json['BedNo']; @@ -138,7 +138,7 @@ class PrescriptionReportForInPatient { routeId = json['RouteId']; routeN = json['RouteN']; setupID = json['SetupID']; - startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']) ; + startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']); status = json['Status']; statusDescription = json['StatusDescription']; statusDescriptionN = json['StatusDescriptionN']; @@ -148,8 +148,8 @@ class PrescriptionReportForInPatient { unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['AdmissionNo'] = this.admissionNo; data['AuthorizedBy'] = this.authorizedBy; data['BedNo'] = this.bedNo; diff --git a/lib/models/patient/prescription/prescription_req_model.dart b/lib/models/patient/prescription/prescription_req_model.dart index 9141c282..6f2a16e1 100644 --- a/lib/models/patient/prescription/prescription_req_model.dart +++ b/lib/models/patient/prescription/prescription_req_model.dart @@ -6,19 +6,19 @@ *@desc: PrescriptionReqModel class */ class PrescriptionReqModel { - int patientID; - int setupID; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? patientID; + int ?setupID; + int ?projectID; + int ?languageID; + String ?stamp; + String ?iPAdress; + double ?versionID; + int ?channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; PrescriptionReqModel( {this.patientID, diff --git a/lib/models/patient/prescription/prescription_res_model.dart b/lib/models/patient/prescription/prescription_res_model.dart index 9c7e296d..db864617 100644 --- a/lib/models/patient/prescription/prescription_res_model.dart +++ b/lib/models/patient/prescription/prescription_res_model.dart @@ -6,39 +6,39 @@ *@desc: PrescriptionResModel class */ class PrescriptionResModel { - String setupID; - int projectID; - int patientID; - int appointmentNo; - String appointmentDate; - String doctorName; - String clinicDescription; - String name; - int episodeID; - int actualDoctorRate; - int admission; - int clinicID; - String companyName; - String despensedStatus; - String dischargeDate; - int dischargeNo; - int doctorID; - String doctorImageURL; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isInsurancePatient; - String nationalityFlagURL; - int noOfPatientsRate; - String qR; - List speciality; + String? setupID; + int? projectID; + int? patientID; + int? appointmentNo; + String? appointmentDate; + String? doctorName; + String? clinicDescription; + String? name; + int? episodeID; + int? actualDoctorRate; + int? admission; + int? clinicID; + String? companyName; + String? despensedStatus; + String? dischargeDate; + int? dischargeNo; + int? doctorID; + String? doctorImageURL; + int? doctorRate; + String? doctorTitle; + int? gender; + String? genderDescription; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; + String? isInOutPatientDescription; + String? isInOutPatientDescriptionN; + bool? isInsurancePatient; + String? nationalityFlagURL; + int? noOfPatientsRate; + String? qR; + List? speciality; PrescriptionResModel( {this.setupID, diff --git a/lib/models/patient/prescription/request_prescription_report.dart b/lib/models/patient/prescription/request_prescription_report.dart index 0581692e..3546210d 100644 --- a/lib/models/patient/prescription/request_prescription_report.dart +++ b/lib/models/patient/prescription/request_prescription_report.dart @@ -1,18 +1,18 @@ class RequestPrescriptionReport { - int projectID; - int appointmentNo; - int episodeID; - String setupID; - int patientTypeID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + int? appointmentNo; + int? episodeID; + String? setupID; + int? patientTypeID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestPrescriptionReport( {this.projectID, diff --git a/lib/models/patient/profile/patient_profile_app_bar_model.dart b/lib/models/patient/profile/patient_profile_app_bar_model.dart new file mode 100644 index 00000000..97862aaa --- /dev/null +++ b/lib/models/patient/profile/patient_profile_app_bar_model.dart @@ -0,0 +1,91 @@ +import '../patiant_info_model.dart'; + +class PatientProfileAppBarModel { + double? height; + bool? isInpatient; + bool? isDischargedPatient; + bool? isFromLiveCare; + PatiantInformtion? patient; + String? doctorName; + String? branch; + DateTime? appointmentDate; + String? profileUrl; + String? invoiceNO; + String? orderNo; + bool? isPrescriptions; + bool? isMedicalFile; + String? episode; + String? visitDate; + String? clinic; + bool? isAppointmentHeader; + bool? isFromLabResult; + Stream ?videoCallDurationStream; + + + PatientProfileAppBarModel( + {this.height = 0.0, + this.isInpatient= false, + this.isDischargedPatient= false, + this.isFromLiveCare= false, + this.patient, + this.doctorName, + this.branch, + this.appointmentDate, + this.profileUrl, + this.invoiceNO, + this.orderNo, + this.isPrescriptions= false, + this.isMedicalFile= false, + this.episode, + this.visitDate, + this.clinic, + this.isAppointmentHeader = false, + this.isFromLabResult =false, this.videoCallDurationStream}); + + PatientProfileAppBarModel.fromJson(Map json) { + height = json['height']; + isInpatient = json['isInpatient']; + isDischargedPatient = json['isDischargedPatient']; + isFromLiveCare = json['isFromLiveCare']; + patient = json['patient']; + doctorName = json['doctorName']; + branch = json['branch']; + appointmentDate = json['appointmentDate']; + profileUrl = json['profileUrl']; + invoiceNO = json['invoiceNO']; + orderNo = json['orderNo']; + isPrescriptions = json['isPrescriptions']; + isMedicalFile = json['isMedicalFile']; + episode = json['episode']; + visitDate = json['visitDate']; + clinic = json['clinic']; + isAppointmentHeader = json['isAppointmentHeader']; + isFromLabResult = json['isFromLabResult']; + videoCallDurationStream = json['videoCallDurationStream']; + + } + + Map toJson() { + final Map data = new Map(); + data['height'] = this.height; + data['isInpatient'] = this.isInpatient; + data['isDischargedPatient'] = this.isDischargedPatient; + data['isFromLiveCare'] = this.isFromLiveCare; + data['patient'] = this.patient; + data['doctorName'] = this.doctorName; + data['branch'] = this.branch; + data['appointmentDate'] = this.appointmentDate; + data['profileUrl'] = this.profileUrl; + data['invoiceNO'] = this.invoiceNO; + data['orderNo'] = this.orderNo; + data['isPrescriptions'] = this.isPrescriptions; + data['isMedicalFile'] = this.isMedicalFile; + data['episode'] = this.episode; + data['visitDate'] = this.visitDate; + data['clinic'] = this.clinic; + data['isAppointmentHeader'] = this.isAppointmentHeader; + data['isFromLabResult'] = this.isFromLabResult; + data['videoCallDurationStream'] = this.videoCallDurationStream; + return data; + } +} diff --git a/lib/models/patient/progress_note_request.dart b/lib/models/patient/progress_note_request.dart index 13e1b571..b174c62e 100644 --- a/lib/models/patient/progress_note_request.dart +++ b/lib/models/patient/progress_note_request.dart @@ -1,5 +1,4 @@ - -/* +/* *@author: Ibrahim Albitar *@Date:15/5/2020 @@ -23,20 +22,22 @@ */ class ProgressNoteRequest { - int visitType; - int admissionNo; - int projectID; - int languageID; - String stamp; - String iPAdress; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? visitType; + int? admissionNo; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; + double? versionID; + ProgressNoteRequest( - {this.visitType , + {this.visitType, this.admissionNo, this.projectID = 12, this.stamp = '2020-04-23T21:01:21.492Z', diff --git a/lib/models/patient/radiology/radiology_req_model.dart b/lib/models/patient/radiology/radiology_req_model.dart index 47154d8b..83c8f847 100644 --- a/lib/models/patient/radiology/radiology_req_model.dart +++ b/lib/models/patient/radiology/radiology_req_model.dart @@ -6,18 +6,18 @@ *@desc: RadiologyReqModel class */ class RadiologyReqModel { - int patientID; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? patientID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; RadiologyReqModel( {this.patientID, diff --git a/lib/models/patient/radiology/radiology_res_model.dart b/lib/models/patient/radiology/radiology_res_model.dart index 6c6509a9..328a1beb 100644 --- a/lib/models/patient/radiology/radiology_res_model.dart +++ b/lib/models/patient/radiology/radiology_res_model.dart @@ -6,21 +6,21 @@ *@desc: RadiologyResModel class */ class RadiologyResModel { - String setupID; - int projectID; - int patientID; - int invoiceLineItemNo; - int invoiceNo; - String reportData; - String imageURL; - int clinicId; - int doctorId; - String reportDate; - String clinicName; - String doctorImageURL; - String doctorName; - String projectName; - Null statusDescription; + String? setupID; + int? projectID; + int? patientID; + int? invoiceLineItemNo; + int? invoiceNo; + String? reportData; + String? imageURL; + int? clinicId; + int? doctorId; + String? reportDate; + String? clinicName; + String? doctorImageURL; + String? doctorName; + String? projectName; + dynamic statusDescription; RadiologyResModel( {this.setupID, @@ -39,7 +39,7 @@ class RadiologyResModel { this.projectName, this.statusDescription}); - RadiologyResModel.fromJson(Map json) { + RadiologyResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; diff --git a/lib/models/patient/reauest_prescription_report_for_in_patient.dart b/lib/models/patient/reauest_prescription_report_for_in_patient.dart index 857705c4..fe5b93ec 100644 --- a/lib/models/patient/reauest_prescription_report_for_in_patient.dart +++ b/lib/models/patient/reauest_prescription_report_for_in_patient.dart @@ -1,17 +1,17 @@ class RequestPrescriptionReportForInPatient { - int patientID; - int projectID; - int admissionNo; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? patientID; + int? projectID; + int? admissionNo; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; RequestPrescriptionReportForInPatient( {this.patientID, diff --git a/lib/models/patient/refer_to_doctor_request.dart b/lib/models/patient/refer_to_doctor_request.dart index 83db54f4..5946dcc5 100644 --- a/lib/models/patient/refer_to_doctor_request.dart +++ b/lib/models/patient/refer_to_doctor_request.dart @@ -10,31 +10,30 @@ class ReferToDoctorRequest { *@desc: ReferToDoctor */ - int projectID; - int admissionNo; - String roomID; - String referralClinic; - String referralDoctor; - int createdBy; - int editedBy; - int patientID; - int patientTypeID; - int referringClinic; - int referringDoctor; - String referringDoctorRemarks; - String priority; - String frequency; - String extension; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - + int? projectID; + int? admissionNo; + String? roomID; + String? referralClinic; + String? referralDoctor; + int? createdBy; + int? editedBy; + int? patientID; + int? patientTypeID; + int? referringClinic; + int? referringDoctor; + String? referringDoctorRemarks; + String? priority; + String? frequency; + String? extension; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; /* { diff --git a/lib/models/patient/request_my_referral_patient_model.dart b/lib/models/patient/request_my_referral_patient_model.dart index 219b7b2a..4a76b5a9 100644 --- a/lib/models/patient/request_my_referral_patient_model.dart +++ b/lib/models/patient/request_my_referral_patient_model.dart @@ -1,26 +1,26 @@ class RequestMyReferralPatientModel { - int projectID; - int clinicID; - int doctorID; - String firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + int? clinicID; + int? doctorID; + String? firstName; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; + String? from; + String? to; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestMyReferralPatientModel( {this.projectID, diff --git a/lib/models/patient/topten_users_res_model.dart b/lib/models/patient/topten_users_res_model.dart index 3454568f..58e91af6 100644 --- a/lib/models/patient/topten_users_res_model.dart +++ b/lib/models/patient/topten_users_res_model.dart @@ -10,18 +10,16 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; //ModelResponse class ModelResponse { - final List list; - String firstName; + final List? list; + String? firstName; ModelResponse({ this.list, this.firstName, }); factory ModelResponse.fromJson(List parsedJson) { - - - List list = new List(); - + List list = []; + list = parsedJson.map((i) => PatiantInformtion.fromJson(i)).toList(); return new ModelResponse(list: list); diff --git a/lib/models/patient/vital_sign/patient-vital-sign-data.dart b/lib/models/patient/vital_sign/patient-vital-sign-data.dart index 57133a08..84b2bb95 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-data.dart @@ -1,33 +1,33 @@ class VitalSignData { - int appointmentNo; - int bloodPressureCuffLocation; - int bloodPressureCuffSize; - int bloodPressureHigher; - int bloodPressureLower; - int bloodPressurePatientPosition; + int? appointmentNo; + int? bloodPressureCuffLocation; + int? bloodPressureCuffSize; + int? bloodPressureHigher; + int? bloodPressureLower; + int? bloodPressurePatientPosition; var bodyMassIndex; - int fio2; - int headCircumCm; + int? fio2; + int? headCircumCm; var heightCm; - int idealBodyWeightLbs; - bool isPainManagementDone; - bool isVitalsRequired; - int leanBodyWeightLbs; - String painCharacter; - String painDuration; - String painFrequency; - String painLocation; - int painScore; - int patientMRN; - int patientType; - int pulseBeatPerMinute; - int pulseRhythm; - int respirationBeatPerMinute; - int respirationPattern; - int sao2; - int status; + int? idealBodyWeightLbs; + bool? isPainManagementDone; + bool? isVitalsRequired; + int? leanBodyWeightLbs; + String? painCharacter; + String? painDuration; + String? painFrequency; + String? painLocation; + int? painScore; + int? patientMRN; + int? patientType; + int? pulseBeatPerMinute; + int? pulseRhythm; + int? respirationBeatPerMinute; + int? respirationPattern; + int? sao2; + int? status; var temperatureCelcius; - int temperatureCelciusMethod; + int? temperatureCelciusMethod; var waistSizeInch; var weightKg; @@ -133,5 +133,4 @@ class VitalSignData { data['weightKg'] = this.weightKg; return data; } - } diff --git a/lib/models/patient/vital_sign/patient-vital-sign-history.dart b/lib/models/patient/vital_sign/patient-vital-sign-history.dart index ed39a86e..d3d445f6 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-history.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-history.dart @@ -25,9 +25,9 @@ class VitalSignHistory { var painDuration; var painCharacter; var painFrequency; - bool isPainManagementDone; + bool? isPainManagementDone; var status; - bool isVitalsRequired; + bool? isVitalsRequired; var patientID; var createdOn; var doctorID; diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/models/patient/vital_sign/vital_sign_req_model.dart index 8f5be6ba..e5fe2d16 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_req_model.dart @@ -1,26 +1,25 @@ - -/* - *@author: Elham Rababah - *@Date:27/4/2020 - *@param: +/* + *@author: Elham Rababah + *@Date:27/4/2020 + *@param: *@return: *@desc: VitalSignReqModel */ class VitalSignReqModel { - int patientID; - int projectID; - int patientTypeID; - int inOutpatientType; - int transNo; - int languageID; - String stamp ; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? patientID; + int? projectID; + int? patientTypeID; + int? inOutpatientType; + int? transNo; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; VitalSignReqModel( {this.patientID, diff --git a/lib/models/patient/vital_sign/vital_sign_res_model.dart b/lib/models/patient/vital_sign/vital_sign_res_model.dart index 78af108d..625d4d63 100644 --- a/lib/models/patient/vital_sign/vital_sign_res_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_res_model.dart @@ -34,17 +34,17 @@ class VitalSignResModel { var painDuration; var painCharacter; var painFrequency; - bool isPainManagementDone; + bool? isPainManagementDone; var status; - bool isVitalsRequired; + bool? isVitalsRequired; var patientID; - var createdOn; + var createdOn; var doctorID; var clinicID; var triageCategory; var gCScore; var lineItemNo; - DateTime vitalSignDate; + DateTime? vitalSignDate; var actualTimeTaken; var sugarLevel; var fBS; diff --git a/lib/models/pending_orders/pending_order_request_model.dart b/lib/models/pending_orders/pending_order_request_model.dart index c69cf780..47577b16 100644 --- a/lib/models/pending_orders/pending_order_request_model.dart +++ b/lib/models/pending_orders/pending_order_request_model.dart @@ -1,20 +1,20 @@ class PendingOrderRequestModel { - bool isDentalAllowedBackend; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int deviceTypeID; - String tokenID; - int patientID; - int admissionNo; - String sessionID; - int projectID; - String setupID; - bool patientOutSA; - int patientType; - int patientTypeID; + bool? isDentalAllowedBackend; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? deviceTypeID; + String? tokenID; + int? patientID; + int? admissionNo; + String? sessionID; + int? projectID; + String? setupID; + bool? patientOutSA; + int? patientType; + int? patientTypeID; PendingOrderRequestModel( {this.isDentalAllowedBackend, diff --git a/lib/models/pending_orders/pending_orders_model.dart b/lib/models/pending_orders/pending_orders_model.dart index 89525369..65f93f89 100644 --- a/lib/models/pending_orders/pending_orders_model.dart +++ b/lib/models/pending_orders/pending_orders_model.dart @@ -1,5 +1,5 @@ class PendingOrderModel { - String notes; + String? notes; PendingOrderModel({this.notes}); diff --git a/lib/models/pharmacies/pharmacies_List_request_model.dart b/lib/models/pharmacies/pharmacies_List_request_model.dart index a00e217a..c1f0c4ae 100644 --- a/lib/models/pharmacies/pharmacies_List_request_model.dart +++ b/lib/models/pharmacies/pharmacies_List_request_model.dart @@ -8,17 +8,17 @@ */ class PharmaciesListRequestModel { - int itemID; - int languageID; - String stamp; - String ipAdress; - double versionID; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - int channel; + int? itemID; + int? languageID; + String? stamp; + String? ipAdress; + double? versionID; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; + int? channel; PharmaciesListRequestModel( {this.itemID, diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/models/pharmacies/pharmacies_items_request_model.dart index e81ce9b3..a8cd82c3 100644 --- a/lib/models/pharmacies/pharmacies_items_request_model.dart +++ b/lib/models/pharmacies/pharmacies_items_request_model.dart @@ -7,17 +7,17 @@ */ class PharmaciesItemsRequestModel { - String pHRItemName; - int pageIndex = 0; - int pageSize = 20; - int channel = 3; - int languageID = 2; - String iPAdress = "10.20.10.20"; - String generalid = "Cs2020@2016\$2958"; - int patientOutSA = 0; - String sessionID = "KvFJENeAUCxyVdIfEkHw"; - bool isDentalAllowedBackend = false; - int deviceTypeID = 2; + String? pHRItemName; + int? pageIndex = 0; + int? pageSize = 20; + int? channel = 3; + int? languageID = 2; + String? iPAdress = "10.20.10.20"; + String? generalid = "Cs2020@2016\$2958"; + int? patientOutSA = 0; + String? sessionID = "KvFJENeAUCxyVdIfEkHw"; + bool? isDentalAllowedBackend = false; + int? deviceTypeID = 2; PharmaciesItemsRequestModel( {this.pHRItemName, diff --git a/lib/models/sickleave/add_sickleave_request.dart b/lib/models/sickleave/add_sickleave_request.dart index d398153b..05d839f1 100644 --- a/lib/models/sickleave/add_sickleave_request.dart +++ b/lib/models/sickleave/add_sickleave_request.dart @@ -1,16 +1,11 @@ class AddSickLeaveRequest { - String patientMRN; - String appointmentNo; - String startDate; - String noOfDays; - String remarks; + String? patientMRN; + String? appointmentNo; + String? startDate; + String? noOfDays; + String? remarks; - AddSickLeaveRequest( - {this.patientMRN, - this.appointmentNo, - this.startDate, - this.noOfDays, - this.remarks}); + AddSickLeaveRequest({this.patientMRN, this.appointmentNo, this.startDate, this.noOfDays, this.remarks}); AddSickLeaveRequest.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/sickleave/extend_sick_leave_request.dart b/lib/models/sickleave/extend_sick_leave_request.dart index 8b61eb90..026fc8bd 100644 --- a/lib/models/sickleave/extend_sick_leave_request.dart +++ b/lib/models/sickleave/extend_sick_leave_request.dart @@ -1,8 +1,8 @@ class ExtendSickLeaveRequest { - String patientMRN; - String previousRequestNo; - String noOfDays; - String remarks; + String? patientMRN; + String? previousRequestNo; + String? noOfDays; + String? remarks; ExtendSickLeaveRequest( {this.patientMRN, this.previousRequestNo, this.noOfDays, this.remarks}); diff --git a/lib/models/sickleave/get_all_sickleave_response.dart b/lib/models/sickleave/get_all_sickleave_response.dart index de831213..7cfb292b 100644 --- a/lib/models/sickleave/get_all_sickleave_response.dart +++ b/lib/models/sickleave/get_all_sickleave_response.dart @@ -1,13 +1,13 @@ class GetAllSickLeaveResponse { - int appointmentNo; - bool isExtendedLeave; - int noOfDays; - int patientMRN; - String remarks; - int requestNo; - String startDate; - int status; - String statusDescription; + int? appointmentNo; + bool? isExtendedLeave; + int? noOfDays; + int? patientMRN; + String? remarks; + int? requestNo; + String? startDate; + int? status; + String? statusDescription; GetAllSickLeaveResponse( {this.appointmentNo, this.isExtendedLeave, diff --git a/lib/models/sickleave/sick_leave_statisitics_model.dart b/lib/models/sickleave/sick_leave_statisitics_model.dart index f679807c..5104de0f 100644 --- a/lib/models/sickleave/sick_leave_statisitics_model.dart +++ b/lib/models/sickleave/sick_leave_statisitics_model.dart @@ -1,7 +1,7 @@ class SickLeaveStatisticsModel { - String recommendedSickLeaveDays; - int totalLeavesByAllClinics; - int totalLeavesByDoctor; + String? recommendedSickLeaveDays; + int? totalLeavesByAllClinics; + int? totalLeavesByDoctor; SickLeaveStatisticsModel( {this.recommendedSickLeaveDays, diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 78c68256..6ae073c1 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -23,7 +23,7 @@ class LoginScreen extends StatefulWidget { } class _LoginScreenState extends State { - String platformImei; + late String platformImei; bool allowCallApi = true; //TODO change AppTextFormField to AppTextFormFieldCustom @@ -34,7 +34,7 @@ class _LoginScreenState extends State { List projectsList = []; FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -73,7 +73,7 @@ class _LoginScreenState extends State { height: 10, ), Text( - TranslationBase.of(context).welcomeTo, + TranslationBase.of(context).welcomeTo!, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, @@ -81,7 +81,7 @@ class _LoginScreenState extends State { ), Text( TranslationBase.of(context) - .drSulaimanAlHabib, + .drSulaimanAlHabib!, style: TextStyle( color: Color(0xFF2B353E), fontWeight: FontWeight.bold, @@ -224,8 +224,8 @@ class _LoginScreenState extends State { login( context, ) async { - if (loginFormKey.currentState.validate()) { - loginFormKey.currentState.save(); + if (loginFormKey.currentState!.validate()) { + loginFormKey.currentState!.save(); GifLoaderDialogUtils.showMyDialog(context); await authenticationViewModel.login(authenticationViewModel.userInfo); if (authenticationViewModel.state == ViewState.ErrorLocal) { @@ -251,10 +251,10 @@ class _LoginScreenState extends State { setState(() { authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; - projectIdController.text = projectsList[index].facilityName; + projectIdController.text = projectsList[index].facilityName!; }); - primaryFocus.unfocus(); + primaryFocus!.unfocus(); } String memberID = ""; @@ -268,7 +268,7 @@ class _LoginScreenState extends State { setState(() { authenticationViewModel.userInfo.projectID = projectsList[0].facilityId; - projectIdController.text = projectsList[0].facilityName; + projectIdController.text = projectsList[0].facilityName!; }); } } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index e1f2f49b..08a6ac6c 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -41,12 +41,12 @@ class VerificationMethodsScreen extends StatefulWidget { } class _VerificationMethodsScreenState extends State { - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; bool isMoreOption = false; bool onlySMSBox = false; - AuthMethodTypes fingerPrintBefore; - AuthMethodTypes selectedOption; - AuthenticationViewModel authenticationViewModel; + AuthMethodTypes? fingerPrintBefore; + late AuthMethodTypes selectedOption; + late AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -103,7 +103,7 @@ class _VerificationMethodsScreenState extends State { ), AppText( Helpers.convertToTitleCase( - authenticationViewModel.user.doctorName), + authenticationViewModel.user!.doctorName??''), fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * 6, @@ -150,7 +150,7 @@ class _VerificationMethodsScreenState extends State { children: [ Text( TranslationBase.of(context) - .lastLoginAt, + .lastLoginAt!, overflow: TextOverflow.ellipsis, style: TextStyle( fontFamily: 'Poppins', @@ -170,7 +170,7 @@ class _VerificationMethodsScreenState extends State { text: TextSpan( text: TranslationBase.of( context) - .verifyWith + + .verifyWith! + ':', style: TextStyle( color: @@ -187,7 +187,7 @@ class _VerificationMethodsScreenState extends State { text: authenticationViewModel .getType( authenticationViewModel - .user + .user! .logInTypeID, context), style: TextStyle( @@ -217,25 +217,25 @@ class _VerificationMethodsScreenState extends State { children: [ AppText( authenticationViewModel - .user.editedOn != + .user!.editedOn != null ? AppDateUtils .getDayMonthYearDateFormatted( AppDateUtils .convertStringToDate( authenticationViewModel - .user - .editedOn), + .user! + .editedOn!), isMonthShort: true) : authenticationViewModel - .user.createdOn != + .user!.createdOn! != null ? AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils .convertStringToDate( authenticationViewModel - .user - .createdOn), + .user! + .createdOn!), isMonthShort: true) : '--', textAlign: TextAlign.right, @@ -248,21 +248,21 @@ class _VerificationMethodsScreenState extends State { ), AppText( authenticationViewModel - .user.editedOn != + .user!.editedOn! != null ? AppDateUtils.getHour(AppDateUtils .convertStringToDate( authenticationViewModel - .user.editedOn)) + .user!.editedOn!)) : authenticationViewModel - .user.createdOn != + .user!.createdOn! != null ? AppDateUtils.getHour( AppDateUtils .convertStringToDate( authenticationViewModel - .user - .createdOn)) + .user! + .createdOn!)) : '--', textAlign: TextAlign.right, fontSize: SizeConfig @@ -355,8 +355,8 @@ class _VerificationMethodsScreenState extends State { SelectedAuthMethodTypesService .getMethodsTypeService( authenticationViewModel - .user - .logInTypeID), + .user! + .logInTypeID!), authenticateUser: (AuthMethodTypes authMethodType, @@ -490,15 +490,12 @@ class _VerificationMethodsScreenState extends State { ); } - sendActivationCodeByOtpNotificationType( - AuthMethodTypes authMethodType) async { - if (authMethodType == AuthMethodTypes.SMS || - authMethodType == AuthMethodTypes.WhatsApp) { + sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async { + if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.showMyDialog(context); await authenticationViewModel.sendActivationCodeForDoctorApp( - authMethodType: authMethodType, - password: authenticationViewModel.userInfo.password); + authMethodType: authMethodType, password: authenticationViewModel.userInfo.password!); if (authenticationViewModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(authenticationViewModel.error); GifLoaderDialogUtils.hideDialog(context); @@ -523,12 +520,9 @@ class _VerificationMethodsScreenState extends State { GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(authenticationViewModel.error); } else { - await sharedPref.setString( - TOKEN, - authenticationViewModel - .activationCodeVerificationScreenRes.logInTokenID); - if (authMethodType == AuthMethodTypes.SMS || - authMethodType == AuthMethodTypes.WhatsApp) { + await sharedPref.setString(TOKEN, + authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!); + if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType, isSilentLogin: true); } else { @@ -542,8 +536,7 @@ class _VerificationMethodsScreenState extends State { authMethodType == AuthMethodTypes.FaceID) { fingerPrintBefore = authMethodType; } - this.selectedOption = - fingerPrintBefore != null ? fingerPrintBefore : authMethodType; + this.selectedOption = (fingerPrintBefore != null ? fingerPrintBefore : authMethodType)!; switch (authMethodType) { case AuthMethodTypes.SMS: @@ -578,8 +571,8 @@ class _VerificationMethodsScreenState extends State { context, type, authenticationViewModel.loggedUser != null - ? authenticationViewModel.loggedUser.mobileNumber - : authenticationViewModel.user.mobile, + ? authenticationViewModel.loggedUser!.mobileNumber + : authenticationViewModel.user!.mobile, (value) { showDialog( context: context, @@ -601,11 +594,9 @@ class _VerificationMethodsScreenState extends State { await authenticationViewModel.showIOSAuthMessages(); if (!mounted) return; if (authenticationViewModel.user != null && - (SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == + (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == AuthMethodTypes.Fingerprint || - SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == + SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == AuthMethodTypes.FaceID)) { this.sendActivationCode(authMethodTypes); } else { @@ -616,19 +607,22 @@ class _VerificationMethodsScreenState extends State { } } - checkActivationCode({String value, bool isSilentLogin = false}) async { - await authenticationViewModel.checkActivationCodeForDoctorApp( - activationCode: value, isSilentLogin: isSilentLogin); + checkActivationCode({String? value,bool isSilentLogin = false}) async { + await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value!,isSilentLogin: isSilentLogin); if (authenticationViewModel.state == ViewState.ErrorLocal) { Navigator.pop(context); Helpers.showErrorToast(authenticationViewModel.error); } else { await authenticationViewModel.onCheckActivationCodeSuccess(); - if (value != null) { - if (Navigator.canPop(context)) Navigator.pop(context); - } - if (Navigator.canPop(context)) Navigator.pop(context); - navigateToLandingPage(); + if(value !=null){ + if(Navigator.canPop(context)) + Navigator.pop(context); + } + if(Navigator.canPop(context)) + Navigator.pop(context); + navigateToLandingPage(); + + } } diff --git a/lib/screens/base/base_view.dart b/lib/screens/base/base_view.dart index 7a5c93e6..0cf174c7 100644 --- a/lib/screens/base/base_view.dart +++ b/lib/screens/base/base_view.dart @@ -5,11 +5,11 @@ import 'package:provider/provider.dart'; import '../../locator.dart'; class BaseView extends StatefulWidget { - final Widget Function(BuildContext context, T model, Widget child) builder; - final Function(T) onModelReady; + final Widget Function(BuildContext context, T model, Widget? child) builder; + final Function(T)? onModelReady; BaseView({ - this.builder, + required this.builder, this.onModelReady, }); @@ -18,14 +18,14 @@ class BaseView extends StatefulWidget { } class _BaseViewState extends State> { - T model = locator(); + T? model = locator(); bool isLogin = false; @override void initState() { if (widget.onModelReady != null) { - widget.onModelReady(model); + widget.onModelReady!(model!); } super.initState(); @@ -34,7 +34,7 @@ class _BaseViewState extends State> { @override Widget build(BuildContext context) { return ChangeNotifierProvider.value( - value: model, + value: model!, child: Consumer(builder: widget.builder), ); } diff --git a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart index 5166d2b1..9510504e 100644 --- a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart @@ -12,9 +12,8 @@ import 'package:flutter/material.dart'; import 'doctor_repaly_chat.dart'; class AllDoctorQuestions extends StatefulWidget { - final Function changeCurrentTab; - const AllDoctorQuestions({Key key, this.changeCurrentTab}) : super(key: key); + const AllDoctorQuestions({Key? key}) : super(key: key); @override _AllDoctorQuestionsState createState() => _AllDoctorQuestionsState(); @@ -31,10 +30,10 @@ class _AllDoctorQuestionsState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( children: [ Expanded( @@ -82,7 +81,7 @@ class _AllDoctorQuestionsState extends State { }); model.getDoctorReply(pageIndex: pageIndex); } - return; + return false; }, ), ), diff --git a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart index cda899f1..df948a8b 100644 --- a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart @@ -25,7 +25,7 @@ class DoctorReplayChat extends StatefulWidget { final DoctorReplayViewModel previousModel; bool showMsgBox = false; DoctorReplayChat( - {Key key, this.reply, this.previousModel, + {Key? key, required this.reply, required this.previousModel, }); @override @@ -38,8 +38,8 @@ class _DoctorReplayChatState extends State { @override Widget build(BuildContext context) { - if(widget.reply.doctorResponse.isNotEmpty){ - msgController.text = widget.reply.doctorResponse; + if(widget.reply.doctorResponse!.isNotEmpty){ + msgController.text = widget.reply.doctorResponse!; } else { widget.showMsgBox = true; @@ -173,7 +173,7 @@ class _DoctorReplayChatState extends State { margin: EdgeInsets.symmetric(horizontal: 0), child: InkWell( onTap: () { - launch("tel://" +widget.reply.mobileNumber); + launch("tel://" +widget.reply.mobileNumber!); }, child: Icon( Icons.phone, @@ -195,7 +195,7 @@ class _DoctorReplayChatState extends State { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, ), AppText( - widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()), + widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!)):AppDateUtils.getHour(DateTime.now()), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontFamily: 'Poppins', color: Colors.white, @@ -237,7 +237,7 @@ class _DoctorReplayChatState extends State { SizedBox(height: 30,), SizedBox(height: 30,), - if(widget.reply.doctorResponse != null && widget.reply.doctorResponse.isNotEmpty) + if(widget.reply.doctorResponse != null && widget.reply.doctorResponse!.isNotEmpty) Align( alignment: Alignment.centerRight, child: Container( @@ -270,7 +270,7 @@ class _DoctorReplayChatState extends State { width: 50, height: 50, child: Image.asset( - widget.previousModel.doctorProfile.gender == 0 + widget.previousModel.doctorProfile!.gender == 0 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -281,7 +281,7 @@ class _DoctorReplayChatState extends State { Container( width: MediaQuery.of(context).size.width * 0.35, child: AppText( - widget.previousModel.doctorProfile.doctorName, + widget.previousModel.doctorProfile!.doctorName, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontFamily: 'Poppins', color: Color(0xFF2B353E), diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index 7957d4bd..3d72068b 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -30,7 +30,7 @@ import 'not_replaied_Doctor_Questions.dart'; class DoctorReplyScreen extends StatefulWidget { final Function changeCurrentTab; - const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key); + const DoctorReplyScreen({Key? key, required this.changeCurrentTab}) : super(key: key); @override _DoctorReplyScreenState createState() => _DoctorReplyScreenState(); @@ -38,7 +38,7 @@ class DoctorReplyScreen extends StatefulWidget { class _DoctorReplyScreenState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; int _activeTab = 0; int pageIndex = 1; @@ -71,7 +71,7 @@ class _DoctorReplyScreenState extends State return false; }, child: AppScaffold( - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: false, body: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -107,7 +107,7 @@ class _DoctorReplyScreenState extends State screenSize, _activeTab == 1, - TranslationBase.of(context).all, + TranslationBase.of(context)!.all!, isLast: true, context: context ), diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index ecd0f93d..fc73d6f3 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -18,7 +18,7 @@ class DoctorReplyWidget extends StatefulWidget { final ListGtMyPatientsQuestions reply; bool isShowMore = false; - DoctorReplyWidget({Key key, this.reply}); + DoctorReplyWidget({Key? key, required this.reply}); @override _DoctorReplyWidgetState createState() => _DoctorReplyWidgetState(); @@ -88,35 +88,21 @@ class _DoctorReplyWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .day - .toString() + + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).day.toString() + " " + AppDateUtils.getMonth( - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .month) + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).month) .toString() .substring(0, 3) + ' ' + - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .year - .toString(), + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).year.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ), AppText( - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .hour - .toString() + + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).hour.toString() + ":" + - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .minute - .toString(), + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).minute.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) @@ -139,7 +125,7 @@ class _DoctorReplyWidgetState extends State { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + widget.reply.mobileNumber); + launch("tel://" + widget.reply.mobileNumber!); }, child: Icon( Icons.phone, @@ -205,10 +191,10 @@ class _DoctorReplyWidgetState extends State { isCopyable:false, ), CustomRow( - label: TranslationBase.of(context).age + " : ", + label: TranslationBase.of(context).age! + " : ", isCopyable:false, value: - "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}", ), SizedBox( height: 8, @@ -230,7 +216,7 @@ class _DoctorReplyWidgetState extends State { children: [ new TextSpan( text: - TranslationBase.of(context).requestType + + TranslationBase.of(context).requestType! + ": ", style: TextStyle( fontSize: SizeConfig diff --git a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart index 1f195a24..743240e2 100644 --- a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart @@ -32,10 +32,10 @@ class _NotRepliedDoctorQuestionsState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: false, body: model.listDoctorNotRepliedQuestions.isEmpty - ? ErrorMessage(error: TranslationBase.of(context).noItem) + ? ErrorMessage(error: TranslationBase.of(context).noItem!) : Column( children: [ Expanded( @@ -90,7 +90,7 @@ class _NotRepliedDoctorQuestionsState extends State { }); model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); } - return; + return false; }, ), ), diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 5ef8b617..55a01fd8 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -14,9 +14,8 @@ class PatientArrivalScreen extends StatefulWidget { _PatientArrivalScreen createState() => _PatientArrivalScreen(); } -class _PatientArrivalScreen extends State - with SingleTickerProviderStateMixin { - TabController _tabController; +class _PatientArrivalScreen extends State with SingleTickerProviderStateMixin { + late TabController _tabController; var _patientSearchFormValues = PatientModel( FirstName: "0", MiddleName: "0", @@ -54,7 +53,7 @@ class _PatientArrivalScreen extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).arrivalpatient, + appBarTitle: TranslationBase.of(context).arrivalpatient ?? "", body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 0bae430a..d5e466c1 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -13,11 +13,11 @@ import 'package:flutter/material.dart'; import 'label.dart'; class DashboardReferralPatient extends StatelessWidget { - final List dashboardItemList; - final double height; - final DashboardViewModel model; + final List? dashboardItemList; + final double? height; + final DashboardViewModel? model; - const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key); + const DashboardReferralPatient({Key? key, this.dashboardItemList, this.height, this.model}) : super(key: key); @override Widget build(BuildContext context) { return Container( @@ -95,20 +95,20 @@ class DashboardReferralPatient extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ RowCounts( - dashboardItemList[2].summaryoptions[0].kPIParameter, - dashboardItemList[2].summaryoptions[0].value, + dashboardItemList![2].summaryoptions![0].kPIParameter, + dashboardItemList![2].summaryoptions![0].value!, AppGlobal.appTextColor, height: height, ), RowCounts( - dashboardItemList[2].summaryoptions[1].kPIParameter, - dashboardItemList[2].summaryoptions[1].value, + dashboardItemList![2].summaryoptions![1].kPIParameter!, + dashboardItemList![2].summaryoptions![1].value!, Color(0xFFC8D0DC), height: height, ), RowCounts( - dashboardItemList[2].summaryoptions[2].kPIParameter, - dashboardItemList[2].summaryoptions[2].value, + dashboardItemList![2].summaryoptions![2].kPIParameter!, + dashboardItemList![2].summaryoptions![2].value!, Color(0xFFEC6666), height: height, @@ -122,20 +122,20 @@ class DashboardReferralPatient extends StatelessWidget { Expanded( flex: 3, child: Stack(children: [ - Container(padding: EdgeInsets.all(0), child: GaugeChart(_createReferralData(dashboardItemList))), + Container(padding: EdgeInsets.all(0), child: GaugeChart(_createReferralData(dashboardItemList!))), Positioned( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ AppText( - model.getPatientCount(dashboardItemList[2]).toString(), + model?.getPatientCount(dashboardItemList![2]).toString(), fontSize: SizeConfig.textMultiplier * 3.2, color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, ) ], ), - top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.35), + top: height! * (SizeConfig.isHeightVeryShort ? 0.35 : 0.35), left: 0, right: 0) ]), @@ -148,12 +148,12 @@ class DashboardReferralPatient extends StatelessWidget { static List> _createReferralData(List dashboardItemList) { final data = [ - new GaugeSegment(dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), charts.ColorUtil.fromDartColor(AppGlobal.appTextColor)), - new GaugeSegment(dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), charts.ColorUtil.fromDartColor(Color(0xFFC6CEDA),),), - new GaugeSegment(dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), charts.ColorUtil.fromDartColor(Color(0xFFEC6666),),), + new GaugeSegment(dashboardItemList![2].summaryoptions![0].kPIParameter!, + getValue(dashboardItemList![1].summaryoptions![0].value), charts.ColorUtil.fromDartColor(AppGlobal.appTextColor)), + new GaugeSegment(dashboardItemList![2].summaryoptions![1].kPIParameter!, + getValue(dashboardItemList![1].summaryoptions![1].value), charts.ColorUtil.fromDartColor(Color(0xFFC6CEDA),),), + new GaugeSegment(dashboardItemList[2].summaryoptions![2].kPIParameter!, + getValue(dashboardItemList![1].summaryoptions![2].value), charts.ColorUtil.fromDartColor(Color(0xFFEC6666),),), ]; return [ diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 9005b816..62490bda 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -19,13 +19,9 @@ class DashboardSliderItemWidget extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Container( - margin: EdgeInsets.symmetric(horizontal: SizeConfig.widthMultiplier *1), - - child: Label( - firstLine: Helpers.getLabelFromKPI(item.kPIName), - secondLine: Helpers.getNameFromKPI(item.kPIName), - ), + Label( + firstLine: Helpers.getLabelFromKPI(item.kPIName!), + secondLine: Helpers.getNameFromKPI(item.kPIName!), ), ], ), @@ -40,8 +36,8 @@ class DashboardSliderItemWidget extends StatelessWidget { : 13), child: ListView( scrollDirection: Axis.horizontal, - children: List.generate(item.summaryoptions.length, (int index) { - return GetActivityCard(item.summaryoptions[index]); + children: List.generate(item.summaryoptions!.length, (int index) { + return GetActivityCard(item.summaryoptions![index]); }))) ], ); diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index bcd7864c..7f071175 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -104,16 +104,16 @@ class _DashboardSwipeWidgetState extends State { List dashboardItemList) { final data = [ new GaugeSegment( - dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), + dashboardItemList![2].summaryoptions![0].kPIParameter!, + getValue(dashboardItemList![1].summaryoptions![0].value!), charts.MaterialPalette.black), new GaugeSegment( - dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), + dashboardItemList[2].summaryoptions![1].kPIParameter!, + getValue(dashboardItemList[1].summaryoptions![1].value), charts.MaterialPalette.gray.shadeDefault), new GaugeSegment( - dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), + dashboardItemList![2].summaryoptions![2].kPIParameter!, + getValue(dashboardItemList[1].summaryoptions![2].value), charts.MaterialPalette.red.shadeDefault), ]; diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 39a99e65..17d3426e 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -5,23 +5,22 @@ import 'package:hexcolor/hexcolor.dart'; class HomePageCard extends StatelessWidget { const HomePageCard( {this.hasBorder = false, - this.imageName, - this.child, - this.onTap, - Key key, - this.color, - this.opacity = 0.4, - this.margin, this.width, this.gradient}) + this.imageName, + required this.child, + required this.onTap, + Key? key, this.color, + this.opacity = 0.4, + required this.margin, this.width, this.gradient}) : super(key: key); final bool hasBorder; - final String imageName; + final String? imageName; final Widget child; final GestureTapCallback onTap; - final Color color; + final Color ?color; final double opacity; - final double width; + final double? width; final EdgeInsets margin; - final LinearGradient gradient; + final LinearGradient? gradient; @override Widget build(BuildContext context) { diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 0180fc14..a7d1988b 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -4,10 +4,10 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class HomePatientCard extends StatelessWidget { - final Color backgroundColor; + final Color? backgroundColor; final IconData cardIcon; - final String cardIconImage; - final Color backgroundIconColor; + final String? cardIconImage; + final Color? backgroundIconColor; final String text; final Color textColor; final VoidCallback onTap; @@ -16,13 +16,13 @@ class HomePatientCard extends StatelessWidget { HomePatientCard({ this.backgroundColor, - this.backgroundIconColor, - this.cardIcon, - this.cardIconImage, - this.text, - this.textColor, - this.onTap, - this.iconSize = 30, this.gradient, + required this.backgroundIconColor, + required this.cardIcon, + this.cardIconImage, + required this.text, + required this.textColor, + required this.onTap, + this.iconSize = 30, required this.gradient, }); @override @@ -30,7 +30,7 @@ class HomePatientCard extends StatelessWidget { double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightLarge?15:13); return HomePageCard( - color: backgroundColor, + // color: backgroundColor!, width: width, gradient: gradient, margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), @@ -77,7 +77,7 @@ class HomePatientCard extends StatelessWidget { color: textColor, ) : Image.asset( - cardIconImage, + cardIconImage!, height: iconSize, width: iconSize, ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 2a1d7d1a..5452777c 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -78,12 +78,12 @@ class _HomeScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBar: HomeScreenHeader( - model: model, - onOpenDrawer: () { - Scaffold.of(context).openDrawer(); - }, - ), + // appBar: HomeScreenHeader( + // model: model, + // onOpenDrawer: () { + // Scaffold.of(context).openDrawer(); + // }, + // ), body: ListView(children: [ Column(children: [ StickyHeader( @@ -182,7 +182,7 @@ class _HomeScreenState extends State { )), ], ), - AppText(Helpers.convertToTitleCase(item.clinicName), + AppText(Helpers.convertToTitleCase(item.clinicName!), fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, @@ -197,7 +197,7 @@ class _HomeScreenState extends State { clinicId = newValue; GifLoaderDialogUtils.showMyDialog( context); - await model.changeClinic(newValue, + await model.changeClinic(newValue??0, authenticationViewModel); GifLoaderDialogUtils.hideDialog( context); @@ -212,7 +212,7 @@ class _HomeScreenState extends State { .map((item) { return DropdownMenuItem( child: AppText( - Helpers.convertToTitleCase(item.clinicName), + Helpers.convertToTitleCase(item.clinicName??""), fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, @@ -339,35 +339,35 @@ class _HomeScreenState extends State { DashboardViewModel model, projectsProvider) { colorIndex = 0; - List backgroundColors = List(3); - backgroundColors[0] = LinearGradient( + List backgroundColors = []; + backgroundColors.add(LinearGradient( begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 2.0), colors: [ AppGlobal.appRedColor,Color(0xFFAD3B3B), - ]);//AppGlobal.appRedColor; - backgroundColors[1] = LinearGradient( + ]));//AppGlobal.appRedColor; + backgroundColors.add( LinearGradient( begin: Alignment.center, end: Alignment.center, colors: [ Color(0xFFC9C9C9),Color(0xFFC9C9C9), - ]); - backgroundColors[2] = LinearGradient( + ])); + backgroundColors.add( LinearGradient( begin: Alignment.center, end: Alignment.center, colors: [ Color(0xFF71787E),AppGlobal.appTextColor - ]); - List backgroundIconColors = List(3); - backgroundIconColors[0] = Colors.white12; - backgroundIconColors[1] = Colors.white38; - backgroundIconColors[2] = Colors.white10; - List textColors = List(3); - textColors[0] = Colors.white; - textColors[1] = Color(0xFF353E47); - textColors[2] = Colors.white; + ])); + List backgroundIconColors = []; + backgroundIconColors.add(Colors.white12); + backgroundIconColors.add(Colors.white38); + backgroundIconColors.add(Colors.white10); + List textColors = []; + textColors.add(Colors.white); + textColors.add(Color(0xFF353E47)); + textColors.add(Colors.white); - List patientCards = List(); + List patientCards = []; if (model.hasVirtualClinic) { patientCards.add(HomePatientCard( @@ -412,7 +412,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.inpatient, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myInPatient, + text: TranslationBase.of(context).myInPatient!, onTap: () { Navigator.push( context, @@ -433,7 +433,7 @@ class _HomeScreenState extends State { //TODO Elham* match the of the icon cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], - text: TranslationBase.of(context).registerNewPatient, + text: TranslationBase.of(context).registerNewPatient!, onTap: () { Navigator.push( context, @@ -450,7 +450,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myOutPatient_2lines, + text: TranslationBase.of(context).myOutPatient_2lines!, onTap: () { String date = AppDateUtils.convertDateToFormat( DateTime( @@ -464,7 +464,7 @@ class _HomeScreenState extends State { patientSearchRequestModel: PatientSearchRequestModel( from: date, to: date, - doctorID: authenticationViewModel.doctorProfile.doctorID), + doctorID: authenticationViewModel.doctorProfile!.doctorID), ), settings: RouteSettings(name: 'OutPatientsScreen'), )); @@ -477,7 +477,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.referral_1, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myPatientsReferral, + text: TranslationBase.of(context).myPatientsReferral!, onTap: () { Navigator.push( context, @@ -495,7 +495,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search, textColor: textColors[colorIndex], - text: TranslationBase.of(context).searchPatientDashBoard, + text: TranslationBase.of(context).searchPatientDashBoard!, onTap: () { Navigator.push( context, @@ -512,7 +512,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search_medicines, textColor: textColors[colorIndex], - text: TranslationBase.of(context).searchMedicineDashboard, + text: TranslationBase.of(context).searchMedicineDashboard!, onTap: () { Navigator.push( context, diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart index 0d316652..db5a29fb 100644 --- a/lib/screens/home/label.dart +++ b/lib/screens/home/label.dart @@ -3,15 +3,16 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; +// ignore: must_be_immutable class Label extends StatelessWidget { Label({ - Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, + Key? key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, }) : super(key: key); - final String firstLine; - final String secondLine; + final String? firstLine; + final String? secondLine; Color color; - final double secondLineFontSize; - final double firstLineFontSize; + final double? secondLineFontSize; + final double? firstLineFontSize; @override Widget build(BuildContext context) { diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index b7e64233..56bf327c 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -405,7 +405,7 @@ class _CheckBoxListState extends State { onChanged: (newValue) { setState(() { widget.model! - .setSelectedCheckboxValues(element, newValue); + .setSelectedCheckboxValues(element, newValue!); }); }, activeColor: Color(0xFFD02127), diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart index 233f59d8..20af0514 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -23,7 +23,7 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class LivaCareTransferToAdmin extends StatefulWidget { final PatiantInformtion patient; - const LivaCareTransferToAdmin({Key key, this.patient}) : super(key: key); + const LivaCareTransferToAdmin({Key? key, required this.patient}) : super(key: key); @override _LivaCareTransferToAdminState createState() => @@ -34,10 +34,10 @@ class _LivaCareTransferToAdminState extends State { stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; TextEditingController noteController = TextEditingController(); - String noteError; + late String noteError; void initState() { requestPermissions(); @@ -110,27 +110,27 @@ class _LivaCareTransferToAdminState extends State { onPressed: () { setState(() { if (noteController.text.isEmpty) { - noteError = TranslationBase.of(context).emptyMessage; + noteError = TranslationBase.of(context).emptyMessage!; } else { - noteError = null; + noteError = null!; } if (noteController.text.isNotEmpty) { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?", - () async { - Navigator.of(context).pop(); - GifLoaderDialogUtils.showMyDialog(context); - await model.transferToAdmin(widget.patient.vcId, noteController.text); - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } else { - DrAppToastMsg.showSuccesToast("You successfully transfer to admin"); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - } - }); + () async { + Navigator.of(context).pop(); + GifLoaderDialogUtils.showMyDialog(context); + await model.transferToAdmin(widget.patient.vcId!, noteController.text); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast("You successfully transfer to admin"); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + }); } }); }, diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index a434a212..38a34a26 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -31,8 +31,8 @@ class LiveCarePatientScreen extends StatefulWidget { class _LiveCarePatientScreenState extends State { final _controller = TextEditingController(); - Timer timer; - LiveCarePatientViewModel _liveCareViewModel; + late Timer timer; + late LiveCarePatientViewModel _liveCareViewModel; @override void initState() { super.initState(); @@ -46,8 +46,8 @@ class _LiveCarePatientScreenState extends State { @override void dispose() { _liveCareViewModel.isLogin(0); - _liveCareViewModel = null; - timer?.cancel(); + // _liveCareViewModel = null!; + timer.cancel(); super.dispose(); } @@ -85,11 +85,13 @@ class _LiveCarePatientScreenState extends State { }, marginTop: 5, suffixIcon: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, + onPressed: () {}, + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + ), ), model.state == ViewState.Idle @@ -99,7 +101,7 @@ class _LiveCarePatientScreenState extends State { ? Center( child: ErrorMessage( error: TranslationBase.of(context) - .youDontHaveAnyPatient, + .youDontHaveAnyPatient!, ), ) : ListView.builder( diff --git a/lib/screens/live_care/panding_list.dart b/lib/screens/live_care/panding_list.dart index f081479c..1a91c0e4 100644 --- a/lib/screens/live_care/panding_list.dart +++ b/lib/screens/live_care/panding_list.dart @@ -21,7 +21,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class LiveCarePandingListScreen extends StatefulWidget { // In the constructor, require a item id. - LiveCarePandingListScreen({Key key}) : super(key: key); + LiveCarePandingListScreen({Key? key}) : super(key: key); @override _LiveCarePandingListState createState() => _LiveCarePandingListState(); @@ -31,7 +31,7 @@ class _LiveCarePandingListState extends State { List _data = []; Helpers helpers = new Helpers(); bool _isInit = true; - LiveCareViewModel _liveCareProvider; + late LiveCareViewModel _liveCareProvider; @override void didChangeDependencies() { super.didChangeDependencies(); @@ -45,7 +45,7 @@ class _LiveCarePandingListState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).livecare, + appBarTitle: TranslationBase.of(context).livecare!, body: Container( child: ListView(scrollDirection: Axis.vertical, @@ -96,9 +96,9 @@ class _LiveCarePandingListState extends State { 1, 1), colors: [ Colors.grey[ - 100], + 100]!, Colors.grey[ - 200], + 200]!, ]), boxShadow: [ BoxShadow( @@ -154,7 +154,7 @@ class _LiveCarePandingListState extends State { AppText( TranslationBase.of( context) - .fileNo + + .fileNo! + item.patientID .toString(), fontSize: 2.0 * @@ -167,7 +167,7 @@ class _LiveCarePandingListState extends State { AppText( TranslationBase.of( context) - .age + + .age! + ' ' + item.age .toString(), @@ -255,9 +255,9 @@ class _LiveCarePandingListState extends State { MyGlobals myGlobals = new MyGlobals(); class MyGlobals { - GlobalKey _scaffoldKey; + GlobalKey? _scaffoldKey; MyGlobals() { _scaffoldKey = GlobalKey(); } - GlobalKey get scaffoldKey => _scaffoldKey; + GlobalKey get scaffoldKey => _scaffoldKey!; } diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index 2d3f1d15..040cc682 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -19,7 +19,8 @@ class VideoCallPage extends StatefulWidget { final PatiantInformtion patientData; final listContext; final LiveCarePatientViewModel model; - VideoCallPage({this.patientData, this.listContext, this.model}); + VideoCallPage( + {required this.patientData, this.listContext, required this.model}); @override _VideoCallPageState createState() => _VideoCallPageState(); @@ -28,10 +29,10 @@ class VideoCallPage extends StatefulWidget { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class _VideoCallPageState extends State { - Timer _timmerInstance; + late Timer _timmerInstance; int _start = 0; String _timmer = ''; - LiveCareViewModel _liveCareProvider; + late LiveCareViewModel _liveCareProvider; bool _isInit = true; var _tokenData; bool isTransfer = false; @@ -67,8 +68,12 @@ class _VideoCallPageState extends State { //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', kApiKey: '46209962', vcId: widget.patientData.vcId, - isRecording: tokenData != null ? tokenData.isRecording: false, - patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", + isRecording: tokenData != null ? tokenData.isRecording! : false, + patientName: widget.patientData.fullName != null + ? widget.patientData.fullName! + : widget.patientData.firstName != null + ? "${widget.patientData.firstName} ${widget.patientData.lastName}" + : "-", tokenID: token, //"hfkjshdf347r8743", generalId: "Cs2020@2016\$2958", doctorId: doctorprofile['DoctorID'], @@ -78,13 +83,13 @@ class _VideoCallPageState extends State { }, onCallEnd: () { //TODO handling onCallEnd - WidgetsBinding.instance.addPostFrameCallback((_) { + WidgetsBinding.instance!.addPostFrameCallback((_) { changeRoute(context); }); }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { //TODO handling onCalNotRespondEnd - WidgetsBinding.instance.addPostFrameCallback((_) { + WidgetsBinding.instance!.addPostFrameCallback((_) { changeRoute(context); }); }); @@ -137,7 +142,7 @@ class _VideoCallPageState extends State { height: MediaQuery.of(context).size.height * 0.02, ), Text( - widget.patientData.fullName, + widget.patientData.fullName!, style: TextStyle( color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, @@ -233,7 +238,7 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {endCall()}, child: - Text(TranslationBase.of(context).endcall), + Text(TranslationBase.of(context).endcall!), color: Colors.red, textColor: Colors.white, )), @@ -242,8 +247,8 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {resumeCall()}, child: - Text(TranslationBase.of(context).resumecall), - color: AppGlobal.appGreenColor, + Text(TranslationBase.of(context).resumecall!), + color: Colors.green[900], textColor: Colors.white, ), ), @@ -252,7 +257,7 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {endCallWithCharge()}, child: Text(TranslationBase.of(context) - .endcallwithcharge), + .endcallwithcharge!), textColor: Colors.white, ), ), @@ -263,7 +268,7 @@ class _VideoCallPageState extends State { setState(() => {isTransfer = true}) }, child: Text( - TranslationBase.of(context).transfertoadmin), + TranslationBase.of(context).transfertoadmin!), color: Colors.yellow[900], ), ), diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index b1ee901b..b11c3b01 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -2,11 +2,11 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -19,23 +19,23 @@ class HealthSummaryPage extends StatefulWidget { } class _HealthSummaryPageState extends State { - PatiantInformtion patient; + late PatiantInformtion patient; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), - builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( - appBar: PatientProfileAppBar( - patient, + builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold( + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient: isInpatient, ), isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), + appBarTitle: TranslationBase.of(context).medicalReport!.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -75,86 +75,88 @@ class _HealthSummaryPageState extends State { ), (model.medicalFileList != null && model.medicalFileList.length != 0) ? ListView.builder( - //physics: , - physics: NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList[0].timelines.length, - itemBuilder: (BuildContext ctxt, int index) { - return InkWell( - onTap: () async { - if (model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0] - .consulations.length != - 0) - await locator().logEvent( - eventCategory: "Health Summary Page", - eventAction: "Health Summary Details", - ); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MedicalFileDetails( - age: patient.age is String ? patient.age ?? "" : "${patient.age}", - firstName: patient.firstName, - lastName: patient.lastName, - gender: patient.genderDescription, - encounterNumber: index, - pp: patient.patientId, - patient: patient, - doctorName: model.medicalFileList[0].entityList[0].timelines[index] - .timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].doctorName - : "", - clinicName: model.medicalFileList[0].entityList[0].timelines[index] - .timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].clinicName - : "", - doctorImage: model.medicalFileList[0].entityList[0].timelines[index] - .timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].doctorImage - : "", - episode: model.medicalFileList[0].entityList[0].timelines[index] - .timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0] - .consulations[0].episodeID - .toString() - : "", - vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString()), - settings: RouteSettings(name: 'MedicalFileDetails'), - ), - ); - }, - child: DoctorCard( - doctorName: model.medicalFileList[0].entityList[0].timelines[index].doctorName, - clinic: model.medicalFileList[0].entityList[0].timelines[index].clinicName, - branch: model.medicalFileList[0].entityList[0].timelines[index].projectName, - profileUrl: model.medicalFileList[0].entityList[0].timelines[index].doctorImage, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.medicalFileList[0].entityList[0].timelines[index].date, - ), - isPrescriptions: true, - isShowEye: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0] - .consulations.length != - 0 - ? true - : false), + //physics: , + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.medicalFileList[0].entityList![0].timelines!.length, + itemBuilder: (BuildContext ctxt, int index) { + return InkWell( + onTap: () async{ + if (model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0] + .consulations!.length != + 0) + await locator().logEvent( + eventCategory: "Health Summary Page", + eventAction: "Health Summary Details", + );Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MedicalFileDetails( + age: patient.age is String ? patient.age ?? "" : "${patient.age}", + firstName: patient.firstName ?? "", + lastName: patient.lastName ?? "", + gender: patient.genderDescription ?? "", + encounterNumber: index, + pp: patient.patientId, + patient: patient, + doctorName: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index].doctorName + : "", + clinicName: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index].clinicName + : "", + doctorImage: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index].doctorImage + : "", + episode: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0] + .consulations![0].episodeID + .toString() + : "", + vistDate: model.medicalFileList[0].entityList![0].timelines![index].date + .toString()), + settings: RouteSettings(name: 'MedicalFileDetails'), + ), ); - }) - : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, + }, + child: DoctorCard( + doctorName: + model.medicalFileList[0].entityList![0].timelines![index].doctorName ?? "", + clinic: model.medicalFileList[0].entityList![0].timelines![index].clinicName ?? "", + branch: model.medicalFileList[0].entityList![0].timelines![index].projectName ?? "", + profileUrl: + model.medicalFileList[0].entityList![0].timelines![index].doctorImage ?? "", + appointmentDate: AppDateUtils.getDateTimeFromServerFormat( + model.medicalFileList[0].entityList![0].timelines![index].date ?? "", ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context).noMedicalFileFound), - ) - ], - ), + isPrescriptions: true, + isShowEye: model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0].consulations!.length != + 0 + ? true + : false), + ); + }) + : Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText(TranslationBase.of(context).noMedicalFileFound), ) + ], + ), + ) ], ), ), diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index b53284a9..4f70f3f5 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; @@ -21,41 +21,41 @@ class MedicalFileDetails extends StatefulWidget { int encounterNumber; int pp; PatiantInformtion patient; - String clinicName; + String? clinicName; String episode; - String doctorName; + String? doctorName; String vistDate; - String doctorImage; + String? doctorImage; MedicalFileDetails( - {this.age, - this.firstName, - this.lastName, - this.gender, - this.encounterNumber, - this.pp, - this.patient, - this.doctorName, - this.vistDate, - this.clinicName, - this.episode, - this.doctorImage}); + {required this.age, + required this.firstName, + required this.lastName, + required this.gender, + required this.encounterNumber, + required this.pp, + required this.patient, + this.doctorName, + required this.vistDate, + this.clinicName, + required this.episode, + this.doctorImage}); @override _MedicalFileDetailsState createState() => _MedicalFileDetailsState( - firstName: firstName, - age: age, - lastName: lastName, - gender: gender, - encounterNumber: encounterNumber, - pp: pp, - patient: patient, - clinicName: clinicName, - doctorName: doctorName, - episode: episode, - vistDate: vistDate, - doctorImage: doctorImage, - ); + firstName: firstName, + age: age, + lastName: lastName, + gender: gender, + encounterNumber: encounterNumber, + pp: pp, + patient: patient, + clinicName: clinicName!, + doctorName: doctorName!, + episode: episode, + vistDate: vistDate, + doctorImage: doctorImage!, + ); } class _MedicalFileDetailsState extends State { @@ -73,51 +73,64 @@ class _MedicalFileDetailsState extends State { String doctorImage; _MedicalFileDetailsState( - {this.age, - this.firstName, - this.lastName, - this.gender, - this.encounterNumber, - this.pp, - this.patient, - this.doctorName, - this.vistDate, - this.clinicName, - this.episode, - this.doctorImage}); + {required this.age, + required this.firstName, + required this.lastName, + required this.gender, + required this.encounterNumber, + required this.pp, + required this.patient, + required this.doctorName, + required this.vistDate, + required this.clinicName, + required this.episode, + required this.doctorImage}); bool isPhysicalExam = true; bool isProcedureExpand = true; bool isHistoryExpand = true; bool isAssessmentExpand = true; + PatientProfileAppBarModel? patientProfileAppBarModel; + ProjectViewModel? projectViewModel; + @override - Widget build(BuildContext context) { + void didChangeDependencies() { ProjectViewModel projectViewModel = Provider.of(context); + patientProfileAppBarModel = PatientProfileAppBarModel( + patient: patient, + doctorName: doctorName, + profileUrl: doctorImage, + clinic: clinicName, + isPrescriptions: true, + isMedicalFile: true, + episode: episode, + visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( + vistDate, + ), isArabic: projectViewModel.isArabic)}', + isAppointmentHeader: true, + ); + + // TODO: implement didChangeDependencies + super.didChangeDependencies(); + } + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { if (model.medicalFileList.length == 0) { model.getMedicalFile(mrn: pp); } }, - builder: - (BuildContext context, MedicalFileViewModel model, Widget child) => - AppScaffold( - appBar: PatientProfileAppBar( - patient, - doctorName: doctorName, - profileUrl: doctorImage, - clinic: clinicName, - isPrescriptions: true, - isMedicalFile: true, - episode: episode, - visitDate: - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( - vistDate, - ), isArabic: projectViewModel.isArabic)}', - isAppointmentHeader: true, - ), + builder: (BuildContext? context, MedicalFileViewModel? model, Widget? child) => AppScaffold( + patientProfileAppBarModel: patientProfileAppBarModel!, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), + appBarTitle: TranslationBase.of(context!).medicalReport!.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -125,826 +138,617 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0 + model!.medicalFileList.length != 0 && + model.medicalFileList[0].entityList![0].timelines![encounterNumber].timeLineEvents![0] + .consulations!.length != + 0 ? Padding( - padding: EdgeInsets.all(10.0), - child: Container( - child: Column( - children: [ - SizedBox(height: 25.0), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + padding: EdgeInsets.all(10.0), + child: Container( + child: Column( + children: [ + SizedBox(height: 25.0), + if (model.medicalFileList.length != 0 && + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != + 0) + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context) + .historyOfPresentIllness! + .toUpperCase(), + variant: isHistoryExpand ? "bodyText" : '', + bold: isHistoryExpand ? true : true, + color: Colors.black), + ], ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), - ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + InkWell( + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstCheifComplaint! + .length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - TranslationBase.of( - context) - .historyOfPresentIllness - .toUpperCase(), - variant: isHistoryExpand - ? "bodyText" - : '', - bold: isHistoryExpand - ? true - : true, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = - !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstCheifComplaint - .length, - itemBuilder: (BuildContext ctxt, - int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Row( - children: [ - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstCheifComplaint[ - index] - .hOPI - .trim(), - ), - ), - SizedBox( - width: 35.0), - ], + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstCheifComplaint![index] + .hOPI! + .trim(), ), - ], - ), + ), + SizedBox(width: 35.0), + ], ), - ); - }), - isExpand: isHistoryExpand, - ), - ), - ), - // SizedBox( - // height: 30, - // ), + ], + ), + ), + ); + }), + isExpand: isHistoryExpand, + ), + ), + ), + // SizedBox( + // height: 30, + // ), - SizedBox( - height: 30, + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0 && + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != + 0) + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText(TranslationBase.of(context).assessment!.toUpperCase(), + variant: isAssessmentExpand ? "bodyText" : '', + bold: isAssessmentExpand ? true : true, + color: Colors.black), + ], ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), - ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: + Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments! + .length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - TranslationBase.of( - context) - .assessment - .toUpperCase(), - variant: - isAssessmentExpand - ? "bodyText" - : '', - bold: isAssessmentExpand - ? true - : true, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = - !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments - .length, - itemBuilder: (BuildContext ctxt, - int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Row( - children: [ - AppText( - 'ICD: ', - fontSize: 13.0, - ), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .iCD10 - .trim(), - fontSize: 13.5, - fontWeight: - FontWeight - .w700, - ), - SizedBox( - width: 15.0), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .condition + - ": ", - fontSize: 12.5, - ), - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .condition - .trim(), - fontSize: 13.0, - fontWeight: - FontWeight - .w700, - ), - ), - ], - ), - Row( - children: [ - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .description, - fontWeight: - FontWeight - .w700, - fontSize: 15.0, - ), - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .type + - ": ", - fontSize: 15.5, - ), - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .type, - fontSize: 16.0, - fontWeight: - FontWeight - .w700, - ), - ), - ], - ), - SizedBox( - height: 15.0, - ), - AppText( + Row( + children: [ + AppText( + 'ICD: ', + fontSize: 13.0, + ), + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .iCD10! + .trim(), + fontSize: 13.5, + fontWeight: FontWeight.w700, + ), + SizedBox(width: 15.0), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).condition! + ": ", + fontSize: 12.5, + ), + Expanded( + child: AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .remarks + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .condition! .trim(), + fontSize: 13.0, + fontWeight: FontWeight.w700, ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, + ), + ], + ), + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .description, + fontWeight: FontWeight.w700, + fontSize: 15.0, ), - SizedBox( - height: 8.0, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).type! + ": ", + fontSize: 15.5, + ), + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .type, + fontSize: 16.0, + fontWeight: FontWeight.w700, ), - ], - ), + ), + ], ), - ); - }), - isExpand: isAssessmentExpand, - ), - ), - ), + SizedBox( + height: 15.0, + ), + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .remarks! + .trim(), + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), + ), + ); + }), + isExpand: isAssessmentExpand, + ), + ), + ), - SizedBox( - height: 30, + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0 && + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != + 0) + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText(TranslationBase.of(context).test!.toUpperCase(), + variant: isProcedureExpand ? "bodyText" : '', + bold: isProcedureExpand ? true : true, + color: Colors.black), + ], ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), - ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + InkWell( + onTap: () { + setState(() { + isProcedureExpand = !isProcedureExpand; + }); + }, + child: + Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure! + .length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - TranslationBase.of( - context) - .test - .toUpperCase(), - variant: isProcedureExpand - ? "bodyText" - : '', - bold: isProcedureExpand - ? true - : true, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isProcedureExpand = - !isProcedureExpand; - }); - }, - child: Icon(isProcedureExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure - .length, - itemBuilder: (BuildContext ctxt, - int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Row( - children: [ - Column( - children: [ - AppText( - 'Procedure ID: ', - ), - AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .procedureId - .trim(), - fontSize: - 13.5, - fontWeight: - FontWeight - .w700, - ), - ], - ), - SizedBox( - width: 35.0), - Column( - children: [ - AppText( - TranslationBase.of( - context) - .orderDate + - ": ", - ), - AppText( - AppDateUtils.getDateFormatted( - DateTime - .parse( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .orderDate - .trim(), - )), - fontSize: - 13.5, - fontWeight: - FontWeight - .w700, - ), - ], - ), - ], - ), - SizedBox( - height: 20.0, - ), - Row( - children: [ - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .procName, - fontWeight: - FontWeight - .w700, - ), - ) - ], - ), - Row( - children: [ - AppText( - 'CPT Code : ', - ), - AppText( + Row( + children: [ + Column( + children: [ + AppText( + 'Procedure ID: ', + ), + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] + .procedureId! + .trim(), + fontSize: 13.5, + fontWeight: FontWeight.w700, + ), + ], + ), + SizedBox(width: 35.0), + Column( + children: [ + AppText( + TranslationBase.of(context).orderDate! + ": ", + ), + AppText( + AppDateUtils.getDateFormatted(DateTime.parse( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .patientID - .toString(), - fontWeight: - FontWeight - .w700, - ), - ], - ), - SizedBox( - height: 15.0, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] + .orderDate! + .trim(), + )), + fontSize: 13.5, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + SizedBox( + height: 20.0, + ), + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] + .procName, + fontWeight: FontWeight.w700, ), - ], - ), + ) + ], ), - ); - }), - isExpand: isProcedureExpand, - ), - ), - ), + Row( + children: [ + AppText( + 'CPT Code : ', + ), + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] + .patientID + .toString(), + fontWeight: FontWeight.w700, + ), + ], + ), + SizedBox( + height: 15.0, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), + ), + ); + }), + isExpand: isProcedureExpand, + ), + ), + ), - SizedBox( - height: 30, + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0 && + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != + 0) + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context) + .physicalSystemExamination! + .toUpperCase(), + variant: isPhysicalExam ? "bodyText" : '', + bold: isPhysicalExam ? true : true, + color: Colors.black), + ], ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), - ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + InkWell( + onTap: () { + setState(() { + isPhysicalExam = !isPhysicalExam; + }); + }, + child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam! + .length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( children: [ + Row( + children: [ + AppText(TranslationBase.of(context).examType! + ": "), + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] + .examDesc, + fontWeight: FontWeight.w700, + ), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] + .examDesc, + fontWeight: FontWeight.w700, + ) + ], + ), + Row( + children: [ + AppText(TranslationBase.of(context).abnormal! + ": "), + AppText( + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] + .abnormal, + fontWeight: FontWeight.w700, + ), + ], + ), + SizedBox( + height: 15.0, + ), AppText( - TranslationBase.of( - context) - .physicalSystemExamination - .toUpperCase(), - variant: isPhysicalExam - ? "bodyText" - : '', - bold: isPhysicalExam - ? true - : true, - color: Colors.black), + model + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] + .remarks, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), ], ), - InkWell( - onTap: () { - setState(() { - isPhysicalExam = - !isPhysicalExam; - }); - }, - child: Icon(isPhysicalExam - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam - .length, - itemBuilder: (BuildContext ctxt, - int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - children: [ - Row( - children: [ - AppText(TranslationBase.of( - context) - .examType + - ": "), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] - .examDesc, - fontWeight: - FontWeight - .w700, - ), - ], - ), - Row( - children: [ - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] - .examDesc, - fontWeight: - FontWeight - .w700, - ) - ], - ), - Row( - children: [ - AppText(TranslationBase.of( - context) - .abnormal + - ": "), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] - .abnormal, - fontWeight: - FontWeight - .w700, - ), - ], - ), - SizedBox( - height: 15.0, - ), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] - .remarks, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], - ), - ), - ); - }), - isExpand: isPhysicalExam, - ), - ), - ), - SizedBox( - height: 30, + ), + ); + }), + isExpand: isPhysicalExam, ), - ], + ), ), + SizedBox( + height: 30, ), - ) + ], + ), + ), + ) : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText('No Data For This Visit '), - ), - SizedBox( - height: 100, - ), - ], - ), - ) + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText('No Data For This Visit '), + ), + SizedBox( + height: 100, + ), + ], + ), + ) ], ), ), diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 4998e99c..6713d1bc 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -33,7 +33,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg { MedicineSearchScreen({this.changeLoadingState}); - final Function changeLoadingState; + final Function? changeLoadingState; @override _MedicineSearchState createState() => _MedicineSearchState(); @@ -48,17 +48,16 @@ class _MedicineSearchState extends State { bool _isInit = true; final SpeechToText speech = SpeechToText(); String lastStatus = ''; - GetMedicationResponseModel _selectedMedication; - GlobalKey key = - new GlobalKey>(); + late GetMedicationResponseModel _selectedMedication; + GlobalKey key = new GlobalKey>(); // String lastWords; List _localeNames = []; - String lastError; + late String lastError; double level = 0.0; double minSoundLevel = 50000; double maxSoundLevel = -50000; - String reconizedWord; + late String reconizedWord; @override void didChangeDependencies() { @@ -90,9 +89,7 @@ class _MedicineSearchState extends State { }); } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -125,10 +122,7 @@ class _MedicineSearchState extends State { return AppScaffold( // baseViewModel: model, isShowAppBar: true, - appBar: PatientSearchHeader( - title: TranslationBase.of(context).searchMedicine, - ), - //appBarTitle: TranslationBase.of(context).searchMedicine + "6", + appBarTitle: TranslationBase.of(context).searchMedicine!, body: SingleChildScrollView( child: FractionallySizedBox( widthFactor: 0.97, @@ -180,12 +174,10 @@ class _MedicineSearchState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).youCanFind + - (myController.text != '' - ? model.pharmacyItemsList.length.toString() - : '0') + + TranslationBase.of(context).youCanFind! + + (myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') + " " + - TranslationBase.of(context).itemsInSearch, + TranslationBase.of(context).itemsInSearch!, fontWeight: FontWeight.bold, ), ], diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 49c39c53..376ccdd9 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -23,8 +23,7 @@ class PharmaciesListScreen extends StatefulWidget { final String url; - PharmaciesListScreen({Key key, @required this.itemID, this.url}) - : super(key: key); + PharmaciesListScreen({Key? key, required this.itemID, required this.url}) : super(key: key); @override _PharmaciesListState createState() => _PharmaciesListState(); @@ -32,8 +31,7 @@ class PharmaciesListScreen extends StatefulWidget { class _PharmaciesListState extends State { Helpers helpers = new Helpers(); - ProjectViewModel projectsProvider; - + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { @@ -42,7 +40,7 @@ class _PharmaciesListState extends State { onModelReady: (model) => model.getPharmaciesList(widget.itemID), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).pharmaciesList, + appBarTitle: TranslationBase.of(context).pharmaciesList!, body: Container( height: SizeConfig.screenHeight, child: ListView( @@ -230,9 +228,8 @@ class _PharmaciesListState extends State { } //TODO CHECK THE URL IS NULL OR NOT - Uint8List dataFromBase64String(String base64String) { - if(base64String !=null) - return base64Decode(base64String); + Uint8List? dataFromBase64String(String base64String) { + if (base64String != null) return base64Decode(base64String); } String base64String(Uint8List data) { diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index 1e902547..70bff0cd 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -24,13 +24,13 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PatientSickLeaveScreen extends StatelessWidget { - PatiantInformtion patient; + late PatiantInformtion patient; @override Widget build(BuildContext context) { ProjectViewModel projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; bool isInpatient = routeArgs['isInpatient']; return BaseView( @@ -85,7 +85,7 @@ class PatientSickLeaveScreen extends StatelessWidget { ), ), AddNewOrder( - label: TranslationBase.of(context).noSickLeaveApplied, + label: TranslationBase.of(context).noSickLeaveApplied!, onTap: () async { await locator().logEvent( eventCategory: "Add Sick Leave Screen" @@ -194,7 +194,7 @@ class PatientSickLeaveScreen extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .startDate + + .startDate! + ' ' ?? "", labelSize: SizeConfig @@ -218,7 +218,7 @@ class PatientSickLeaveScreen extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .endDate + + .endDate! + ' ' ?? "", labelSize: SizeConfig @@ -270,7 +270,7 @@ class PatientSickLeaveScreen extends StatelessWidget { ) : patient.patientStatusType != 43 ? ErrorMessage( - error: TranslationBase.of(context).noSickLeave, + error: TranslationBase.of(context).noSickLeave!, ) : SizedBox(), SizedBox( diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 9fd9e699..2f5168d2 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -70,6 +70,7 @@ class _DischargedPatientState extends State { }, marginTop: 0, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( DoctorApp.filter_1, color: Colors.black, @@ -170,14 +171,14 @@ class _DischargedPatientState extends State { ? model .filterData[ index] - .nationalityName + .nationalityName! .trim() : model.filterData[index].nationality != null ? model .filterData[ index] - .nationality + .nationality! .trim() : model.filterData[index].nationalityId != null @@ -203,7 +204,7 @@ class _DischargedPatientState extends State { .network( model.filterData[index].nationalityFlagURL != null - ? model.filterData[index].nationalityFlagURL + ? model.filterData[index].nationalityFlagURL! : '', height: 25, @@ -320,7 +321,7 @@ class _DischargedPatientState extends State { text: model.filterData[index].admissionDate == null ? "" - : TranslationBase.of(context).admissionDate + + : TranslationBase.of(context).admissionDate! + " : ", style: TextStyle( fontSize: @@ -385,7 +386,7 @@ class _DischargedPatientState extends State { .w300, ), AppText( - "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", + "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate!)).inDays + 1}", fontSize: 15, fontWeight: diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index ba4c108c..23e117d5 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -17,21 +18,20 @@ import 'package:url_launcher/url_launcher.dart'; class ECGPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patient-type']; String arrivalType = routeArgs['arrival-type']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getECGPatient( - patientType: patient.patientType, - patientOutSA: 0, - patientID: patient.patientId), + onModelReady: (model) => + model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, backgroundColor: Color(0xffF8F8F8), - appBar: PatientProfileAppBar(patient), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8.0), @@ -46,7 +46,7 @@ class ECGPage extends StatelessWidget { ...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell( onTap: () async { await launch( - model.patientMuseResultsModelList[index].imageURL); + model.patientMuseResultsModelList[index]!.imageURL!); }, child: Container( width: double.infinity, @@ -100,8 +100,8 @@ class ECGPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ - AppText('${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), - AppText('${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), + AppText('${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime!,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), + AppText('${AppDateUtils.getHour(model.patientMuseResultsModelList[index]!.createdOnDateTime!)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), ], ), ), diff --git a/lib/screens/patients/In_patient/InPatientHeader.dart b/lib/screens/patients/In_patient/InPatientHeader.dart index cbc8a823..3566fa23 100644 --- a/lib/screens/patients/In_patient/InPatientHeader.dart +++ b/lib/screens/patients/In_patient/InPatientHeader.dart @@ -10,7 +10,7 @@ import 'package:provider/provider.dart'; class InPatientHeader extends StatelessWidget with PreferredSizeWidget { InPatientHeader( - { this.model, + {required this.model, this.specialClinic, this.activeTab, this.selectedMapId, diff --git a/lib/screens/patients/In_patient/NoData.dart b/lib/screens/patients/In_patient/NoData.dart index 0c48cd2a..89f7c65e 100644 --- a/lib/screens/patients/In_patient/NoData.dart +++ b/lib/screens/patients/In_patient/NoData.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; class NoData extends StatelessWidget { const NoData({ - Key key, + Key? key, }) : super(key: key); @override @@ -13,7 +13,7 @@ class NoData extends StatelessWidget { child: SingleChildScrollView( child: Container( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable)), + error: TranslationBase.of(context).noDataAvailable!)), ), ); } diff --git a/lib/screens/patients/In_patient/in_patient_list_page.dart b/lib/screens/patients/In_patient/in_patient_list_page.dart index 7498257d..77707b9b 100644 --- a/lib/screens/patients/In_patient/in_patient_list_page.dart +++ b/lib/screens/patients/In_patient/in_patient_list_page.dart @@ -25,12 +25,12 @@ class InPatientListPage extends StatefulWidget { final Function onChangeValue; InPatientListPage( - {this.isMyInPatient, - this.patientSearchViewModel, - this.selectedClinicName, - this.onChangeValue, - this.isAllClinic, - this.showBottomSheet}); + {required this.isMyInPatient, + required this.patientSearchViewModel, + required this.selectedClinicName, + required this.onChangeValue, + required this.isAllClinic, + required this.showBottomSheet}); @override _InPatientListPageState createState() => _InPatientListPageState(); @@ -280,7 +280,7 @@ class _InPatientListPageState extends State { .patientSearchViewModel .InpatientClinicList[index]); widget.patientSearchViewModel - .filterByClinic(clinicName: value); + .filterByClinic(clinicName: value.toString()); }); }, activeColor: Colors.red, diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index c0eaa510..d6e20254 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -26,7 +26,7 @@ class InPatientScreen extends StatefulWidget { bool isAllClinic = true; bool showBottomSheet = false; String ?selectedClinicName; - InPatientScreen({Key key, this.specialClinic}); + InPatientScreen({Key ? key, this.specialClinic}); @override _InPatientScreenState createState() => _InPatientScreenState(); @@ -141,13 +141,13 @@ class _InPatientScreenState extends State // unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, - TranslationBase.of(context).inPatientAll,context: context, + TranslationBase.of(context).inPatientAll!,context: context, counter: model.inPatientList.length, isFirst: true), tabWidget(screenSize, _activeTab == 1, - TranslationBase.of(context).myInPatientTitle, + TranslationBase.of(context).myInPatientTitle!, counter: model.myIinPatientList.length, isMiddle: true, context: context,), tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged, isLast:true, context: context,), + TranslationBase.of(context).discharged!, isLast:true, context: context,), ], ), ), @@ -200,7 +200,7 @@ class _InPatientScreenState extends State {int counter = -1, bool isFirst = false, bool isMiddle = false, - bool isLast = false,BuildContext context}) { + bool isLast = false,required BuildContext context}) { ProjectViewModel projectsProvider = Provider.of(context); diff --git a/lib/screens/patients/In_patient/list_of_all_in_patient.dart b/lib/screens/patients/In_patient/list_of_all_in_patient.dart index 06634819..b29aafa2 100644 --- a/lib/screens/patients/In_patient/list_of_all_in_patient.dart +++ b/lib/screens/patients/In_patient/list_of_all_in_patient.dart @@ -7,10 +7,10 @@ import 'NoData.dart'; class ListOfAllInPatient extends StatelessWidget { const ListOfAllInPatient({ - Key key, - @required this.isAllClinic, - @required this.hasQuery, - this.patientSearchViewModel, + Key? key, + required this.isAllClinic, + required this.hasQuery, + required this.patientSearchViewModel, }) : super(key: key); final bool isAllClinic; @@ -42,7 +42,7 @@ class ListOfAllInPatient extends StatelessWidget { isInpatient: true, isMyPatient: patientSearchViewModel .filteredInPatientItems[index].doctorId == - patientSearchViewModel.doctorProfile.doctorID, + patientSearchViewModel.doctorProfile!.doctorID, onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { @@ -61,7 +61,7 @@ class ListOfAllInPatient extends StatelessWidget { "arrivalType": "1", "isMyPatient": patientSearchViewModel .filteredInPatientItems[index].doctorId == - patientSearchViewModel.doctorProfile.doctorID, + patientSearchViewModel.doctorProfile!.doctorID, }); }, ); @@ -77,7 +77,7 @@ class ListOfAllInPatient extends StatelessWidget { patientSearchViewModel.removeOnFilteredList(); } } - return; + return false; }, ), ), diff --git a/lib/screens/patients/In_patient/list_of_my_inpatient.dart b/lib/screens/patients/In_patient/list_of_my_inpatient.dart index f5f7c070..79b7c0df 100644 --- a/lib/screens/patients/In_patient/list_of_my_inpatient.dart +++ b/lib/screens/patients/In_patient/list_of_my_inpatient.dart @@ -6,10 +6,10 @@ import '../../../routes.dart'; import 'NoData.dart'; class ListOfMyInpatient extends StatelessWidget { const ListOfMyInpatient({ - Key key, - @required this.isAllClinic, - @required this.hasQuery, - this.patientSearchViewModel, + Key? key, + required this.isAllClinic, + required this.hasQuery, + required this.patientSearchViewModel, }) : super(key: key); final bool isAllClinic; @@ -56,9 +56,6 @@ class ListOfMyInpatient extends StatelessWidget { }, ); }), - onNotification: (t) { - return; - }, ), ), ); diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index a52df188..d9a128ac 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -116,7 +116,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { MainAxisAlignment.spaceBetween, children: [ AppText( - "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", + "${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}", fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, @@ -128,7 +128,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), AppText( AppDateUtils.getDayMonthYearDateFormatted( - referredPatient.referralDate, + referredPatient.referralDate!, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -151,8 +151,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.admissionDate, - "dd MMM,yyyy"), + referredPatient.admissionDate ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: @@ -176,8 +175,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.dischargeDate, - "dd MMM,yyyy"), + referredPatient.dischargeDate ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: @@ -200,7 +198,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - "${AppDateUtils.convertStringToDate(referredPatient.dischargeDate).difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate)).inDays + 1}", + "${AppDateUtils.convertStringToDate(referredPatient.dischargeDate ?? "").difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate ?? "")).inDays + 1}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: @@ -301,7 +299,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { children: [ AppText( TranslationBase.of(context) - .frequency + + .frequency! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -332,7 +330,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + + TranslationBase.of(context).priority! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -427,7 +425,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { children: [ AppText( TranslationBase.of(context) - .maxResponseTime + + .maxResponseTime! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -437,7 +435,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime, + referredPatient.mAXResponseTime!, "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart index 92f92f87..a1164b40 100644 --- a/lib/screens/patients/ReferralDischargedPatientPage.dart +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -63,12 +63,12 @@ class _ReferralDischargedPatientPageState extends State model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: int.parse(patient?.appointmentNo.toString()), - projectId: patient.projectId) + appointmentNo: int.parse(patient.appointmentNo.toString()), projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), - builder: (BuildContext context, InsuranceViewModel model, Widget child) => - AppScaffold( - appBar: PatientProfileAppBar( - patient, + builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold( + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient: isInpatient, ), isShowAppBar: true, baseViewModel: model, - appBarTitle: TranslationBase.of(context).approvals, + appBarTitle: TranslationBase.of(context).approvals ?? "", body: patient.admissionNo != null ? SingleChildScrollView( child: Container( @@ -67,8 +66,8 @@ class _InsuranceApprovalScreenNewState crossAxisAlignment: CrossAxisAlignment.start, children: [ ServiceTitle( - title: TranslationBase.of(context).insurance22, - subTitle: TranslationBase.of(context).approvals22, + title: TranslationBase.of(context).insurance22!, + subTitle: TranslationBase.of(context).approvals22!, ), ...List.generate( model.insuranceApprovalInPatient.length, @@ -150,9 +149,9 @@ class _InsuranceApprovalScreenNewState ? Column( children: [ ServiceTitle( - title: TranslationBase.of(context).insurance22, + title: TranslationBase.of(context).insurance22!, subTitle: - TranslationBase.of(context).approvals22, + TranslationBase.of(context).approvals22!, ), ...List.generate( model.insuranceApproval.length, diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index e81a843a..c60f77c5 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -19,14 +20,10 @@ class InsuranceApprovalsDetails extends StatefulWidget { int indexInsurance; String patientType; - InsuranceApprovalsDetails( - {this.patient, this.indexInsurance, this.patientType}); + InsuranceApprovalsDetails({required this.patient, required this.indexInsurance, required this.patientType}); @override _InsuranceApprovalsDetailsState createState() => - _InsuranceApprovalsDetailsState( - patient: patient, - indexInsurance: indexInsurance, - patientType: patientType); + _InsuranceApprovalsDetailsState(patient: patient, indexInsurance: indexInsurance, patientType: patientType); } class _InsuranceApprovalsDetailsState extends State { @@ -34,13 +31,12 @@ class _InsuranceApprovalsDetailsState extends State { int indexInsurance; String patientType; - _InsuranceApprovalsDetailsState( - {this.patient, this.indexInsurance, this.patientType}); + _InsuranceApprovalsDetailsState({required this.patient, required this.indexInsurance, required this.patientType}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; return BaseView( onModelReady: (model) => model.insuranceApprovalInPatient.length == 0 @@ -48,162 +44,158 @@ class _InsuranceApprovalsDetailsState extends State { ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient.appointmentNo, - projectId: patient.projectId) + appointmentNo: patient.appointmentNo, projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient) : null, - builder: (BuildContext context, InsuranceViewModel model, Widget child) => - AppScaffold( - isShowAppBar: true, - baseViewModel: model, - appBar: PatientProfileAppBar(patient), - body: patient.admissionNo != null - ? SingleChildScrollView( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ServiceTitle( - title: TranslationBase.of(context).insurance22, - subTitle: TranslationBase.of(context).approvals22, - ), - Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, + builder: (BuildContext? context, InsuranceViewModel? model, Widget? child) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), + body: patient.admissionNo != null + ? SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context!).insurance22, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).approvals22, + fontSize: 30.0, + fontWeight: FontWeight.w700, ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalStatusDescption != - null - ? model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalStatusDescption ?? - "" - : "", - color: model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalStatusDescption != - null - ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "Approved" || - "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "تمت الموافقة" - ? Color(0xff359846) - : Color(0xffD02127) - : Color(0xffD02127), - letterSpacing: -0.4, - fontWeight: FontWeight.w600, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 2.7, - ), - ], + AppText( + model!.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption != null + ? model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption ?? + "" + : "", + color: model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption != + null + ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "Approved" || + "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "تمت الموافقة" + ? Color(0xff359846) + : Color(0xffD02127) + : Color(0xffD02127), ), - Row( - children: [ - AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .doctorName - .toUpperCase(), - color: Color(0xff2E303A), - fontSize: 16, - letterSpacing: -0.64, - fontWeight: FontWeight.w600, - ) - ], - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( + ], + ), + Row( + children: [ + AppText( + model.insuranceApprovalInPatient[indexInsurance].doctorName!.toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Column( children: [ - Column( - children: [ - Container( - height: MediaQuery.of(context) - .size - .height * - 0.065, - width: MediaQuery.of(context) - .size - .height * - 0.065, - child: CircleAvatar( - radius: SizeConfig - .imageSizeMultiplier * - 12, - // radius: (52) - child: ClipRRect( - borderRadius: - BorderRadius.circular( - 50), - child: Image.network( - model - .insuranceApprovalInPatient[ - indexInsurance] - .doctorImage, - fit: BoxFit.fill, - width: 700, - ), - ), - backgroundColor: - Colors.transparent, + Container( + height: 85.0, + width: 85.0, + child: CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(50), + child: Image.network( + model.insuranceApprovalInPatient[indexInsurance].doctorImage!, + fit: BoxFit.fill, + width: 700, ), ), - ], + backgroundColor: Colors.transparent, + ), ), - Expanded( - child: Padding( - padding: - const EdgeInsets.symmetric( - horizontal: 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, + ], + ), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 25.0, + ), + Row( children: [ - SizedBox( - height: 25.0, + AppText( + TranslationBase.of(context).clinic! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - CustomRow( - label: TranslationBase.of( - context) - .clinic + - ": ", - value: model - .insuranceApprovalInPatient[ - indexInsurance] - .clinicName, + Expanded( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance].clinicName, + fontSize: 14, + ), + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).approvalNo! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - CustomRow( - label: TranslationBase.of( - context) - .approvalNo + - ": ", - value: model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalNo + AppText( + model.insuranceApprovalInPatient[indexInsurance].approvalNo .toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + 'Unused Count:', + color: Colors.grey[500], + fontSize: 14, ), CustomRow( label: 'Unused Count:', @@ -216,26 +208,26 @@ class _InsuranceApprovalsDetailsState extends State { CustomRow( label: TranslationBase.of( context) - .companyName + + .companyName! + ": ", value: 'Sample'), CustomRow( label: TranslationBase.of( context) - .receiptOn + + .receiptOn! + ": ", value: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn ?? ""), isArabic: projectViewModel.isArabic)}'), CustomRow( label: TranslationBase.of( context) - .expiryDate + + .expiryDate! + ": ", value: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate ?? ""), isArabic: projectViewModel.isArabic)}'), ], - ), - ), + ),] + ),) ), ], ), @@ -302,7 +294,7 @@ class _InsuranceApprovalsDetailsState extends State { itemCount: model .insuranceApprovalInPatient[ indexInsurance] - .apporvalDetails + .apporvalDetails! .length, itemBuilder: (BuildContext context, @@ -318,8 +310,8 @@ class _InsuranceApprovalsDetailsState extends State { model .insuranceApprovalInPatient[ indexInsurance] - ?.apporvalDetails[ - index] + ?.apporvalDetails![ + index]! ?.procedureName ?? "", textAlign: @@ -345,7 +337,7 @@ class _InsuranceApprovalsDetailsState extends State { model .insuranceApprovalInPatient[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.status ?? "", @@ -372,7 +364,7 @@ class _InsuranceApprovalsDetailsState extends State { model .insuranceApprovalInPatient[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.isInvoicedDesc ?? "", @@ -428,7 +420,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).insurance22, + TranslationBase.of(context!).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -465,8 +457,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .approvalStatusDescption != null @@ -476,12 +467,12 @@ class _InsuranceApprovalsDetailsState extends State { .approvalStatusDescption ?? "" : "", - color: model + color: model! .insuranceApproval[ - indexInsurance] + indexInsurance]! .approvalStatusDescption != null - ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == + ? "${model!.insuranceApproval[indexInsurance]!.approvalStatusDescption}" == "Approved" ? Color(0xff359846) : Color(0xffD02127) @@ -492,9 +483,9 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApproval[indexInsurance] - .doctorName + model! + .insuranceApproval[indexInsurance]! + .doctorName! .toUpperCase(), color: Colors.black, fontSize: 18, @@ -522,10 +513,10 @@ class _InsuranceApprovalsDetailsState extends State { BorderRadius.circular( 50), child: Image.network( - model - .insuranceApproval[ + model! + .insuranceApproval![ indexInsurance] - .doctorImage, + .doctorImage!, fit: BoxFit.fill, width: 700, ), @@ -554,7 +545,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .clinic + + .clinic! + ": ", color: Colors.grey[500], fontSize: 14, @@ -575,7 +566,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .approvalNo + + .approvalNo! + ": ", color: Colors.grey[500], fontSize: 14, @@ -595,7 +586,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .unusedCount + + .unusedCount! + ": ", color: Colors.grey[500], fontSize: 14, @@ -615,7 +606,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .companyName + + .companyName! + ": ", color: Colors.grey[500], ), @@ -627,13 +618,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .receiptOn + + .receiptOn! + ": ", color: Colors.grey[500], ), Expanded( child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model!.insuranceApproval![indexInsurance]!.rceiptOn!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -646,7 +637,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .expiryDate + + .expiryDate! + ": ", color: Colors.grey[500], ), @@ -656,7 +647,7 @@ class _InsuranceApprovalsDetailsState extends State { .expiryDate != null) AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model!.insuranceApproval[indexInsurance]!.expiryDate!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -683,7 +674,7 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .procedure, fontWeight: FontWeight.w700, ), @@ -717,7 +708,7 @@ class _InsuranceApprovalsDetailsState extends State { itemCount: model .insuranceApproval[ indexInsurance] - .apporvalDetails + .apporvalDetails! .length, itemBuilder: (BuildContext context, @@ -733,7 +724,7 @@ class _InsuranceApprovalsDetailsState extends State { model .insuranceApproval[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.procedureName ?? "", @@ -749,7 +740,7 @@ class _InsuranceApprovalsDetailsState extends State { model .insuranceApproval[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.status ?? "", @@ -765,7 +756,7 @@ class _InsuranceApprovalsDetailsState extends State { model .insuranceApproval[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.isInvoicedDesc ?? "", diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 14ae707b..7863eaf1 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -16,8 +16,7 @@ class FilterDatePage extends StatefulWidget { final OutPatientFilterType outPatientFilterType; final PatientSearchViewModel patientSearchViewModel; - const FilterDatePage( - {Key key, this.outPatientFilterType, this.patientSearchViewModel}) + const FilterDatePage({Key? key, required this.outPatientFilterType, required this.patientSearchViewModel}) : super(key: key); @override @@ -63,18 +62,14 @@ class _FilterDatePageState extends State { color: Colors.white, child: InkWell( onTap: () => selectDate(context, - firstDate: - getFirstDate(widget.outPatientFilterType), - lastDate: - getLastDate(widget.outPatientFilterType)), + firstDate: getFirstDate(widget.outPatientFilterType), + lastDate: getLastDate(widget.outPatientFilterType)), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).fromDate, - widget.patientSearchViewModel - .selectedFromDate != - null + TranslationBase.of(context).fromDate!, + widget.patientSearchViewModel.selectedFromDate != null ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" - : null, + : "", true, suffixIcon: Icon( Icons.calendar_today, @@ -92,18 +87,14 @@ class _FilterDatePageState extends State { child: InkWell( onTap: () => selectDate(context, isFromDate: false, - firstDate: - getFirstDate(widget.outPatientFilterType), - lastDate: - getLastDate(widget.outPatientFilterType)), + firstDate: getFirstDate(widget.outPatientFilterType), + lastDate: getLastDate(widget.outPatientFilterType)), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).toDate, - widget.patientSearchViewModel - .selectedToDate != - null + TranslationBase.of(context).toDate!, + widget.patientSearchViewModel.selectedToDate != null ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" - : null, + : "", true, suffixIcon: Icon( Icons.calendar_today, @@ -154,18 +145,18 @@ class _FilterDatePageState extends State { "Please Select All The date Fields "); } else { Duration difference = widget - .patientSearchViewModel.selectedToDate + .patientSearchViewModel.selectedToDate! .difference(widget - .patientSearchViewModel.selectedFromDate); + .patientSearchViewModel!.selectedFromDate!); if (difference.inDays > 90) { Helpers.showErrorToast( "The difference between from date and end date must be less than 3 months"); } else { String dateTo = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedToDate, + widget.patientSearchViewModel.selectedToDate!, 'yyyy-MM-dd'); String dateFrom = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedFromDate, + widget.patientSearchViewModel.selectedFromDate!, 'yyyy-MM-dd'); PatientSearchRequestModel currentModel = @@ -199,16 +190,15 @@ class _FilterDatePageState extends State { )); } - selectDate(BuildContext context, - {bool isFromDate = true, DateTime firstDate, lastDate}) async { + selectDate(BuildContext context, {bool isFromDate = true, DateTime? firstDate, lastDate}) async { Helpers.hideKeyboard(context); DateTime selectedDate = isFromDate ? this.widget.patientSearchViewModel.selectedFromDate ?? firstDate : this.widget.patientSearchViewModel.selectedToDate ?? lastDate; - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, - firstDate: firstDate, + firstDate: firstDate!, lastDate: lastDate, initialEntryMode: DatePickerEntryMode.calendar, ); @@ -250,9 +240,8 @@ class _FilterDatePageState extends State { } } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String? hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index a43a4582..379e237b 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -35,13 +35,13 @@ class OutPatientsScreen extends StatefulWidget { final isAppbar; final arrivalType; final isView; - final PatientType selectedPatientType; - final PatientSearchRequestModel patientSearchRequestModel; + final PatientType? selectedPatientType; + final PatientSearchRequestModel? patientSearchRequestModel; final bool isSearchWithKeyInfo; final bool isSearch; final bool isInpatient; final bool isSearchAndOut; - final String searchKey; + final String? searchKey; OutPatientsScreen( {this.patientSearchForm, @@ -62,21 +62,21 @@ class OutPatientsScreen extends StatefulWidget { } class _OutPatientsScreenState extends State { - int clinicId; - AuthenticationViewModel authenticationViewModel; + late int clinicId; + late AuthenticationViewModel authenticationViewModel; List _times = []; int _activeLocation = 1; - String patientType; - String patientTypeTitle; + String? patientType; + late String patientTypeTitle; var selectedFilter = 1; - String arrivalType; - ProjectViewModel projectsProvider; + late String arrivalType; + late ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - PatientModel patient; + late PatientModel patient; OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; bool isSortDes = true; @@ -84,16 +84,17 @@ class _OutPatientsScreenState extends State { @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); + projectsProvider = Provider.of(context); _times = [ - TranslationBase.of(context).previous, - TranslationBase.of(context).today, - TranslationBase.of(context).nextWeek, + TranslationBase.of(context).previous!, + TranslationBase.of(context).today!, + TranslationBase.of(context).nextWeek!, ]; final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - await model.getOutPatient(widget.patientSearchRequestModel); + await model.getOutPatient(widget.patientSearchRequestModel!); }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", @@ -223,8 +224,7 @@ class _OutPatientsScreenState extends State { child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, + error: TranslationBase.of(context).youDontHaveAnyPatient ?? "", ), ) : ListView.builder( @@ -243,8 +243,8 @@ class _OutPatientsScreenState extends State { horizontal: 8, vertical: 0), child: PatientCard( patientInfo: model.filterData[index], - patientType: patientType, - arrivalType: arrivalType, + patientType: "1", + arrivalType: "1", isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, onTap: () { @@ -255,9 +255,9 @@ class _OutPatientsScreenState extends State { "patient": model.filterData[index], "patientType": "1", "from": widget - .patientSearchRequestModel.from, + .patientSearchRequestModel!.from, "to": widget - .patientSearchRequestModel.from, + .patientSearchRequestModel!.from!, "isSearch": false, "isInpatient": false, "arrivalType": "7", diff --git a/lib/screens/patients/out_patient_prescription_details_screen.dart b/lib/screens/patients/out_patient_prescription_details_screen.dart index c7056ce3..8a87d93c 100644 --- a/lib/screens/patients/out_patient_prescription_details_screen.dart +++ b/lib/screens/patients/out_patient_prescription_details_screen.dart @@ -12,7 +12,7 @@ import 'package:flutter/material.dart'; class OutPatientPrescriptionDetailsScreen extends StatefulWidget { final PrescriptionResModel prescriptionResModel; - OutPatientPrescriptionDetailsScreen({Key key, this.prescriptionResModel}); + OutPatientPrescriptionDetailsScreen({Key? key, required this.prescriptionResModel}); @override _OutPatientPrescriptionDetailsScreenState createState() => @@ -37,7 +37,7 @@ class _OutPatientPrescriptionDetailsScreenState return BaseView( onModelReady: (model) => getPrescriptionReport(context, model), builder: (_, model, w) => AppScaffold( - appBarTitle: TranslationBase.of(context).prescriptionDetails, + appBarTitle: TranslationBase.of(context).prescriptionDetails!, body: CardWithBgWidgetNew( widget: ListView.builder( itemCount: model.prescriptionReport.length, diff --git a/lib/screens/patients/patient_search/patient_search_header.dart b/lib/screens/patients/patient_search/patient_search_header.dart index 2dd01e1a..2f0a131c 100644 --- a/lib/screens/patients/patient_search/patient_search_header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { final String title; - const PatientSearchHeader({Key key, this.title}) : super(key: key); + const PatientSearchHeader({Key? key, required this.title}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/patient_search/patient_search_result_screen.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart index b0ec2943..7f11d32b 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -31,12 +31,12 @@ class PatientsSearchResultScreen extends StatefulWidget { final String searchKey; PatientsSearchResultScreen( - {this.selectedPatientType, - this.patientSearchRequestModel, + {required this.selectedPatientType, + required this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, this.isInpatient = false, - this.searchKey, + required this.searchKey, this.isSearchAndOut = false}); @override @@ -44,20 +44,19 @@ class PatientsSearchResultScreen extends StatefulWidget { _PatientsSearchResultScreenState(); } -class _PatientsSearchResultScreenState - extends State { - int clinicId; - AuthenticationViewModel authenticationViewModel; +class _PatientsSearchResultScreenState extends State { + late int clinicId; + late AuthenticationViewModel authenticationViewModel; - String patientType; - String patientTypeTitle; + String? patientType; + String? patientTypeTitle; var selectedFilter = 1; - String arrivalType; - ProjectViewModel projectsProvider; + String? arrivalType; + late ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - PatientModel patient; + late PatientModel patient; @override Widget build(BuildContext context) { @@ -89,14 +88,15 @@ class _PatientsSearchResultScreenState }, marginTop: 5, suffixIcon: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - // padding: EdgeInsets.only(bottom: 30), - ), - ), + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + // padding: EdgeInsets.only(bottom: 30), + onPressed: () {}, + ), + ), SizedBox( height: 10.0, ), @@ -105,8 +105,7 @@ class _PatientsSearchResultScreenState child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, + error: TranslationBase.of(context).youDontHaveAnyPatient ?? "", ), ) : ListView.builder( @@ -118,8 +117,8 @@ class _PatientsSearchResultScreenState padding: EdgeInsets.all(8.0), child: PatientCard( patientInfo: model.filterData[index], - patientType: patientType, - arrivalType: arrivalType, + patientType: patientType ?? "", + arrivalType: arrivalType ?? "", isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, onTap: () { diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index e1fdd033..9e9c4c37 100644 --- a/lib/screens/patients/patient_search/patient_search_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -30,7 +30,7 @@ class _PatientSearchScreenState extends State { TextEditingController middleNameInfoController = TextEditingController(); TextEditingController lastNameFileInfoController = TextEditingController(); PatientType selectedPatientType = PatientType.inPatient; - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -45,8 +45,7 @@ class _PatientSearchScreenState extends State { child: Center( child: Column( children: [ - BottomSheetTitle( - title: TranslationBase.of(context).searchPatient), + BottomSheetTitle(title: TranslationBase.of(context).searchPatient!), FractionallySizedBox( // widthFactor: 0.9, child: Container( @@ -139,7 +138,7 @@ class _PatientSearchScreenState extends State { }); PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel( - doctorID: authenticationViewModel.doctorProfile.doctorID); + doctorID: authenticationViewModel.doctorProfile!.doctorID); if (showOther) { patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty diff --git a/lib/screens/patients/patient_search/time_bar.dart b/lib/screens/patients/patient_search/time_bar.dart deleted file mode 100644 index a1ee2cab..00000000 --- a/lib/screens/patients/patient_search/time_bar.dart +++ /dev/null @@ -1,110 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; -import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -class TimeBar extends StatefulWidget { - final PatientSearchViewModel model; - final PatientType selectedPatientType; - final PatientSearchRequestModel patientSearchRequestModel; - final bool isSearchWithKeyInfo; - - const TimeBar( - {Key key, - this.model, - this.selectedPatientType, - this.patientSearchRequestModel, - this.isSearchWithKeyInfo}) - : super(key: key); - @override - _TimeBarState createState() => _TimeBarState(); -} - -class _TimeBarState extends State { - @override - Widget build(BuildContext context) { - List _locations = [ - TranslationBase.of(context).today, - TranslationBase.of(context).tomorrow, - TranslationBase.of(context).nextWeek, - ]; - int _activeLocation = 0; - return Container( - height: MediaQuery.of(context).size.height * 0.0619, - width: SizeConfig.screenWidth * 0.94, - decoration: BoxDecoration( - color: Color(0Xffffffff), - borderRadius: BorderRadius.circular(12.5), - // border: Border.all( - // width: 0.5, - // ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.058, - width: SizeConfig.screenWidth * 0.2334, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(12.5), - topRight: Radius.circular(12.5), - topLeft: Radius.circular(9.5), - bottomLeft: Radius.circular(9.5)), - color: _isActive ? HexColor("#B8382B") : Colors.white, - ), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - - fontWeight: FontWeight.normal, - ), - ), - )), - ), - onTap: () async { - setState(() { - _activeLocation = _locations.indexOf(item); - }); - GifLoaderDialogUtils.showMyDialog(context); - await widget.model.getPatientBasedOnDate( - item: item, - selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: - widget.patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo); - GifLoaderDialogUtils.hideDialog(context); - }), - _isActive - ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(10), - topRight: Radius.circular(10)), - color: Colors.white), - alignment: Alignment.center, - height: 1, - width: SizeConfig.screenWidth * 0.23, - ) - : Container() - ]); - }).toList(), - ), - ); - } -} diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 7cd7288e..9e96679a 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; @@ -8,6 +7,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -33,8 +33,8 @@ class UcafDetailScreen extends StatefulWidget { } class _UcafDetailScreenState extends State { - PatiantInformtion patient; - UcafViewModel model; + PatiantInformtion patient; + UcafViewModel model; late UcafViewModel ucafModel; @@ -74,48 +74,47 @@ class _UcafDetailScreenState extends State { widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Column( - children: [ - Expanded( - child: Container( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 16), - child: Column( - children: [ - treatmentStepsBar( - context, model, screenSize, patient), - SizedBox( - height: 16, - ), - ...getSelectedTreatmentStepItem( - context, model), - ], + baseViewModel: model, + isShowAppBar: false, + body: Column( + children: [ + Expanded( + child: Container( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric( + vertical: 16, horizontal: 16), + child: Column( + children: [ + treatmentStepsBar( + context, model, screenSize, patient), + SizedBox( + height: 16, ), - ), - ], + ...getSelectedTreatmentStepItem( + context, model), + ], + ), ), - ), + ], ), ), - - ], + ), ), - )); + ], + ), + )); } Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, Size screenSize, PatiantInformtion patient) { List __treatmentSteps = [ - TranslationBase.of(context).diagnosis.toUpperCase(), - TranslationBase.of(context).medications.toUpperCase(), - TranslationBase.of(context).procedures.toUpperCase(), + TranslationBase.of(context).diagnosis ?? "".toUpperCase(), + TranslationBase.of(context).medications ?? "".toUpperCase(), + TranslationBase.of(context).procedures ?? "".toUpperCase(), ]; return Container( height: screenSize.height * 0.070, @@ -200,14 +199,14 @@ class _UcafDetailScreenState extends State { return [ ListView.builder( itemCount: model.prescriptionList != null - ? model.prescriptionList.entityList.length + ? model.prescriptionList!.entityList!.length : 0, scrollDirection: Axis.vertical, physics: ScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { return MedicationWidget( - model, model.prescriptionList.entityList[index]); + model, model.prescriptionList!.entityList![index]); }) ]; break; @@ -245,10 +244,10 @@ class DiagnosisWidget extends StatelessWidget { @override Widget build(BuildContext context) { - MasterKeyModel diagnosisType = model.findMasterDataById( + MasterKeyModel? diagnosisType = model.findMasterDataById( masterKeys: MasterKeysService.DiagnosisType, id: diagnosis.diagnosisTypeID); - MasterKeyModel diagnosisCondition = model.findMasterDataById( + MasterKeyModel? diagnosisCondition = model.findMasterDataById( masterKeys: MasterKeysService.DiagnosisCondition, id: diagnosis.conditionID); @@ -265,8 +264,8 @@ class DiagnosisWidget extends StatelessWidget { AppText( diagnosisType != null ? model.selectedLanguage == 'ar' - ? diagnosisType.nameAr - : diagnosisType.nameEn + ? diagnosisType.nameAr + : diagnosisType.nameEn : "-", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, @@ -521,7 +520,7 @@ class ProceduresWidget extends StatelessWidget { AppText( "${procedure.isCovered}", fontWeight: FontWeight.normal, - color: procedure.isCovered ? AppGlobal.appGreenColor : Colors.red, + color: procedure.isCovered! ? Colors.green : Colors.red, fontSize: SizeConfig.textMultiplier * 2.0, ), SizedBox( diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 64b1bd29..adbc2a50 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -261,7 +261,8 @@ class _UCAFInputScreenState extends State { TranslationBase.of(context).instruction, dropDownText: Helpers.parseHtmlString(model .patientChiefComplaintList[0] - .chiefComplaint ), + .chiefComplaint! ?? + ""), controller: _additionalComplaintsController, inputType: TextInputType.multiline, enabled: false, diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index 3aa89949..408219d8 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -19,10 +19,10 @@ class PageStepperWidget extends StatelessWidget { final List ?stepsTitles; PageStepperWidget( - { this.stepsCount, - this.currentStepIndex, - this.screenSize, - this.stepsTitles}); + {required this.stepsCount, + required this.currentStepIndex, + required this.screenSize, + this.stepsTitles}); @override Widget build(BuildContext context) { @@ -63,7 +63,6 @@ class PageStepperWidget extends StatelessWidget { } class StepWidget extends StatelessWidget { - final int index; final bool isInProgress; final bool isFinalStep; @@ -81,9 +80,9 @@ class StepWidget extends StatelessWidget { if (isInProgress) { status = StepStatus.InProgress; } else { - if(isStepFinish){ + if (isStepFinish) { status = StepStatus.Completed; - }else { + } else { status = StepStatus.Locked; } } @@ -99,20 +98,28 @@ class StepWidget extends StatelessWidget { width: 30, height: 30, decoration: BoxDecoration( - color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), + color: status == StepStatus.InProgress + ? Color(0xFFCC9B14) + : status == StepStatus.Locked + ? Color(0xFFE3E3E3) + : Color(0xFF359846), shape: BoxShape.circle, border: Border.all( - color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), + color: status == StepStatus.InProgress + ? Color(0xFFCC9B14) + : status == StepStatus.Locked + ? Color(0xFFE3E3E3) + : Color(0xFF359846), width: 1), ), child: Center( child: Icon( - Icons.check, - size: 20, - color: status == StepStatus.Locked - ? Color(0xFF969696) - : Colors.white, - )), + Icons.check, + size: 20, + color: status == StepStatus.Locked + ? Color(0xFF969696) + : Colors.white, + )), ), if (!isFinalStep) Container( @@ -144,23 +151,25 @@ class StepWidget extends StatelessWidget { color: status == StepStatus.InProgress ? Color(0xFFF1E9D3) : status == StepStatus.Locked - ? Color(0x29797979) - : Color(0xFFD8E8D8), + ? Color(0x29797979) + : Color(0xFFD8E8D8), borderRadius: BorderRadius.all( Radius.circular(4.0), ), - border: Border.all(color: status == StepStatus.InProgress - ? Color(0xFFF1E9D3) - : status == StepStatus.Locked - ? Color(0x29797979) - : Color(0xFFD8E8D8), width: 0.30), + border: Border.all( + color: status == StepStatus.InProgress + ? Color(0xFFF1E9D3) + : status == StepStatus.Locked + ? Color(0x29797979) + : Color(0xFFD8E8D8), + width: 0.30), ), child: AppText( status == StepStatus.InProgress ? "inProgress" : status == StepStatus.Locked - ? "Locked" - : "Completed", + ? "Locked" + : "Completed", fontWeight: FontWeight.bold, textAlign: TextAlign.center, fontFamily: 'Poppins', @@ -181,4 +190,4 @@ enum StepStatus { InProgress, Locked, Completed, -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index 80072f17..acaf3a98 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -18,7 +18,7 @@ import 'UCAF-detail-screen.dart'; import 'UCAF-input-screen.dart'; class UCAFPagerScreen extends StatefulWidget { - const UCAFPagerScreen({Key key}) : super(key: key); + const UCAFPagerScreen({Key? key}) : super(key: key); @override _UCAFPagerScreenState createState() => _UCAFPagerScreenState(); @@ -56,7 +56,7 @@ class _UCAFPagerScreenState extends State @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings!.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index 6a20d0c0..9b42e444 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -16,7 +16,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class AdmissionOrdersScreen extends StatefulWidget { - const AdmissionOrdersScreen({Key key}) : super(key: key); + const AdmissionOrdersScreen({Key? key}) : super(key: key); @override _AdmissionOrdersScreenState createState() => _AdmissionOrdersScreenState(); @@ -25,23 +25,23 @@ class AdmissionOrdersScreen extends StatefulWidget { class _AdmissionOrdersScreenState extends State { bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => model.getAdmissionOrders( - admissionNo: int.parse(patient.admissionNo), - patientId: patient.patientMRN), + admissionNo: int.parse(patient!.admissionNo!), + patientId: patient!.patientMRN!), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -53,11 +53,8 @@ class _AdmissionOrdersScreenState extends State { isShowAppBar: true, body: model.admissionOrderList == null || model.admissionOrderList.length == 0 - ? Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, - ), - ) + ? DrAppEmbeddedError( + error: TranslationBase.of(context).noDataAvailable!) : Container( color: Colors.grey[200], child: Column( diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index 9fa78cef..3466fee2 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-view import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -41,16 +42,16 @@ class _AdmissionRequestThirdScreenState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileAppBar(patient), - appBarTitle: TranslationBase.of(context).admissionRequest, + patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), + appBarTitle: TranslationBase.of(context)!.admissionRequest!, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -217,7 +218,7 @@ class _AdmissionRequestThirdScreenState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileAppBar(patient), - appBarTitle: TranslationBase.of(context).admissionRequest, + patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), + + appBarTitle: TranslationBase.of(context).admissionRequest!, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -154,7 +156,7 @@ class _AdmissionRequestThirdScreenState extends State GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.Idle && model.icdCodes.length > 0) { openListDialogField('description', 'code', model.icdCodes, (selectedValue) { diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 0258d26f..06e8d828 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-view import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -40,28 +41,28 @@ class _AdmissionRequestSecondScreenState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileAppBar(patient), - appBarTitle: TranslationBase.of(context).admissionRequest, + patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), + appBarTitle: TranslationBase.of(context).admissionRequest!, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -187,15 +188,16 @@ class _AdmissionRequestSecondScreenState extends State { DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4) ]; - DiabeticType selectedDiabeticType; + late DiabeticType selectedDiabeticType; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; ProjectViewModel projectsProvider = Provider.of(context); return BaseView( onModelReady: (model) async { selectedDiabeticType = diabeticType[2]; - await model.getDiabeticChartValues(patient, selectedDiabeticType.value, isLocalBusy: false); + await model.getDiabeticChartValues(patient, selectedDiabeticType.value!, + isLocalBusy: false); generateData(model); }, builder: (_, model, w) => AppScaffold( @@ -164,7 +165,7 @@ class _DiabeticChartState extends State { color: Colors.white, borderRadius: BorderRadius.circular(12)), child: LineChartForDiabetic( - title: selectedDiabeticType.nameEn, + title: selectedDiabeticType.nameEn!, isOX: false, timeSeries1: timeSeriesData1, // timeSeries2: timeSeriesData2, @@ -201,7 +202,7 @@ class _DiabeticChartState extends State { ], ), ) - : Center(child: ErrorMessage(error: TranslationBase.of(context).noItem)), + : ErrorMessage(error: TranslationBase.of(context).noItem!), ], ), )), @@ -213,21 +214,21 @@ class _DiabeticChartState extends State { model.diabeticChartValuesList.toList().forEach( (element) { DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(element.dateChart); - if (element.resultValue.toInt() != 0) + AppDateUtils.getDateTimeFromServerFormat(element.dateChart!); + if (element.resultValue!.toInt() != 0) timeSeriesData1.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.resultValue.toDouble(), + element.resultValue!.toDouble(), ), ); - if (element.resultValue.toInt() != 0) + if (element.resultValue!.toInt() != 0) timeSeriesData2.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.resultValue.toDouble(), + element.resultValue!.toDouble(), ), ); }, @@ -243,8 +244,9 @@ class _DiabeticChartState extends State { timeSeriesData2.clear(); }); - await model.getDiabeticChartValues(patient, selectedDiabeticType.value,isLocalBusy:true); - if(model.state == ViewState.ErrorLocal){ + await model.getDiabeticChartValues(patient, selectedDiabeticType.value!, + isLocalBusy: true); + if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } generateData(model); diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart index b3b1b581..22c42db4 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart @@ -12,8 +12,10 @@ import 'package:provider/provider.dart'; class DiabeticDetails extends StatefulWidget { final List diabeticDetailsList; - DiabeticDetails( - {Key key, this.diabeticDetailsList,}); + DiabeticDetails({ + Key? key, + required this.diabeticDetailsList, + }); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -70,7 +72,8 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: + BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -85,7 +88,7 @@ class _VitalSignDetailsWidgetState extends State { widget.diabeticDetailsList.forEach((diabetic) { var data = diabetic.resultValue; DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart); + AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart!); if (data != 0) tableRow.add(TableRow(children: [ Container( diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index ce14d468..3da6fa9a 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -33,7 +33,7 @@ import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class DiagnosisScreen extends StatefulWidget { - const DiagnosisScreen({Key key}) : super(key: key); + const DiagnosisScreen({Key? key}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); @@ -41,20 +41,20 @@ class DiagnosisScreen extends StatefulWidget { class _ProgressNoteState extends State { bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; getDiagnosisForInPatient(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); print(type); GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel = GetDiagnosisForInPatientRequestModel( - admissionNo: int.parse(patient.admissionNo), - patientTypeID: patient.patientType, + admissionNo: int.parse(patient!.admissionNo!), + patientTypeID: patient!.patientType!, patientID: patient.patientId, setupID: "010266"); model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); @@ -64,7 +64,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; @@ -82,7 +82,7 @@ class _ProgressNoteState extends State { model.diagnosisForInPatientList.length == 0 ? Center( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, + error: TranslationBase.of(context)!.noDataAvailable!, ), ) : Container( @@ -166,7 +166,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .diagnosisForInPatientList[ index] - .createdOn), + .createdOn!), isArabic: projectViewModel .isArabic, @@ -192,7 +192,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .diagnosisForInPatientList[ index] - .createdOn)) + .createdOn!)) : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight.w600, @@ -214,7 +214,7 @@ class _ProgressNoteState extends State { children: [ AppText( TranslationBase.of(context) - .icd + + .icd! + " : ", fontSize: 12, ), diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index 532d5e46..a20ead40 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -10,10 +10,9 @@ import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; class AllDischargeSummary extends StatefulWidget { - final Function changeCurrentTab; final PatiantInformtion patient; - const AllDischargeSummary({this.changeCurrentTab, this.patient}); + const AllDischargeSummary({ required this.patient}); @override _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); @@ -27,7 +26,7 @@ class _AllDischargeSummaryState extends State { onModelReady: (model) { model.getAllDischargeSummary( patientId: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), ); }, builder: (_, model, w) => AppScaffold( @@ -37,7 +36,7 @@ class _AllDischargeSummaryState extends State { model.allDisChargeSummaryList.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable), + error: TranslationBase.of(context).noDataAvailable!), ) : Column( children: [ diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index a892b7be..4b6c87d4 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -40,7 +40,7 @@ class _DischargeSummaryWidgetState extends State { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200], width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Padding( padding: EdgeInsets.all(15.0), @@ -52,14 +52,14 @@ class _DischargeSummaryWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ CustomRow( - label: TranslationBase.of(context).doctorName + ": ", + label: TranslationBase.of(context).doctorName! + ": ", value: widget.dischargeSummary.createdByName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( - label: TranslationBase.of(context).branch + ": ", + label: TranslationBase.of(context).branch! + ": ", value: widget.dischargeSummary.projectName.toString() ?? "".toString(), isCopyable: false, @@ -72,7 +72,7 @@ class _DischargeSummaryWidgetState extends State { ), CustomRow( label: - TranslationBase.of(context).dischargeDate + ": ", + TranslationBase.of(context).dischargeDate! + ": ", value: AppDateUtils.getDateTimeFromServerFormat( widget.dischargeSummary.createdOn!) .day @@ -132,7 +132,7 @@ class _DischargeSummaryWidgetState extends State { children: [ new TextSpan( text: TranslationBase.of(context) - .pastMedicalHistory + + .pastMedicalHistory! + ": ", style: TextStyle( fontSize: SizeConfig @@ -171,7 +171,7 @@ class _DischargeSummaryWidgetState extends State { children: [ new TextSpan( text: TranslationBase.of(context) - .investigation + + .investigation! + ": ", style: TextStyle( fontSize: SizeConfig @@ -211,7 +211,7 @@ class _DischargeSummaryWidgetState extends State { children: [ new TextSpan( text: TranslationBase.of(context) - .investigation + + .investigation! + ": ", style: TextStyle( fontSize: SizeConfig @@ -250,7 +250,7 @@ class _DischargeSummaryWidgetState extends State { children: [ new TextSpan( text: TranslationBase.of(context) - .planedProcedure + + .planedProcedure! + ": ", style: TextStyle( fontSize: SizeConfig diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index fbe2f108..88018c4e 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -13,9 +13,8 @@ import 'all_discharge_summary.dart'; import 'pending_discharge_summary.dart'; class DischargeSummaryPage extends StatefulWidget { - final Function changeCurrentTab; - const DischargeSummaryPage({Key key, this.changeCurrentTab}) + const DischargeSummaryPage({Key? key, }) : super(key: key); @override @@ -24,7 +23,7 @@ class DischargeSummaryPage extends StatefulWidget { class _DoctorReplyScreenState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; int _activeTab = 0; int pageIndex = 1; @@ -50,16 +49,15 @@ class _DoctorReplyScreenState extends State @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return WillPopScope( onWillPop: () async { - widget.changeCurrentTab(); return false; }, child: AppScaffold( - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: true, patientProfileAppBarModel: PatientProfileAppBarModel( patient:patient, @@ -98,12 +96,12 @@ class _DoctorReplyScreenState extends State tabWidget( screenSize, _activeTab == 0, - TranslationBase.of(context).pending, + TranslationBase.of(context).pending!, ), tabWidget( screenSize, _activeTab == 1, - TranslationBase.of(context).all, + TranslationBase.of(context).all!, ), ], ), diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index 0313371b..aca2c27e 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -9,10 +9,9 @@ import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; class PendingDischargeSummary extends StatefulWidget { - final Function changeCurrentTab; final PatiantInformtion patient; - const PendingDischargeSummary({Key key, this.changeCurrentTab, this.patient}) + const PendingDischargeSummary({Key? key, required this.patient}) : super(key: key); @override @@ -29,17 +28,16 @@ class _PendingDischargeSummaryState extends State { onModelReady: (model) { model.getPendingDischargeSummary( patientId: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), ); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, body: model.pendingDischargeSummaryList.isEmpty - ? Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable), - ) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ? ErrorMessage( + error: TranslationBase.of(context) + .noDataAvailable!) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) : Column( children: [ Padding( diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index be863b87..7e344990 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -20,7 +20,7 @@ class FlowChartPage extends StatelessWidget { final bool isInpatient; FlowChartPage( - {this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); + {required this.patientLabOrder, required this.filterName, required this.patient, required this.isInpatient}); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart index 118bc476..4a23710f 100644 --- a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart +++ b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart @@ -14,7 +14,7 @@ class LabResultHistoryPage extends StatelessWidget { final String filterName; final PatiantInformtion patient; - LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient}); + LabResultHistoryPage({required this.patientLabOrder, required this.filterName, required this.patient}); // TODO mosa UI changes @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 6ca92a4a..99a8d73d 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -21,14 +21,14 @@ class LabResultWidget extends StatelessWidget { final bool isInpatient; LabResultWidget( - {Key key, - this.filterName, - this.patientLabResultList, - this.patientLabOrder, - this.patient, - this.isInpatient}) + {Key? key, + required this.filterName, + required this.patientLabResultList, + required this.patientLabOrder, + required this.patient, + required this.isInpatient}) : super(key: key); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -222,7 +222,7 @@ class LabResultWidget extends StatelessWidget { FadePage( page: FlowChartPage( filterName: - patientLabResultList[index].description, + patientLabResultList[index].description!, patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient, @@ -331,7 +331,7 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - lab.resultValue + " " + lab.uOM, + lab.resultValue! + " " + lab.uOM!, textAlign: TextAlign.center, ), ), diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart index 697d16d2..64ed4550 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart @@ -12,7 +12,7 @@ class LabResultDetailsWidget extends StatefulWidget { final List labResult; LabResultDetailsWidget({ - this.labResult, + required this.labResult, }); @override @@ -74,7 +74,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder.symmetric( - inside: BorderSide(width: 1.0, color: Colors.grey[300]), + inside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -87,7 +87,7 @@ class _VitalSignDetailsWidgetState extends State { List fullData(ProjectViewModel projectViewModel) { List tableRow = []; widget.labResult.forEach((vital) { - var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); + var date = AppDateUtils.convertStringToDate(vital!.verifiedOnDateTime!); tableRow.add(TableRow(children: [ Container( child: Container( diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart index 490d0ec4..7eb168a1 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart @@ -12,7 +12,7 @@ class LabResultHistoryDetailsWidget extends StatefulWidget { final List labResultHistory; LabResultHistoryDetailsWidget({ - this.labResultHistory, + required this.labResultHistory, }); @override @@ -72,7 +72,7 @@ class _VitalSignDetailsWidgetState extends State ), Table( border: TableBorder.symmetric( - inside: BorderSide(width: 1.0, color: Colors.grey[300]), + inside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -85,7 +85,7 @@ class _VitalSignDetailsWidgetState extends State List fullData(ProjectViewModel projectViewModel) { List tableRow = []; widget.labResultHistory.forEach((vital) { - var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); + var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!); tableRow.add(TableRow(children: [ Container( child: Container( diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index e9dfe476..45ded281 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -15,24 +15,24 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class AllLabSpecialResult extends StatefulWidget { - const AllLabSpecialResult({Key key}) : super(key: key); + const AllLabSpecialResult({Key? key}) : super(key: key); @override _AllLabSpecialResultState createState() => _AllLabSpecialResultState(); } class _AllLabSpecialResultState extends State { - String patientType; + late String patientType; - String arrivalType; - PatiantInformtion patient; - bool isInpatient; - bool isFromLiveCare; + late String arrivalType; + late PatiantInformtion patient; + late bool isInpatient; + late bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -47,7 +47,7 @@ class _AllLabSpecialResultState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => - model.getAllSpecialLabResult(patientId: patient.patientMRN), + model.getAllSpecialLabResult(patientId: patient!.patientMRN!), builder: (context, LabsViewModel model, widget) => AppScaffold( baseViewModel: model, backgroundColor: Colors.grey[100], @@ -72,9 +72,9 @@ class _AllLabSpecialResultState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).special + + TranslationBase.of(context).special! + " " + - TranslationBase.of(context).lab, + TranslationBase.of(context).lab!, style: "caption2", color: Colors.black, fontSize: 13, @@ -111,10 +111,10 @@ class _AllLabSpecialResultState extends State { height: 160, decoration: BoxDecoration( color: model.allSpecialLabList[index] - .isLiveCareAppointment + .isLiveCareAppointment! ? Colors.red[900] : !model.allSpecialLabList[index] - .isInOutPatient + .isInOutPatient! ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -136,17 +136,17 @@ class _AllLabSpecialResultState extends State { child: Center( child: Text( model.allSpecialLabList[index] - .isLiveCareAppointment + .isLiveCareAppointment! ? TranslationBase.of(context) - .liveCare + .liveCare! .toUpperCase() : !model.allSpecialLabList[index] - .isInOutPatient + .isInOutPatient! ? TranslationBase.of(context) - .inPatientLabel + .inPatientLabel! .toUpperCase() : TranslationBase.of(context) - .outpatient + .outpatient! .toUpperCase(), style: TextStyle(color: Colors.white), ), @@ -160,21 +160,21 @@ class _AllLabSpecialResultState extends State { FadePage( page: SpecialLabResultDetailsPage( resultData: model.allSpecialLabList[index] - .resultDataHTML, + .resultDataHTML!, patient: patient, ), ), ), doctorName: - model.allSpecialLabList[index].doctorName, + model.allSpecialLabList[index].doctorName!, invoiceNO: ' ${model.allSpecialLabList[index].invoiceNo}', profileUrl: model - .allSpecialLabList[index].doctorImageURL, + .allSpecialLabList[index].doctorImageURL!, branch: - model.allSpecialLabList[index].projectName, - clinic: model - .allSpecialLabList[index].clinicDescription, + model.allSpecialLabList[index].projectName!, + clinic: model.allSpecialLabList[index] + .clinicDescription!, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( model.allSpecialLabList[index].createdOn, diff --git a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart index 49fee0f4..04bea7ac 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -11,9 +11,9 @@ import 'Lab_Result_details_wideget.dart'; class LabResultChartAndDetails extends StatelessWidget { LabResultChartAndDetails({ - Key key, - @required this.labResult, - @required this.name, + Key? key, + required this.labResult, + required this.name, }) : super(key: key); final List labResult; diff --git a/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart index 322eb817..fdf95b2c 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart @@ -9,9 +9,9 @@ import 'LineChartCurvedLabHistory.dart'; class LabResultHistoryChartAndDetails extends StatelessWidget { LabResultHistoryChartAndDetails({ - Key key, - @required this.labResultHistory, - @required this.name, + Key? key, + required this.labResultHistory, + required this.name, }) : super(key: key); final List labResultHistory; diff --git a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart index dd8ace01..37af7382 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart @@ -14,7 +14,7 @@ import 'package:flutter/material.dart'; class LabResult extends StatefulWidget { final LabOrdersResModel labOrders; - LabResult({Key key, this.labOrders}); + LabResult({Key? key, required this.labOrders}); @override _LabResultState createState() => _LabResultState(); @@ -27,10 +27,9 @@ class _LabResultState extends State { onModelReady: (model) => model.getLabResult(widget.labOrders), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).labOrders, + appBarTitle: TranslationBase.of(context).labOrders ?? "", body: model.labResultList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoLabOrders) + ? DrAppEmbeddedError(error: TranslationBase.of(context).errorNoLabOrders ?? "") : Container( margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 4ccd4379..c8555069 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -17,12 +18,12 @@ class LaboratoryResultPage extends StatefulWidget { final bool isInpatient; LaboratoryResultPage( - {Key key, - this.patientLabOrders, - this.patient, - this.patientType, - this.arrivalType, - this.isInpatient}); + {Key? key, + required this.patientLabOrders, + required this.patient, + required this.patientType, + required this.arrivalType, + required this.isInpatient}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -33,16 +34,14 @@ class _LaboratoryResultPageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getPatientLabResult( - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, - isInpatient: true), + patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: true), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBar: PatientProfileAppBar( - widget.patient, - isInpatient:widget.isInpatient, - isFromLabResult: true, - appointmentDate: widget.patientLabOrders.orderDate, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: widget.patient, + isInpatient: widget.isInpatient, + isFromLabResult: true, + appointmentDate: widget.patientLabOrders.orderDate!, ), baseViewModel: model, @@ -51,11 +50,10 @@ class _LaboratoryResultPageState extends State { body: SingleChildScrollView( child: LaboratoryResultWidget( onTap: () async {}, - billNo: widget.patientLabOrders.invoiceNo, - details: model.patientLabSpecialResult.length > 0 - ? model.patientLabSpecialResult[0].resultDataHTML - : null, - orderNo: widget.patientLabOrders.orderNo, + billNo: widget.patientLabOrders.invoiceNo!, + details: + model.patientLabSpecialResult.length > 0 ? model.patientLabSpecialResult[0].resultDataHTML : null, + orderNo: widget.patientLabOrders.orderNo!, patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: widget.patientType == "1", diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 9bf81081..96ae6ed9 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -18,21 +18,21 @@ import 'package:provider/provider.dart'; class LaboratoryResultWidget extends StatefulWidget { final GestureTapCallback onTap; final String billNo; - final String details; + final String? details; final String orderNo; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; final bool isInpatient; const LaboratoryResultWidget( - {Key key, - this.onTap, - this.billNo, - this.details, - this.orderNo, - this.patientLabOrder, - this.patient, - this.isInpatient}) + {Key? key, + required this.onTap, + required this.billNo, + required this.details, + required this.orderNo, + required this.patientLabOrder, + required this.patient, + required this.isInpatient}) : super(key: key); @override @@ -42,7 +42,7 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMoreGeneral = true; bool _isShowMore = true; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -158,13 +158,13 @@ class _LaboratoryResultWidgetState extends State { else if (widget.details == null) Container( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, + error: TranslationBase.of(context).noDataAvailable!, ), ), SizedBox( height: 15, ), - if (widget.details != null && widget.details.isNotEmpty) + if (widget.details != null && widget.details!.isNotEmpty) Column( children: [ InkWell( @@ -223,7 +223,7 @@ class _LaboratoryResultWidgetState extends State { duration: Duration(milliseconds: 7000), child: Container( width: double.infinity, - child: !Helpers.isTextHtml(widget.details) + child: !Helpers.isTextHtml(widget.details!) ? AppText( widget.details ?? TranslationBase.of(context) diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 67303256..90a1c51e 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; @@ -24,17 +25,17 @@ class LabsHomePage extends StatefulWidget { } class _LabsHomePageState extends State { - String patientType; + late String patientType; - String arrivalType; - PatiantInformtion patient; - bool isInpatient; - bool isFromLiveCare; + late String arrivalType; + late PatiantInformtion patient; + late bool isInpatient; + late bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -53,10 +54,8 @@ class _LabsHomePageState extends State { baseViewModel: model, backgroundColor: Colors.grey[100], isShowAppBar: true, - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient:isInpatient,), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -70,8 +69,8 @@ class _LabsHomePageState extends State { if (model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) ServiceTitle( - title: TranslationBase.of(context).lab, - subTitle: TranslationBase.of(context).result, + title: TranslationBase.of(context).lab!, + subTitle: TranslationBase.of(context).result!, ), if (patient.patientStatusType != null && patient.patientStatusType == 43) @@ -111,7 +110,7 @@ class _LabsHomePageState extends State { ), ); }, - label: TranslationBase.of(context).applyForNewLabOrder, + label: TranslationBase.of(context).applyForNewLabOrder!, ), ...List.generate( model.patientLabOrdersList.length, @@ -136,10 +135,10 @@ class _LabsHomePageState extends State { width: 20, decoration: BoxDecoration( color: model.patientLabOrdersList[index] - .isLiveCareAppointment + .isLiveCareAppointment! ? Colors.red[900] : !model.patientLabOrdersList[index] - .isInOutPatient + .isInOutPatient! ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -161,17 +160,17 @@ class _LabsHomePageState extends State { child: Center( child: Text( model.patientLabOrdersList[index] - .isLiveCareAppointment + .isLiveCareAppointment! ? TranslationBase.of(context) - .liveCare + .liveCare! .toUpperCase() : !model.patientLabOrdersList[index] - .isInOutPatient + .isInOutPatient! ? TranslationBase.of(context) - .inPatientLabel + .inPatientLabel! .toUpperCase() : TranslationBase.of(context) - .outpatient + .outpatient! .toUpperCase(), style: TextStyle(color: Colors.white), ), @@ -198,17 +197,17 @@ class _LabsHomePageState extends State { ), ), doctorName: - model.patientLabOrdersList[index].doctorName, + model.patientLabOrdersList[index].doctorName!, invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', profileUrl: model - .patientLabOrdersList[index].doctorImageURL, + .patientLabOrdersList[index].doctorImageURL!, branch: - model.patientLabOrdersList[index].projectName, + model.patientLabOrdersList[index].projectName!, clinic: model - .patientLabOrdersList[index].clinicDescription, + .patientLabOrdersList[index].clinicDescription!, appointmentDate: - model.patientLabOrdersList[index].orderDate, + model.patientLabOrdersList[index].orderDate!, orderNo: model.patientLabOrdersList[index].orderNo, isShowTime: false, ), diff --git a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart index db86dd72..e338635a 100644 --- a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart +++ b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart @@ -13,7 +13,7 @@ class SpecialLabResultDetailsPage extends StatelessWidget { final String resultData; final PatiantInformtion patient; - const SpecialLabResultDetailsPage({Key key, this.resultData, this.patient}) : super(key: key); + const SpecialLabResultDetailsPage({Key? key, required this.resultData, required this.patient}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 72ee1311..bd6fd476 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -14,16 +14,16 @@ import 'package:html_editor_enhanced/html_editor.dart'; import 'package:permission_handler/permission_handler.dart'; class AddVerifyMedicalReport extends StatefulWidget { - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final MedicalReportModel medicalReport; - final PatientMedicalReportViewModel model; - final MedicalReportStatus status; - final String medicalNote; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + final MedicalReportModel? medicalReport; + final PatientMedicalReportViewModel? model; + final MedicalReportStatus? status; + final String? medicalNote; const AddVerifyMedicalReport( - {Key key, + {Key? key, this.patient, this.patientType, this.arrivalType, @@ -38,6 +38,7 @@ class AddVerifyMedicalReport extends StatefulWidget { } class _AddVerifyMedicalReportState extends State { + HtmlEditorController _controller = HtmlEditorController(); @override Widget build(BuildContext context) { String txtOfMedicalReport; @@ -50,8 +51,8 @@ class _AddVerifyMedicalReportState extends State { baseViewModel: model, isShowAppBar: true, appBarTitle: widget.status == MedicalReportStatus.ADD - ? TranslationBase.of(context).medicalReportAdd - : TranslationBase.of(context).medicalReportVerify, + ? TranslationBase.of(context).medicalReportAdd! + : TranslationBase.of(context).medicalReportVerify!, backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: Column( children: [ @@ -68,13 +69,26 @@ class _AddVerifyMedicalReportState extends State { children: [ if (model.medicalReportTemplate.length > 0) HtmlRichEditor( - initialText: (widget.medicalReport != null + initialText: (widget.medicalReport != + null ? widget.medicalNote - : widget.model.medicalReportTemplate[0].templateText.length > 0 - ? widget.model.medicalReportTemplate[0].templateText + : widget + .model! + .medicalReportTemplate[ + 0] + .templateText! + .length > + 0 + ? widget + .model! + .medicalReportTemplate[0] + .templateText : ""), hint: "Write the medical report ", - height: MediaQuery.of(context).size.height * 0.75, + height: + MediaQuery.of(context).size.height * + 0.75, + controller: _controller, ), ], ), @@ -100,64 +114,77 @@ class _AddVerifyMedicalReportState extends State { // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = await HtmlEditor.getText(); + txtOfMedicalReport = await _controller.getText(); - if (txtOfMedicalReport.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); + if (txtOfMedicalReport.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + widget.medicalReport != null + ? await widget.model!.updateMedicalReport( + widget.patient!, + txtOfMedicalReport, + widget.medicalReport! != null + ? widget.medicalReport!.lineItemNo! + : '', widget.medicalReport != null - ?await widget.model.updateMedicalReport( - widget.patient, - txtOfMedicalReport, - widget.medicalReport != null ? widget.medicalReport.lineItemNo : null, - widget.medicalReport != null ? widget.medicalReport.invoiceNo : null) - : await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); - //model.getMedicalReportList(patient); + ? widget.medicalReport!.invoiceNo! + : '') + : await widget.model!.addMedicalReport( + widget.patient!, txtOfMedicalReport); + //model.getMedicalReportList(patient); - Navigator.pop(context); + Navigator.pop(context); - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(widget.model.error); - } - } else { - DrAppToastMsg.showErrorToast("Please enter medical note"); + GifLoaderDialogUtils.hideDialog(context); + if (widget.model!.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + widget.model!.error); + } + } else { + DrAppToastMsg.showErrorToast( + "Please enter medical note"); + } + }, + ), + ), + SizedBox( + width: 8, + ), + if (widget.medicalReport != null) + Expanded( + child: AppButton( + title: widget.status == MedicalReportStatus.ADD + ? TranslationBase.of(context).add + : TranslationBase.of(context).verify, + color: Color(0xff359846), + fontWeight: FontWeight.w700, + onPressed: () async { + txtOfMedicalReport = + await _controller.getText(); + if (txtOfMedicalReport.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + await widget.model!.verifyMedicalReport( + widget.patient!, widget.medicalReport!); + GifLoaderDialogUtils.hideDialog(context); + Navigator.pop(context); + if (widget.model!.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + widget.model!.error); } - }, - ), - ), - SizedBox( - width: 8, + } else { + DrAppToastMsg.showErrorToast( + "Please enter medical note"); + } + }, ), - if (widget.medicalReport != null) - Expanded( - child: AppButton( - title: widget.status == MedicalReportStatus.ADD - ? TranslationBase.of(context).add - : TranslationBase.of(context).verify, - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () async { - txtOfMedicalReport = await HtmlEditor.getText(); - if (txtOfMedicalReport.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport); - GifLoaderDialogUtils.hideDialog(context); - Navigator.pop(context); - if (widget.model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(widget.model.error); - } - } else { - DrAppToastMsg.showErrorToast("Please enter medical note"); - } - }, - ), - ), - ], - ), - ), - ], + ), + ], + ), ), - )); + ], + ), + )); } void requestPermissions() async { diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index ab24f8e0..c22511af 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -20,7 +20,7 @@ class MedicalReportDetailPage extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index bb03a9bc..c794edae 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -34,7 +35,7 @@ class MedicalReportPage extends StatefulWidget { class _MedicalReportPageState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -49,9 +50,8 @@ class _MedicalReportPageState extends State { baseViewModel: model, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: PatientProfileAppBar( - patient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( @@ -85,22 +85,21 @@ class _MedicalReportPageState extends State { await locator().logEvent( eventCategory: "Medical Report Page", eventAction: "Add New Medical Report", - ); - Navigator.push( + );Navigator.push( context, MaterialPageRoute( builder: (context) => AddVerifyMedicalReport( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - model: model, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + model: model, status: MedicalReportStatus.ADD, - ), + ), settings: RouteSettings(name: 'AddVerifyMedicalReport'), ), ); }, - label: TranslationBase.of(context).createNewMedicalReport, + label: TranslationBase.of(context).createNewMedicalReport!, ), // if (model.state != ViewState.ErrorLocal)ß ...List.generate( @@ -169,13 +168,13 @@ class _MedicalReportPageState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}', + '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index]!.editedOn! ?? model.medicalReportList[index].createdOn!, "dd MMM yyyy")}', color: Color(0xFF2E303A), fontWeight: FontWeight.w600, fontSize: 1.6 * SizeConfig.textMultiplier, ), AppText( - '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}', + '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index]!.editedOn! ?? model.medicalReportList[index]!.createdOn!, "hh:mm a")}', color: Color(0xFF2E303A), fontWeight: FontWeight.w600, fontSize: 1.5 * SizeConfig.textMultiplier, @@ -191,8 +190,8 @@ class _MedicalReportPageState extends State { margin: EdgeInsets.only(left: 0, top: 4, right: 8, bottom: 0), child: LargeAvatar( name: projectViewModel.isArabic - ? model.medicalReportList[index].doctorNameN - : model.medicalReportList[index].doctorName, + ? model.medicalReportList[index].doctorNameN??"" + : model.medicalReportList[index].doctorName??"", url: model.medicalReportList[index].doctorImageURL, ), width: 50, diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index 3e07f76e..5fe9b4b4 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; @@ -35,22 +34,21 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class ProgressNoteScreen extends StatefulWidget { final int visitType; - const ProgressNoteScreen({Key key, this.visitType}) : super(key: key); + const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - List notesList; + late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; - getProgressNoteList(BuildContext context, PatientViewModel model, - {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); @@ -59,15 +57,12 @@ class _ProgressNoteState extends State { ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( visitType: widget.visitType, // if equal 5 then this will return progress note - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient.admissionNo ?? ""), projectID: patient.projectId, tokenID: token, patientTypeID: patient.patientType, languageID: 2); - model - .getPatientProgressNote(progressNoteRequest.toJson(), - isLocalBusy: isLocalBusy) - .then((c) { + model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) { notesList = model.patientProgressNoteList; }); } @@ -76,11 +71,10 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; - if (routeArgs.containsKey('isDischargedPatient')) - isDischargedPatient = routeArgs['isDischargedPatient']; + if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => getProgressNoteList(context, model), builder: (_, model, w) => AppScaffold( @@ -92,578 +86,473 @@ class _ProgressNoteState extends State { ), isShowAppBar: true, body: model.patientProgressNoteList == null || - model.patientProgressNoteList.length == 0 + model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) + error: TranslationBase.of(context).errorNoProgressNote!) : Container( - color: Colors.grey[200], - child: Column( - children: [ - if (!isDischargedPatient) - AddNewOrder( - onTap: () async { - await locator().logEvent( - eventCategory: "Progress Note Screen", - eventAction: "Update Progress Note", - ); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateNoteOrder( - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: false, - ), - settings: RouteSettings(name: 'UpdateNoteOrder'), - ), - ); - }, - label: widget.visitType == 3 - ? TranslationBase.of(context).addNewOrderSheet - : TranslationBase.of(context).addProgressNote, + color: Colors.grey[200], + child: Column( + children: [ + if (!isDischargedPatient) + AddNewOrder( + onTap: () async { + await locator().logEvent( + eventCategory: "Progress Note Screen", + eventAction: "Update Progress Note", + ); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: false, + ), + settings: RouteSettings(name: 'UpdateNoteOrder'), ), - Expanded( - child: Container( - child: ListView.builder( - itemCount: model.patientProgressNoteList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: model.patientProgressNoteList[index] - .status == - 1 && - authenticationViewModel - .doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy - ? Color(0xFFCC9B14) - : model.patientProgressNoteList[index] - .status == - 4 - ? Colors.red.shade700 - : model.patientProgressNoteList[index] - .status == - 2 - ? AppGlobal.appGreenColor - : Color(0xFFCC9B14), - widget: Column( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - if (model - .patientProgressNoteList[ - index] - .status == - 1 && - authenticationViewModel - .doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy) - AppText( + ); + }, + label: widget.visitType == 3 + ? TranslationBase.of(context).addNewOrderSheet! + : TranslationBase.of(context).addProgressNote!, + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index] + .status == + 1 && + authenticationViewModel + .doctorProfile!.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy + ? Color(0xFFCC9B14) + : model.patientProgressNoteList[index] + .status == + 4 + ? Colors.red.shade700 + : model.patientProgressNoteList[index] + .status == + 2 + ? Colors.green[600]! + : Color(0xFFCC9B14), + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (model + .patientProgressNoteList[ + index] + .status == + 1 && + authenticationViewModel + .doctorProfile!.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy) + AppText( - TranslationBase.of(context) - .notePending, + TranslationBase.of(context) + .notePending, - fontWeight: FontWeight.bold, - color: Color(0xFFCC9B14), - fontSize: 12, - ), - if (model - .patientProgressNoteList[ - index] - .status == - 4) - AppText( - TranslationBase.of(context) - .noteCanceled, - fontWeight: FontWeight.bold, - color: Colors.red.shade700, - fontSize: 12, - ), - if (model - .patientProgressNoteList[ - index] - .status == - 2) - AppText( - TranslationBase.of(context) - .noteVerified, - fontWeight: FontWeight.bold, - color: AppGlobal.appGreenColor, - fontSize: 12, - ), - if (model.patientProgressNoteList[index].status != 2 && - model - .patientProgressNoteList[ - index] - .status != - 4 && - authenticationViewModel - .doctorProfile.doctorID == - model - .patientProgressNoteList[ - index] - .createdBy) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - UpdateNoteOrder( - note: model - .patientProgressNoteList[ - index], - patientModel: - model, - patient: - patient, - visitType: widget - .visitType, - isUpdate: true, - )), - ); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 12, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 4) + AppText( + TranslationBase.of(context) + .noteCanceled, + fontWeight: FontWeight.bold, + color: Colors.red.shade700, + fontSize: 12, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 2) + AppText( + TranslationBase.of(context) + .noteVerified, + fontWeight: FontWeight.bold, + color: Colors.green[600], + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status != 2 && + model + .patientProgressNoteList[ + index] + .status != + 4 && + authenticationViewModel + .doctorProfile!.doctorID == + model + .patientProgressNoteList[ + index] + .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateNoteOrder( + note: model + .patientProgressNoteList[ + index], + patientModel: + model, + patient: + patient, + visitType: widget + .visitType, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - DoctorApp.edit_1, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of( - context) - .update, - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: "verify", - confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( - context); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: int - .parse(patient - .admissionNo), - cancelledNote: - false, - lineItemNo: model - .patientProgressNoteList[ - index] - .lineItemNo, - createdBy: model - .patientProgressNoteList[ - index] - .createdBy, - notes: model - .patientProgressNoteList[ - index] - .notes, - verifiedNote: true, - patientTypeID: - patient - .patientType, - patientOutSA: false, - ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, - isLocalBusy: - true); - GifLoaderDialogUtils - .hideDialog( - context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: AppGlobal.appGreenColor, - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - FontAwesomeIcons - .check, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of( - context) - .noteVerify, - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + SizedBox( + width: 2, ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: - TranslationBase.of( - context) - .cancel, - confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( - context, - ); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: int - .parse(patient - .admissionNo), - cancelledNote: true, - lineItemNo: model - .patientProgressNoteList[ - index] - .lineItemNo, - createdBy: model - .patientProgressNoteList[ - index] - .createdBy, - notes: model - .patientProgressNoteList[ - index] - .notes, - verifiedNote: false, - patientTypeID: - patient - .patientType, - patientOutSA: false, - ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, - isLocalBusy: - true); - GifLoaderDialogUtils - .hideDialog( - context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.red[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - FontAwesomeIcons - .trash, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - 'Cancel', - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + AppText( + TranslationBase.of(context).update, + fontSize: 10, + color: Colors.white, ), - ), - SizedBox( - width: 10, - ) - ], + ], + ), + padding: EdgeInsets.all(6), ), + ), SizedBox( - height: 10, + width: 10, ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.60, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .createdBy, - fontSize: 10, - ), - Expanded( - child: AppText( - model - .patientProgressNoteList[ - index] - .doctorName ?? - '', - fontWeight: - FontWeight.w600, - fontSize: 12, - isCopyable:true, - ), - ), - ], - ), - ], - ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "verify", + confirmFun: () async { + GifLoaderDialogUtils.showMyDialog(context); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo ?? ""), + cancelledNote: false, + lineItemNo: + model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, + verifiedNote: true, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, + isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: BorderRadius.circular(10), ), - Column( + // color:Colors.red[600], + + child: Row( children: [ - AppText( - model - .patientProgressNoteList[ - index] - .createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .getDateTimeFromServerFormat(model - .patientProgressNoteList[ - index] - .createdOn), - isArabic: - projectViewModel - .isArabic, - isMonthShort: true) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now(), - isArabic: - projectViewModel - .isArabic), - fontWeight: FontWeight.w600, - fontSize: 14, - isCopyable:true, + Icon( + FontAwesomeIcons.check, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, ), AppText( - model - .patientProgressNoteList[ - index] - .createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils - .getDateTimeFromServerFormat(model - .patientProgressNoteList[ - index] - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - isCopyable:true, + TranslationBase.of(context).noteVerify, + fontSize: 10, + color: Colors.white, ), ], - crossAxisAlignment: - CrossAxisAlignment.end, - ) - ], + ), + padding: EdgeInsets.all(6), + ), ), SizedBox( - height: 8, + width: 10, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - model - .patientProgressNoteList[ - index] - .notes, + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: TranslationBase.of(context).cancel!, + confirmFun: () async { + GifLoaderDialogUtils.showMyDialog( + context, + ); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo ?? ""), + cancelledNote: true, + lineItemNo: + model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, + verifiedNote: false, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, + isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[600], + borderRadius: BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + FontAwesomeIcons.trash, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Cancel', fontSize: 10, - isCopyable:true, + color: Colors.white, ), - ), - ]) + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ) ], ), - SizedBox( - height: 20, + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.60, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).createdBy, + fontSize: 10, + ), + Expanded( + child: AppText( + model.patientProgressNoteList[index].doctorName ?? '', + fontWeight: FontWeight.w600, + fontSize: 12, + isCopyable:true,), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model.patientProgressNoteList[index].createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.getDateTimeFromServerFormat( + model.patientProgressNoteList[index].createdOn ?? ""), + isArabic: projectViewModel.isArabic, + isMonthShort: true): AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), + isArabic: projectViewModel.isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable:true,), + AppText( + model.patientProgressNoteList[index].createdOn != null + ? AppDateUtils.getHour( + AppDateUtils.getDateTimeFromServerFormat( + model.patientProgressNoteList[index].createdOn ?? "")) + : AppDateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14,isCopyable:true, + ), + ], + crossAxisAlignment: CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row(mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + child: AppText( + model.patientProgressNoteList[index].notes, + fontSize: 10,isCopyable:true, + ), ), - ], - ), + ]) + ], ), - ); - }), - ), - ), - ], + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), ), ), + ], + ), + ), ), ); } - showMyDialog({BuildContext context, Function confirmFun, String actionName}) { + showMyDialog({required BuildContext context, required Function confirmFun, required String actionName}) { showDialog( context: context, builder: (ctx) => Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.8, - height: 200, - child: AppScaffold( - isShowAppBar: false, - body: Container( - color: Colors.white, - child: Center( - child: Column( + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + height: 200, + child: AppScaffold( + isShowAppBar: false, + body: Container( + color: Colors.white, + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // SizedBox(height: 20,), + SizedBox( + height: 10, + ), + Row( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: [ - // SizedBox(height: 20,), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).noteConfirm, - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, - ), - ], - ), - SizedBox( - height: 10, - ), - DividerWithSpacesAround(), - SizedBox( - height: 12, + AppText( + TranslationBase.of(context).noteConfirm, + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, ), + ], + ), + SizedBox( + height: 10, + ), + DividerWithSpacesAround(), + SizedBox( + height: 12, + ), - Container( - padding: EdgeInsets.all(20), - color: Colors.white, - child: AppText( - projectViewModel.isArabic - ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" - : 'Are you sure you want $actionName this order?', - fontSize: 15, - textAlign: TextAlign.center, - ), - ), + Container( + padding: EdgeInsets.all(20), + color: Colors.white, + child: AppText( + projectViewModel.isArabic + ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" + : 'Are you sure you want $actionName this order?', + fontSize: 15, + textAlign: TextAlign.center, + ), + ), - SizedBox( - height: 8, - ), - DividerWithSpacesAround(), - FractionallySizedBox( - widthFactor: 0.75, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - FlatButton( - child: AppText( - TranslationBase.of(context).cancel, - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, - ), //Text("Cancel"), - onPressed: () { - Navigator.of(context).pop(); - }), - FlatButton( - child: AppText( - TranslationBase.of(context).noteConfirm, - fontWeight: FontWeight.w600, - color: Colors.red.shade700, - fontSize: 16, - ), //Text("Confirm", ), - onPressed: () async { - await confirmFun(); - Navigator.of(context).pop(); - }) - ], - ), - ) - ], + SizedBox( + height: 8, ), - ), + DividerWithSpacesAround(), + FractionallySizedBox( + widthFactor: 0.75, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + FlatButton( + child: AppText( + TranslationBase.of(context).cancel, + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, + ), //Text("Cancel"), + onPressed: () { + Navigator.of(context).pop(); + }), + FlatButton( + child: AppText( + TranslationBase.of(context).noteConfirm, + fontWeight: FontWeight.w600, + color: Colors.red.shade700, + fontSize: 16, + ), //Text("Confirm", ), + onPressed: () async { + await confirmFun(); + Navigator.of(context).pop(); + }) + ], + ), + ) + ], ), ), ), - )); + ), + ), + )); } } diff --git a/lib/screens/patients/profile/notes/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart index 3fde4262..300c9560 100644 --- a/lib/screens/patients/profile/notes/note/update_note.dart +++ b/lib/screens/patients/profile/notes/note/update_note.dart @@ -28,19 +28,19 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class UpdateNoteOrder extends StatefulWidget { - final NoteModel note; + final NoteModel? note; final PatientViewModel patientModel; final PatiantInformtion patient; final int visitType; final bool isUpdate; const UpdateNoteOrder( - {Key key, + {Key? key, this.note, - this.patientModel, - this.patient, - this.visitType, - this.isUpdate}) + required this.patientModel, + required this.patient, + required this.visitType, + required this.isUpdate}) : super(key: key); @override @@ -48,12 +48,12 @@ class UpdateNoteOrder extends StatefulWidget { } class _UpdateNoteOrderState extends State { - int selectedType; + int? selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - ProjectViewModel projectViewModel; + ProjectViewModel? projectViewModel; TextEditingController progressNoteController = TextEditingController(); @@ -81,7 +81,7 @@ class _UpdateNoteOrderState extends State { projectViewModel = Provider.of(context); if (widget.note != null) { - progressNoteController.text = widget.note.notes; + progressNoteController.text = widget.note!.notes!; } return AppScaffold( @@ -99,12 +99,12 @@ class _UpdateNoteOrderState extends State { title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).orderSheet! : (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).progressNote!, ), SizedBox( height: 10.0, @@ -119,17 +119,13 @@ class _UpdateNoteOrderState extends State { AppTextFieldCustom( hintText: widget.visitType == 3 ? (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).orderSheet + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).orderSheet! : (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).progressNote, + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).progressNote!, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 35, @@ -144,11 +140,8 @@ class _UpdateNoteOrderState extends State { : null, ), Positioned( - top: - -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, + top: -2, //MediaQuery.of(context).size.height * 0, + right: projectViewModel!.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, child: Column( children: [ IconButton( @@ -195,12 +188,12 @@ class _UpdateNoteOrderState extends State { title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).orderSheet! : (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + ? TranslationBase.of(context).noteUpdate! + : TranslationBase.of(context).noteAdd!) + + TranslationBase.of(context).progressNote!, color: Color(0xff359846), // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, @@ -217,10 +210,10 @@ class _UpdateNoteOrderState extends State { if (widget.isUpdate) { UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient!.admissionNo!), cancelledNote: false, - lineItemNo: widget.note.lineItemNo, - createdBy: widget.note.createdBy, + lineItemNo: widget.note!.lineItemNo, + createdBy: widget.note?.createdBy, notes: progressNoteController.text, verifiedNote: false, patientTypeID: widget.patient.patientType, @@ -231,8 +224,8 @@ class _UpdateNoteOrderState extends State { } else { CreateNoteModel reqModel = CreateNoteModel( admissionNo: - int.parse(widget.patient.admissionNo), - createdBy: doctorProfile.doctorID, + int.parse(widget.patient!.admissionNo!), + createdBy: doctorProfile!.doctorID, visitType: widget.visitType, patientID: widget.patient.patientId, nursingRemarks: ' ', @@ -252,7 +245,7 @@ class _UpdateNoteOrderState extends State { visitType: widget.visitType, // if equal 5 then this will return progress note admissionNo: - int.parse(widget.patient.admissionNo), + int.parse(widget.patient!.admissionNo!), projectID: widget.patient.projectId, patientTypeID: widget.patient.patientType, languageID: 2); diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 3c67014e..90adbba9 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -32,30 +32,30 @@ import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class NursingProgressNoteScreen extends StatefulWidget { - const NursingProgressNoteScreen({Key key}) : super(key: key); + const NursingProgressNoteScreen({Key? key}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - List notesList; + late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); print(type); GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = GetNursingProgressNoteRequestModel( - admissionNo: int.parse(patient.admissionNo), - patientTypeID: patient.patientType, + admissionNo: int.parse(patient!.admissionNo!), + patientTypeID: patient!.patientType!, patientID: patient.patientId, setupID: "010266"); model.getNursingProgressNote(getNursingProgressNoteRequestModel); @@ -65,7 +65,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; @@ -84,7 +84,7 @@ class _ProgressNoteState extends State { model.patientNursingProgressNoteList.length == 0 ? Center( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, + error: TranslationBase.of(context)!.noDataAvailable!, ), ) : Container( @@ -168,8 +168,8 @@ class _ProgressNoteState extends State { AppDateUtils .getDateTimeFromServerFormat(model .patientNursingProgressNoteList[ - index] - .createdOn), + index]! + .createdOn!), isArabic: projectViewModel .isArabic, @@ -194,8 +194,8 @@ class _ProgressNoteState extends State { AppDateUtils .getDateTimeFromServerFormat(model .patientNursingProgressNoteList[ - index] - .createdOn)) + index]! + .createdOn!)) : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 7df24564..37ed90ce 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -34,31 +34,30 @@ import '../../../../widgets/shared/app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class OperationReportScreen extends StatefulWidget { - final int visitType; - const OperationReportScreen({Key key, this.visitType}) : super(key: key); + const OperationReportScreen({Key? key}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - List notesList; + late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( - onModelReady: (model) => model.getReservations(patient.patientMRN), + onModelReady: (model) => model.getReservations(patient!.patientMRN!), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -74,7 +73,7 @@ class _ProgressNoteState extends State { model.reservationList == null || model.reservationList.length == 0 ? Center( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, ), + error: TranslationBase.of(context).noDataAvailable!, ), ): Column( children: [ Expanded( @@ -286,7 +285,7 @@ class _ProgressNoteState extends State { // if ( // authenticationViewModel - // .doctorProfile.doctorID == + // .doctorProfile!.doctorID == // model // .operationReportList[ // index] diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 85c36bae..a23ec9a4 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -134,7 +134,7 @@ class _UpdateOperationReportState extends State { baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, appBar: BottomSheetTitle( - title: TranslationBase.of(context).operationReports, + title: TranslationBase.of(context).operationReports!, ), body: SingleChildScrollView( child: Container( @@ -219,7 +219,7 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText:TranslationBase.of(context).assistant, + hintText:TranslationBase.of(context).assistant!, controller: assistantNoteController, maxLines: 1, minLines: 1, @@ -237,8 +237,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).operation, + hintText: "Operation", + //TranslationBase.of(context).addoperationReports, controller: operationController, maxLines: 20, minLines: 4, @@ -523,8 +523,8 @@ class _UpdateOperationReportState extends State { child: AppButton( title: (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) +" "+ - TranslationBase.of(context).operationReports, + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).operationReports!, color: Color(0xff359846), // disabled: operationReportsController.text.isEmpty, fontWeight: FontWeight.w700, @@ -579,9 +579,9 @@ class _UpdateOperationReportState extends State { bloodLossDetailController.text, patientID: widget.patient.patientId, admissionNo: int.parse( - widget.patient.admissionNo), + widget.patient!.admissionNo!), createdBy: - model.doctorProfile.doctorID, + model.doctorProfile!.doctorID, setupID: "010266"); await model.updateOperationReport( createUpdateOperationReportRequestModel); diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index 0909376d..a3eef424 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -36,7 +36,7 @@ class PendingOrdersScreen extends StatelessWidget { model.pendingOrdersList.length == 0 ? Center( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, ), + error: TranslationBase.of(context).noDataAvailable!, ), ) : Column( children: [ diff --git a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart index ca8be2c0..7df00041 100644 --- a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart +++ b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart @@ -17,10 +17,10 @@ class InpatientPrescriptionDetailsScreen extends StatefulWidget { class _InpatientPrescriptionDetailsScreenState extends State { bool _showDetails = false; - String error; - TextEditingController answerController; + String? error; + TextEditingController? answerController; bool _isInit = true; - PrescriptionReportForInPatient prescription; + late PrescriptionReportForInPatient prescription; @override void initState() { @@ -31,7 +31,7 @@ class _InpatientPrescriptionDetailsScreenState void didChangeDependencies() { super.didChangeDependencies(); if (_isInit) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; prescription = routeArgs['prescription']; } _isInit = false; @@ -40,7 +40,7 @@ class _InpatientPrescriptionDetailsScreenState @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).prescriptionInfo, + appBarTitle: TranslationBase.of(context).prescriptionInfo ?? "", body: CardWithBgWidgetNew( widget: Container( child: ListView( @@ -96,11 +96,11 @@ class _InpatientPrescriptionDetailsScreenState key: 'UOM'), buildTableRow( des: - '${AppDateUtils.getDate(prescription.startDatetime)}', + '${AppDateUtils.getDate(prescription.startDatetime!)}', key: 'Start Date'), buildTableRow( des: - '${AppDateUtils.getDate(prescription.stopDatetime)}', + '${AppDateUtils.getDate(prescription.stopDatetime!)}', key: 'Stop Date'), buildTableRow( des: '${prescription.noOfDoses}', @@ -115,7 +115,7 @@ class _InpatientPrescriptionDetailsScreenState key: 'Pharmacy Remarks'), buildTableRow( des: - '${AppDateUtils.getDate(prescription.prescriptionDatetime)}', + '${AppDateUtils.getDate(prescription.prescriptionDatetime!)}', key: 'Prescription Date'), buildTableRow( des: '${prescription.refillID}', diff --git a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart index 50585143..75300769 100644 --- a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart +++ b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; class OutPatientPrescriptionDetailsItem extends StatefulWidget { final PrescriptionReport prescriptionReport; - OutPatientPrescriptionDetailsItem({Key key, this.prescriptionReport}); + OutPatientPrescriptionDetailsItem({Key? key, required this.prescriptionReport}); @override _OutPatientPrescriptionDetailsItemState createState() => diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart index e4351d91..9af68ead 100644 --- a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -8,12 +8,12 @@ class PatientProfileCardModel { final bool isInPatient; final bool isDisable; final bool isLoading; - final Function onTap; + final GestureTapCallback? onTap; final bool isDischargedPatient; final bool isSelectInpatient; final bool isDartIcon; - final IconData dartIcon; - final Color color; + final IconData? dartIcon; + final Color? color; PatientProfileCardModel( this.nameLine1, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 142efba6..2de6c04c 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -36,14 +36,14 @@ class ProfileGridForInPatient extends StatelessWidget { Widget build(BuildContext context) { final List cardsList = [ PatientProfileCardModel( - TranslationBase.of(context).vital , - TranslationBase.of(context).signs , + TranslationBase.of(context).vital ?? "", + TranslationBase.of(context).signs ?? "", VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab , - TranslationBase.of(context).result , + TranslationBase.of(context).lab ?? "", + TranslationBase.of(context).result ?? "", LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), @@ -54,116 +54,116 @@ class ProfileGridForInPatient extends StatelessWidget { 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).result, + TranslationBase.of(context).radiology!, + TranslationBase.of(context).result!, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/Radiology.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).prescription, + TranslationBase.of(context).patient!, + TranslationBase.of(context).prescription!, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).progress, - TranslationBase.of(context).note, + TranslationBase.of(context).progress!, + TranslationBase.of(context).note!, PROGRESS_NOTE, 'assets/images/svgs/profile_screen/Progress notes.svg', isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), PatientProfileCardModel( - TranslationBase.of(context).order, - TranslationBase.of(context).sheet, + TranslationBase.of(context).order!, + TranslationBase.of(context).sheet!, ORDER_NOTE, 'assets/images/svgs/profile_screen/order sheets.svg', isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, + TranslationBase.of(context).orders!, + TranslationBase.of(context).procedures!, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, + TranslationBase.of(context).health!, + TranslationBase.of(context).summary!, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).medical, - TranslationBase.of(context).report, + TranslationBase.of(context).medical!, + TranslationBase.of(context).report!, PATIENT_MEDICAL_REPORT, 'assets/images/svgs/profile_screen/medical report.svg', isInPatient: isInpatient, isDisable: false), PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, + TranslationBase.of(context).referral!, + TranslationBase.of(context).patient!, REFER_IN_PATIENT_TO_DOCTOR, 'assets/images/svgs/profile_screen/refer patient.svg', isInPatient: isInpatient, isDisable: isDischargedPatient || isFromSearch, ), PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).approvals, + TranslationBase.of(context).insurance!, + TranslationBase.of(context).approvals!, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).discharge, - TranslationBase.of(context).report, + TranslationBase.of(context).discharge!, + TranslationBase.of(context).report!, DISCHARGE_SUMMARY, 'assets/images/svgs/profile_screen/discharge summary.svg', isInPatient: isInpatient, ), PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, + TranslationBase.of(context).patientSick!, + TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient, ), PatientProfileCardModel( - TranslationBase.of(context).operation, - TranslationBase.of(context).report, + "Operation", + "Report", GET_OPERATION_REPORT, 'assets/images/svgs/profile_screen/operating report.svg', isInPatient: isInpatient, ), PatientProfileCardModel( - TranslationBase.of(context).pending, - TranslationBase.of(context).orders, + TranslationBase.of(context).pending!, + TranslationBase.of(context).orders!, PENDING_ORDERS, 'assets/images/svgs/profile_screen/pending orders.svg', isInPatient: isInpatient, ), PatientProfileCardModel( - TranslationBase.of(context).admission, - TranslationBase.of(context).orders, + TranslationBase.of(context).admission!, + TranslationBase.of(context).orders!, ADMISSION_ORDERS, 'assets/images/svgs/profile_screen/admission req.svg', isInPatient: isInpatient, ), PatientProfileCardModel( "Nursing", - TranslationBase.of(context).progressNote, + TranslationBase.of(context).progressNote!, NURSING_PROGRESS_NOTE, 'assets/images/svgs/profile_screen/Progress notes.svg', isInPatient: isInpatient, ), PatientProfileCardModel( - TranslationBase.of(context).diagnosis, + TranslationBase.of(context).diagnosis!, "", DIAGNOSIS_FOR_IN_PATIENT, 'assets/images/svgs/profile_screen/diagnosis.svg', isInPatient: isInpatient, ), PatientProfileCardModel( - TranslationBase.of(context).diabetic, - TranslationBase.of(context).chart, + TranslationBase.of(context).diabetic!, + TranslationBase.of(context).chart!, DIABETIC_CHART_VALUES, 'assets/images/svgs/profile_screen/diabetic chart.svg', isInPatient: isInpatient, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 51fae4c9..e8013bc9 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -34,14 +34,14 @@ class ProfileGridForOther extends StatelessWidget { Widget build(BuildContext context) { final List cardsList = [ PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, + TranslationBase.of(context).vital!, + TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, + TranslationBase.of(context).lab!, + TranslationBase.of(context).result!, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), @@ -64,37 +64,37 @@ class ProfileGridForOther extends StatelessWidget { 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, + TranslationBase.of(context).health!, + TranslationBase.of(context).summary!, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", + PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, + TranslationBase.of(context).orders!, + TranslationBase.of(context).procedures!, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).service, + TranslationBase.of(context).insurance!, + TranslationBase.of(context).service!, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, + TranslationBase.of(context).patientSick!, + TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).ucaf, + TranslationBase.of(context).patient!, + TranslationBase.of(context).ucaf!, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg', isInPatient: isInpatient, @@ -105,8 +105,8 @@ class ProfileGridForOther extends StatelessWidget { if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, + TranslationBase.of(context).referral!, + TranslationBase.of(context).patient!, REFER_PATIENT_TO_DOCTOR, 'assets/images/svgs/profile_screen/refer patient.svg', isInPatient: isInpatient, @@ -118,8 +118,8 @@ class ProfileGridForOther extends StatelessWidget { if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel( - TranslationBase.of(context).admission, - TranslationBase.of(context).request, + TranslationBase.of(context).admission!, + TranslationBase.of(context).request!, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg', isInPatient: isInpatient, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index 87fceb48..cfd7f160 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -31,14 +31,14 @@ class ProfileGridForSearch extends StatelessWidget { Widget build(BuildContext context) { final List cardsList = [ PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, + TranslationBase.of(context).vital!, + TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, + TranslationBase.of(context).lab!, + TranslationBase.of(context).result!, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), @@ -61,52 +61,52 @@ class ProfileGridForSearch extends StatelessWidget { 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, + TranslationBase.of(context).health!, + TranslationBase.of(context).summary!, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", + PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, + TranslationBase.of(context).orders!, + TranslationBase.of(context).procedures!, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).service, + TranslationBase.of(context).insurance!, + TranslationBase.of(context).service!, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, + TranslationBase.of(context).patientSick!, + TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient), if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).ucaf, + TranslationBase.of(context).patient!, + TranslationBase.of(context).ucaf!, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg', isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, + TranslationBase.of(context).referral!, + TranslationBase.of(context).patient!, REFER_PATIENT_TO_DOCTOR, 'assets/images/svgs/profile_screen/refer patient.svg', isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileCardModel( - TranslationBase.of(context).admission, - TranslationBase.of(context).request, + TranslationBase.of(context).admission!, + TranslationBase.of(context).request!, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg', isInPatient: isInpatient, diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 1e742de9..d03bc10c 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -17,12 +17,13 @@ import '../../../../locator.dart'; class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; final PatiantInformtion patient; - final String patientType; - final String arrivalType; + final String? patientType; + final String? arrivalType; final bool isInpatient; RadiologyDetailsPage( - {Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false}); + {Key? key, required this.finalRadiology, required this.patient, this.patientType, this.arrivalType, + this.isInpatient = false}); @override Widget build(BuildContext context) { @@ -106,7 +107,7 @@ class RadiologyDetailsPage extends StatelessWidget { ); launch(model.radImageURL); }, - label: TranslationBase.of(context).openRad, + label: TranslationBase.of(context).openRad ?? "", ), ), ) diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 958301fd..8179e25a 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; @@ -23,16 +24,16 @@ class RadiologyHomePage extends StatefulWidget { } class _RadiologyHomePageState extends State { - String patientType; - PatiantInformtion patient; - String arrivalType; - bool isInpatient; - bool isFromLiveCare; + String? patientType; + late PatiantInformtion patient; + late String arrivalType; + late bool isInpatient; + late bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -50,10 +51,8 @@ class _RadiologyHomePageState extends State { isShowAppBar: true, backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient:isInpatient,), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -118,7 +117,7 @@ class _RadiologyHomePageState extends State { settingRoute: 'AddProcedureTabPage'), ); }, - label: TranslationBase.of(context).applyForRadiologyOrder, + label: TranslationBase.of(context).applyForRadiologyOrder ?? "", ), ...List.generate( model.radiologyList.length, @@ -140,9 +139,9 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index].isLiveCareAppodynamicment + color: model.radiologyList[index].isLiveCareAppodynamicment! ? Colors.red[900] - : !model.radiologyList[index].isInOutPatient + : !model.radiologyList[index].isInOutPatient! ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -155,11 +154,11 @@ class _RadiologyHomePageState extends State { quarterTurns: 3, child: Center( child: Text( - model.radiologyList[index].isLiveCareAppodynamicment - ? TranslationBase.of(context).liveCare.toUpperCase() - : !model.radiologyList[index].isInOutPatient - ? TranslationBase.of(context).inPatientLabel.toUpperCase() - : TranslationBase.of(context).outpatient.toUpperCase(), + model.radiologyList[index]!.isLiveCareAppodynamicment! + ? TranslationBase.of(context).liveCare!.toUpperCase() + : !model.radiologyList[index].isInOutPatient! + ? TranslationBase.of(context).inPatientLabel!.toUpperCase() + : TranslationBase.of(context).outpatient!.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -173,7 +172,7 @@ class _RadiologyHomePageState extends State { branch: '${model.radiologyList[index].projectName}', clinic: model.radiologyList[index].clinicDescription, appointmentDate: - model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate, + model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate!, onTap: () { Navigator.push( context, diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index e7714074..3bb7f94d 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -11,12 +11,12 @@ class RadiologyReportScreen extends StatelessWidget { final String reportData; final String url; - RadiologyReportScreen({Key key, this.reportData, this.url}); + RadiologyReportScreen({Key? key, required this.reportData, required this.url}); @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).radiologyReport, + appBarTitle: TranslationBase.of(context).radiologyReport ?? "", body: SingleChildScrollView( child: Column( children: [ diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 15d176d0..05bd2305 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -26,13 +26,11 @@ import 'ReplySummeryOnReferralPatient.dart'; class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; - final AddReferredRemarksRequestModel myReferralInPatientRequestModel; - final bool isEdited; + final AddReferredRemarksRequestModel? myReferralInPatientRequestModel; + final bool? isEdited; const AddReplayOnReferralPatient( - {Key key, - this.patientReferralViewModel, - this.myReferralInPatientModel, + {Key? key, required this.patientReferralViewModel, required this.myReferralInPatientModel, this.isEdited, this.myReferralInPatientRequestModel}) : super(key: key); diff --git a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart index 72bd6825..4c162ea5 100644 --- a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart @@ -38,7 +38,7 @@ class _ReplySummeryOnReferralPatientState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).summeryReply, + appBarTitle: TranslationBase.of(context).summeryReply!, body: Container( child: Column( children: [ diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 58569dc1..be7cbd91 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -19,7 +19,7 @@ import 'package:flutter/material.dart'; class MyReferralDetailScreen extends StatelessWidget { final MyReferralPatientModel? referralPatient; - const MyReferralDetailScreen({Key key, this.referralPatient}) + const MyReferralDetailScreen({Key? key, this.referralPatient}) : super(key: key); @override diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index b2242ff7..94c1b66e 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -32,7 +32,7 @@ class _MyReferralInPatientScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient ?? "", body: Column( children: [ Container( @@ -112,8 +112,8 @@ class _MyReferralInPatientScreenState extends State { child: PatientReferralItemWidget( referralStatus: model.getReferralStatusNameByCode( - model.myReferralPatients[index] - .referralStatus, + model.myReferralPatients[index]! + .referralStatus!, context), referralStatusCode: model .myReferralPatients[index] @@ -125,11 +125,11 @@ class _MyReferralInPatientScreenState extends State { .myReferralPatients[index].gender, referredDate: AppDateUtils .getDayMonthYearDateFormatted(model - .myReferralPatients[index] - .referralDate), + .myReferralPatients[index]! + .referralDate!), referredTime: AppDateUtils.getTimeHHMMA( - model.myReferralPatients[index] - .referralDate), + model.myReferralPatients[index]! + .referralDate!!), patientID: "${model.myReferralPatients[index].patientID}", isSameBranch: false, diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index 2eefeb43..03488886 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -17,7 +17,7 @@ class MyReferralPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient ?? "", body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( child: Column( @@ -50,49 +50,30 @@ class MyReferralPatientScreen extends StatelessWidget { model.pendingReferral.length, (index) => InkWell( onTap: () { - Navigator.of(context).pushNamed(MY_REFERRAL_DETAIL, - arguments: { - 'referral': model.pendingReferral[index] - }); + Navigator.of(context) + .pushNamed(MY_REFERRAL_DETAIL, arguments: {'referral': model.pendingReferral[index]}); }, child: PatientReferralItemWidget( - referralStatus: - model.pendingReferral[index].referralStatus, - patientName: - model.pendingReferral[index].patientName, - patientGender: model - .pendingReferral[index].patientDetails.gender, - referredDate: model - .pendingReferral[index].referredOn - .split(" ")[0], - referredTime: model - .pendingReferral[index].referredOn - .split(" ")[1], - patientID: - "${model.pendingReferral[index].patientID}", - isSameBranch: model.pendingReferral[index] - .isReferralDoctorSameBranch, + referralStatus: model.pendingReferral[index].referralStatus, + patientName: model.pendingReferral[index].patientName, + patientGender: model.pendingReferral[index].patientDetails?.gender, + referredDate: model.pendingReferral[index].referredOn!.split(" ")[0], + referredTime: model.pendingReferral[index].referredOn!.split(" ")[1], + patientID: "${model.pendingReferral[index].patientID}", + isSameBranch: model.pendingReferral[index].isReferralDoctorSameBranch, isReferral: true, - remark: - model.pendingReferral[index].remarksFromSource, - nationality: model.pendingReferral[index] - .patientDetails.nationalityName, - nationalityFlag: - model.pendingReferral[index].nationalityFlagUrl, - doctorAvatar: - model.pendingReferral[index].doctorImageUrl, - referralDoctorName: model - .pendingReferral[index].referredByDoctorInfo, + remark: model.pendingReferral[index].remarksFromSource, + nationality: model.pendingReferral[index].patientDetails!.nationalityName, + nationalityFlag: model.pendingReferral[index].nationalityFlagUrl, + doctorAvatar: model.pendingReferral[index].doctorImageUrl, + referralDoctorName: model.pendingReferral[index].referredByDoctorInfo, clinicDescription: null, infoIcon: InkWell( onTap: () { - Navigator.of(context) - .pushNamed(MY_REFERRAL_DETAIL, arguments: { - 'referral': model.pendingReferral[index] - }); + Navigator.of(context).pushNamed(MY_REFERRAL_DETAIL, + arguments: {'referral': model.pendingReferral[index]}); }, - child: Icon(FontAwesomeIcons.arrowRight, - size: 25, color: Colors.black), + child: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), ), ), ), diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 59e58198..13bf0cb4 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -21,9 +21,8 @@ class PatientReferralScreen extends StatefulWidget { _PatientReferralScreen createState() => _PatientReferralScreen(); } -class _PatientReferralScreen extends State - with SingleTickerProviderStateMixin { - TabController _tabController; +class _PatientReferralScreen extends State with SingleTickerProviderStateMixin { + late TabController _tabController; int index = 0; @override @@ -52,9 +51,9 @@ class _PatientReferralScreen extends State return AppScaffold( isShowAppBar: true, appBar: PatientSearchHeader( - title: TranslationBase.of(context).patientsreferral, + title: TranslationBase.of(context).patientsreferral!, ), - appBarTitle: TranslationBase.of(context).patientsreferral, + appBarTitle: TranslationBase.of(context).patientsreferral!, body: Scaffold( extendBodyBehindAppBar: true, // backgroundColor: Colors.white, @@ -81,7 +80,7 @@ class _PatientReferralScreen extends State decoration: Helpers.getBoxTabsBoxDecoration( isActive: index == 0, isFirst: true, projectViewModel:projectsProvider ), child: Center( - child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient, isActive:index == 0 ) + child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient!, isActive:index == 0 ) ), ), Center( @@ -89,7 +88,7 @@ class _PatientReferralScreen extends State decoration:Helpers.getBoxTabsBoxDecoration( isActive: index == 1, isMiddle: true, projectViewModel:projectsProvider ), child: Center( - child:Helpers.getTabText(title:TranslationBase.of(context).referral, isActive:index == 1 ) + child:Helpers.getTabText(title:TranslationBase.of(context).referral!, isActive:index == 1 ) ), ), ), @@ -98,7 +97,7 @@ class _PatientReferralScreen extends State decoration:Helpers.getBoxTabsBoxDecoration( isActive: index == 2, isLast: true, projectViewModel:projectsProvider ), child: Center( - child: Helpers.getTabText(title:TranslationBase.of(context).discharged, isActive:index == 2 ), + child: Helpers.getTabText(title:TranslationBase.of(context).discharged!, isActive:index == 2 ), ), ), ), diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 41686ead..4fab04fb 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -31,8 +32,8 @@ class PatientMakeInPatientReferralScreen extends StatefulWidget { class _PatientMakeInPatientReferralScreenState extends State { - PatiantInformtion patient; - List referToList; + late PatiantInformtion patient; + late List referToList; dynamic _referTo; dynamic _selectedBranch; dynamic _selectedClinic; @@ -41,13 +42,13 @@ class _PatientMakeInPatientReferralScreenState final _remarksController = TextEditingController(); final _extController = TextEditingController(); int _activePriority = 1; - String appointmentDate; + late String appointmentDate; - String branchError; - String hospitalError; - String clinicError; - String doctorError; - String frequencyError; + String? branchError; + String? hospitalError; + String? clinicError; + String? doctorError; + String? frequencyError; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); @@ -121,12 +122,12 @@ class _PatientMakeInPatientReferralScreenState @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings!.arguments as Map; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; - referToList = List(); + referToList = []; dynamic sameBranch = { "id": 1, "name": TranslationBase.of(context).sameBranch @@ -144,12 +145,10 @@ class _PatientMakeInPatientReferralScreenState onModelReady: (model) => model.getReferralFrequencyList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient!, isShowAppBar: true, - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient:isInpatient,), body: SingleChildScrollView( child: Container( child: Column( @@ -593,9 +592,9 @@ class _PatientMakeInPatientReferralScreenState Widget priorityBar(BuildContext _context, Size screenSize) { List _priorities = [ - TranslationBase.of(context).veryUrgent.toUpperCase(), - TranslationBase.of(context).urgent.toUpperCase(), - TranslationBase.of(context).routine.toUpperCase(), + TranslationBase.of(context).veryUrgent!.toUpperCase(), + TranslationBase.of(context).urgent!.toUpperCase(), + TranslationBase.of(context).routine!.toUpperCase(), ]; return Container( height: screenSize.height * 0.070, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index bb89f6ce..5ade907e 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -23,24 +24,23 @@ import 'package:hexcolor/hexcolor.dart'; class PatientMakeReferralScreen extends StatefulWidget { // previous design page is: ReferPatientScreen @override - _PatientMakeReferralScreenState createState() => - _PatientMakeReferralScreenState(); + _PatientMakeReferralScreenState createState() => _PatientMakeReferralScreenState(); } class _PatientMakeReferralScreenState extends State { - PatiantInformtion patient; - List referToList; + late PatiantInformtion patient; + late List referToList; dynamic _referTo; dynamic _selectedBranch; dynamic _selectedClinic; dynamic _selectedDoctor; - DateTime appointmentDate; + late DateTime appointmentDate; final _remarksController = TextEditingController(); - String branchError = null; - String hospitalError = null; - String clinicError = null; - String doctorError = null; + String? branchError = null; + String? hospitalError = null; + String? clinicError = null; + String? doctorError = null; @override void initState() { @@ -51,12 +51,12 @@ class _PatientMakeReferralScreenState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings!.arguments as Map; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - referToList = List(); + referToList = []; dynamic sameBranch = { "id": 1, "name": TranslationBase.of(context).sameBranch @@ -74,9 +74,9 @@ class _PatientMakeReferralScreenState extends State { onModelReady: (model) => model.getPatientReferral(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient!, isShowAppBar: true, - appBar: PatientProfileAppBar(patient), + patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), body: SingleChildScrollView( child: Container( child: Column( @@ -110,57 +110,25 @@ class _PatientMakeReferralScreenState extends State { model.patientReferral.length == 0 ? referralForm(model, screenSize) : PatientReferralItemWidget( - referralStatus: model - .patientReferral[ - model.patientReferral.length - 1] - .referralStatus, - patientName: model - .patientReferral[ - model.patientReferral.length - 1] - .patientName, - patientGender: model - .patientReferral[ - model.patientReferral.length - 1] - .patientDetails - .gender, - referredDate: model - .patientReferral[ - model.patientReferral.length - 1] - .referredOn - .split(" ")[0], - referredTime: model - .patientReferral[ - model.patientReferral.length - 1] - .referredOn - .split(" ")[1], - patientID: - "${model.patientReferral[model.patientReferral.length - 1].patientID}", - isSameBranch: model - .patientReferral[ - model.patientReferral.length - 1] - .isReferralDoctorSameBranch, + referralStatus: model.patientReferral[model.patientReferral.length - 1].referralStatus, + patientName: model.patientReferral[model.patientReferral.length - 1].patientName, + patientGender: + model.patientReferral[model.patientReferral.length - 1].patientDetails!.gender, + referredDate: + model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[0], + referredTime: + model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[1], + patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}", + isSameBranch: + model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch, isReferral: true, - remark: model - .patientReferral[ - model.patientReferral.length - 1] - .remarksFromSource, - nationality: model - .patientReferral[ - model.patientReferral.length - 1] - .patientDetails - .nationalityName, - nationalityFlag: model - .patientReferral[ - model.patientReferral.length - 1] - .nationalityFlagUrl, - doctorAvatar: model - .patientReferral[ - model.patientReferral.length - 1] - .doctorImageUrl, - referralDoctorName: model - .patientReferral[ - model.patientReferral.length - 1] - .referredByDoctorInfo, + remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource, + nationality: + model.patientReferral[model.patientReferral.length - 1].patientDetails!.nationalityName, + nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl, + doctorAvatar: model.patientReferral[model.patientReferral.length - 1].doctorImageUrl, + referralDoctorName: + model.patientReferral[model.patientReferral.length - 1].referredByDoctorInfo, clinicDescription: null, ), ], @@ -180,26 +148,22 @@ class _PatientMakeReferralScreenState extends State { setState(() { if (_referTo == null) { - branchError = - TranslationBase.of(context).fieldRequired; + branchError = TranslationBase.of(context).fieldRequired!; } else { branchError = null; } if (_selectedBranch == null) { - hospitalError = - TranslationBase.of(context).fieldRequired; + hospitalError = TranslationBase.of(context).fieldRequired!; } else { hospitalError = null; } if (_selectedClinic == null) { - clinicError = - TranslationBase.of(context).fieldRequired; + clinicError = TranslationBase.of(context).fieldRequired!; } else { clinicError = null; } if (_selectedDoctor == null) { - doctorError = - TranslationBase.of(context).fieldRequired; + doctorError = TranslationBase.of(context).fieldRequired!; } else { doctorError = null; } @@ -443,10 +407,11 @@ class _PatientMakeReferralScreenState extends State { enabled: false, isTextFieldHasSuffix: true, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + Icons.calendar_today, + color: Colors.black, + )), onClick: () { _selectDate(context, model); }, @@ -469,12 +434,12 @@ class _PatientMakeReferralScreenState extends State { _selectDate(BuildContext context, PatientReferralViewModel model) async { // https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference // https://stackoverflow.com/a/63147062/6246772 to customize a date picker - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: appointmentDate, firstDate: DateTime.now().add(Duration(hours: 2)), lastDate: DateTime(2040), - initialEntryMode: DatePickerEntryMode.calendar, + initialEntryMode: DatePickerEntryMode.calendar!, ); if (picked != null && picked != appointmentDate) { setState(() { diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index d88d5a95..fb694a0d 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -22,7 +22,6 @@ import 'AddReplayOnReferralPatient.dart'; class ReferralPatientDetailScreen extends StatelessWidget { final MyReferralPatientModel referredPatient; final PatientReferralViewModel patientReferralViewModel; - ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel); @override @@ -140,7 +139,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", + "${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}", fontFamily: 'Poppins', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, @@ -152,7 +151,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.getDayMonthYearDateFormatted( - referredPatient.referralDate, + referredPatient.referralDate!, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -185,7 +184,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.getTimeHHMMA( - referredPatient.referralDate, + referredPatient.referralDate!, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -223,29 +222,28 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), ], ), - if (referredPatient.frequency != null) - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).frequency + ": ", + if (referredPatient.frequency != null)Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).frequency! + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.5 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.frequencyDescription?? '', fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.5 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - referredPatient.frequencyDescription ?? '', - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), - ), + fontWeight: FontWeight.w700, + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), ), - ], - ), + ), + ], + ), ], ), ), @@ -263,11 +261,11 @@ class ReferralPatientDetailScreen extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.nationalityFlagURL, + referredPatient.nationalityFlagURL!, height: 25, width: 30, errorBuilder: - (BuildContext context, Object exception, StackTrace stackTrace) { + (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -282,7 +280,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + ": ", + TranslationBase.of(context).priority! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.5 * SizeConfig.textMultiplier, @@ -290,7 +288,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - referredPatient.priorityDescription ?? '', + referredPatient.priorityDescription! ?? '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.6 * SizeConfig.textMultiplier, @@ -305,7 +303,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).maxResponseTime + ": ", + TranslationBase.of(context).maxResponseTime! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.5 * SizeConfig.textMultiplier, @@ -315,7 +313,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { child: AppText( referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime, "dd MMM,yyyy") + referredPatient.mAXResponseTime!, "dd MMM,yyyy") : '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, @@ -343,11 +341,11 @@ class ReferralPatientDetailScreen extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL, + referredPatient.doctorImageURL!, height: 25, width: 30, errorBuilder: - (BuildContext context, Object exception, StackTrace stackTrace) { + (BuildContext context, Object exception, StackTrace? stackTrace) { return Text(''); }, )) @@ -437,7 +435,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), ), if (referredPatient.referredDoctorRemarks != null && - referredPatient.referredDoctorRemarks.isNotEmpty) + referredPatient.referredDoctorRemarks!.isNotEmpty) Container( width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0), @@ -501,7 +499,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { patientReferralViewModel: patientReferralViewModel, myReferralInPatientModel: referredPatient, isEdited: referredPatient.referredDoctorRemarks != null && - referredPatient.referredDoctorRemarks.isNotEmpty, + referredPatient.referredDoctorRemarks!.isNotEmpty, ), ), ); diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 354ee04f..facead22 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -27,7 +27,7 @@ class _ReferredPatientScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referredPatient, + appBarTitle: TranslationBase.of(context).referredPatient!, body: Column( children: [ Container( @@ -107,13 +107,13 @@ class _ReferredPatientScreenState extends State { .convertDateFromServerFormat( model .getReferredPatientItem(index) - .referralDate, + .referralDate!, "dd/MM/yyyy"), referredTime: AppDateUtils .convertDateFromServerFormat( model .getReferredPatientItem(index) - .referralDate, + .referralDate!, "hh:mm a"), patientID: "${model.getReferredPatientItem(index).patientID}", @@ -182,9 +182,9 @@ class _PatientTypeRadioWidgetState extends State { title: AppText(TranslationBase.of(context).inPatient), value: PatientType.IN_PATIENT, groupValue: patientType, - onChanged: (PatientType value) { + onChanged: (PatientType? value) { setState(() { - patientType = value; + patientType = value!; radioOnChange(value); }); }, @@ -195,10 +195,10 @@ class _PatientTypeRadioWidgetState extends State { title: AppText(TranslationBase.of(context).outpatient), value: PatientType.OUT_PATIENT, groupValue: patientType, - onChanged: (PatientType value) { + onChanged: (PatientType? value) { setState(() { - patientType = value; - radioOnChange(value); + patientType = value!; + radioOnChange(value)!; }); }, ), diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index 21634d0f..04cf6a1d 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -163,8 +163,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate, - "dd MMM,yyyy"), + referredPatient.referralDate ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -200,8 +199,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate, - "hh:mm a"), + referredPatient.referralDate ?? "", "hh:mm a"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -252,7 +250,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { children: [ AppText( TranslationBase.of(context) - .frequency + + .frequency! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -294,13 +292,11 @@ class ReferredPatientDetailScreen extends StatelessWidget { BorderRadius.circular(20.0), child: Image.network( referredPatient - .nationalityFlagURL, + .nationalityFlagURL!, height: 25, width: 30, - errorBuilder: (BuildContext - context, - Object exception, - StackTrace stackTrace) { + errorBuilder: + (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -316,7 +312,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + + TranslationBase.of(context).priority! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -341,7 +337,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { children: [ AppText( TranslationBase.of(context) - .maxResponseTime + + .maxResponseTime! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -356,7 +352,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ? AppDateUtils .convertDateFromServerFormat( referredPatient - .mAXResponseTime, + .mAXResponseTime!, "dd MMM,yyyy") : '', fontFamily: 'Poppins', @@ -394,13 +390,11 @@ class ReferredPatientDetailScreen extends StatelessWidget { borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL, + referredPatient.doctorImageURL!, height: 25, width: 30, errorBuilder: - (BuildContext context, - Object exception, - StackTrace stackTrace) { + (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -503,12 +497,10 @@ class ReferredPatientDetailScreen extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL, + referredPatient.doctorImageURL!, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -536,7 +528,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { referredPatient.referredDoctorRemarks == null ? '' - : referredPatient.referredDoctorRemarks + : referredPatient.referredDoctorRemarks! .isNotEmpty ? referredPatient .referredDoctorRemarks @@ -570,7 +562,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { vPadding: 12, disabled: referredPatient.referredDoctorRemarks == null ? true - : referredPatient.referredDoctorRemarks.isNotEmpty + : referredPatient.referredDoctorRemarks!.isNotEmpty ? false : true, onPressed: () async { diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 0410f239..1972b167 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -29,17 +29,17 @@ class AddAssessmentDetails extends StatefulWidget { final MySelectedAssessment mySelectedAssessment; final List mySelectedAssessmentList; final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) - addSelectedAssessment; + addSelectedAssessment; final PatiantInformtion patientInfo; final bool isUpdate; AddAssessmentDetails( - {Key key, - this.mySelectedAssessment, - this.addSelectedAssessment, - this.patientInfo, - this.isUpdate = false, - this.mySelectedAssessmentList}); + {Key? key, + required this.mySelectedAssessment, + required this.addSelectedAssessment, + required this.patientInfo, + this.isUpdate = false, + required this.mySelectedAssessmentList}); @override _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); @@ -60,48 +60,37 @@ class _AddAssessmentDetailsState extends State { ProjectViewModel projectViewModel = Provider.of(context); remarkController.text = widget.mySelectedAssessment.remark ?? ""; - appointmentIdController.text = - widget.mySelectedAssessment.appointmentId.toString(); + appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); if (widget.isUpdate) { if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) conditionController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr - : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; + ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr ?? "" + : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn ?? ""; if (widget.mySelectedAssessment.selectedDiagnosisType != null) typeController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr - : widget.mySelectedAssessment.selectedDiagnosisType.nameEn; + ? widget.mySelectedAssessment.selectedDiagnosisType!.nameAr ?? "" + : widget.mySelectedAssessment.selectedDiagnosisType!.nameEn ?? ""; if (widget.mySelectedAssessment.selectedICD != null) - icdNameController.text = widget.mySelectedAssessment.selectedICD.code; + icdNameController.text = widget.mySelectedAssessment.selectedICD!.code; } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon, String validationError}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {IconData? icon, String? validationError}) { return new InputDecoration( fillColor: Colors.white, contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: (validationError != null - ? Colors.red.shade700 - : Color(0xFFEFEFEF)), - width: 2.5), + borderSide: + BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: (validationError != null - ? Colors.red.shade700 - : Color(0xFFEFEFEF)), - width: 2.5), + borderSide: + BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: (validationError != null - ? Colors.red.shade700 - : Color(0xFFEFEFEF)), - width: 2.5), + borderSide: + BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, @@ -135,9 +124,7 @@ class _AddAssessmentDetailsState extends State { FractionallySizedBox( widthFactor: 0.9, child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 16, ), @@ -145,10 +132,7 @@ class _AddAssessmentDetailsState extends State { margin: EdgeInsets.only(left: 0, right: 0, top: 15), child: AppTextFieldCustom( // height: 55.0, - height: Helpers.getTextFieldHeight(), - - hintText: - TranslationBase.of(context).appointmentNumber, + height: Helpers.getTextFieldHeight(),hintText: TranslationBase.of(context).appointmentNumber, isTextFieldHasSuffix: false, enabled: false, controller: appointmentIdController, @@ -161,155 +145,109 @@ class _AddAssessmentDetailsState extends State { child: InkWell( onTap: model.listOfICD10 != null ? () { - setState(() { - widget.mySelectedAssessment - .selectedICD = null; - icdNameController.text = null; - }); - } + setState(() { + widget.mySelectedAssessment.selectedICD = null; + icdNameController.text = null!; + }); + } : null, - child: widget - .mySelectedAssessment.selectedICD == - null + child: widget.mySelectedAssessment.selectedICD == null ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && - widget.mySelectedAssessment - .selectedICD == - null, - child: AutoCompleteTextField< - MasterKeyModel>( - decoration: TextFieldsUtils - .textFieldSelectorDecoration( - TranslationBase.of(context) - .nameOrICD, - null, - true, - suffixIcon: Icons.search), - itemSubmitted: (item) => setState(() { - widget.mySelectedAssessment - .selectedICD = item; - icdNameController.text = - '${item.code.trim()}/${item.description}'; - }), - key: key, - suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => - new Padding( - child: AppText( - suggestion.description + - " / " + - suggestion.code - .toString()), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.code - .toLowerCase() - .startsWith( - input.toLowerCase()), - ), - ) - : AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), + isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null, + child: AutoCompleteTextField( + decoration: TextFieldsUtils.textFieldSelectorDecoration( + TranslationBase.of(context).nameOrICD!, "", true, + suffixIcon: Icons.search), + itemSubmitted: (item) => setState(() { + widget.mySelectedAssessment.selectedICD = item; + icdNameController.text = '${item.code.trim()}/${item.description}'; + }), + suggestions: model.listOfICD10, + itemBuilder: (context, suggestion) => new Padding( + child: AppText(suggestion.description + " / " + suggestion.code.toString()), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.code.toLowerCase().startsWith(input.toLowerCase()), + ), + ) + : AppTextFieldCustom(height: Helpers.getTextFieldHeight(), onClick: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment - .selectedICD = null; - icdNameController.text = null; - }); - } - : null, - hintText: TranslationBase.of(context) - .nameOrICD, - maxLines: 1, - minLines: 1, - controller: icdNameController, - enabled: true, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.grey.shade600, - )), + ? () { + setState(() { + widget.mySelectedAssessment.selectedICD = null; + icdNameController.text = null!; + }); + } + : null, + hintText: TranslationBase.of(context).nameOrICD, + maxLines: 1, + minLines: 1, + controller: icdNameController, + enabled: true, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + onPressed: () {}, + icon: Icon( + Icons.search, + color: Colors.grey.shade600, )), - ), + )),), - if(widget.mySelectedAssessment - .selectedICD != null) - Column( - children: [ - SizedBox( - height: 3, - ), - Container( - width: MediaQuery - .of(context) - .size - .width * 0.7, - child: AppText( - widget.mySelectedAssessment - .selectedICD!.description! + - (' (${widget.mySelectedAssessment - .selectedICD!.code!} )'), - color: Color(0xFF575757), - fontSize: 10, - fontWeight: FontWeight.w700, - letterSpacing: -0.4, - ), - ), - ], + if(widget.mySelectedAssessment + .selectedICD != null) + Column( + children: [ + SizedBox( + height: 3, + ), + Container( + width: MediaQuery + .of(context) + .size + .width * 0.7, + child: AppText( + widget.mySelectedAssessment + .selectedICD!.description! + + (' (${widget.mySelectedAssessment + .selectedICD!.code!} )'), + color: Color(0xFF575757), + fontSize: 10, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), ), + ], + ), SizedBox( height: 7, ), AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - - onClick: model.listOfDiagnosisCondition != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisCondition, - okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition, - - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisCondition = - selectedValue; - conditionController - .text = projectViewModel - .isArabic - ? widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameAr - : widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, + height: Helpers.getTextFieldHeight(),onClick: model.listOfDiagnosisCondition != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisCondition, + okText: TranslationBase.of(context).ok, + selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,okFunction: (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue; + conditionController.text = projectViewModel.isArabic + ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr ?? "" + : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn ?? ""; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, hintText: TranslationBase.of(context).condition, maxLines: 1, minLines: 1, @@ -317,10 +255,8 @@ class _AddAssessmentDetailsState extends State { isTextFieldHasSuffix: true, enabled: false, hasBorder: true, - validationError: isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisCondition == - null + validationError: + isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null, ), @@ -328,36 +264,28 @@ class _AddAssessmentDetailsState extends State { height: 10, ), AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - - onClick: model.listOfDiagnosisType != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisType, - okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment.selectedDiagnosisType, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisType = - selectedValue; - typeController.text = - projectViewModel.isArabic - ? selectedValue.nameAr - : selectedValue.nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, + height: Helpers.getTextFieldHeight(),onClick: model.listOfDiagnosisType != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisType, + okText: TranslationBase.of(context).ok, + selectedValue: widget.mySelectedAssessment.selectedDiagnosisType,okFunction: (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment.selectedDiagnosisType = selectedValue; + typeController.text = + (projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn)!; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, hintText: TranslationBase.of(context).dType, maxLines: 1, minLines: 1, @@ -365,10 +293,7 @@ class _AddAssessmentDetailsState extends State { isTextFieldHasSuffix: true, controller: typeController, hasBorder: true, - validationError: isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisType == - null + validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : null, ), @@ -384,8 +309,7 @@ class _AddAssessmentDetailsState extends State { inputType: TextInputType.multiline, controller: remarkController, onChanged: (value) { - widget.mySelectedAssessment.remark = - remarkController.text; + widget.mySelectedAssessment.remark = remarkController.text; }, ), ), @@ -402,31 +326,23 @@ class _AddAssessmentDetailsState extends State { bottomSheet: model.state == ViewState.Busy?Container(height: 0,): BottomSheetDialogButton( - label: (widget.isUpdate - ? 'Update Assessment Details' - : 'Add Assessment Details'), + label: (widget.isUpdate ? 'Update Assessment Details' : 'Add Assessment Details'), onTap: () async { setState(() { isFormSubmitted = true; }); - widget.mySelectedAssessment.remark = - remarkController.text; - widget.mySelectedAssessment.appointmentId = - int.parse(appointmentIdController.text); - if (widget.mySelectedAssessment - .selectedDiagnosisCondition != - null && - widget.mySelectedAssessment - .selectedDiagnosisType != - null && + widget.mySelectedAssessment.remark = remarkController.text; + widget.mySelectedAssessment.appointmentId = int.parse(appointmentIdController.text); + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && + widget.mySelectedAssessment.selectedDiagnosisType != null && widget.mySelectedAssessment.selectedICD != null) { await submitAssessment( isUpdate: widget.isUpdate, model: model, - mySelectedAssessment: - widget.mySelectedAssessment); + mySelectedAssessment: widget.mySelectedAssessment); } }, + ), ), ), @@ -434,9 +350,7 @@ class _AddAssessmentDetailsState extends State { } submitAssessment( - {SOAPViewModel model, - MySelectedAssessment mySelectedAssessment, - bool isUpdate = false}) async { + {required SOAPViewModel model, required MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { GifLoaderDialogUtils.showMyDialog(context); if (isUpdate) { PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( @@ -445,25 +359,24 @@ class _AddAssessmentDetailsState extends State { appointmentNo: widget.patientInfo.appointmentNo, remarks: mySelectedAssessment.remark, complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: mySelectedAssessment.selectedICD.code, + conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, + icdcode10Id: mySelectedAssessment.selectedICD!.code, prevIcdCode10ID: mySelectedAssessment.icdCode10ID); await model.patchAssessment(patchAssessmentReqModel); } else { - PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - icdCodeDetails: [ + PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ new IcdCodeDetails( remarks: mySelectedAssessment.remark, complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: mySelectedAssessment.selectedICD.code) + conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, + icdcode10Id: mySelectedAssessment.selectedICD!.code) ]); await model.postAssessment(postAssessmentRequestModel); @@ -476,9 +389,9 @@ class _AddAssessmentDetailsState extends State { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; + mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code; mySelectedAssessment.doctorName = doctorProfile.doctorName; - widget.addSelectedAssessment(mySelectedAssessment, isUpdate); + widget.addSelectedAssessment(mySelectedAssessment, isUpdate); Navigator.of(context).pop(); } } diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index a54b5140..963efb36 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -30,13 +30,12 @@ class UpdateAssessmentPage extends StatefulWidget { final PatiantInformtion patientInfo; final Function changeLoadingState; final int currentIndex; - UpdateAssessmentPage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.currentIndex}); + {Key? key, + required this.changePageViewIndex, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -45,7 +44,7 @@ class UpdateAssessmentPage extends StatefulWidget { class _UpdateAssessmentPageState extends State implements AssessmentCallBack { bool isAssessmentExpand = false; - List mySelectedAssessmentList = List(); + List mySelectedAssessmentList = []; @override Widget build(BuildContext context) { @@ -56,37 +55,34 @@ class _UpdateAssessmentPageState extends State model.setAssessmentCallBack(this); mySelectedAssessmentList.clear(); - await model.onUpdateAssessmentStepStart(widget.patientInfo); + await model.onUpdateAssessmentStepStart(widget.patientInfo); if (model.patientAssessmentList.isNotEmpty) { model.patientAssessmentList.forEach((element) { - MasterKeyModel diagnosisType = model.getOneMasterKey( + MasterKeyModel? diagnosisType = model.getOneMasterKey( masterKeys: MasterKeysService.DiagnosisType, id: element.diagnosisTypeID, ); - MasterKeyModel selectedICD = model.getOneMasterKey( + MasterKeyModel? selectedICD = model.getOneMasterKey( masterKeys: MasterKeysService.ICD10, id: element.icdCode10ID, ); - MasterKeyModel diagnosisCondition = model.getOneMasterKey( + MasterKeyModel? diagnosisCondition = model.getOneMasterKey( masterKeys: MasterKeysService.DiagnosisCondition, id: element.conditionID, ); - if (diagnosisCondition != null && - diagnosisType != null && - diagnosisCondition != null) { - MySelectedAssessment temMySelectedAssessment = - SoapUtils.generateMySelectedAssessment( - appointmentNo: element.appointmentNo, - remark: element.remarks, - diagnosisType: diagnosisType, - diagnosisCondition: diagnosisCondition, - selectedICD: selectedICD, - doctorID: element.doctorID, - doctorName: element.doctorName, - createdBy: element.createdBy, - createdOn: element.createdOn, - icdCode10ID: element.icdCode10ID); + if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) { + MySelectedAssessment temMySelectedAssessment = SoapUtils.generateMySelectedAssessment( + appointmentNo: element.appointmentNo, + remark: element.remarks, + diagnosisType: diagnosisType, + diagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + createdOn: element.createdOn, + icdCode10ID: element.icdCode10ID); mySelectedAssessmentList.add(temMySelectedAssessment); } @@ -128,7 +124,7 @@ class _UpdateAssessmentPageState extends State children: [ SOAPOpenItems( label: - "${TranslationBase.of(context).addAssessment}", + "${TranslationBase.of(context).addAssessment}", onTap: () { openAssessmentDialog(context, isUpdate: false, model: model); @@ -139,25 +135,25 @@ class _UpdateAssessmentPageState extends State ), Column( children: - mySelectedAssessmentList.map((assessment) { + mySelectedAssessmentList.map((assessment) { return Container( margin: EdgeInsets.only( left: 5, right: 5, top: 15, bottom: 15), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ RichText( text: new TextSpan( style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', @@ -169,23 +165,23 @@ class _UpdateAssessmentPageState extends State ), new TextSpan( text: assessment - .selectedICD!.code - .trim() - .toUpperCase() ?? + .selectedICD!.code + .trim() + .toUpperCase() ?? ""), ], ), ), Container( width: MediaQuery.of(context) - .size - .width * + .size + .width * 0.50, child: RichText( text: new TextSpan( style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 5, color: Color(0xFF2E303A), fontFamily: 'Poppins', @@ -206,7 +202,7 @@ class _UpdateAssessmentPageState extends State text: new TextSpan( style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A), fontFamily: 'Poppins', @@ -215,11 +211,11 @@ class _UpdateAssessmentPageState extends State children: [ new TextSpan( text: TranslationBase.of( - context) + context) .appointmentNo, style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3, letterSpacing: -0.4, color: Color(0xFF575757), @@ -227,11 +223,11 @@ class _UpdateAssessmentPageState extends State ), new TextSpan( text: assessment.appointmentId - .toString() ?? + .toString() ?? "", style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), @@ -244,7 +240,7 @@ class _UpdateAssessmentPageState extends State text: new TextSpan( style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', @@ -252,8 +248,8 @@ class _UpdateAssessmentPageState extends State children: [ new TextSpan( text: TranslationBase.of( - context) - .condition! + + context) + .condition! + " : ", style: new TextStyle( letterSpacing: -0.4, @@ -262,16 +258,16 @@ class _UpdateAssessmentPageState extends State ), new TextSpan( text: projectViewModel - .isArabic + .isArabic ? assessment - .selectedDiagnosisCondition! - .nameAr! + .selectedDiagnosisCondition! + .nameAr! : assessment - .selectedDiagnosisCondition! - .nameEn!, + .selectedDiagnosisCondition! + .nameEn!, style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), @@ -284,7 +280,7 @@ class _UpdateAssessmentPageState extends State text: new TextSpan( style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', @@ -292,8 +288,8 @@ class _UpdateAssessmentPageState extends State children: [ new TextSpan( text: TranslationBase.of( - context) - .dType! + + context) + .dType! + ' : ', style: new TextStyle( letterSpacing: -0.4, @@ -302,16 +298,16 @@ class _UpdateAssessmentPageState extends State ), new TextSpan( text: projectViewModel - .isArabic + .isArabic ? assessment - .selectedDiagnosisType! - .nameAr + .selectedDiagnosisType! + .nameAr : assessment - .selectedDiagnosisType! - .nameEn, + .selectedDiagnosisType! + .nameEn, style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), @@ -325,21 +321,21 @@ class _UpdateAssessmentPageState extends State text: new TextSpan( style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: - FontWeight.w600), + FontWeight.w600), children: [ new TextSpan( text: TranslationBase.of( - context) - .doctor! + + context) + .doctor! + ' : ', style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3, letterSpacing: -0.4, color: Color(0xFF575757), @@ -347,11 +343,11 @@ class _UpdateAssessmentPageState extends State ), new TextSpan( text: - assessment.doctorName ?? - '', + assessment.doctorName ?? + '', style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), @@ -365,24 +361,24 @@ class _UpdateAssessmentPageState extends State ), Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ SizedBox( height: 6, ), AppText( (assessment.remark != null && - assessment.remark != - '') + assessment.remark != + '') ? TranslationBase.of( - context) - .remarks! + - " : " + context) + .remarks! + + " : " : '', fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', @@ -396,41 +392,41 @@ class _UpdateAssessmentPageState extends State ), Column( crossAxisAlignment: - CrossAxisAlignment.end, + CrossAxisAlignment.end, children: [ Row( children: [ Column( crossAxisAlignment: - CrossAxisAlignment.end, + CrossAxisAlignment.end, children: [ AppText( assessment.createdOn != null ? AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.parse( - assessment! - .createdOn!)) + .getDayMonthYearDateFormatted( + DateTime.parse( + assessment! + .createdOn!)) : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), + .getDayMonthYearDateFormatted( + DateTime.now()), fontWeight: FontWeight.w600, fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3.6, ), AppText( assessment.createdOn != null ? AppDateUtils.getHour( - DateTime.parse( - assessment! - .createdOn!)) + DateTime.parse( + assessment! + .createdOn!)) : AppDateUtils.getHour( - DateTime.now()), + DateTime.now()), fontWeight: FontWeight.w600, color: Color(0xFF575757), fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * + .getTextMultiplierBasedOnWidth() * 3.6, ), ], @@ -439,8 +435,8 @@ class _UpdateAssessmentPageState extends State ), SizedBox( height: MediaQuery.of(context) - .size - .height * + .size + .height * 0.05, ), InkWell( @@ -481,10 +477,9 @@ class _UpdateAssessmentPageState extends State } openAssessmentDialog(BuildContext context, - {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { + {MySelectedAssessment? assessment, required bool isUpdate, required SOAPViewModel model}) { if (assessment == null) { - assessment = SoapUtils.generateMySelectedAssessment( - remark: '', appointmentNo: widget.patientInfo.appointmentNo); + assessment = SoapUtils.generateMySelectedAssessment(remark: '', appointmentNo: widget.patientInfo.appointmentNo); } showModalBottomSheet( backgroundColor: Colors.white, @@ -492,12 +487,11 @@ class _UpdateAssessmentPageState extends State context: context, builder: (context) { return AddAssessmentDetails( - mySelectedAssessment: assessment, + mySelectedAssessment: assessment!, patientInfo: widget.patientInfo, isUpdate: isUpdate, mySelectedAssessmentList: mySelectedAssessmentList, - addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, - bool isUpdate) async { + addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async { setState(() { if (!isUpdate) mySelectedAssessmentList.add(mySelectedAssessment); diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index e73788e9..82e9b3fb 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -18,9 +18,7 @@ class AddExaminationPage extends StatefulWidget { final Function(MasterKeyModel) removeExamination; AddExaminationPage( - {this.mySelectedExamination, - this.addSelectedExamination, - this.removeExamination}); + {required this.mySelectedExamination, required this.addSelectedExamination, required this.removeExamination}); @override _AddExaminationPageState createState() => _AddExaminationPageState(); @@ -44,78 +42,74 @@ class _AddExaminationPageState extends State { } }, builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - appBar: BottomSheetTitle( - title: "${TranslationBase.of(context).addExamination}", - ), - backgroundColor: Color.fromRGBO(248, 248, 248, 1), - body: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - child: SingleChildScrollView( - child: Column( - children: [ - Container( - margin: EdgeInsets.all(16.0), - padding: EdgeInsets.all(0.0), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.circular(12), - border: Border.fromBorderSide(BorderSide( - color: Colors.grey.shade400, - width: 0.4, - )), - ), - child: Column( - children: [ - ExaminationsListSearchWidget( - mySelectedExamination: - widget.mySelectedExamination, - masterList: model.physicalExaminationList, - isServiceSelected: (master) => - isServiceSelected(master), - removeExamination: (selectedExamination) { - setState(() { - mySelectedExaminationLocal.remove(selectedExamination); - }); - }, - addExamination: (selectedExamination) { + baseViewModel: model, + isShowAppBar: true, + appBar: BottomSheetTitle( + title: "${TranslationBase.of(context).addExamination}", + ), + backgroundColor: Color.fromRGBO(248, 248, 248, 1), + body: Column( + mainAxisAlignment: MainAxisAlignment.start, + + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + children: [ + Container( + margin: EdgeInsets.all(16.0), + padding: EdgeInsets.all(0.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.fromBorderSide(BorderSide( + color: Colors.grey.shade400, + width: 0.4, + )), + ), + child: Column( + children: [ + ExaminationsListSearchWidget( + mySelectedExamination: + widget.mySelectedExamination,masterList: model.physicalExaminationList, + isServiceSelected: (master) => isServiceSelected(master), + removeExamination: (selectedExamination) { + setState(() { + mySelectedExaminationLocal.remove(selectedExamination); + }); + }, + addExamination: (selectedExamination) { - mySelectedExaminationLocal - .insert(0, selectedExamination); - // setState(() {}); - }, - ), - ], + mySelectedExaminationLocal.insert(0, selectedExamination); + // setState(() {}); + }, ), - ), - ], + ], + ), ), - ), + ], ), - ], + ), ), - bottomSheet: model.state != ViewState.Idle - ? Container( - height: 0, - ) - : BottomSheetDialogButton( - label: "${TranslationBase.of(context).addExamination}", - onTap: () { - widget.addSelectedExamination(mySelectedExaminationLocal); - }, - ), - )); + ], + ), + bottomSheet: model.state != ViewState.Idle + ? Container( + height: 0, + ) + : BottomSheetDialogButton( + label: "${TranslationBase.of(context).addExamination}", + onTap: () { + widget.addSelectedExamination(mySelectedExaminationLocal); + }, + ), + )); } isServiceSelected(MasterKeyModel masterKey) { - Iterable exam = mySelectedExaminationLocal.where( - (element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); + Iterable exam = mySelectedExaminationLocal.where((element) => + masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId); if (exam.length > 0) { return true; } diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index af3a419b..d0c18be3 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; @@ -11,7 +10,7 @@ import 'package:provider/provider.dart'; class ExaminationItemCard extends StatelessWidget { final MySelectedExamination examination; - final Function removeExamination; + final VoidCallback removeExamination; ExaminationItemCard(this.examination, this.removeExamination); @@ -30,37 +29,36 @@ class ExaminationItemCard extends StatelessWidget { children: [ Expanded( child: Container( - child: AppText( - projectViewModel.isArabic - ? examination.selectedExamination.nameAr != null && - examination.selectedExamination.nameAr != "" - ? examination.selectedExamination.nameAr - : examination.selectedExamination.nameEn - : examination.selectedExamination.nameEn, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - color: Color(0xFF2B353E), - fontSize: SizeConfig.textMultiplier * 1.8, - ), - )), + child: AppText( + projectViewModel.isArabic + ? examination.selectedExamination!.nameAr != null && examination.selectedExamination!.nameAr != "" + ? examination.selectedExamination!.nameAr + : examination.selectedExamination!.nameEn + : examination.selectedExamination!.nameEn, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + fontSize: SizeConfig.textMultiplier * 1.8, + ), + )), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - !examination.isNormal - ? examination.isAbnormal - ? TranslationBase.of(context).abnormal - : TranslationBase.of(context).notExamined + !examination.isNormal! + ? examination.isAbnormal! + ? TranslationBase.of(context).abnormal + : TranslationBase.of(context).notExamined : TranslationBase.of(context).normal, fontWeight: FontWeight.bold, fontFamily: 'Poppins', - color: !examination.isNormal - ? examination.isAbnormal - ? Colors.red.shade800 - : Colors.grey.shade800 - : AppGlobal.appGreenColor, + color: !examination.isNormal! + ? examination.isAbnormal! + ? Colors.red.shade800 + : Colors.grey.shade800 + : Colors.green.shade800, fontSize: SizeConfig.textMultiplier * 1.8, ), if (!examination.notExamined) diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index a251aed4..d9d55925 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; @@ -32,11 +31,11 @@ class UpdateObjectivePage extends StatefulWidget { final PatiantInformtion patientInfo; UpdateObjectivePage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.currentIndex}); + {Key? key, + required this.changePageViewIndex, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); @@ -45,10 +44,9 @@ class UpdateObjectivePage extends StatefulWidget { class _UpdateObjectivePageState extends State implements ObjectiveCallBack { bool isSysExaminationExpand = false; - List mySelectedExamination = List(); + List mySelectedExamination = []; - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -78,7 +76,7 @@ class _UpdateObjectivePageState extends State id: element.examId, ); MySelectedExamination tempEam = - SoapUtils.generateMySelectedExamination( + SoapUtils.generateMySelectedExamination( examination: examMaster, remark: element.remarks, isNormal: element.isNormal, @@ -108,13 +106,13 @@ class _UpdateObjectivePageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex, + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, patientInfo: widget.patientInfo, ), ExpandableSOAPWidget( headerTitle: - TranslationBase.of(context).physicalSystemExamination, + TranslationBase.of(context).physicalSystemExamination, onTap: () { setState(() { isSysExaminationExpand = !isSysExaminationExpand; @@ -124,7 +122,7 @@ class _UpdateObjectivePageState extends State children: [ SOAPOpenItems( label: - "${TranslationBase.of(context).addExamination}", + "${TranslationBase.of(context).addExamination}", onTap: () { openExaminationList(context); }, @@ -144,13 +142,13 @@ class _UpdateObjectivePageState extends State Column( children: mySelectedExamination .sublist( - 0, - model.getFirstIndexForOldExamination( - mySelectedExamination) == - -1 - ? 0 - : model.getFirstIndexForOldExamination( - mySelectedExamination)) + 0, + model.getFirstIndexForOldExamination( + mySelectedExamination) == + -1 + ? 0 + : model.getFirstIndexForOldExamination( + mySelectedExamination)) .map((examination) { return ExaminationItemCard(examination, () { removeExamination( @@ -160,7 +158,7 @@ class _UpdateObjectivePageState extends State ), if (mySelectedExamination.isNotEmpty && model.getFirstIndexForOldExamination( - mySelectedExamination) > + mySelectedExamination) > -1) Row( children: [ @@ -168,18 +166,18 @@ class _UpdateObjectivePageState extends State "Verified", fontWeight: FontWeight.w600, fontFamily: 'Poppins', - color: AppGlobal.appGreenColor, + color: Colors.green, ), ], ), Column( children: mySelectedExamination .sublist(model.getFirstIndexForOldExamination( - mySelectedExamination) == - -1 - ? 0 - : model.getFirstIndexForOldExamination( - mySelectedExamination)) + mySelectedExamination) == + -1 + ? 0 + : model.getFirstIndexForOldExamination( + mySelectedExamination)) .map((examination) { return ExaminationItemCard(examination, () { removeExamination( @@ -295,9 +293,8 @@ class _UpdateObjectivePageState extends State removeExamination(MasterKeyModel masterKey) { Iterable history = mySelectedExamination.where( - (element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); + (element) => + masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId); if (history.length > 0) { setState(() { @@ -325,8 +322,8 @@ class _UpdateObjectivePageState extends State mySelectedExaminationLocal.forEach((element) { if ((mySelectedExamination.singleWhere( (it) => - it.selectedExamination!.id == - element.selectedExamination!.id)) == + it.selectedExamination!.id == + element.selectedExamination!.id)) == null) { mySelectedExamination.insert(0,element); } @@ -336,10 +333,10 @@ class _UpdateObjectivePageState extends State List removedList = []; mySelectedExamination.forEach((element) { if ((mySelectedExaminationLocal.singleWhere( - (it) => - it.selectedExamination!.id == - element.selectedExamination!.id, - )) == + (it) => + it.selectedExamination!.id == + element.selectedExamination!.id, + )) == null) { removedList.add(element); } diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index cac5deeb..08bd697f 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -366,7 +366,7 @@ class _UpdatePlanPageState extends State } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; + postProgressNoteRequestModel.editedBy = doctorProfile!.doctorID; await widget.sOAPViewModel .patchProgressNote(postProgressNoteRequestModel); } diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart index 6449913c..f2cc707e 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart @@ -4,10 +4,10 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class SOAPOpenItems extends StatelessWidget { - final Function onTap; + final VoidCallback onTap; final String label; - const SOAPOpenItems({Key key, this.onTap, this.label}) : super(key: key); + const SOAPOpenItems({Key? key, required this.onTap, required this.label}) : super(key: key); @override Widget build(BuildContext context) { return InkWell( diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart index 4bb9b6a6..b9e6ba14 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart @@ -9,7 +9,7 @@ class BottomSheetDialogButton extends StatelessWidget { double headerHeight = SizeConfig.heightMultiplier * 12; - BottomSheetDialogButton({Key key, this.onTap, this.label}) : super(key: key); + BottomSheetDialogButton({Key? key, this.onTap, this.label}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart index f5134c1c..b451ce85 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart @@ -4,8 +4,8 @@ import 'package:flutter/material.dart'; class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { BottomSheetTitle({ - Key key, - this.title, + Key? key, + required this.title, }) : super(key: key); final String title; diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index c1b2d443..bf743f7f 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -9,12 +9,17 @@ import 'package:hexcolor/hexcolor.dart'; class ExpandableSOAPWidget extends StatelessWidget { final bool isExpanded; final Widget child; - final Function onTap; + final VoidCallback onTap; final headerTitle; final bool isRequired; const ExpandableSOAPWidget( - {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle, this.isRequired= true}) + {Key? key, + required this.isExpanded, + required this.child, + required this.onTap, + this.headerTitle, + this.isRequired = true}) : super(key: key); @override diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart index 568cfe30..e989852d 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart @@ -10,7 +10,7 @@ class RemoveButton extends StatelessWidget { final VoidCallback? onTap; final String? label; - const RemoveButton({Key key, this.onTap, this.label}) : super(key: key); + const RemoveButton({Key? key, this.onTap, this.label}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index f3748df3..297d77ab 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -17,7 +17,7 @@ import 'add_allergies.dart'; class UpdateAllergiesWidget extends StatefulWidget { List myAllergiesList; - UpdateAllergiesWidget({Key key, this.myAllergiesList}); + UpdateAllergiesWidget({Key? key, required this.myAllergiesList}); @override _UpdateAllergiesWidgetState createState() => _UpdateAllergiesWidgetState(); @@ -38,6 +38,7 @@ class _UpdateAllergiesWidgetState extends State { onTap: () { openAllergiesList(context, changeAllState, removeAllergy); }, + ), SizedBox( height: 20, @@ -46,78 +47,75 @@ class _UpdateAllergiesWidgetState extends State { margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( children: widget.myAllergiesList.map((selectedAllergy) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Column( + return Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - projectViewModel.isArabic - ? selectedAllergy.selectedAllergy.nameAr - : selectedAllergy.selectedAllergy.nameEn - .toUpperCase(), - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, - bold: true, - color: Color(0xFF2B353E), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, - fontWeight: FontWeight.w700, - letterSpacing: -0.48, - // fontHeight:0.18 , - ), - AppText( - projectViewModel.isArabic - ? selectedAllergy + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + projectViewModel.isArabic + ? selectedAllergy.selectedAllergy!.nameAr + : selectedAllergy.selectedAllergy!.nameEn!.toUpperCase(), + textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough, + bold: true, + color: Color(0xFF2B353E), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + // fontHeight:0.18 , + ), + AppText( + projectViewModel.isArabic + ? selectedAllergy .selectedAllergySeverity!.nameAr - : selectedAllergy + : selectedAllergy .selectedAllergySeverity!.nameEn! .toUpperCase(), - textDecoration: selectedAllergy!.isChecked! - ? null - : TextDecoration.lineThrough, - color: Color(0xFFCC9B14), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, - fontWeight: FontWeight.w700, - letterSpacing: -0.48, + textDecoration: selectedAllergy!.isChecked! + ? null + : TextDecoration.lineThrough, + color: Color(0xFFCC9B14), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + ), + ], ), + width: MediaQuery.of(context).size.width * 0.5, + ), + if (selectedAllergy.isChecked!) + RemoveButton( + onTap: () => removeAllergy(selectedAllergy), + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Row( + children: [ + RemarkText(remark: selectedAllergy.remark,), ], ), - width: MediaQuery.of(context).size.width * 0.5, ), - if (selectedAllergy.isChecked) - RemoveButton( - onTap: () => removeAllergy(selectedAllergy), - ) + DividerWithSpacesAround() ], ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: Row( - children: [ - RemarkText(remark: selectedAllergy.remark,), - ], - ), + SizedBox( + height: 10, ), - DividerWithSpacesAround() ], - ), - SizedBox( - height: 10, - ), - ], - ); - }).toList()), + ); + }).toList()), ) ], ); @@ -125,14 +123,13 @@ class _UpdateAllergiesWidgetState extends State { removeAllergy(MySelectedAllergy mySelectedAllergy) { List allergy = - // ignore: missing_return - widget.myAllergiesList - .where((element) => - mySelectedAllergy.selectedAllergySeverity.id == - element.selectedAllergySeverity.id && - mySelectedAllergy.selectedAllergy.id == - element.selectedAllergy.id) - .toList(); + // ignore: missing_return + widget.myAllergiesList + .where((element) => + mySelectedAllergy.selectedAllergySeverity!.id == element.selectedAllergySeverity!.id && + mySelectedAllergy.selectedAllergy!.id == + element.selectedAllergy!.id) + .toList(); if (allergy.length > 0) { if (allergy!.first!.isLocal!) { @@ -167,9 +164,9 @@ class _UpdateAllergiesWidgetState extends State { if (isAllDataFilled) { mySelectedAllergy.forEach((element) { if ((widget.myAllergiesList.singleWhere( - (it) => - it.selectedAllergy!.id == - element.selectedAllergy!.id,)) == + (it) => + it.selectedAllergy!.id == + element.selectedAllergy!.id,)) == null) { widget.myAllergiesList.add(element); } @@ -180,8 +177,8 @@ class _UpdateAllergiesWidgetState extends State { widget.myAllergiesList.forEach((element) { if ((mySelectedAllergy.singleWhere( (it) => - it.selectedAllergy!.id == - element.selectedAllergy!.id)) == + it.selectedAllergy!.id == + element.selectedAllergy!.id)) == null) { removedList.add(element); } @@ -193,8 +190,7 @@ class _UpdateAllergiesWidgetState extends State { changeParentState(); Navigator.of(context).pop(); } else { - Helpers.showErrorToast( - TranslationBase.of(context).requiredMsg); + Helpers.showErrorToast(TranslationBase.of(context).requiredMsg); } }); }); diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index 0e5e6ec1..eac11c31 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -7,14 +7,14 @@ import '../medication/update_medication_widget.dart'; class UpdateChiefComplaints extends StatelessWidget { const UpdateChiefComplaints({ - Key key, - @required this.formKey, - @required this.complaintsController, - @required this.illnessController, - @required this.medicationController, - this.complaintsControllerError, - this.illnessControllerError, - this.medicationControllerError, + Key? key, + required this.formKey, + required this.complaintsController, + required this.illnessController, + required this.medicationController, + required this.complaintsControllerError, + required this.illnessControllerError, + required this.medicationControllerError, }) : super(key: key); final GlobalKey formKey; diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index 4e9dac03..a6937867 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -23,12 +23,12 @@ class AddHistoryDialog extends StatefulWidget { final Function(MasterKeyModel) removeHistory; const AddHistoryDialog( - {Key key, - this.changePageViewIndex, - this.controller, - this.myHistoryList, - this.addSelectedHistories, - this.removeHistory}) + {Key? key, + required this.changePageViewIndex, + required this.controller, + required this.myHistoryList, + required this.addSelectedHistories, + required this.removeHistory}) : super(key: key); @override @@ -59,136 +59,135 @@ class _AddHistoryDialogState extends State { baseViewModel: model, isShowAppBar: true, appBar: - BottomSheetTitle(title: TranslationBase.of(context).addHistory!), + BottomSheetTitle(title: TranslationBase.of(context).addHistory!), body: Center( child: Container( child: Column( - children: [ - SizedBox( - height: 10, - ), - PriorityBar(onTap: (activePriority) async { - widget.changePageViewIndex(activePriority); - }), - SizedBox( - height: 20, - ), - Expanded( - child: FractionallySizedBox( - widthFactor: 0.9, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: widget.controller, - onPageChanged: (index) { - setState(() {}); - }, - scrollDirection: Axis.horizontal, - children: [ - NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.historyFamilyList, - removeHistory: (history) { - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history) { - setState(() { - createAndAddHistory(history); - }); - }, - addSelectedHistories: () { - widget.addSelectedHistories(); - }, - isServiceSelected: (master) => - isServiceSelected(master), - ), - ), - NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchWidget( - model: model, - masterList: model - .mergeHistorySurgicalWithHistorySportList, - removeHistory: (history) { - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history) { - setState(() { - createAndAddHistory(history); - }); - }, - addSelectedHistories: () { - widget.addSelectedHistories(); - }, - isServiceSelected: (master) => - isServiceSelected(master), - ), - ), - NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.historyMedicalList, - removeHistory: (history) { - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history) { - setState(() { - createAndAddHistory(history); - }); - }, - addSelectedHistories: () { - widget.addSelectedHistories(); - }, - isServiceSelected: (master) => - isServiceSelected(master), - ), + children: [ + SizedBox( + height: 10, + ), + PriorityBar(onTap: (activePriority) async { + widget.changePageViewIndex(activePriority); + }), + SizedBox( + height: 20, + ), + Expanded( + child: FractionallySizedBox( + widthFactor: 0.9, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: widget.controller, + onPageChanged: (index) { + setState(() {}); + }, + scrollDirection: Axis.horizontal, + children: [ + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyFamilyList, + removeHistory: (history) { + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history) { + setState(() { + createAndAddHistory(history); + }); + }, + addSelectedHistories: () { + widget.addSelectedHistories(); + }, + isServiceSelected: (master) => + isServiceSelected(master), + ), + ), + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model + .mergeHistorySurgicalWithHistorySportList, + removeHistory: (history) { + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history) { + setState(() { + createAndAddHistory(history); + }); + }, + addSelectedHistories: () { + widget.addSelectedHistories(); + }, + isServiceSelected: (master) => + isServiceSelected(master), + ), + ), + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyMedicalList, + removeHistory: (history) { + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history) { + setState(() { + createAndAddHistory(history); + }); + }, + addSelectedHistories: () { + widget.addSelectedHistories(); + }, + isServiceSelected: (master) => + isServiceSelected(master), + ), + ), + ], ), - ], + ), ), - ), - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.11, - ) - ], - )), + SizedBox( + height: MediaQuery.of(context).size.height * 0.11, + ) + ], + )), ), bottomSheet: model.state != ViewState.Idle ? Container( - height: 0, - ) + height: 0, + ) : BottomSheetDialogButton( - label: TranslationBase.of(context).addSelectedHistories, - onTap: () { - widget.addSelectedHistories(); - }, - ), + label: TranslationBase.of(context).addSelectedHistories, + onTap: () { + widget.addSelectedHistories(); + }, + ), ), )); } createAndAddHistory(MasterKeyModel history) { List myhistory = widget.myHistoryList - .where((element) => - history.id == element.selectedHistory.id && - history.typeId == element.selectedHistory.typeId) + .where( + (element) => history.id == element.selectedHistory!.id && history.typeId == element.selectedHistory!.typeId) .toList(); if (myhistory.isEmpty) { setState(() { MySelectedHistory mySelectedHistory = - SoapUtils.generateMySelectedHistory( - remark: history.remarks ?? "", - history: history, - isChecked: true); + SoapUtils.generateMySelectedHistory( + remark: history.remarks ?? "", + history: history, + isChecked: true); widget.myHistoryList.add(mySelectedHistory); }); @@ -198,11 +197,10 @@ class _AddHistoryDialogState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable history = widget.myHistoryList.where( - (element) => - masterKey.id == element.selectedHistory.id && - masterKey.typeId == element.selectedHistory.typeId && - element.isChecked); + Iterable history = widget.myHistoryList.where((element) => + masterKey.id == element.selectedHistory!.id && + masterKey.typeId == element.selectedHistory!.typeId && + element.isChecked!); if (history.length > 0) { return true; } diff --git a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart index 57698f56..a4aa674f 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart @@ -8,7 +8,7 @@ import 'package:provider/provider.dart'; class PriorityBar extends StatefulWidget { final Function onTap; - const PriorityBar({Key key, this.onTap}) : super(key: key); + const PriorityBar({Key? key, required this.onTap}) : super(key: key); @override _PriorityBarState createState() => _PriorityBarState(); diff --git a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart index a3a58f7b..7ead4c3f 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart @@ -14,15 +14,14 @@ import 'add_history_dialog.dart'; class UpdateHistoryWidget extends StatefulWidget { final List myHistoryList; - const UpdateHistoryWidget({Key key, this.myHistoryList}) : super(key: key); + const UpdateHistoryWidget({Key? key, required this.myHistoryList}) : super(key: key); @override _UpdateHistoryWidgetState createState() => _UpdateHistoryWidgetState(); } -class _UpdateHistoryWidgetState extends State - with TickerProviderStateMixin { - PageController _controller; +class _UpdateHistoryWidgetState extends State with TickerProviderStateMixin { + late PageController _controller; changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); @@ -61,16 +60,14 @@ class _UpdateHistoryWidgetState extends State Container( child: AppText( projectViewModel.isArabic - ? myHistory.selectedHistory.nameAr - : myHistory.selectedHistory.nameEn, - textDecoration: myHistory.isChecked - ? null - : TextDecoration.lineThrough, + ? myHistory.selectedHistory!.nameAr + : myHistory.selectedHistory!.nameEn, + + textDecoration: myHistory.isChecked! ? null : TextDecoration.lineThrough, color: Color(0xFF2B353E), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontWeight: FontWeight.w700, - letterSpacing: -0.48, - ), + letterSpacing: -0.48,), width: MediaQuery.of(context).size.width * 0.5, ), if (myHistory!.isChecked!) @@ -93,14 +90,13 @@ class _UpdateHistoryWidgetState extends State removeHistory(MasterKeyModel historyKey) { List history = - // ignore: missing_return - widget.myHistoryList - .where((element) => - historyKey.id == element.selectedHistory.id && - historyKey.typeId == element.selectedHistory.typeId) - .toList(); + // ignore: missing_return + widget.myHistoryList + .where((element) => + historyKey.id == element.selectedHistory!.id && historyKey.typeId == element.selectedHistory!.typeId) + .toList(); - if (history.length > 0) { + if (history.length > 0){ if (history!.first!.isLocal!) { setState(() { widget.myHistoryList.remove(history.first); diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart index c6427511..fa8d2a6e 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart @@ -9,8 +9,8 @@ class UpdateMedicationWidget extends StatefulWidget { final TextEditingController medicationController; UpdateMedicationWidget({ - Key key, - this.medicationController, + Key? key, + required this.medicationController, }); @override diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index 0b58d340..b9b4d118 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -26,11 +26,11 @@ class UpdateSubjectivePage extends StatefulWidget { final int currentIndex; UpdateSubjectivePage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.currentIndex}); + {Key? key, + required this.changePageViewIndex, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); @@ -46,74 +46,70 @@ class _UpdateSubjectivePageState extends State TextEditingController medicationController = TextEditingController(); final formKey = GlobalKey(); - List myAllergiesList = List(); - List myHistoryList = List(); + List myAllergiesList = []; + List myHistoryList = []; getHistory(SOAPViewModel model) async { widget.changeLoadingState(true); if (model.patientHistoryList.isNotEmpty) { model.patientHistoryList.forEach((element) { - if (element.historyType == - MasterKeysService.HistoryFamily.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryFamily, id: element.historyId, ); if (history != null) { MySelectedHistory mySelectedHistory = - SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + SoapUtils.generateMySelectedHistory( + history: history, + isChecked: element.isChecked, + remark: element.remarks, + isLocal: false); myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistoryMedical.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryMedical, id: element.historyId, ); if (history != null) { MySelectedHistory mySelectedHistory = - SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + SoapUtils.generateMySelectedHistory( + history: history, + isChecked: element.isChecked, + remark: element.remarks, + isLocal: false); myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistorySports.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySports, id: element.historyId, ); if (history != null) { MySelectedHistory mySelectedHistory = - SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + SoapUtils.generateMySelectedHistory( + history: history, + isChecked: element.isChecked, + remark: element.remarks, + isLocal: false); myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistorySurgical.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySurgical, id: element.historyId, ); if (history != null) { MySelectedHistory mySelectedHistory = - SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + SoapUtils.generateMySelectedHistory( + history: history, + isChecked: element.isChecked, + remark: element.remarks, + isLocal: false); myHistoryList.add(mySelectedHistory); } } @@ -124,35 +120,30 @@ class _UpdateSubjectivePageState extends State getAllergies(SOAPViewModel model) async { if (model.patientAllergiesList.isNotEmpty) { model.patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = model.getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); + MasterKeyModel? selectedAllergy = model.getOneMasterKey( + masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); MasterKeyModel selectedAllergySeverity; if (element.severity == 0) { selectedAllergySeverity = MasterKeyModel( - id: 0, - typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), + id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); } else { selectedAllergySeverity = model.getOneMasterKey( masterKeys: MasterKeysService.AllergySeverity, id: element.severity, - ); + )!; } MySelectedAllergy mySelectedAllergy = - SoapUtils.generateMySelectedAllergy( - allergy: selectedAllergy, - isChecked: element.isChecked, - createdBy: element!.createdBy!, - remark: element.remarks, - isLocal: false, - allergySeverity: selectedAllergySeverity); - - if (selectedAllergy != null && selectedAllergySeverity != null) - myAllergiesList.add(mySelectedAllergy); + SoapUtils.generateMySelectedAllergy( + allergy: selectedAllergy, + isChecked: element.isChecked, + createdBy: element!.createdBy!, + remark: element.remarks, + isLocal: false, + allergySeverity: selectedAllergySeverity); + if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); }); } } @@ -168,14 +159,11 @@ class _UpdateSubjectivePageState extends State if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; - complaintsController.text = Helpers.parseHtmlString( - model.patientChiefComplaintList[0].chiefComplaint); - illnessController.text = model.patientChiefComplaintList[0].hopi; - medicationController.text = - !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty - ? model.patientChiefComplaintList[0].currentMedication + - '\n \n' - : model.patientChiefComplaintList[0].currentMedication; + complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint!); + illnessController.text = model.patientChiefComplaintList[0].hopi!; + medicationController.text = !(model.patientChiefComplaintList[0].currentMedication)!.isNotEmpty + ? model.patientChiefComplaintList[0].currentMedication! + '\n \n' + : model.patientChiefComplaintList[0].currentMedication!; } if (widget.patientInfo.admissionNo == null) { await getHistory(model); @@ -215,10 +203,10 @@ class _UpdateSubjectivePageState extends State illnessController: illnessController, medicationController: medicationController, complaintsControllerError: - model.complaintsControllerError, + model.complaintsControllerError, illnessControllerError: model.illnessControllerError, medicationControllerError: - model.medicationControllerError, + model.medicationControllerError, ), isExpanded: isChiefExpand, ), @@ -226,47 +214,43 @@ class _UpdateSubjectivePageState extends State height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), ), - if (widget.patientInfo.admissionNo == null) - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).histories, - isRequired: false, - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Column( - children: [ - UpdateHistoryWidget(myHistoryList: myHistoryList) - ], - ), - isExpanded: isHistoryExpand, + if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).histories, + isRequired: false, + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Column( + children: [UpdateHistoryWidget(myHistoryList: myHistoryList)], ), + isExpanded: isHistoryExpand, + ), SizedBox( height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), ), - if (widget.patientInfo.admissionNo == null) - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).allergiesSoap, - isRequired: false, - onTap: () { - setState(() { - isAllergiesExpand = !isAllergiesExpand; - }); - }, - child: Column( - children: [ - UpdateAllergiesWidget( - myAllergiesList: myAllergiesList, - ), - SizedBox( - height: 30, - ), - ], - ), - isExpanded: isAllergiesExpand, + if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).allergiesSoap, + isRequired: false, + onTap: () { + setState(() { + isAllergiesExpand = !isAllergiesExpand; + }); + }, + child: Column( + children: [ + UpdateAllergiesWidget( + myAllergiesList: myAllergiesList, + ), + SizedBox( + height: 30, + ), + ], ), + isExpanded: isAllergiesExpand, + ), SizedBox( height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), @@ -282,8 +266,8 @@ class _UpdateSubjectivePageState extends State addSubjectiveInfo( {required SOAPViewModel model, - required List myAllergiesList, - required List myHistoryList}) async { + required List myAllergiesList, + required List myHistoryList}) async { if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); widget.changeLoadingState(true); formKey.currentState!.save(); @@ -310,21 +294,17 @@ class _UpdateSubjectivePageState extends State } else { setState(() { if (complaintsController.text.isEmpty) { - model.complaintsControllerError = - TranslationBase.of(context).emptyMessage; + model.complaintsControllerError = TranslationBase.of(context).emptyMessage!; } else if (complaintsController.text.length < 25) { - model.complaintsControllerError = - TranslationBase.of(context).chiefComplaintLength; + model.complaintsControllerError = TranslationBase.of(context).chiefComplaintLength!; } if (illnessController.text.isEmpty) { - model.illnessControllerError = - TranslationBase.of(context).emptyMessage; + model.illnessControllerError = TranslationBase.of(context).emptyMessage!; } if (medicationController.text.isEmpty) { - model.medicationControllerError = - TranslationBase.of(context).emptyMessage; + model.medicationControllerError = TranslationBase.of(context).emptyMessage!; } }); @@ -335,8 +315,8 @@ class _UpdateSubjectivePageState extends State } @override - VoidCallback? nextFunction(model) { - addSubjectiveInfo( + VoidCallback? nextFunction(model) { + addSubjectiveInfo( model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList); diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index 5642faa8..85f1a744 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -21,22 +22,21 @@ import 'plan/update_plan_page.dart'; class UpdateSoapIndex extends StatefulWidget { final bool isUpdate; - const UpdateSoapIndex({Key key, this.isUpdate}) : super(key: key); + const UpdateSoapIndex({Key? key, required this.isUpdate}) : super(key: key); @override _UpdateSoapIndexState createState() => _UpdateSoapIndexState(); } -class _UpdateSoapIndexState extends State - with TickerProviderStateMixin { - PageController _controller; +class _UpdateSoapIndexState extends State with TickerProviderStateMixin { + PageController? _controller; int _currentIndex = 0; - List myAllergiesList = List(); - List myHistoryList = List(); + List myAllergiesList = []; + List myHistoryList = []; changePageViewIndex(pageIndex, {isChangeState = true}) { if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); - _controller.jumpToPage(pageIndex); + _controller?.jumpToPage(pageIndex); setState(() { _currentIndex = pageIndex; }); @@ -64,7 +64,7 @@ class _UpdateSoapIndexState extends State } @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return BaseView( builder: (_,model,w)=>AppScaffold( @@ -72,8 +72,8 @@ class _UpdateSoapIndexState extends State isShowAppBar: true, appBar: PatientProfileAppBar(patient), patientProfileAppBarModel: PatientProfileAppBarModel( - isInpatient:patient.admissionNo== null || patient.admissionNo!.isEmpty?false:true , - patient: patient + isInpatient:patient.admissionNo== null || patient.admissionNo!.isEmpty?false:true , + patient: patient ), body: SingleChildScrollView( child: Column( @@ -149,8 +149,8 @@ class _UpdateSoapIndexState extends State ), Container( child: FractionallySizedBox( - widthFactor: .80, - child: getBottomSheet(model, patient) + widthFactor: .80, + child: getBottomSheet(model, patient) ), ), SizedBox( @@ -258,7 +258,7 @@ class _UpdateSoapIndexState extends State padding: 10, disabled: model.state == ViewState.BusyLocal, onPressed: () async { - model.nextOnAssessmentPage(model); + model.nextOnAssessmentPage(model); }, ), ), @@ -283,7 +283,7 @@ class _UpdateSoapIndexState extends State fontWeight: FontWeight.w600, disabled: model.state == ViewState.BusyLocal, onPressed: () async { - changePageViewIndex(2); + changePageViewIndex(2); }, ), ), @@ -302,7 +302,7 @@ class _UpdateSoapIndexState extends State color: Colors.red[700], disabled: model.progressNoteText.isEmpty, onPressed: () async { - model.nextOnPlanPage(model); + model.nextOnPlanPage(model); }, ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index 69f45d6e..b99e66b4 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -17,13 +17,13 @@ class VitalSignBloodPressureWidget extends StatefulWidget { final String viewKey2; VitalSignBloodPressureWidget( - {Key key, - this.vitalList, - this.title1, - this.title2, - this.viewKey1, - this.title3, - this.viewKey2}); + {Key? key, + required this.vitalList, + required this.title1, + required this.title2, + required this.viewKey1, + required this.title3, + required this.viewKey2}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -96,7 +96,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart index cec53580..520438d8 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -15,7 +15,7 @@ class VitalSignDetailsWidget extends StatefulWidget { final String viewKey; VitalSignDetailsWidget( - {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); + {Key? key, required this.vitalList, required this.title1, required this.title2, required this.viewKey}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -93,7 +93,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index 20d5b439..d051f98c 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -9,17 +9,17 @@ class VitalSignItem extends StatelessWidget { final String lastVal; final String unit; final String imagePath; - final double height; - final double width; + final double? height; + final double? width; const VitalSignItem( - {Key key, - @required this.des, + {Key? key, + required this.des, this.lastVal = 'N/A', this.unit = '', this.height, this.width, - @required this.imagePath}) + required this.imagePath}) : super(key: key); @override diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 0ed9da56..b8b8958f 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -14,20 +14,20 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class VitalSignItemDetailsScreen extends StatelessWidget { - final vitalSignDetails pageKey; - final String pageTitle; - List VSchart; + final vitalSignDetails? pageKey; + final String? pageTitle; + List? VSchart; PatiantInformtion patient; String patientType; String arrivalType; VitalSignItemDetailsScreen( - {this.vitalList, - this.pageKey, - this.pageTitle, - this.patient, - this.patientType, - this.arrivalType}); + {required this.vitalList, + required this.pageKey, + required this.pageTitle, + required this.patient, + required this.patientType, + required this.arrivalType}); final List vitalList; @@ -187,7 +187,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { default: } return AppScaffold( - appBarTitle: pageTitle, + appBarTitle: pageTitle ?? "", backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, appBar: PatientProfileAppBar( @@ -202,7 +202,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient?.patientDetails?.firstName?? patient.fullName?? ''}'s", + "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, @@ -220,7 +220,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { child: ListView( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), - children: VSchart.map((chartInfo) { + children: VSchart!.map((chartInfo) { var vitalListTemp = vitalList.where( (element) => element.toJson()[chartInfo['viewKey']] != null, ); diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index ef8049ce..1f9a9280 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -11,12 +11,12 @@ import 'LineChartCurved.dart'; class VitalSingChartAndDetials extends StatelessWidget { VitalSingChartAndDetials({ - Key key, - @required this.vitalList, - @required this.name, - @required this.viewKey, - @required this.title1, - @required this.title2, + Key? key, + required this.vitalList, + required this.name, + required this.viewKey, + required this.title1, + required this.title2, }) : super(key: key); final List vitalList; diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index d0416539..adfb124b 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -11,14 +11,14 @@ import 'LineChartCurvedBloodPressure.dart'; class VitalSingChartBloodPressure extends StatelessWidget { VitalSingChartBloodPressure({ - Key key, - @required this.vitalList, - @required this.name, - @required this.viewKey1, - @required this.viewKey2, - @required this.title1, - @required this.title2, - @required this.title3, + Key? key, + required this.vitalList, + required this.name, + required this.viewKey1, + required this.viewKey2, + required this.title1, + required this.title2, + required this.title3, }) : super(key: key); final List vitalList; diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart index 0fa99b00..8d9bfeef 100644 --- a/lib/screens/patients/register_patient/CustomEditableText.dart +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; class CustomEditableText extends StatefulWidget { CustomEditableText({ Key? key, - @required this.controller, + required this.controller, this.hint, this.isEditable = false, required this.isSubmitted, @@ -37,7 +37,7 @@ class _CustomEditableTextState extends State { borderRadius: BorderRadius.all(Radius.circular(20)), border: Border.fromBorderSide( BorderSide( - color: Colors.grey[300], + color: Colors.grey[300]!, width: 2, ), ), diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index a07104e3..5a65146c 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -14,7 +14,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'RegisterSearchPatientPage.dart'; class RegisterPatientPage extends StatefulWidget { - const RegisterPatientPage({Key key}) : super(key: key); + const RegisterPatientPage({Key? key}) : super(key: key); @override _RegisterPatientPageState createState() => _RegisterPatientPageState(); @@ -82,9 +82,9 @@ class _RegisterPatientPageState extends State currentStepIndex: _currentIndex + 1, screenSize: screenSize, stepsTitles: [ - TranslationBase.of(context).search, - TranslationBase.of(context).activation, - TranslationBase.of(context).confirmation, + TranslationBase.of(context).search!, + TranslationBase.of(context).activation!, + TranslationBase.of(context).confirmation!, ], ), SizedBox( diff --git a/lib/screens/patients/register_patient/VerifyActivationCodePage.dart b/lib/screens/patients/register_patient/VerifyActivationCodePage.dart index d58e5a3b..6f0e1a31 100644 --- a/lib/screens/patients/register_patient/VerifyActivationCodePage.dart +++ b/lib/screens/patients/register_patient/VerifyActivationCodePage.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class VerifyActivationCodePage extends StatefulWidget { - const VerifyActivationCodePage({Key key}) : super(key: key); + const VerifyActivationCodePage({Key? key}) : super(key: key); @override _VerifyActivationCodePageState createState() => diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart index f4692138..c60b5012 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -506,15 +506,15 @@ class _ActivationPageState extends State { counterText: " ", enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index eeb21cc9..3d4e0203 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -21,7 +21,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; -import '../../widgets/shared/text_fields/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/drugtodrug.dart index 15abfeb6..e5c5291f 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/drugtodrug.dart @@ -33,6 +33,8 @@ class _DrugToDrug extends State { {'name': 'LOW', 'level': 'LEVEL_1'}, {'name': 'INFO', 'level': 'INFO'}, ]; + + ///TODO Elham* Check this it seem something wrong GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( patientMRN: 2954208, //widget.patient.patientMRN, episodeId: 210011002, //widget.patient.episodeNo, @@ -54,45 +56,34 @@ class _DrugToDrug extends State { Widget build(BuildContext context) { return isLoaded == true ? BaseView( - onModelReady: (model3) => model3.getDrugToDrug( - model.patientVitalSigns, - widget.listAssessment, - model2.patientAllergiesList, - widget.patient, - widget.prescription), - builder: (BuildContext context, PrescriptionViewModel model3, - Widget child) => - NetworkBaseView( - baseViewModel: model3, - child: Container( - height: SizeConfig.realScreenHeight * .4, - child: new ListView.builder( - itemCount: expandableList.length, - itemBuilder: (context, i) { - return new ExpansionTile( - title: new AppText( - expandableList[i]['name'] + - ' ' + - '(' + - getDrugInfo(expandableList[i]['level'], - model3) - .length - .toString() + - ')', - fontSize: 20, - fontWeight: FontWeight.bold, - ), - children: getDrugInfo( - expandableList[i]['level'], model3) - .map((item) { - return Container( - padding: EdgeInsets.all(10), - child: AppText( - item['comment'], - color: Colors.red[900], - )); - }).toList()); - })))) + onModelReady: (model3) => model3.getDrugToDrug(model.patientVitalSigns!, widget.listAssessment, + model2.patientAllergiesList, widget.patient, widget.prescription), + builder: (BuildContext context, PrescriptionViewModel model3, Widget? child) => NetworkBaseView( + baseViewModel: model3, + child: Container( + height: SizeConfig.realScreenHeight * .4, + child: new ListView.builder( + itemCount: expandableList.length, + itemBuilder: (context, i) { + return new ExpansionTile( + title: new AppText( + expandableList[i]['name'] + + ' ' + + '(' + + getDrugInfo(expandableList[i]['level'], model3).length.toString() + + ')', + fontSize: 20, + fontWeight: FontWeight.bold, + ), + children: getDrugInfo(expandableList[i]['level'], model3).map((item) { + return Container( + padding: EdgeInsets.all(10), + child: AppText( + item['comment'], + color: Colors.red[900], + )); + }).toList()); + })))) : Container( height: SizeConfig.realScreenHeight * .45, child: Center( diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index cac2f99a..98428e9d 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -32,12 +32,12 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class PrescriptionCheckOutScreen extends StatefulWidget { - final PrescriptionViewModel model; - final PatiantInformtion patient; - final List prescriptionList; - final ProcedureTempleteDetailsModel groupProcedures; + final PrescriptionViewModel? model; + final PatiantInformtion? patient; + final List? prescriptionList; + final ProcedureTempleteDetailsModel? groupProcedures; - const PrescriptionCheckOutScreen({Key key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) + const PrescriptionCheckOutScreen({Key? key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) : super(key: key); @override @@ -46,44 +46,44 @@ class PrescriptionCheckOutScreen extends StatefulWidget { class _PrescriptionCheckOutScreenState extends State { postPrescription( - {String duration, - String doseTimeIn, - String dose, - String drugId, - String strength, - String route, - String frequency, - String indication, - String instruction, - PrescriptionViewModel model, - DateTime doseTime, - String doseUnit, - String icdCode, - PatiantInformtion patient, - String patientType}) async { + {String? duration, + String? doseTimeIn, + String? dose, + String? drugId, + String? strength, + String? route, + String? frequency, + String? indication, + String? instruction, + PrescriptionViewModel? model, + DateTime? doseTime, + String? doseUnit, + String? icdCode, + PatiantInformtion? patient, + String? patientType}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); - List prescriptionList = List(); + List prescriptionList = []; - postProcedureReqModel.appointmentNo = patient.appointmentNo; + postProcedureReqModel.appointmentNo = patient!.appointmentNo; postProcedureReqModel.clinicID = patient.clinicId; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; prescriptionList.add(PrescriptionRequestModel( covered: true, - dose: double.parse(dose), - itemId: drugId.isEmpty ? 1 : int.parse(drugId), - doseUnitId: int.parse(doseUnit), - route: route.isEmpty ? 1 : int.parse(route), - frequency: frequency.isEmpty ? 1 : int.parse(frequency), + dose: double.parse(dose!), + itemId: drugId!.isEmpty ? 1 : int.parse(drugId), + doseUnitId: int.parse(doseUnit!), + route: route!.isEmpty ? 1 : int.parse(route), + frequency: frequency!.isEmpty ? 1 : int.parse(frequency), remarks: instruction, approvalRequired: true, icdcode10Id: icdCode.toString(), - doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), - duration: duration.isEmpty ? 1 : int.parse(duration), - doseStartDate: doseTime.toIso8601String())); + doseTime: doseTimeIn!.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration!.isEmpty ? 1 : int.parse(duration), + doseStartDate: doseTime!.toIso8601String())); postProcedureReqModel.prescriptionRequestModel = prescriptionList; - await model.postPrescription(postProcedureReqModel, patient.patientMRN); + await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -93,14 +93,14 @@ class _PrescriptionCheckOutScreenState extends State } } - String routeError; - String frequencyError; - String doseTimeError; - String durationError; - String unitError; - String strengthError; + String? routeError; + String? frequencyError; + String? doseTimeError; + String? durationError; + String? unitError; + String? strengthError; - int selectedType; + late int selectedType; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -110,10 +110,10 @@ class _PrescriptionCheckOutScreenState extends State bool visbiltySearch = true; final myController = TextEditingController(); - DateTime selectedDate; - int strengthChar; - GetMedicationResponseModel _selectedMedication; - GlobalKey key = new GlobalKey>(); + late DateTime selectedDate; + late int strengthChar; + late GetMedicationResponseModel _selectedMedication; + late GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -210,17 +210,17 @@ class _PrescriptionCheckOutScreenState extends State final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - model.getItem(itemID: int.parse(widget.groupProcedures.aliasN.replaceAll("item code ;", ""))); + model.getItem(itemID: int.parse(widget.groupProcedures!.aliasN!.replaceAll("item code ;", ""))); x = model.patientAssessmentList.map((element) { return element.icdCode10ID; }); GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: widget.patient.patientMRN, - episodeID: widget.patient.episodeNo.toString(), + patientMRN: widget.patient!.patientMRN, + episodeID: widget.patient!.episodeNo.toString(), editedBy: '', doctorID: '', - appointmentNo: widget.patient.appointmentNo); + appointmentNo: widget.patient!.appointmentNo); if (model.medicationStrengthList.length == 0) { await model.getMedicationStrength(); } @@ -235,7 +235,7 @@ class _PrescriptionCheckOutScreenState extends State builder: ( BuildContext context, MedicineViewModel model, - Widget child, + Widget? child, ) => AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), @@ -309,7 +309,7 @@ class _PrescriptionCheckOutScreenState extends State child: Column( children: [ AppText( - widget.groupProcedures.procedureName ?? "", + widget.groupProcedures!.procedureName ?? "", bold: true, ), Container( @@ -323,11 +323,11 @@ class _PrescriptionCheckOutScreenState extends State activeColor: Color(0xFFB9382C), value: 1, groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); + onChanged: (int? value) { + setSelectedType(value!); }, ), - Text(TranslationBase.of(context).regular), + Text(TranslationBase.of(context).regular!), ], ), ), @@ -366,7 +366,7 @@ class _PrescriptionCheckOutScreenState extends State PrescriptionTextFiled( width: MediaQuery.of(context).size.width * 0.560, element: units, - elementError: unitError, + elementError: unitError ?? "", keyName: 'description', keyId: 'parameterCode', hintText: 'Select', @@ -385,7 +385,7 @@ class _PrescriptionCheckOutScreenState extends State PrescriptionTextFiled( elementList: model.itemMedicineListRoute, element: route, - elementError: routeError, + elementError: routeError ?? "", keyId: 'parameterCode', keyName: 'description', okFunction: (selectedValue) { @@ -394,12 +394,12 @@ class _PrescriptionCheckOutScreenState extends State route['isDefault'] = true; }); }, - hintText: TranslationBase.of(context).route, + hintText: TranslationBase.of(context).route!, ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).frequency, - elementError: frequencyError, + hintText: TranslationBase.of(context).frequency!, + elementError: frequencyError ?? "", element: frequency, elementList: model.itemMedicineList, keyId: 'parameterCode', @@ -415,7 +415,7 @@ class _PrescriptionCheckOutScreenState extends State model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, + itemCode: _selectedMedication.itemId!, strength: double.parse(strengthController.text)); return; @@ -424,8 +424,8 @@ class _PrescriptionCheckOutScreenState extends State }), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).doseTime, - elementError: doseTimeError, + hintText: TranslationBase.of(context).doseTime! ?? "", + elementError: doseTimeError!, element: doseTime, elementList: model.medicationDoseTimeList, keyId: 'id', @@ -475,13 +475,13 @@ class _PrescriptionCheckOutScreenState extends State height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: () => selectDate(context, widget.model), + onTap: () => selectDate(context, widget.model!), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).date, + TranslationBase.of(context).date!, selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, + : '', true, suffixIcon: Icon( Icons.calendar_today, @@ -494,8 +494,8 @@ class _PrescriptionCheckOutScreenState extends State SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( element: duration, - elementError: durationError, - hintText: TranslationBase.of(context).duration, + elementError: durationError ?? "", + hintText: TranslationBase.of(context).duration!, elementList: model.medicationDurationList, keyName: 'nameEn', keyId: 'id', @@ -509,7 +509,7 @@ class _PrescriptionCheckOutScreenState extends State model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, + itemCode: _selectedMedication.itemId!, strength: double.parse(strengthController.text), ); box = model.boxQuintity; @@ -531,7 +531,7 @@ class _PrescriptionCheckOutScreenState extends State TextFields( maxLines: 6, minLines: 4, - hintText: TranslationBase.of(context).instruction, + hintText: TranslationBase.of(context).instruction!, controller: instructionController, //keyboardType: TextInputType.number, ), @@ -586,13 +586,13 @@ class _PrescriptionCheckOutScreenState extends State return; } - if (formKey.currentState.validate()) { + if (formKey.currentState!.validate()) { Navigator.pop(context); // openDrugToDrug(model); { postPrescription( icdCode: model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID.isEmpty + ? model.patientAssessmentList[0].icdCode10ID!.isEmpty ? "test" : model.patientAssessmentList[0].icdCode10ID.toString() : "test", @@ -607,9 +607,9 @@ class _PrescriptionCheckOutScreenState extends State doseUnit: model.itemMedicineListUnit.length == 1 ? model.itemMedicineListUnit[0]['parameterCode'].toString() : units['parameterCode'].toString(), - patient: widget.patient, + patient: widget.patient!, doseTimeIn: doseTime['id'].toString(), - model: widget.model, + model: widget.model!, duration: duration['id'].toString(), frequency: model.itemMedicineList.length == 1 ? model.itemMedicineList[0]['parameterCode'].toString() @@ -617,8 +617,8 @@ class _PrescriptionCheckOutScreenState extends State route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: (widget.groupProcedures.aliasN - .replaceAll("item code ;", "")), + drugId: (widget.groupProcedures!.aliasN! + .replaceAll!("item code ;", "")), strength: strengthController.text, indication: indicationController.text, instruction: instructionController.text, @@ -649,19 +649,19 @@ class _PrescriptionCheckOutScreenState extends State frequencyError = null; } if (units == null) { - unitError = TranslationBase.of(context).fieldRequired; + unitError = TranslationBase.of(context).fieldRequired!; } else { unitError = null; } if (strengthController.text == "") { - strengthError = TranslationBase.of(context).fieldRequired; + strengthError = TranslationBase.of(context).fieldRequired!; } else { strengthError = null; } }); } - formKey.currentState.save(); + formKey.currentState!.save(); }, ), ], @@ -690,12 +690,12 @@ class _PrescriptionCheckOutScreenState extends State Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), lastDate: DateTime(2040), - initialEntryMode: DatePickerEntryMode.calendar, + initialEntryMode: DatePickerEntryMode.calendar!, ); if (picked != null && picked != selectedDate) { setState(() { @@ -704,8 +704,8 @@ class _PrescriptionCheckOutScreenState extends State } } - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/prescription/prescription_details_page.dart b/lib/screens/prescription/prescription_details_page.dart index 623cee90..0fba4dc3 100644 --- a/lib/screens/prescription/prescription_details_page.dart +++ b/lib/screens/prescription/prescription_details_page.dart @@ -8,13 +8,13 @@ import 'package:flutter/material.dart'; class PrescriptionDetailsPage extends StatelessWidget { final PrescriptionReport prescriptionReport; - PrescriptionDetailsPage({Key key, this.prescriptionReport}); + PrescriptionDetailsPage({required Key key, required this.prescriptionReport}); @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, + appBarTitle: TranslationBase.of(context).prescriptions!, body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -28,14 +28,14 @@ class PrescriptionDetailsPage extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200], width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Row( children: [ ClipRRect( borderRadius: BorderRadius.all(Radius.circular(5)), child: Image.network( - prescriptionReport.imageSRCUrl, + prescriptionReport!.imageSRCUrl!, fit: BoxFit.cover, width: 60, height: 70, @@ -46,7 +46,7 @@ class PrescriptionDetailsPage extends StatelessWidget { padding: const EdgeInsets.all(8.0), child: Center( child: AppText( - prescriptionReport.itemDescription.isNotEmpty + prescriptionReport.itemDescription!.isNotEmpty! ? prescriptionReport.itemDescription : prescriptionReport.itemDescriptionN), ), @@ -109,28 +109,22 @@ class PrescriptionDetailsPage extends StatelessWidget { color: Colors.white, height: 50, width: double.infinity, - child: - Center(child: Text(prescriptionReport.routeN))), + child: Center(child: Text(prescriptionReport.routeN ?? ""))), Container( color: Colors.white, height: 50, width: double.infinity, - child: Center( - child: - Text(prescriptionReport.frequencyN ?? ''))), + child: Center(child: Text(prescriptionReport.frequencyN ?? ''))), Container( color: Colors.white, height: 50, width: double.infinity, - child: Center( - child: Text( - '${prescriptionReport.doseDailyQuantity}'))), + child: Center(child: Text('${prescriptionReport.doseDailyQuantity}'))), Container( color: Colors.white, height: 50, width: double.infinity, - child: - Center(child: Text('${prescriptionReport.days}'))) + child: Center(child: Text('${prescriptionReport.days}'))) ], ), ], diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index 84f38748..13f6f948 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_pati import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -23,14 +24,14 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { final int prescriptionIndex; PrescriptionItemsInPatientPage( - {Key key, - this.prescriptions, - this.patient, - this.patientType, - this.arrivalType, - this.stopOn, - this.startOn, - this.prescriptionIndex}); + {Key? key, + required this.prescriptions, + required this.patient, + required this.patientType, + required this.arrivalType, + required this.stopOn, + required this.startOn, + required this.prescriptionIndex}); @override Widget build(BuildContext context) { @@ -43,9 +44,9 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100], + backgroundColor: Colors.grey[100]!, baseViewModel: model, - appBar: PatientProfileAppBar(patient), + patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), body: SingleChildScrollView( child: Container( child: Column( @@ -101,7 +102,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).route, color: Colors.grey, ), - AppText(" " + prescriptions.routeDescription.toString() ?? ''), + AppText(" " + prescriptions.routeDescription.toString()), ], ), Row( @@ -169,7 +170,9 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).status, color: Colors.grey, ), - AppText(" " + prescriptions.statusDescription.toString() ?? ''), + AppText( + " " + prescriptions.statusDescription.toString(), + ), ], ), Row( diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index b97343c4..548b02a5 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; import 'package:doctor_app_flutter/core/viewModel/prescriptions_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -17,7 +18,12 @@ class PrescriptionItemsPage extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - PrescriptionItemsPage({Key key, this.prescriptions, this.patient, this.patientType, this.arrivalType}); + PrescriptionItemsPage( + {Key? key, + required this.prescriptions, + required this.patient, + required this.patientType, + required this.arrivalType}); @override Widget build(BuildContext context) { @@ -26,24 +32,23 @@ class PrescriptionItemsPage extends StatelessWidget { model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100], + backgroundColor: Colors.grey[100]!, baseViewModel: model, - appBar: PatientProfileAppBar( - patient, - clinic: prescriptions.clinicDescription, - branch: prescriptions.name, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, + clinic: prescriptions.clinicDescription!, + branch: prescriptions.name!, isPrescriptions: true, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), - doctorName: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, + appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate!), + doctorName: prescriptions.doctorName!, + profileUrl: prescriptions.doctorImageURL!, isAppointmentHeader: true, ), body: SingleChildScrollView( child: Container( child: Column( children: [ - - if (!prescriptions.isInOutPatient) + if (!prescriptions.isInOutPatient!) ...List.generate( model.prescriptionReportList.length, (index) => Container( @@ -59,7 +64,7 @@ class PrescriptionItemsPage extends StatelessWidget { children: [ Container( margin: EdgeInsets.only(left: 18,right: 18), - child: AppText(model.prescriptionReportList[index].itemDescription.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)), + child: AppText(model.prescriptionReportList[index].itemDescription!.isNotEmpty! ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)), SizedBox(height: 12,), Row( children: [ @@ -75,15 +80,15 @@ class PrescriptionItemsPage extends StatelessWidget { onTap: (){ showDialog( context: context, - builder: (ctx) => ShowImageDialog( - imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, - ) - ); + builder: (ctx) => ShowImageDialog( + imageUrl: + model.prescriptionReportEnhList[index].imageSRCUrl ?? "", + )); }, child: Padding( padding: const EdgeInsets.all(8.0), child: Image.network( - model.prescriptionReportList[index].imageSRCUrl, + model.prescriptionReportList[index].imageSRCUrl ?? "", fit: BoxFit.cover, ), ), @@ -96,13 +101,13 @@ class PrescriptionItemsPage extends StatelessWidget { Row( children: [ AppText(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: AppText(" "+model.prescriptionReportList[index].routeN)), + Expanded(child: AppText(" "+model.prescriptionReportList[index].routeN!)), ], ), Row( children: [ AppText(TranslationBase.of(context).frequency,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].frequencyN ?? ''), + AppText(" "+model.prescriptionReportList[index].frequencyN! ?? ''), ], ), Row( @@ -165,7 +170,7 @@ class PrescriptionItemsPage extends StatelessWidget { showDialog( context: context, builder: (ctx) => ShowImageDialog( - imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, + imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl!, ) ); }, @@ -174,7 +179,7 @@ class PrescriptionItemsPage extends StatelessWidget { Padding( padding: const EdgeInsets.all(8.0), child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl, + model.prescriptionReportEnhList[index].imageSRCUrl!, fit: BoxFit.cover, ), @@ -194,13 +199,13 @@ class PrescriptionItemsPage extends StatelessWidget { Row( children: [ AppText(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: AppText(" "+model.prescriptionReportEnhList[index].route??'')), + Expanded(child: AppText(" "+model.prescriptionReportEnhList[index].route!??'')), ], ), Row( children: [ AppText(TranslationBase.of(context).frequency,color: Colors.grey,), - AppText(" "+model.prescriptionReportEnhList[index].frequency ?? ''), + AppText(" "+model.prescriptionReportEnhList[index].frequency! ?? ''), ], ), Row( diff --git a/lib/screens/prescription/prescription_text_filed.dart b/lib/screens/prescription/prescription_text_filed.dart index 9fe92ed9..078456b8 100644 --- a/lib/screens/prescription/prescription_text_filed.dart +++ b/lib/screens/prescription/prescription_text_filed.dart @@ -8,6 +8,7 @@ import 'package:flutter/material.dart'; class PrescriptionTextFiled extends StatefulWidget { dynamic element; final String? elementError; + final bool? isSubmitted; final List elementList; final String keyName; final String keyId; diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index d61ac08d..9b27eeef 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_item_in_patient_page.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; @@ -23,7 +24,7 @@ import 'package:flutter/material.dart'; class PrescriptionsPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -38,10 +39,8 @@ class PrescriptionsPage extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Colors.grey[100], - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient:isInpatient,), body: patient.admissionNo == null ? FractionallySizedBox( widthFactor: 1.0, @@ -59,9 +58,9 @@ class PrescriptionsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ ServiceTitle( - title: TranslationBase.of(context).orders, + title: TranslationBase.of(context).orders!, subTitle: - TranslationBase.of(context).prescriptions, + TranslationBase.of(context).prescriptions!, ), ], ), @@ -74,9 +73,9 @@ class PrescriptionsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ ServiceTitle( - title: TranslationBase.of(context).orders, + title: TranslationBase.of(context).orders!, subTitle: - TranslationBase.of(context).prescriptions, + TranslationBase.of(context)!.prescriptions!, ), ], ), @@ -97,8 +96,8 @@ class PrescriptionsPage extends StatelessWidget { settingRoute: 'AddProcedureTabPage'), ); }, - label: TranslationBase.of(context) - .applyForNewPrescriptionsOrder, + label: TranslationBase.of(context)! + .applyForNewPrescriptionsOrder!, ), ...List.generate( model.prescriptionsList.length, @@ -117,17 +116,17 @@ class PrescriptionsPage extends StatelessWidget { ), child: DoctorCard( doctorName: - model.prescriptionsList[index].doctorName, + model.prescriptionsList[index].doctorName ?? "", profileUrl: model - .prescriptionsList[index].doctorImageURL, - branch: model.prescriptionsList[index].name, + .prescriptionsList[index].doctorImageURL ?? "", + branch: model.prescriptionsList[index].name ?? "", clinic: model.prescriptionsList[index] - .clinicDescription, + .clinicDescription ?? "", isPrescriptions: true, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.prescriptionsList[index] - .appointmentDate, + model.prescriptionsList[index]! + .appointmentDate ?? "", ), ))), if (model.prescriptionsList.isEmpty && @@ -183,14 +182,14 @@ class PrescriptionsPage extends StatelessWidget { model .medicationForInPatient[ index] - .startDatetime, + .startDatetime ?? "", ), stopOn: AppDateUtils .getDateTimeFromServerFormat( model .medicationForInPatient[ index] - .stopDatetime, + .stopDatetime ?? "", ), ), ), @@ -205,8 +204,8 @@ class PrescriptionsPage extends StatelessWidget { isPrescriptions: true, appointmentDate: AppDateUtils .getDateTimeFromServerFormat( - model.medicationForInPatient[index] - .prescriptionDatetime, + model.medicationForInPatient[index]! + .prescriptionDatetime ?? "", ), createdBy: model .medicationForInPatient[index] diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 01ba6a91..1fa0e98a 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -42,22 +42,22 @@ class UpdatePrescriptionForm extends StatefulWidget { final PrescriptionViewModel model; UpdatePrescriptionForm( - {this.drugName, - this.doseStreangth, - this.drugId, - this.remarks, - this.patient, - this.duration, - this.route, - this.dose, - this.startDate, - this.doseUnit, - this.enteredRemarks, - this.frequency, - this.model, - this.drugNameGeneric, - this.uom, - this.box}); + {required this.drugName, + required this.doseStreangth, + required this.drugId, + required this.remarks, + required this.patient, + required this.duration, + required this.route, + required this.dose, + required this.startDate, + required this.doseUnit, + required this.enteredRemarks, + required this.frequency, + required this.model, + required this.drugNameGeneric, + required this.uom, + required this.box}); @override _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); } @@ -66,35 +66,31 @@ class _UpdatePrescriptionFormState extends State { TextEditingController strengthController = TextEditingController(); TextEditingController remarksController = TextEditingController(); int testNum = 0; - int strengthChar; - PatiantInformtion patient; + late int strengthChar; + late PatiantInformtion patient; dynamic route; dynamic doseTime; dynamic frequencyUpdate; dynamic updatedDuration; dynamic units; - GetMedicationResponseModel newSelectedMedication; - GlobalKey key = - new GlobalKey>(); - List indicationList; + late GetMedicationResponseModel newSelectedMedication; + GlobalKey key = new GlobalKey>(); + late List indicationList; dynamic indication; - DateTime selectedDate; + late DateTime selectedDate; @override void initState() { super.initState(); strengthController.text = widget.doseStreangth; remarksController.text = widget.remarks; - indicationList = List(); + indicationList = []; dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; dynamic indication4 = {"id": 548, "name": "Mild Dizziness"}; dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"}; - dynamic indication6 = { - "id": 550, - "name": "Phenytoin Hypersensitivity Syndrome" - }; + dynamic indication6 = {"id": 550, "name": "Phenytoin Hypersensitivity Syndrome"}; dynamic indication7 = {"id": 551, "name": "Asterixis"}; dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"}; dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; @@ -115,8 +111,7 @@ class _UpdatePrescriptionFormState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return StatefulBuilder(builder: - (BuildContext context, StateSetter setState /*You can rename this!*/) { + return StatefulBuilder(builder: (BuildContext context, StateSetter setState /*You can rename this!*/) { return BaseView( onModelReady: (model) async { await model.getMedicationList(); @@ -127,20 +122,13 @@ class _UpdatePrescriptionFormState extends State { await model.getMedicationDoseTime(); await model.getItem(itemID: widget.drugId); //await model.getMedicationIndications(); - route = model.getLookupByIdFilter( - model.itemMedicineListRoute, widget.route); - doseTime = - model.getLookupById(model.medicationDoseTimeList, widget.dose); - updatedDuration = model.getLookupById( - model.medicationDurationList, widget.duration); - units = model.getLookupByIdFilter( - model.itemMedicineListUnit, widget.doseUnit); - frequencyUpdate = model.getLookupById( - model.medicationFrequencyList, widget.frequency); + route = model.getLookupByIdFilter(model.itemMedicineListRoute, widget.route); + doseTime = model.getLookupById(model.medicationDoseTimeList, widget.dose); + updatedDuration = model.getLookupById(model.medicationDurationList, widget.duration); + units = model.getLookupByIdFilter(model.itemMedicineListUnit, widget.doseUnit); + frequencyUpdate = model.getLookupById(model.medicationFrequencyList, widget.frequency); }, - builder: - (BuildContext context, MedicineViewModel model, Widget child) => - NetworkBaseView( + builder: (BuildContext context, MedicineViewModel model, Widget? child) => NetworkBaseView( baseViewModel: model, child: GestureDetector( onTap: () { @@ -150,15 +138,13 @@ class _UpdatePrescriptionFormState extends State { initialChildSize: 0.98, maxChildSize: 0.99, minChildSize: 0.6, - builder: - (BuildContext context, ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.5, child: Form( child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, vertical: 12.0), + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -244,25 +230,16 @@ class _UpdatePrescriptionFormState extends State { // height: 12, // ), Container( - height: - MediaQuery.of(context).size.height * - 0.060, + height: MediaQuery.of(context).size.height * 0.060, width: double.infinity, child: Row( children: [ Container( - width: MediaQuery.of(context) - .size - .width * - 0.4900, - height: MediaQuery.of(context) - .size - .height * - 0.55, + width: MediaQuery.of(context).size.width * 0.4900, + height: MediaQuery.of(context).size.height * 0.55, child: TextFields( inputFormatters: [ - LengthLimitingTextInputFormatter( - 5), + LengthLimitingTextInputFormatter(5), // WhitelistingTextInputFormatter // .digitsOnly ], @@ -270,8 +247,7 @@ class _UpdatePrescriptionFormState extends State { hintText: widget.doseStreangth, fontSize: 15.0, controller: strengthController, - keyboardType: TextInputType - .numberWithOptions( + keyboardType: TextInputType.numberWithOptions( decimal: true, ), onChanged: (String value) { @@ -279,8 +255,7 @@ class _UpdatePrescriptionFormState extends State { strengthChar = value.length; }); if (strengthChar >= 5) { - DrAppToastMsg.showErrorToast( - "Only 5 Digits allowed for strength"); + DrAppToastMsg.showErrorToast("Only 5 Digits allowed for strength"); } }, // validator: (value) { @@ -298,59 +273,34 @@ class _UpdatePrescriptionFormState extends State { width: 10.0, ), Container( - width: MediaQuery.of(context) - .size - .width * - 0.3700, + width: MediaQuery.of(context).size.width * 0.3700, child: InkWell( - onTap: - model.itemMedicineListUnit != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .itemMedicineListUnit, - attributeName: - 'description', - attributeValueId: - 'parameterCode', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + onTap: model.itemMedicineListUnit != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.itemMedicineListUnit, + attributeName: 'description', + attributeValueId: 'parameterCode', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + units = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: TextField( - decoration: - textFieldSelectorDecoration( - 'UNIT Type', - units != null - ? units[ - 'description'] - : null, - true), + decoration: textFieldSelectorDecoration( + 'UNIT Type', units != null ? units['description'] : null, true), enabled: false, ), ), @@ -362,51 +312,37 @@ class _UpdatePrescriptionFormState extends State { height: 12, ), Container( - height: - MediaQuery.of(context).size.height * - 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.itemMedicineListRoute != - null + onTap: model.itemMedicineListRoute != null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .itemMedicineListRoute, - attributeName: 'description', - attributeValueId: - 'parameterCode', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - }); - if (route == null) { - route = route['id']; - } - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.itemMedicineListRoute, + attributeName: 'description', + attributeValueId: 'parameterCode', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + }); + if (route == null) { + route = route['id']; } + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - 'Route', - route != null - ? route['description'] - : null, - true), + decoration: textFieldSelectorDecoration( + 'Route', route != null ? route['description'] : null, true), enabled: false, ), ), @@ -415,48 +351,34 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: - MediaQuery.of(context).size.height * - 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationDoseTimeList != - null + onTap: model.medicationDoseTimeList != null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDoseTimeList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationDoseTimeList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .doseTime, - doseTime != null - ? doseTime['nameEn'] - : null, - true), + decoration: textFieldSelectorDecoration(TranslationBase.of(context).doseTime!, + doseTime != null ? doseTime['nameEn'] : null, true), enabled: false, ), ), @@ -465,50 +387,36 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: - MediaQuery.of(context).size.height * - 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationFrequencyList != - null + onTap: model.medicationFrequencyList != null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationFrequencyList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - frequencyUpdate = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationFrequencyList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + frequencyUpdate = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .frequency, - frequencyUpdate != null - ? frequencyUpdate[ - 'nameEn'] - : null, - true), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).frequency!, + frequencyUpdate != null ? frequencyUpdate['nameEn'] : null, + true), enabled: false, ), ), @@ -517,51 +425,36 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: - MediaQuery.of(context).size.height * - 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationDurationList != - null + onTap: model.medicationDurationList != null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDurationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - updatedDuration = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationDurationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + updatedDuration = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .duration, - updatedDuration != null - ? updatedDuration[ - 'nameEn'] - .toString() - : null, - true), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).duration!, + updatedDuration != null ? updatedDuration['nameEn'].toString() : null, + true), enabled: false, ), ), @@ -570,89 +463,55 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: model.patientAssessmentList - .isNotEmpty - ? screenSize.height * 0.070 - : 0.0, - width: model.patientAssessmentList - .isNotEmpty - ? double.infinity - : 0.0, - child: model.patientAssessmentList - .isNotEmpty + height: + model.patientAssessmentList.isNotEmpty ? screenSize.height * 0.070 : 0.0, + width: model.patientAssessmentList.isNotEmpty ? double.infinity : 0.0, + child: model.patientAssessmentList.isNotEmpty ? Row( - children: [ - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.29, - child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - model.patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString() - : '', - indication != null - ? indication[ - 'name'] - : null, - true), - enabled: true, - readOnly: true, - ), - ), - ), - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.61, - child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, - child: TextField( - maxLines: 3, - decoration: textFieldSelectorDecoration( - model.patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .asciiDesc - .toString() - : '', - indication != null - ? indication[ - 'name'] - : null, - true), - enabled: true, - readOnly: true, - ), - ), - ), - ], - ) + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: InkWell( + onTap: indicationList != null + ? () { + Helpers.hideKeyboard(context); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + model.patientAssessmentList.isNotEmpty + ? model.patientAssessmentList[0].icdCode10ID.toString() + : '', + indication != null ? indication['name'] : null, + true), + enabled: true, + readOnly: true, + ), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.61, + child: InkWell( + onTap: indicationList != null + ? () { + Helpers.hideKeyboard(context); + } + : null, + child: TextField( + maxLines: 3, + decoration: textFieldSelectorDecoration( + model.patientAssessmentList.isNotEmpty + ? model.patientAssessmentList[0].asciiDesc.toString() + : '', + indication != null ? indication['name'] : null, + true), + enabled: true, + readOnly: true, + ), + ), + ), + ], + ) : null), SizedBox( height: 12.0, @@ -660,22 +519,18 @@ class _UpdatePrescriptionFormState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: () => - selectDate(context, widget.model), + onTap: () => selectDate(context, widget.model), child: TextField( - decoration: Helpers - .textFieldSelectorDecoration( - AppDateUtils.getDateFormatted( - DateTime.parse( - widget.startDate)), - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + decoration: Helpers.textFieldSelectorDecoration( + AppDateUtils.getDateFormatted(DateTime.parse(widget.startDate)), + selectedDate != null + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), enabled: false, ), ), @@ -688,39 +543,30 @@ class _UpdatePrescriptionFormState extends State { child: InkWell( onTap: model.allMedicationList != null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model.allMedicationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - // duration = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.allMedicationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + // duration = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - "UOM", - widget.uom != null - ? widget.uom - : null, - true), + decoration: textFieldSelectorDecoration( + "UOM", widget.uom != null ? widget.uom : null, true), // enabled: false, readOnly: true, ), @@ -731,40 +577,32 @@ class _UpdatePrescriptionFormState extends State { child: InkWell( onTap: model.allMedicationList != null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model.allMedicationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - // duration = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.allMedicationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + // duration = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - 'Box Quantity', - widget.box != null - ? "Box Quantity: " + - widget.box.toString() - : null, - true), + decoration: textFieldSelectorDecoration( + 'Box Quantity', + widget.box != null ? "Box Quantity: " + widget.box.toString() : null, + true), // enabled: false, readOnly: true, ), @@ -775,11 +613,8 @@ class _UpdatePrescriptionFormState extends State { ), Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), child: TextFields( controller: remarksController, maxLines: 7, @@ -790,59 +625,39 @@ class _UpdatePrescriptionFormState extends State { height: 10.0, ), SizedBox( - height: - MediaQuery.of(context).size.height * - 0.08, + height: MediaQuery.of(context).size.height * 0.08, ), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 2), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( - title: 'update prescription' - .toUpperCase(), + title: 'update prescription'.toUpperCase(), onPressed: () { - if (double.parse( - strengthController.text) > - 1000.0) { - DrAppToastMsg.showErrorToast( - "1000 is the MAX for the strength"); + if (double.parse(strengthController.text) > 1000.0) { + DrAppToastMsg.showErrorToast("1000 is the MAX for the strength"); return; } - if (double.parse( - strengthController - .text) == - 0.0) { - DrAppToastMsg.showErrorToast( - "strength can't be zero"); + if (double.parse(strengthController.text) == 0.0) { + DrAppToastMsg.showErrorToast("strength can't be zero"); return; } - if (strengthController - .text.length > - 4) { - DrAppToastMsg.showErrorToast( - "strength can't be more then 4 digits "); + if (strengthController.text.length > 4) { + DrAppToastMsg.showErrorToast("strength can't be more then 4 digits "); return; } // if(units==null&& updatedDuration==null&&frequencyUpdate==null&&) updatePrescription( newStartDate: selectedDate, - newDoseStreangth: - strengthController - .text.isNotEmpty - ? strengthController - .text - : widget - .doseStreangth, + newDoseStreangth: strengthController.text.isNotEmpty + ? strengthController.text + : widget.doseStreangth, newUnit: units != null - ? units['parameterCode'] - .toString() + ? units['parameterCode'].toString() : widget.doseUnit, doseUnit: widget.doseUnit, - doseStreangth: - widget.doseStreangth, + doseStreangth: widget.doseStreangth, duration: widget.duration, startDate: widget.startDate, doseId: widget.dose, @@ -850,30 +665,18 @@ class _UpdatePrescriptionFormState extends State { routeId: widget.route, patient: widget.patient, model: widget.model, - newDuration: - updatedDuration != null - ? updatedDuration['id'] - .toString() - : widget.duration, + newDuration: updatedDuration != null + ? updatedDuration['id'].toString() + : widget.duration, drugId: widget.drugId, - remarks: remarksController - .text, - route: route != null - ? route['parameterCode'] - .toString() - : widget.route, - frequency: - frequencyUpdate != null - ? frequencyUpdate[ - 'id'] - .toString() - : widget.frequency, - dose: doseTime != null - ? doseTime['id'] - .toString() - : widget.dose, - enteredRemarks: - widget.enteredRemarks); + remarks: remarksController.text, + route: + route != null ? route['parameterCode'].toString() : widget.route, + frequency: frequencyUpdate != null + ? frequencyUpdate['id'].toString() + : widget.frequency, + dose: doseTime != null ? doseTime['id'].toString() : widget.dose, + enteredRemarks: widget.enteredRemarks); Navigator.pop(context); }, ), @@ -898,7 +701,7 @@ class _UpdatePrescriptionFormState extends State { Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -912,9 +715,8 @@ class _UpdatePrescriptionFormState extends State { } } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -931,11 +733,11 @@ class _UpdatePrescriptionFormState extends State { hintText: selectedText != null ? selectedText : hintText, suffixIcon: isDropDown ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.arrow_drop_down, - color: Colors.black, - ) + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) : null, hintStyle: TextStyle( fontSize: 14, @@ -945,30 +747,29 @@ class _UpdatePrescriptionFormState extends State { } updatePrescription( - {PrescriptionViewModel model, - int drugId, - String newDrugId, - String frequencyId, - String remarks, - String dose, - String doseId, - String frequency, - String route, - String routeId, - String startDate, - DateTime newStartDate, - String doseUnit, - String doseStreangth, - String newDoseStreangth, - String duration, - String newDuration, - String newUnit, - String enteredRemarks, - PatiantInformtion patient}) async { + {required PrescriptionViewModel model, + required int drugId, + String? newDrugId, + required String frequencyId, + required String remarks, + required String dose, + required String doseId, + required String frequency, + required String route, + required String routeId, + required String startDate, + required DateTime newStartDate, + required String doseUnit, + required String doseStreangth, + required String newDoseStreangth, + required String duration, + required String newDuration, + required String newUnit, + required String enteredRemarks, + required PatiantInformtion patient}) async { //PrescriptionViewModel model = PrescriptionViewModel(); - PostPrescriptionReqModel updatePrescriptionReqModel = - new PostPrescriptionReqModel(); - List sss = List(); + PostPrescriptionReqModel updatePrescriptionReqModel = new PostPrescriptionReqModel(); + List sss = []; updatePrescriptionReqModel.appointmentNo = patient.appointmentNo; updatePrescriptionReqModel.clinicID = patient.clinicId; @@ -977,31 +778,22 @@ class _UpdatePrescriptionFormState extends State { sss.add(PrescriptionRequestModel( covered: true, - dose: newDoseStreangth.isNotEmpty - ? double.parse(newDoseStreangth) - : double.parse(doseStreangth), + dose: newDoseStreangth.isNotEmpty ? double.parse(newDoseStreangth) : double.parse(doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1, itemId: drugId, - doseUnitId: - newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), + doseUnitId: newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), - frequency: frequency.isNotEmpty - ? int.parse(frequency) - : int.parse(frequencyId), + frequency: frequency.isNotEmpty ? int.parse(frequency) : int.parse(frequencyId), remarks: remarks.isEmpty ? enteredRemarks : remarks, approvalRequired: true, icdcode10Id: "test2", doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), - duration: newDuration.isNotEmpty - ? int.parse(newDuration) - : int.parse(duration), - doseStartDate: - newStartDate != null ? newStartDate.toIso8601String() : startDate)); + duration: newDuration.isNotEmpty ? int.parse(newDuration) : int.parse(duration), + doseStartDate: newStartDate != null ? newStartDate.toIso8601String() : startDate)); updatePrescriptionReqModel.prescriptionRequestModel = sss; //postProcedureReqModel.procedures = controlsProcedure; - await model.updatePrescription( - updatePrescriptionReqModel, patient.patientMRN); + await model.updatePrescription(updatePrescriptionReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -1013,22 +805,22 @@ class _UpdatePrescriptionFormState extends State { void updatePrescriptionForm( {context, - String drugName, - String drugNameGeneric, - int drugId, - String remarks, - PrescriptionViewModel model, - PatiantInformtion patient, - String rouat, - String frequency, - String dose, - String duration, - String doseStreangth, - String doseUnit, - String enteredRemarks, - String uom, - int box, - String startDate}) { + required String drugName, + required String drugNameGeneric, + required int drugId, + required String remarks, + required PrescriptionViewModel model, + required PatiantInformtion patient, + required String rouat, + required String frequency, + required String dose, + required String duration, + required String doseStreangth, + required String doseUnit, + required String enteredRemarks, + required String uom, + required int box, + required String startDate}) { TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); diff --git a/lib/screens/procedures/ExpansionProcedure.dart b/lib/screens/procedures/ExpansionProcedure.dart index 06e56f03..740ae8e6 100644 --- a/lib/screens/procedures/ExpansionProcedure.dart +++ b/lib/screens/procedures/ExpansionProcedure.dart @@ -15,24 +15,24 @@ class ExpansionProcedure extends StatefulWidget { final ProcedureViewModel model; final Function(ProcedureTempleteDetailsModel) removeFavProcedure; final Function(ProcedureTempleteDetailsModel) addFavProcedure; - final Function(ProcedureTempleteDetailsModel) selectProcedures; + final Function(ProcedureTempleteDetailsModel)? selectProcedures; - final bool Function(ProcedureTempleteModel) isEntityListSelected; - final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected; + final bool Function(ProcedureTempleteModel)? isEntityListSelected; + final bool Function(ProcedureTempleteDetailsModel)? isEntityFavListSelected; final bool isProcedure; final ProcedureTempleteDetailsModel groupProcedures; const ExpansionProcedure( - {Key key, - this.procedureTempleteModel, - this.model, - this.removeFavProcedure, - this.addFavProcedure, + {Key? key, + required this.procedureTempleteModel, + required this.model, + required this.removeFavProcedure, + required this.addFavProcedure, this.selectProcedures, this.isEntityListSelected, this.isEntityFavListSelected, this.isProcedure = true, - this.groupProcedures}) + required this.groupProcedures}) : super(key: key); @override @@ -77,8 +77,8 @@ class _ExpansionProcedureState extends State { padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), child: AppText( widget.isProcedure == true - ? "Procedures for " + widget.procedureTempleteModel.templateName - : "Prescription for " + widget.procedureTempleteModel.templateName, + ? "Procedures for " + widget.procedureTempleteModel.templateName! + : "Prescription for " + widget.procedureTempleteModel.templateName!, fontSize: 16.0, variant: "bodyText", bold: true, @@ -118,14 +118,14 @@ class _ExpansionProcedureState extends State { onTap: () { if (widget.isProcedure) { setState(() { - if (widget.isEntityFavListSelected(itemProcedure)) { + if (widget.isEntityFavListSelected!(itemProcedure)) { widget.removeFavProcedure(itemProcedure); } else { widget.addFavProcedure(itemProcedure); } }); } else { - widget.selectProcedures(itemProcedure); + widget.selectProcedures!(itemProcedure); } }, child: Container( @@ -140,11 +140,11 @@ class _ExpansionProcedureState extends State { padding: const EdgeInsets.symmetric(horizontal: 11), child: widget.isProcedure ? Checkbox( - value: widget.isEntityFavListSelected(itemProcedure), + value: widget.isEntityFavListSelected!(itemProcedure), activeColor: Color(0xffD02127), - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isEntityFavListSelected(itemProcedure)) { + if (widget.isEntityFavListSelected!(itemProcedure)) { widget.removeFavProcedure(itemProcedure); } else { widget.addFavProcedure(itemProcedure); @@ -155,8 +155,8 @@ class _ExpansionProcedureState extends State { value: itemProcedure, groupValue: widget.groupProcedures, activeColor: Color(0xffD02127), - onChanged: (newValue) { - widget.selectProcedures(newValue); + onChanged: (ProcedureTempleteDetailsModel? newValue) { + widget.selectProcedures!(newValue!); })), Expanded( child: Padding( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 82bb649c..c8e2d5d4 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -12,21 +12,21 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class ProcedureCard extends StatelessWidget { - final Function onTap; + final GestureTapCallback onTap; final EntityList entityList; - final String categoryName; + final String? categoryName; final int categoryID; final PatiantInformtion patient; final int doctorID; final bool isInpatient; const ProcedureCard({ - Key key, - this.onTap, - this.entityList, - this.categoryID, + Key? key, + required this.onTap, + required this.entityList, + required this.categoryID, this.categoryName, - this.patient, - this.doctorID, + required this.patient, + required this.doctorID, this.isInpatient = false, }) : super(key: key); @@ -97,13 +97,13 @@ class ProcedureCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate ?? ""), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate))}', + '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate ?? ""))}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, @@ -150,7 +150,7 @@ class ProcedureCard extends StatelessWidget { 'assets/images/male_avatar.png', height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, ))), diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart index 28a72041..8b7400d4 100644 --- a/lib/screens/procedures/ProcedureType.dart +++ b/lib/screens/procedures/ProcedureType.dart @@ -10,19 +10,19 @@ enum ProcedureType { extension procedureType on ProcedureType { String getFavouriteTabName(BuildContext context) { - return TranslationBase.of(context).favoriteTemplates; + return TranslationBase.of(context).favoriteTemplates!; } String getAllLabelName(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).allProcedures; + return TranslationBase.of(context).allProcedures!; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).allLab; + return TranslationBase.of(context).allLab!; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).allRadiology; + return TranslationBase.of(context).allRadiology!; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).allPrescription; + return TranslationBase.of(context).allPrescription!; default: return ""; } @@ -31,13 +31,13 @@ extension procedureType on ProcedureType { String getToolbarLabel(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).addProcedures; + return TranslationBase.of(context).addProcedures!; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addLabOrder; + return TranslationBase.of(context).addLabOrder!; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).addRadiologyOrder; + return TranslationBase.of(context).addRadiologyOrder!; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).addPrescription; + return TranslationBase.of(context).addPrescription!; default: return ""; } @@ -46,13 +46,13 @@ extension procedureType on ProcedureType { String getAddButtonTitle(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).addProcedures; + return TranslationBase.of(context).addProcedures!; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addLabOrder; + return TranslationBase.of(context).addLabOrder!; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).addRadiologyOrder; + return TranslationBase.of(context).addRadiologyOrder!; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).addPrescription; + return TranslationBase.of(context).addPrescription!; default: return ""; } @@ -61,7 +61,7 @@ extension procedureType on ProcedureType { String getCategoryId() { switch (this) { case ProcedureType.PROCEDURE: - return null; + return ""; case ProcedureType.LAB_RESULT: return "02"; case ProcedureType.RADIOLOGY: @@ -69,20 +69,20 @@ extension procedureType on ProcedureType { case ProcedureType.PRESCRIPTION: return "55"; default: - return null; + return ""; } } String getCategoryName() { switch (this) { case ProcedureType.PROCEDURE: - return null; + return ''; case ProcedureType.LAB_RESULT: return "Laboratory"; case ProcedureType.RADIOLOGY: return "Radiology"; default: - return null; + return ''; } } } diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 7f4e49b2..8c5c8be0 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -19,17 +19,17 @@ import 'package:flutter/material.dart'; import 'ProcedureType.dart'; class AddFavouriteProcedure extends StatefulWidget { - final ProcedureViewModel model; - final PrescriptionViewModel prescriptionModel; + final ProcedureViewModel? model; + final PrescriptionViewModel? prescriptionModel; final PatiantInformtion patient; final ProcedureType procedureType; AddFavouriteProcedure({ - Key key, + Key? key, this.model, this.prescriptionModel, - this.patient, - @required this.procedureType, + required this.patient, + required this.procedureType, }); @override @@ -39,28 +39,28 @@ class AddFavouriteProcedure extends StatefulWidget { class _AddFavouriteProcedureState extends State { _AddFavouriteProcedureState({this.patient, this.model}); - ProcedureViewModel model; - PatiantInformtion patient; - List entityList = List(); - ProcedureTempleteDetailsModel groupProcedures; + ProcedureViewModel? model; + PatiantInformtion? patient; + List entityList = []; + ProcedureTempleteDetailsModel? groupProcedures; @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, baseViewModel: model, body: Column( children: [ Container( - height: MediaQuery.of(context).size.height * 0.070, + height: MediaQuery.of(context!).size.height * 0.070, ), - (model.templateList.length != 0) + (model!.templateList.length != 0) ? Expanded( child: EntityListCheckboxSearchFavProceduresWidget( isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), - model: model, + model: model!, removeFavProcedure: (item) { setState(() { entityList.remove(item); diff --git a/lib/screens/procedures/add-procedure-page.dart b/lib/screens/procedures/add-procedure-page.dart index e0b7374f..2e0c4324 100644 --- a/lib/screens/procedures/add-procedure-page.dart +++ b/lib/screens/procedures/add-procedure-page.dart @@ -16,13 +16,11 @@ import 'ProcedureType.dart'; import 'entity_list_checkbox_search_widget.dart'; class AddProcedurePage extends StatefulWidget { - final ProcedureViewModel model; + final ProcedureViewModel? model; final PatiantInformtion patient; final ProcedureType procedureType; - const AddProcedurePage( - {Key key, this.model, this.patient, @required this.procedureType}) - : super(key: key); + const AddProcedurePage({Key? key, this.model, required this.patient, required this.procedureType}) : super(key: key); @override _AddProcedurePageState createState() => _AddProcedurePageState( @@ -30,17 +28,17 @@ class AddProcedurePage extends StatefulWidget { } class _AddProcedurePageState extends State { - int selectedType; - ProcedureViewModel model; - PatiantInformtion patient; - ProcedureType procedureType; + int? selectedType; + ProcedureViewModel? model; + PatiantInformtion? patient; + ProcedureType? procedureType; _AddProcedurePageState({this.patient, this.model, this.procedureType}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + List entityListProcedure = []; TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -56,17 +54,16 @@ class _AddProcedurePageState extends State { return BaseView( onModelReady: (model) { model.getProcedureCategory( - categoryName: procedureType.getCategoryName(), - categoryID: procedureType.getCategoryId(), - patientId: patient.patientId); + categoryName: procedureType!.getCategoryName(), + categoryID: procedureType!.getCategoryId(), + patientId: patient!.patientId); }, - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, body: Column( children: [ Container( - height: MediaQuery.of(context).size.height * 0.070, + height: MediaQuery.of(context!).size.height * 0.070, ), Expanded( child: NetworkBaseView( @@ -121,8 +118,8 @@ class _AddProcedurePageState extends State { onTap: () { if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) - model.getProcedureCategory( - patientId: patient.patientId, + model!.getProcedureCategory( + patientId: patient!.patientId, categoryName: procedureName.text); else @@ -141,16 +138,13 @@ class _AddProcedurePageState extends State { ), ], ), - if ((procedureType == ProcedureType.PROCEDURE - ? procedureName.text.isNotEmpty - : true) && - model.categoriesList.length != 0) + if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) && + model!.categoriesList.length != 0) NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: - model.categoriesList[0].entityList, + model: widget.model!, + masterList: model.categoriesList[0].entityList!, removeHistory: (item) { setState(() { entityList.remove(item); @@ -181,7 +175,7 @@ class _AddProcedurePageState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: procedureType.getAddButtonTitle(context), + title: procedureType!.getAddButtonTitle(context), fontWeight: FontWeight.w700, color: Color(0xff359846), onPressed: () async { @@ -193,7 +187,7 @@ class _AddProcedurePageState extends State { return; } - await this.model.preparePostProcedure( + await this.model!.preparePostProcedure!( orderType: selectedType.toString(), entityList: entityList, patient: patient, diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index e9ab695b..2a5dd573 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -15,33 +15,28 @@ import 'add-favourite-procedure.dart'; import 'add-procedure-page.dart'; class BaseAddProcedureTabPage extends StatefulWidget { - final ProcedureViewModel model; - final PrescriptionViewModel prescriptionModel; - final PatiantInformtion patient; - final ProcedureType procedureType; + final ProcedureViewModel? model; + final PrescriptionViewModel? prescriptionModel; + final PatiantInformtion? patient; + final ProcedureType? procedureType; const BaseAddProcedureTabPage( - {Key key, - this.model, - this.prescriptionModel, - this.patient, - @required this.procedureType}) + {Key? key, this.model, this.prescriptionModel, this.patient, required this.procedureType}) : super(key: key); @override - _BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState( - patient: patient, model: model, procedureType: procedureType); + _BaseAddProcedureTabPageState createState() => + _BaseAddProcedureTabPageState(patient: patient!, model: model, procedureType: procedureType!); } -class _BaseAddProcedureTabPageState extends State - with SingleTickerProviderStateMixin { - final ProcedureViewModel model; +class _BaseAddProcedureTabPageState extends State with SingleTickerProviderStateMixin { + final ProcedureViewModel? model; final PatiantInformtion patient; final ProcedureType procedureType; - _BaseAddProcedureTabPageState({this.patient, this.model, this.procedureType}); + _BaseAddProcedureTabPageState({required this.patient, required this.model, required this.procedureType}); - TabController _tabController; + late TabController _tabController; int _activeTab = 0; @override @@ -68,8 +63,7 @@ class _BaseAddProcedureTabPageState extends State final screenSize = MediaQuery.of(context).size; return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, body: NetworkBaseView( baseViewModel: model, @@ -77,8 +71,7 @@ class _BaseAddProcedureTabPageState extends State minChildSize: 0.90, initialChildSize: 0.95, maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return Container( height: MediaQuery.of(context).size.height * 1.25, child: Padding( @@ -168,13 +161,13 @@ class _BaseAddProcedureTabPageState extends State if (widget.procedureType == ProcedureType.PRESCRIPTION) PrescriptionFormWidget( - widget.prescriptionModel, - widget.patient, - widget.prescriptionModel + widget.prescriptionModel!, + widget.patient!, + widget.prescriptionModel! .prescriptionList) else AddProcedurePage( - model: this.model, + model: this.model!, patient: patient, procedureType: procedureType, ), diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 725bb007..8d9aeb8b 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -14,20 +14,20 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { final Function addSelectedHistories; final Function(EntityList) removeHistory; final Function(EntityList) addHistory; - final Function(EntityList) addRemarks; + final Function(EntityList)? addRemarks; final bool Function(EntityList) isEntityListSelected; final List masterList; /// todo clear the function here EntityListCheckboxSearchWidget( - {Key key, - this.model, - this.addSelectedHistories, - this.removeHistory, - this.masterList, - this.addHistory, - this.isEntityListSelected, + {Key? key, + required this.model, + required this.addSelectedHistories, + required this.removeHistory, + required this.masterList, + required this.addHistory, + required this.isEntityListSelected, this.addRemarks}) : super(key: key); @@ -36,11 +36,10 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { _EntityListCheckboxSearchWidgetState(); } -class _EntityListCheckboxSearchWidgetState - extends State { +class _EntityListCheckboxSearchWidgetState extends State { int selectedType = 0; - int typeUrgent; - int typeRegular; + late int typeUrgent; + late int typeRegular; setSelectedType(int val) { setState(() { @@ -48,9 +47,9 @@ class _EntityListCheckboxSearchWidgetState }); } - List items = List(); - List remarksList = List(); - List typeList = List(); + List items = []; + List remarksList = []; + List typeList = []; @override void initState() { @@ -97,18 +96,14 @@ class _EntityListCheckboxSearchWidgetState title: Row( children: [ Checkbox( - value: widget.isEntityListSelected( - historyInfo), + value: widget.isEntityListSelected(historyInfo), activeColor: Color(0xffD02127), - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isEntityListSelected( - historyInfo)) { - widget.removeHistory( - historyInfo); + if (widget.isEntityListSelected(historyInfo)) { + widget.removeHistory(historyInfo); } else { - widget - .addHistory(historyInfo); + widget.addHistory(historyInfo); } }); }), @@ -159,13 +154,10 @@ class _EntityListCheckboxSearchWidgetState Color(0xFFD02127), value: 0, groupValue: selectedType, - onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + onChanged: (int? value) { + historyInfo.type = setSelectedType(value!).toString(); - historyInfo.type = - value.toString(); + historyInfo.type = value.toString(); }, ), AppText( @@ -178,10 +170,8 @@ class _EntityListCheckboxSearchWidgetState Color(0xFFD02127), groupValue: selectedType, value: 1, - onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + onChanged: (int? value) { + historyInfo.type = setSelectedType(value!).toString(); historyInfo.type = value.toString(); @@ -245,12 +235,12 @@ class _EntityListCheckboxSearchWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { + if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/screens/procedures/entity_list_fav_procedure.dart b/lib/screens/procedures/entity_list_fav_procedure.dart index 8d4f93ed..c308fa6a 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -15,32 +15,32 @@ import 'ExpansionProcedure.dart'; class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { final ProcedureViewModel model; - final Function addSelectedHistories; - final Function(ProcedureTempleteModel) removeHistory; - final Function(ProcedureTempleteModel) addHistory; - final Function(ProcedureTempleteModel) addRemarks; + final Function? addSelectedHistories; + final Function(ProcedureTempleteModel)? removeHistory; + final Function(ProcedureTempleteModel)? addHistory; + final Function(ProcedureTempleteModel)? addRemarks; final Function(ProcedureTempleteDetailsModel) removeFavProcedure; final Function(ProcedureTempleteDetailsModel) addFavProcedure; - final Function(ProcedureTempleteDetailsModel) selectProcedures; - final ProcedureTempleteDetailsModel groupProcedures; + final Function(ProcedureTempleteDetailsModel)? selectProcedures; + final ProcedureTempleteDetailsModel? groupProcedures; - final bool Function(ProcedureTempleteModel) isEntityListSelected; - final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected; - final List masterList; + final bool Function(ProcedureTempleteModel)? isEntityListSelected; + final bool Function(ProcedureTempleteDetailsModel)? isEntityFavListSelected; + final List? masterList; final bool isProcedure; EntityListCheckboxSearchFavProceduresWidget( - {Key key, - this.model, + {Key? key, + required this.model, this.addSelectedHistories, this.removeHistory, this.masterList, this.addHistory, - this.addFavProcedure, + required this.addFavProcedure, this.selectProcedures, - this.removeFavProcedure, + required this.removeFavProcedure, this.isEntityListSelected, this.isEntityFavListSelected, this.addRemarks, @@ -55,8 +55,8 @@ class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { class _EntityListCheckboxSearchFavProceduresWidgetState extends State { int selectedType = 0; - int typeUrgent; - int typeRegular; + late int typeUrgent; + late int typeRegular; setSelectedType(int val) { setState(() { @@ -64,10 +64,10 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State items = List(); - List itemsProcedure = List(); - List remarksList = List(); - List typeList = List(); + List items = []; + List itemsProcedure = []; + List remarksList = []; + List typeList = []; @override void initState() { @@ -112,11 +112,11 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State dummySearchList = List(); - dummySearchList.addAll(widget.masterList); + List dummySearchList = []; + dummySearchList.addAll(widget.masterList!); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.templateName.toLowerCase().contains(query.toLowerCase())) { + if (item.templateName!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); @@ -152,7 +152,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State _ProcedureCheckOutScreenState(); } class _ProcedureCheckOutScreenState extends State { - List remarksList = List(); + List remarksList = []; final TextEditingController remarksController = TextEditingController(); - List typeList = List(); + List typeList = []; @override Widget build(BuildContext context) { return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), isShowAppBar: false, body: SingleChildScrollView( @@ -198,7 +202,7 @@ class _ProcedureCheckOutScreenState extends State { color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { - List entityList = List(); + List entityList = []; widget.items.forEach((element) { entityList.add( EntityList( diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 79fb961c..d47865bb 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -19,7 +20,7 @@ import 'ProcedureType.dart'; import 'base_add_procedure_tab_page.dart'; class ProcedureScreen extends StatelessWidget { - int doctorNameP; + int? doctorNameP; void initState() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -29,7 +30,7 @@ class ProcedureScreen extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -38,12 +39,12 @@ class ProcedureScreen extends StatelessWidget { return BaseView( onModelReady: (model) => model.getProcedure(mrn: patient.patientId, patientType: patientType, appointmentNo: patient.appointmentNo), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient: isInpatient, ), body: SingleChildScrollView( @@ -152,33 +153,33 @@ class ProcedureScreen extends StatelessWidget { ), if (model.procedureList.isNotEmpty) ...List.generate( - model.procedureList[0].rowcount, + model.procedureList[0].rowcount!, (index) => ProcedureCard( - categoryID: model.procedureList[0].entityList[index].categoryID, - entityList: model.procedureList[0].entityList[index], + categoryID: model.procedureList[0].entityList![index].categoryID!, + entityList: model.procedureList[0].entityList![index], onTap: () { - if (model.procedureList[0].entityList[index].categoryID == 2 || - model.procedureList[0].entityList[index].categoryID == 4) + if (model.procedureList[0].entityList![index].categoryID == 2 || + model.procedureList[0].entityList![index].categoryID == 4) updateProcedureForm(context, model: model, patient: patient, - remarks: model.procedureList[0].entityList[index].remarks, - orderType: model.procedureList[0].entityList[index].orderType.toString(), - orderNo: model.procedureList[0].entityList[index].orderNo, - procedureName: model.procedureList[0].entityList[index].procedureName, - categoreId: model.procedureList[0].entityList[index].categoryID.toString(), - procedureId: model.procedureList[0].entityList[index].procedureId, - limetNo: model.procedureList[0].entityList[index].lineItemNo); + remarks: model.procedureList[0].entityList![index].remarks!, + orderType: model.procedureList[0].entityList![index].orderType.toString(), + orderNo: model.procedureList[0].entityList![index].orderNo!, + procedureName: model.procedureList[0].entityList![index].procedureName!, + categoreId: model.procedureList[0].entityList![index].categoryID.toString(), + procedureId: model.procedureList[0].entityList![index].procedureId!, + limetNo: model.procedureList[0].entityList![index].lineItemNo!); // } else // Helpers.showErrorToast( // 'You Cant Update This Procedure'); }, patient: patient, - doctorID: model?.doctorProfile?.doctorID, + doctorID: model.doctorProfile!.doctorID!, ), ), if (model.state == ViewState.ErrorLocal || - (model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty)) + (model.procedureList.isNotEmpty && model.procedureList[0].entityList!.isEmpty)) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index a11ac875..08402c38 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -18,15 +18,15 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; void updateProcedureForm(context, - {String procedureName, - int orderNo, - int limetNo, - PatiantInformtion patient, - String orderType, - String procedureId, - String remarks, - ProcedureViewModel model, - String categoreId}) { + {required String procedureName, + required int orderNo, + required int limetNo, + required PatiantInformtion patient, + required String orderType, + required String procedureId, + required String remarks, + required ProcedureViewModel model, + required String categoreId}) { //ProcedureViewModel model2 = ProcedureViewModel(); TextEditingController remarksController = TextEditingController(); TextEditingController orderController = TextEditingController(); @@ -60,15 +60,15 @@ class UpdateProcedureWidget extends StatefulWidget { final int limetNo; UpdateProcedureWidget( - {this.model, - this.procedureName, - this.remarks, - this.remarksController, - this.patient, - this.procedureId, - this.categoryId, - this.orderNo, - this.limetNo}); + {required this.model, + required this.procedureName, + required this.remarks, + required this.remarksController, + required this.patient, + required this.procedureId, + required this.categoryId, + required this.orderNo, + required this.limetNo}); @override _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); } @@ -86,26 +86,22 @@ class _UpdateProcedureWidgetState extends State { widget.remarksController.text = widget.remarks; } - List entityList = List(); + List entityList = []; dynamic selectedCategory; @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return StatefulBuilder(builder: - (BuildContext context, StateSetter setState /*You can rename this!*/) { + return StatefulBuilder(builder: (BuildContext context, StateSetter setState /*You can rename this!*/) { return BaseView( onModelReady: (model) => model.getCategory(), - builder: - (BuildContext context, ProcedureViewModel model, Widget child) => - NetworkBaseView( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 0.9, child: Form( child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -247,8 +243,8 @@ class _UpdateProcedureWidgetState extends State { activeColor: Color(0xFFB9382C), value: 0, groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); + onChanged: (int? value) { + setSelectedType(value!); }, ), Text('routine'), @@ -256,11 +252,11 @@ class _UpdateProcedureWidgetState extends State { activeColor: Color(0xFFB9382C), groupValue: selectedType, value: 1, - onChanged: (value) { - setSelectedType(value); + onChanged: (int? value) { + setSelectedType(value!); }, ), - Text(TranslationBase.of(context).urgent), + Text(TranslationBase.of(context).urgent ?? ""), ], ), ), @@ -295,9 +291,7 @@ class _UpdateProcedureWidgetState extends State { children: [ AppButton( color: Color(0xff359846), - title: TranslationBase.of(context) - .updateProcedure - .toUpperCase(), + title: TranslationBase.of(context).updateProcedure!.toUpperCase(), onPressed: () { // if (entityList.isEmpty == true && // widget.remarksController.text == @@ -344,20 +338,19 @@ class _UpdateProcedureWidgetState extends State { } updateProcedure( - {ProcedureViewModel model, - String remarks, - int limetNO, - int orderNo, - String newProcedureId, - String newCategorieId, - List entityList, - String orderType, - String procedureId, - PatiantInformtion patient, - String categorieId}) async { - UpdateProcedureRequestModel updateProcedureReqModel = - new UpdateProcedureRequestModel(); - List controls = List(); + {required ProcedureViewModel model, + required String remarks, + required int limetNO, + required int orderNo, + String? newProcedureId, + String? newCategorieId, + required List entityList, + required String orderType, + required String procedureId, + required PatiantInformtion patient, + required String categorieId}) async { + UpdateProcedureRequestModel updateProcedureReqModel = new UpdateProcedureRequestModel(); + List controls = []; ProcedureDetail controlsProcedure = new ProcedureDetail(); updateProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -424,9 +417,8 @@ class _UpdateProcedureWidgetState extends State { return false; } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index 59033e0d..1188c361 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -31,7 +31,7 @@ class _QrReaderScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).qr + TranslationBase.of(context).reader, + appBarTitle: TranslationBase.of(context).qr! + TranslationBase.of(context).reader!, body: Center( child: Container( margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index db8a0140..43ec1344 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -18,7 +18,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class AddRescheduleLeavScreen extends StatelessWidget { - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); @@ -27,7 +27,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves, + appBarTitle: TranslationBase.of(context).rescheduleLeaves!, body: SingleChildScrollView( child: Column(children: [ Padding( @@ -44,7 +44,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { false, ); }, - label: TranslationBase.of(context).applyForReschedule, + label: TranslationBase.of(context).applyForReschedule!, ), ), Column( @@ -59,7 +59,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { border: Border( left: BorderSide( color: item.status == 10 - ? Colors.red[800] + ? Colors.red[800]! : item.status == 2 ? HexColor('#CC9B14') : item.status == 9 @@ -99,7 +99,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { padding: EdgeInsets.only(top: 10), child: AppText( AppDateUtils.convertStringToDateFormat( - item.createdOn, 'yyyy-MM-dd HH:mm'), + item.createdOn!, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, )) ]), @@ -124,7 +124,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { AppText(TranslationBase.of(context).startDate), AppText( AppDateUtils.convertStringToDateFormat( - item.dateTimeFrom, 'yyyy-MM-dd HH:mm'), + item.dateTimeFrom!, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) @@ -143,7 +143,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { AppText(TranslationBase.of(context).endDate), AppText( AppDateUtils.convertStringToDateFormat( - item.dateTimeTo, 'yyyy-MM-dd HH:mm'), + item.dateTimeTo!, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) ], diff --git a/lib/util/NotificationPermissionUtils.dart b/lib/util/NotificationPermissionUtils.dart index 8950fae3..550fedc5 100644 --- a/lib/util/NotificationPermissionUtils.dart +++ b/lib/util/NotificationPermissionUtils.dart @@ -7,7 +7,7 @@ import 'package:permission_handler/permission_handler.dart'; class AppPermissionsUtils { - static requestVideoCallPermission({BuildContext context, String type,Function onTapGrant}) async { + static requestVideoCallPermission({required BuildContext context, required String type,required Function onTapGrant}) async { var cameraPermission = Permission.camera; var microphonePermission = Permission.microphone; diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index 0239bf57..a92f4bfb 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -10,9 +10,19 @@ import 'package:flutter/services.dart'; class VideoChannel{ /// channel name static const _channel = const MethodChannel("Dr.cloudSolution/videoCall"); - static openVideoCallScreen({kApiKey, kSessionId, kToken, callDuration, warningDuration,int vcId,String tokenID, - String generalId,int doctorId, String patientName, bool isRecording = false, Function() onCallEnd , - Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure, VoidCallback onCallConnected, VoidCallback onCallDisconnected}) async { + static openVideoCallScreen( + {kApiKey, + kSessionId, + kToken, + callDuration, + warningDuration, + int? vcId, + String? tokenID, + String? generalId, + int? doctorId, + required String patientName, bool isRecording = false, Function()? onCallEnd, + Function(SessionStatusModel sessionStatusModel)? onCallNotRespond, + Function(String error)? onFailure, VoidCallback? onCallConnected, VoidCallback? onCallDisconnected}) async { onCallConnected = onCallConnected ?? (){}; onCallDisconnected = onCallDisconnected ?? (){}; @@ -20,10 +30,10 @@ class VideoChannel{ try { _channel.setMethodCallHandler((call) { if(call.method == 'onCallConnected'){ - onCallConnected(); + onCallConnected!(); } if(call.method == 'onCallDisconnected'){ - onCallDisconnected(); + onCallDisconnected!(); } return true as dynamic; }); @@ -44,16 +54,15 @@ class VideoChannel{ "isRecording": isRecording, }, ); - if(result['callResponse'] == 'CallEnd') { - onCallEnd(); + if (result['callResponse'] == 'CallEnd') { + onCallEnd!(); + } else { + SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson( + Platform.isIOS ? result['sessionStatus'] : json.decode(result['sessionStatus'])); + onCallNotRespond!(sessionStatusModel); } - else { - SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson(Platform.isIOS ?result['sessionStatus'] :json.decode(result['sessionStatus'])); - onCallNotRespond(sessionStatusModel); - } - } catch (e) { - onFailure(e.toString()); + onFailure!(e.toString()); } } diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index a10a18e3..26df2120 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -431,7 +431,7 @@ class AppDateUtils { } static convertDateFormatImproved(String str) { - String newDate; + String newDate =''; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -448,6 +448,6 @@ class AppDateUtils { date.day.toString().padLeft(2, '0'); } - return newDate ?? ''; + return newDate ; } } diff --git a/lib/util/dr_app_shared_pref.dart b/lib/util/dr_app_shared_pref.dart index bac296bf..f42ddbed 100644 --- a/lib/util/dr_app_shared_pref.dart +++ b/lib/util/dr_app_shared_pref.dart @@ -32,7 +32,7 @@ class DrAppSharedPreferances { return prefs.setInt(key, value); } - getString(String key) async { + getString (String key) async { final SharedPreferences prefs = await _prefs; return prefs.getString(key); } @@ -40,7 +40,7 @@ class DrAppSharedPreferances { /// Get String [key] the key was saved getStringWithDefaultValue(String key, String defaultVal) async { final SharedPreferences prefs = await _prefs; - String value = prefs.getString(key); + String? value = prefs.getString(key); return value == null ? defaultVal : value; } diff --git a/lib/util/extenstions.dart b/lib/util/extenstions.dart index da353ad0..a0fd8082 100644 --- a/lib/util/extenstions.dart +++ b/lib/util/extenstions.dart @@ -1,10 +1,5 @@ extension Extension on Object { - bool isNullOrEmpty() => this == null || this == ''; - - bool isNullEmptyOrFalse() => this == null || this == '' || !this; - - bool isNullEmptyZeroOrFalse() => - this == null || this == '' || !this || this == 0; + bool isNullOrEmpty() => this == ''; } /// truncate the [String] without cutting words. The length is calculated with the suffix. diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 42816f9f..90b4e572 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -47,8 +47,8 @@ class Helpers { ), actions: [ AppButton( - onPressed: okFunction, - title: TranslationBase.of(context).noteConfirm, + onPressed: okFunction(), + title: TranslationBase.of(context).noteConfirm??"", fontColor: Colors.white, color: AppGlobal.appGreenColor, ), @@ -56,9 +56,9 @@ class Helpers { onPressed: () { Navigator.of(context).pop(); }, - title: TranslationBase.of(context).cancel, + title: TranslationBase.of(context).cancel??"", fontColor: Colors.white, - color: Colors.red[600], + color: Colors.red[600]!, ), ], ), @@ -87,15 +87,14 @@ class Helpers { mainAxisAlignment: MainAxisAlignment.end, children: [ CupertinoButton( - child: Text(TranslationBase.of(context).cancel, - style: textStyle(context)), + child: Text(TranslationBase.of(context).cancel ?? "", style: textStyle(context)), onPressed: () { Navigator.pop(context); }, ), CupertinoButton( child: Text( - TranslationBase.of(context).done, + TranslationBase.of(context).done ?? "", style: textStyle(context), ), onPressed: () { @@ -231,14 +230,13 @@ class Helpers { static String parseHtmlString(String htmlString) { final document = parse(htmlString); - final String parsedString = parse(document.body.text).documentElement.text; + final String parsedString = parse(document.body!.text).documentElement!.text; return parsedString; } - static InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon, Color dropDownColor}) { + static InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon, Color? dropDownColor}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -300,7 +298,7 @@ class Helpers { return htmlRegex.hasMatch(text); } - static String timeFrom({Duration duration}) { + static String timeFrom({required Duration duration}) { String twoDigits(int n) => n.toString().padLeft(2, "0"); String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60)); String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); @@ -335,7 +333,7 @@ class Helpers { bool isMiddle = false, bool isLast = false, bool isActive = false, - double radius = 6.0, ProjectViewModel projectViewModel}) { + double radius = 6.0, required ProjectViewModel projectViewModel}) { return BoxDecoration( color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), shape: BoxShape.rectangle, @@ -386,7 +384,7 @@ class Helpers { } static getTabText({ - String title, + required String title, bool isActive = false, }) { return AppText( @@ -403,7 +401,7 @@ class Helpers { return screenSize.height * 0.07; } - static getTabCounter({bool isActive: false, int counter}) { + static getTabCounter({bool isActive: false, int? counter}) { return Container( margin: EdgeInsets.all(4), width: 15, @@ -426,9 +424,7 @@ class Helpers { } static String convertToTitleCase(String text) { - if (text == null) { - return null; - } + if (text.length <= 1) { return text.toUpperCase(); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 0c25bca7e..e5acca16 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -6,1485 +6,1163 @@ import 'package:flutter/material.dart'; class TranslationBase { TranslationBase(this.locale); - - final Locale locale; + late Locale locale; static TranslationBase of(BuildContext context) { - return Localizations.of(context, TranslationBase); + return Localizations.of(context, TranslationBase)!; } - String get dashboardScreenToolbarTitle => - localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String? get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle']![locale.languageCode]; + + String? get settings => localizedValues['settings']![locale.languageCode]; + + String? get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo']![locale.languageCode]; + + String? get language => localizedValues['language']![locale.languageCode]; + + String? get lanEnglish => localizedValues['lanEnglish']![locale.languageCode]; + + String? get lanArabic => localizedValues['lanArabic']![locale.languageCode]; + + String? get theDoctor => localizedValues['theDoctor']![locale.languageCode]; + + String? get reply => localizedValues['reply']![locale.languageCode]; + + String? get time => localizedValues['time']![locale.languageCode]; - String get settings => localizedValues['settings'][locale.languageCode]; + String? get fileNo => localizedValues['fileNo']![locale.languageCode]; - String get areYouSureYouWantTo => - localizedValues['areYouSureYouWantTo'][locale.languageCode]; + String? get mobileNo => localizedValues['mobileNo']![locale.languageCode]; - String get language => localizedValues['language'][locale.languageCode]; + String? get replySuccessfully => localizedValues['replySuccessfully']![locale.languageCode]; - String get lanEnglish => localizedValues['lanEnglish'][locale.languageCode]; + String? get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle']![locale.languageCode]; - String get lanArabic => localizedValues['lanArabic'][locale.languageCode]; + String? get mySchedule => localizedValues['mySchedule']![locale.languageCode]; - String get theDoctor => localizedValues['theDoctor'][locale.languageCode]; + String? get errorNoSchedule => localizedValues['errorNoSchedule']![locale.languageCode]; - String get reply => localizedValues['reply'][locale.languageCode]; + String? get verify => localizedValues['verify']![locale.languageCode]; - String get time => localizedValues['time'][locale.languageCode]; + String? get referralDoctor => localizedValues['referralDoctor']![locale.languageCode]; - String get fileNo => localizedValues['fileNo'][locale.languageCode]; + String? get referringClinic => localizedValues['referringClinic']![locale.languageCode]; - String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; + String? get frequency => localizedValues['frequency']![locale.languageCode]; - String get replySuccessfully => - localizedValues['replySuccessfully'][locale.languageCode]; + String? get priority => localizedValues['priority']![locale.languageCode]; - String get messagesScreenToolbarTitle => - localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; + String? get maxResponseTime => localizedValues['maxResponseTime']![locale.languageCode]; - String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; + String? get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks']![locale.languageCode]; - String get errorNoSchedule => - localizedValues['errorNoSchedule'][locale.languageCode]; + String? get answerSuggestions => localizedValues['answerSuggestions']![locale.languageCode]; - String get verify => localizedValues['verify'][locale.languageCode]; + String? get outPatients => localizedValues['outPatients']![locale.languageCode]; - String get referralDoctor => - localizedValues['referralDoctor'][locale.languageCode]; + String? get searchPatient => localizedValues['searchPatient']![locale.languageCode]; + String? get searchPatientDashBoard => localizedValues['searchPatientDashBoard']![locale.languageCode]; + String? get searchPatientName => localizedValues['searchPatient-name']![locale.languageCode]; - String get referringClinic => - localizedValues['referringClinic'][locale.languageCode]; + String? get searchAbout => localizedValues['searchAbout']![locale.languageCode]; - String get frequency => localizedValues['frequency'][locale.languageCode]; + String? get patient => localizedValues['patient']![locale.languageCode]; + String? get patients => localizedValues['patients']![locale.languageCode]; + String? get labResult => localizedValues['labResult']![locale.languageCode]; - String get priority => localizedValues['priority'][locale.languageCode]; + String? get todayStatistics => localizedValues['todayStatistics']![locale.languageCode]; - String get maxResponseTime => - localizedValues['maxResponseTime'][locale.languageCode]; + String? get familyMedicine => localizedValues['familyMedicine']![locale.languageCode]; - String get clinicDetailsandRemarks => - localizedValues['clinicDetailsandRemarks'][locale.languageCode]; + String? get arrived => localizedValues['arrived']![locale.languageCode]; - String get answerSuggestions => - localizedValues['answerSuggestions'][locale.languageCode]; + String? get er => localizedValues['er']![locale.languageCode]; - String get outPatients => localizedValues['outPatients'][locale.languageCode]; + String? get walkIn => localizedValues['walkIn']![locale.languageCode]; - String get searchPatient => - localizedValues['searchPatient'][locale.languageCode]; - String get searchPatientDashBoard => - localizedValues['searchPatientDashBoard'][locale.languageCode]; - String get searchPatientName => - localizedValues['searchPatient-name'][locale.languageCode]; + String? get notArrived => localizedValues['notArrived']![locale.languageCode]; - String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; + String? get radiology => localizedValues['radiology']![locale.languageCode]; - String get patient => localizedValues['patient'][locale.languageCode]; - String get patients => localizedValues['patients'][locale.languageCode]; - String get labResult => localizedValues['labResult'][locale.languageCode]; + String? get service => localizedValues['service']![locale.languageCode]; - String get todayStatistics => - localizedValues['todayStatistics'][locale.languageCode]; + String? get referral => localizedValues['referral']![locale.languageCode]; - String get familyMedicine => - localizedValues['familyMedicine'][locale.languageCode]; + String? get inPatient => localizedValues['inPatient']![locale.languageCode]; + String? get myInPatient => localizedValues['myInPatient']![locale.languageCode]; + String? get myInPatientTitle => localizedValues['myInPatientTitle']![locale.languageCode]; + String? get inPatientLabel => localizedValues['inPatientLabel']![locale.languageCode]; - String get arrived => localizedValues['arrived'][locale.languageCode]; + String? get inPatientAll => localizedValues['inPatientAll']![locale.languageCode]; - String get er => localizedValues['er'][locale.languageCode]; + String? get operations => localizedValues['operations']![locale.languageCode]; - String get walkIn => localizedValues['walkIn'][locale.languageCode]; + String? get patientServices => localizedValues['patientServices']![locale.languageCode]; - String get notArrived => localizedValues['notArrived'][locale.languageCode]; + String? get searchMedicine => localizedValues['searchMedicine']![locale.languageCode]; + String? get searchMedicineDashboard => localizedValues['searchMedicineDashboard']![locale.languageCode]; - String get radiology => localizedValues['radiology'][locale.languageCode]; + String? get myReferralPatient => localizedValues['myReferralPatient']![locale.languageCode]; - String get service => localizedValues['service'][locale.languageCode]; + String? get referPatient => localizedValues['referPatient']![locale.languageCode]; - String get referral => localizedValues['referral'][locale.languageCode]; + String? get myReferral => localizedValues['myReferral']![locale.languageCode]; - String get inPatient => localizedValues['inPatient'][locale.languageCode]; - String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; - String get myInPatientTitle => - localizedValues['myInPatientTitle'][locale.languageCode]; - String get inPatientLabel => - localizedValues['inPatientLabel'][locale.languageCode]; + String? get myReferredPatient => localizedValues['myReferredPatient']![locale.languageCode]; + String? get referredPatient => localizedValues['referredPatient']![locale.languageCode]; + String? get referredOn => localizedValues['referredOn']![locale.languageCode]; - String get inPatientAll => - localizedValues['inPatientAll'][locale.languageCode]; + String? get firstName => localizedValues['firstName']![locale.languageCode]; - String get operations => localizedValues['operations'][locale.languageCode]; + String? get middleName => localizedValues['middleName']![locale.languageCode]; - String get patientServices => - localizedValues['patientServices'][locale.languageCode]; + String? get lastName => localizedValues['lastName']![locale.languageCode]; - String get searchMedicine => - localizedValues['searchMedicine'][locale.languageCode]; - String get searchMedicineDashboard => - localizedValues['searchMedicineDashboard'][locale.languageCode]; + String? get phoneNumber => localizedValues['phoneNumber']![locale.languageCode]; - String get myReferralPatient => - localizedValues['myReferralPatient'][locale.languageCode]; + String? get patientID => localizedValues['patientID']![locale.languageCode]; - String get referPatient => - localizedValues['referPatient'][locale.languageCode]; + String? get patientFile => localizedValues['patientFile']![locale.languageCode]; - String get myReferral => localizedValues['myReferral'][locale.languageCode]; + String? get search => localizedValues['search']![locale.languageCode]; - String get myReferredPatient => - localizedValues['myReferredPatient'][locale.languageCode]; - String get referredPatient => - localizedValues['referredPatient'][locale.languageCode]; - String get referredOn => localizedValues['referredOn'][locale.languageCode]; + String? get onlyArrivedPatient => localizedValues['onlyArrivedPatient']![locale.languageCode]; - String get firstName => localizedValues['firstName'][locale.languageCode]; - String get firstNameInAr => - localizedValues['firstNameInAr'][locale.languageCode]; + String? get searchMedicineNameHere => localizedValues['searchMedicineNameHere']![locale.languageCode]; - String get middleName => localizedValues['middleName'][locale.languageCode]; - String get middleNameInAr => - localizedValues['middleNameInAr'][locale.languageCode]; + String? get youCanFind => localizedValues['youCanFind']![locale.languageCode]; - String get lastName => localizedValues['lastName'][locale.languageCode]; - String get lastNameInAr => - localizedValues['lastNameInAr'][locale.languageCode]; + String? get itemsInSearch => localizedValues['itemsInSearch']![locale.languageCode]; - String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; + String? get qr => localizedValues['qr']![locale.languageCode]; - String get patientID => localizedValues['patientID'][locale.languageCode]; + String? get reader => localizedValues['reader']![locale.languageCode]; - String get patientFile => localizedValues['patientFile'][locale.languageCode]; + String? get startScanning => localizedValues['startScanning']![locale.languageCode]; - String get search => localizedValues['search'][locale.languageCode]; + String? get scanQrCode => localizedValues['scanQrCode']![locale.languageCode]; - String get onlyArrivedPatient => - localizedValues['onlyArrivedPatient'][locale.languageCode]; + String? get scanQr => localizedValues['scanQr']![locale.languageCode]; - String get searchMedicineNameHere => - localizedValues['searchMedicineNameHere'][locale.languageCode]; + String? get profile => localizedValues['profile']![locale.languageCode]; - String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; + String? get gender => localizedValues['gender']![locale.languageCode]; - String get itemsInSearch => - localizedValues['itemsInSearch'][locale.languageCode]; + String? get clinic => localizedValues['clinic']![locale.languageCode]; - String get qr => localizedValues['qr'][locale.languageCode]; + String? get clinicSelect => localizedValues['clinicSelect']![locale.languageCode]; - String get reader => localizedValues['reader'][locale.languageCode]; + String? get doctorSelect => localizedValues['doctorSelect']![locale.languageCode]; - String get startScanning => - localizedValues['startScanning'][locale.languageCode]; + String? get hospital => localizedValues['hospital']![locale.languageCode]; - String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; + String? get speciality => localizedValues['speciality']![locale.languageCode]; - String get scanQr => localizedValues['scanQr'][locale.languageCode]; + String? get errorMessage => localizedValues['errorMessage']![locale.languageCode]; - String get profile => localizedValues['profile'][locale.languageCode]; + String? get patientProfile => localizedValues['patientProfile']![locale.languageCode]; - String get gender => localizedValues['gender'][locale.languageCode]; + String? get vitalSign => localizedValues['vitalSign']![locale.languageCode]; - String get clinic => localizedValues['clinic'][locale.languageCode]; + String? get vital => localizedValues['vital']![locale.languageCode]; - String get clinicSelect => - localizedValues['clinicSelect'][locale.languageCode]; + String? get signs => localizedValues['signs']![locale.languageCode]; - String get doctorSelect => - localizedValues['doctorSelect'][locale.languageCode]; + String? get labOrder => localizedValues['labOrder']![locale.languageCode]; - String get hospital => localizedValues['hospital'][locale.languageCode]; + String? get lab => localizedValues['lab']![locale.languageCode]; - String get speciality => localizedValues['speciality'][locale.languageCode]; + String? get result => localizedValues['result']![locale.languageCode]; - String get errorMessage => - localizedValues['errorMessage'][locale.languageCode]; + String? get medicines => localizedValues['medicines']![locale.languageCode]; - String get patientProfile => - localizedValues['patientProfile'][locale.languageCode]; + String? get prescription => localizedValues['prescription']![locale.languageCode]; - String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; + String? get insuranceApprovals => localizedValues['insuranceApprovals']![locale.languageCode]; - String get vital => localizedValues['vital'][locale.languageCode]; + String? get insurance => localizedValues['insurance']![locale.languageCode]; - String get signs => localizedValues['signs'][locale.languageCode]; + String? get approvals => localizedValues['approvals']![locale.languageCode]; - String get labOrder => localizedValues['labOrder'][locale.languageCode]; + String? get bodyMeasurements => localizedValues['bodyMeasurements']![locale.languageCode]; - String get lab => localizedValues['lab'][locale.languageCode]; + String? get temperature => localizedValues['temperature']![locale.languageCode]; - String get result => localizedValues['result'][locale.languageCode]; + String? get pulse => localizedValues['pulse']![locale.languageCode]; - String get medicines => localizedValues['medicines'][locale.languageCode]; + String? get respiration => localizedValues['respiration']![locale.languageCode]; - String get prescription => - localizedValues['prescription'][locale.languageCode]; + String? get bloodPressure => localizedValues['bloodPressure']![locale.languageCode]; - String get insuranceApprovals => - localizedValues['insuranceApprovals'][locale.languageCode]; + String? get oxygenation => localizedValues['oxygenation']![locale.languageCode]; - String get insurance => localizedValues['insurance'][locale.languageCode]; + String? get painScale => localizedValues['painScale']![locale.languageCode]; - String get approvals => localizedValues['approvals'][locale.languageCode]; + String? get errorNoVitalSign => localizedValues['errorNoVitalSign']![locale.languageCode]; - String get bodyMeasurements => - localizedValues['bodyMeasurements'][locale.languageCode]; + String? get labOrders => localizedValues['labOrders']![locale.languageCode]; - String get temperature => localizedValues['temperature'][locale.languageCode]; + String? get errorNoLabOrders => localizedValues['errorNoLabOrders']![locale.languageCode]; - String get pulse => localizedValues['pulse'][locale.languageCode]; + String? get answerThePatient => localizedValues['answerThePatient']![locale.languageCode]; - String get respiration => localizedValues['respiration'][locale.languageCode]; + String? get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer']![locale.languageCode]; - String get bloodPressure => - localizedValues['bloodPressure'][locale.languageCode]; + String? get replay => localizedValues['replay']![locale.languageCode]; - String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; + String? get progressNote =>localizedValues['progressNote']![locale.languageCode]; + String? get operationReports => localizedValues['operationReports']![locale.languageCode]; - String get painScale => localizedValues['painScale'][locale.languageCode]; + String? get progress => localizedValues['progress']![locale.languageCode]; - String get errorNoVitalSign => - localizedValues['errorNoVitalSign'][locale.languageCode]; + String? get note => localizedValues['note']![locale.languageCode]; - String get labOrders => localizedValues['labOrders'][locale.languageCode]; + String? get searchNote => localizedValues['searchNote']![locale.languageCode]; - String get errorNoLabOrders => - localizedValues['errorNoLabOrders'][locale.languageCode]; + String? get errorNoProgressNote => localizedValues['errorNoProgressNote']![locale.languageCode]; - String get answerThePatient => - localizedValues['answerThePatient'][locale.languageCode]; + String? get invoiceNo => localizedValues['invoiceNo:']![locale.languageCode]; + String? get orderNo => localizedValues['orderNo']![locale.languageCode]; - String get pleaseEnterAnswer => - localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String? get generalResult => localizedValues['generalResult']![locale.languageCode]; - String get replay => localizedValues['replay'][locale.languageCode]; + String? get description => localizedValues['description']![locale.languageCode]; - String get progressNote => - localizedValues['progressNote'][locale.languageCode]; - String get operationReports => - localizedValues['operationReports'][locale.languageCode]; - String get reports => localizedValues['reports'][locale.languageCode]; - String get operation => localizedValues['operation'][locale.languageCode]; + String? get value => localizedValues['value']![locale.languageCode]; - String get progress => localizedValues['progress'][locale.languageCode]; + String? get range => localizedValues['range']![locale.languageCode]; - String get note => localizedValues['note'][locale.languageCode]; + String? get enterId => localizedValues['enterId']![locale.languageCode]; - String get searchNote => localizedValues['searchNote'][locale.languageCode]; + String? get pleaseEnterYourID => localizedValues['pleaseEnterYourID']![locale.languageCode]; - String get errorNoProgressNote => - localizedValues['errorNoProgressNote'][locale.languageCode]; + String? get enterPassword => localizedValues['enterPassword']![locale.languageCode]; - String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; - String get orderNo => localizedValues['orderNo'][locale.languageCode]; + String? get pleaseEnterPassword => localizedValues['pleaseEnterPassword']![locale.languageCode]; - String get generalResult => - localizedValues['generalResult'][locale.languageCode]; + String? get selectYourProject => localizedValues['selectYourProject']![locale.languageCode]; - String get description => localizedValues['description'][locale.languageCode]; + String? get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject']![locale.languageCode]; - String get value => localizedValues['value'][locale.languageCode]; + String? get login => localizedValues['login']![locale.languageCode]; - String get range => localizedValues['range'][locale.languageCode]; + String? get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib']![locale.languageCode]; - String get enterId => localizedValues['enterId'][locale.languageCode]; + String? get welcomeTo => localizedValues['welcomeTo']![locale.languageCode]; - String get pleaseEnterYourID => - localizedValues['pleaseEnterYourID'][locale.languageCode]; + String? get welcomeBackTo => localizedValues['welcomeBackTo']![locale.languageCode]; - String get enterPassword => - localizedValues['enterPassword'][locale.languageCode]; + String? get home => localizedValues['home']![locale.languageCode]; - String get pleaseEnterPassword => - localizedValues['pleaseEnterPassword'][locale.languageCode]; + String? get services => localizedValues['services']![locale.languageCode]; - String get selectYourProject => - localizedValues['selectYourProject'][locale.languageCode]; + String? get sms => localizedValues['sms']![locale.languageCode]; - String get pleaseEnterYourProject => - localizedValues['pleaseEnterYourProject'][locale.languageCode]; + String? get fingerprint => localizedValues['fingerprint']![locale.languageCode]; - String get login => localizedValues['login'][locale.languageCode]; + String? get faceId => localizedValues['faceId']![locale.languageCode]; - String get drSulaimanAlHabib => - localizedValues['drSulaimanAlHabib'][locale.languageCode]; + String? get whatsApp => localizedValues['whatsApp']![locale.languageCode]; - String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; + String? get whatsAppBy => localizedValues['whatsAppBy']![locale.languageCode]; - String get welcomeBackTo => - localizedValues['welcomeBackTo'][locale.languageCode]; + String? get pleaseChoose => localizedValues['pleaseChoose']![locale.languageCode]; - String get home => localizedValues['home'][locale.languageCode]; + String? get choose => localizedValues['choose']![locale.languageCode]; - String get services => localizedValues['services'][locale.languageCode]; + String? get verification => localizedValues['verification']![locale.languageCode]; - String get sms => localizedValues['sms'][locale.languageCode]; + String? get firstStep => localizedValues['firstStep']![locale.languageCode]; - String get fingerprint => localizedValues['fingerprint'][locale.languageCode]; + String? get yourAccount => localizedValues['yourAccount!']![locale.languageCode]; - String get faceId => localizedValues['faceId'][locale.languageCode]; + String? get verify1 => localizedValues['verify1']![locale.languageCode]; - String get whatsApp => localizedValues['whatsApp'][locale.languageCode]; + String? get youWillReceiveA => localizedValues['youWillReceiveA']![locale.languageCode]; - String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; + String? get loginCode => localizedValues['loginCode']![locale.languageCode]; - String get pleaseChoose => - localizedValues['pleaseChoose'][locale.languageCode]; + String? get smsBy => localizedValues['smsBy']![locale.languageCode]; - String get choose => localizedValues['choose'][locale.languageCode]; + String? get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode']![locale.languageCode]; - String get verification => - localizedValues['verification'][locale.languageCode]; + String? get youDontHaveAnyPatient => localizedValues['youDontHaveAnyPatient']![locale.languageCode]; - String get firstStep => localizedValues['firstStep'][locale.languageCode]; + String? get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem']![locale.languageCode]; - String get yourAccount => - localizedValues['yourAccount!'][locale.languageCode]; + String? get age => localizedValues['age']![locale.languageCode]; - String get verify1 => localizedValues['verify1'][locale.languageCode]; + String? get nationality => localizedValues['nationality']![locale.languageCode]; + String? get occupation => localizedValues['occupation']![locale.languageCode]; + String? get healthID => localizedValues['healthID']![locale.languageCode]; + String? get identityNumber => localizedValues['identityNumber']![locale.languageCode]; + String? get maritalStatus => localizedValues['maritalStatus']![locale.languageCode]; - String get youWillReceiveA => - localizedValues['youWillReceiveA'][locale.languageCode]; + String? get today => localizedValues['today']![locale.languageCode]; - String get loginCode => localizedValues['loginCode'][locale.languageCode]; + String? get tomorrow => localizedValues['tomorrow']![locale.languageCode]; - String get smsBy => localizedValues['smsBy'][locale.languageCode]; + String? get all => localizedValues['all']![locale.languageCode]; - String get pleaseEnterTheCode => - localizedValues['pleaseEnterTheCode'][locale.languageCode]; + String? get nextWeek => localizedValues['nextWeek']![locale.languageCode]; - String get youDontHaveAnyPatient => - localizedValues['youDontHaveAnyPatient'][locale.languageCode]; + String? get yesterday => localizedValues['yesterday']![locale.languageCode]; - String get youDoNotHaveAnyItem => - localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; + String? get errorNoInsuranceApprovals => localizedValues['errorNoInsuranceApprovals']![locale.languageCode]; - String get age => localizedValues['age'][locale.languageCode]; + String? get searchInsuranceApprovals => localizedValues['searchInsuranceApprovals']![locale.languageCode]; - String get nationality => localizedValues['nationality'][locale.languageCode]; - String get occupation => localizedValues['occupation'][locale.languageCode]; - String get healthID => localizedValues['healthID'][locale.languageCode]; - String get identityNumber => - localizedValues['identityNumber'][locale.languageCode]; - String get maritalStatus => - localizedValues['maritalStatus'][locale.languageCode]; + String? get status => localizedValues['status']![locale.languageCode]; - String get today => localizedValues['today'][locale.languageCode]; + String? get expiryDate => localizedValues['expiryDate']![locale.languageCode]; - String get tomorrow => localizedValues['tomorrow'][locale.languageCode]; + String? get producerName => localizedValues['producerName']![locale.languageCode]; - String get all => localizedValues['all'][locale.languageCode]; + String? get receiptOn => localizedValues['receiptOn']![locale.languageCode]; - String get nextWeek => localizedValues['nextWeek'][locale.languageCode]; + String? get approvalNo => localizedValues['approvalNo']![locale.languageCode]; - String get yesterday => localizedValues['yesterday'][locale.languageCode]; + String? get doctor => localizedValues['doctor']![locale.languageCode]; - String get errorNoInsuranceApprovals => - localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; + String? get ext => localizedValues['ext']![locale.languageCode]; - String get searchInsuranceApprovals => - localizedValues['searchInsuranceApprovals'][locale.languageCode]; + String? get veryUrgent => localizedValues['veryUrgent']![locale.languageCode]; - String get status => localizedValues['status'][locale.languageCode]; + String? get urgent => localizedValues['urgent']![locale.languageCode]; - String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; + String? get routine => localizedValues['routine']![locale.languageCode]; - String get producerName => - localizedValues['producerName'][locale.languageCode]; + String? get send => localizedValues['send']![locale.languageCode]; - String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; + String? get referralFrequency => localizedValues['referralFrequency']![locale.languageCode]; - String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; + String? get selectReferralFrequency => localizedValues['selectReferralFrequency']![locale.languageCode]; - String get doctor => localizedValues['doctor'][locale.languageCode]; + String? get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks']![locale.languageCode]; - String get ext => localizedValues['ext'][locale.languageCode]; + String? get remarks => localizedValues['remarks']![locale.languageCode]; - String get veryUrgent => localizedValues['veryUrgent'][locale.languageCode]; + String? get pleaseFill => localizedValues['pleaseFill']![locale.languageCode]; - String get urgent => localizedValues['urgent'][locale.languageCode]; + String? get replay2 => localizedValues['replay2']![locale.languageCode]; - String get routine => localizedValues['routine'][locale.languageCode]; + String? get outPatient => localizedValues['outPatients']![locale.languageCode]; - String get send => localizedValues['send'][locale.languageCode]; + String? get myOutPatient => localizedValues['myOutPatient']![locale.languageCode]; + String? get myOutPatient_2lines => localizedValues['myOutPatient_2lines']![locale.languageCode]; - String get referralFrequency => - localizedValues['referralFrequency'][locale.languageCode]; + String? get logout => localizedValues['logout']![locale.languageCode]; - String get selectReferralFrequency => - localizedValues['selectReferralFrequency'][locale.languageCode]; + String? get pharmaciesList => localizedValues['pharmaciesList']![locale.languageCode]; - String get clinicalDetailsAndRemarks => - localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; + String? get price => localizedValues['price']![locale.languageCode]; - String get remarks => localizedValues['remarks'][locale.languageCode]; + String? get youCanFindItIn => localizedValues['youCanFindItIn']![locale.languageCode]; - String get pleaseFill => localizedValues['pleaseFill'][locale.languageCode]; + String? get radiologyReport => localizedValues['radiologyReport']![locale.languageCode]; - String get replay2 => localizedValues['replay2'][locale.languageCode]; + String? get orders => localizedValues['orders']![locale.languageCode]; - String get outPatient => localizedValues['outPatients'][locale.languageCode]; + String? get list => localizedValues['list']![locale.languageCode]; - String get myOutPatient => - localizedValues['myOutPatient'][locale.languageCode]; - String get myOutPatient_2lines => - localizedValues['myOutPatient_2lines'][locale.languageCode]; + String? get searchOrders => localizedValues['searchOrders']![locale.languageCode]; - String get logout => localizedValues['logout'][locale.languageCode]; + String? get prescriptionDetails => localizedValues['prescriptionDetails']![locale.languageCode]; - String get pharmaciesList => - localizedValues['pharmaciesList'][locale.languageCode]; + String? get prescriptionInfo => localizedValues['prescriptionInfo']![locale.languageCode]; - String get price => localizedValues['price'][locale.languageCode]; + String? get errorNoOrders => localizedValues['errorNoOrders']![locale.languageCode]; - String get youCanFindItIn => - localizedValues['youCanFindItIn'][locale.languageCode]; + String? get livecare => localizedValues['livecare']![locale.languageCode]; - String get radiologyReport => - localizedValues['radiologyReport'][locale.languageCode]; + String? get beingBad => localizedValues['beingBad']![locale.languageCode]; - String get orders => localizedValues['orders'][locale.languageCode]; + String? get beingGreat => localizedValues['beingGreat']![locale.languageCode]; - String get list => localizedValues['list'][locale.languageCode]; + String? get cancel => localizedValues['cancel']![locale.languageCode]; - String get searchOrders => - localizedValues['searchOrders'][locale.languageCode]; + String? get ok => localizedValues['ok']![locale.languageCode]; - String get prescriptionDetails => - localizedValues['prescriptionDetails'][locale.languageCode]; + String? get done => localizedValues['done']![locale.languageCode]; - String get prescriptionInfo => - localizedValues['prescriptionInfo'][locale.languageCode]; + String? get searchMedicineImageCaption => localizedValues['searchMedicineImageCaption']![locale.languageCode]; - String get errorNoOrders => - localizedValues['errorNoOrders'][locale.languageCode]; + String? get type => localizedValues['type']![locale.languageCode]; - String get livecare => localizedValues['livecare'][locale.languageCode]; + String? get resumecall => localizedValues['resumecall']![locale.languageCode]; - String get beingBad => localizedValues['beingBad'][locale.languageCode]; + String? get endcallwithcharge => localizedValues['endcallwithcharge']![locale.languageCode]; - String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; + String? get endcall => localizedValues['endcall']![locale.languageCode]; - String get cancel => localizedValues['cancel'][locale.languageCode]; + String? get transfertoadmin => localizedValues['transfertoadmin']![locale.languageCode]; - String get ok => localizedValues['ok'][locale.languageCode]; + String? get fromDate => localizedValues['fromDate']![locale.languageCode]; - String get done => localizedValues['done'][locale.languageCode]; + String? get toDate => localizedValues['toDate']![locale.languageCode]; - String get searchMedicineImageCaption => - localizedValues['searchMedicineImageCaption'][locale.languageCode]; + String? get fromTime => localizedValues['fromTime']![locale.languageCode]; - String get type => localizedValues['type'][locale.languageCode]; + String? get toTime => localizedValues['toTime']![locale.languageCode]; - String get resumecall => localizedValues['resumecall'][locale.languageCode]; + String? get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle']![locale.languageCode]; - String get endcallwithcharge => - localizedValues['endcallwithcharge'][locale.languageCode]; + String? get searchPatientImageCaptionBody => localizedValues['searchPatientImageCaptionBody']![locale.languageCode]; - String get endcall => localizedValues['endcall'][locale.languageCode]; + String? get welcome => localizedValues['welcome']![locale.languageCode]; - String get transfertoadmin => - localizedValues['transfertoadmin'][locale.languageCode]; + String? get typeMedicineName => localizedValues['typeMedicineName']![locale.languageCode]; - String get fromDate => localizedValues['fromDate'][locale.languageCode]; + String? get moreThan3Letter => localizedValues['moreThan3Letter']![locale.languageCode]; - String get toDate => localizedValues['toDate'][locale.languageCode]; + String? get gender2 => localizedValues['gender2']![locale.languageCode]; - String get fromTime => localizedValues['fromTime'][locale.languageCode]; + String? get age2 => localizedValues['age2']![locale.languageCode]; - String get toTime => localizedValues['toTime'][locale.languageCode]; + String? get sickleave => localizedValues['sick-leaves']![locale.languageCode]; - String get searchPatientImageCaptionTitle => - localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; + String? get patientSick => localizedValues['patient-sick']![locale.languageCode]; - String get searchPatientImageCaptionBody => - localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; + String? get leave => localizedValues['leave']![locale.languageCode]; - String get welcome => localizedValues['welcome'][locale.languageCode]; + String? get submit => localizedValues['submit']![locale.languageCode]; - String get typeMedicineName => - localizedValues['typeMedicineName'][locale.languageCode]; + String? get doctorName => localizedValues['doc-name']![locale.languageCode]; - String get moreThan3Letter => - localizedValues['moreThan3Letter'][locale.languageCode]; + String? get clinicName => localizedValues['clinicname']![locale.languageCode]; - String get gender2 => localizedValues['gender2'][locale.languageCode]; + String? get sickLeaveDate => localizedValues['sick-leave-date']![locale.languageCode]; - String get age2 => localizedValues['age2'][locale.languageCode]; + String? get sickLeaveDays => localizedValues['sick-leave-days']![locale.languageCode]; - String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; + String? get admissionDetail => localizedValues['admissionDetail']![locale.languageCode]; - String get patientSick => - localizedValues['patient-sick'][locale.languageCode]; + String? get dateTime => localizedValues['dateTime']![locale.languageCode]; - String get leave => localizedValues['leave'][locale.languageCode]; + String? get date => localizedValues['date']![locale.languageCode]; - String get submit => localizedValues['submit'][locale.languageCode]; + String? get admissionNo => localizedValues['admissionNo']![locale.languageCode]; - String get doctorName => localizedValues['doc-name'][locale.languageCode]; + String? get losNo => localizedValues['losNo']![locale.languageCode]; - String get clinicName => localizedValues['clinicname'][locale.languageCode]; + String? get area => localizedValues['area']![locale.languageCode]; - String get sickLeaveDate => - localizedValues['sick-leave-date'][locale.languageCode]; + String? get room => localizedValues['room']![locale.languageCode]; - String get sickLeaveDays => - localizedValues['sick-leave-days'][locale.languageCode]; + String? get bed => localizedValues['bed']![locale.languageCode]; - String get admissionDetail => - localizedValues['admissionDetail'][locale.languageCode]; + String? get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed']![locale.languageCode]; - String get dateTime => localizedValues['dateTime'][locale.languageCode]; + String? get noSickLeaveApplied => localizedValues['no-sickleve-applied']![locale.languageCode]; - String get date => localizedValues['date'][locale.languageCode]; + String? get applyNow => localizedValues['applynow']![locale.languageCode]; - String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; + String? get addSickLeave => localizedValues['add-sickleave']![locale.languageCode]; - String get losNo => localizedValues['losNo'][locale.languageCode]; + String? get add => localizedValues['add']![locale.languageCode]; + String? get addSickLeaverequest => localizedValues['addSickLeaveRequest']![locale.languageCode]; + String? get extendSickLeaverequest => localizedValues['extendSickLeaveRequest']![locale.languageCode]; + String? get approved => localizedValues['approved']![locale.languageCode]; - String get area => localizedValues['area'][locale.languageCode]; + String? get extended => localizedValues['extended']![locale.languageCode]; - String get room => localizedValues['room'][locale.languageCode]; + String? get pending => localizedValues['pending']![locale.languageCode]; - String get bed => localizedValues['bed'][locale.languageCode]; + String? get leaveStartDate => localizedValues['leave-start-date']![locale.languageCode]; - String get previousSickLeaveIssue => - localizedValues['prevoius-sickleave-issed'][locale.languageCode]; + String? get daysSickleave => localizedValues['days-sick-leave']![locale.languageCode]; - String get noSickLeaveApplied => - localizedValues['no-sickleve-applied'][locale.languageCode]; + String? get extend => localizedValues['extend']![locale.languageCode]; - String get applyNow => localizedValues['applynow'][locale.languageCode]; + String? get extendSickLeave => localizedValues['extend-sickleave']![locale.languageCode]; - String get addSickLeave => - localizedValues['add-sickleave'][locale.languageCode]; + String? get targetPatient => localizedValues['patient-target']![locale.languageCode]; - String get add => localizedValues['add'][locale.languageCode]; - String get addSickLeaverequest => - localizedValues['addSickLeaveRequest'][locale.languageCode]; - String get extendSickLeaverequest => - localizedValues['extendSickLeaveRequest'][locale.languageCode]; - String get approved => localizedValues['approved'][locale.languageCode]; + String? get noPrescription => localizedValues['no-priscription-listed']![locale.languageCode]; - String get extended => localizedValues['extended'][locale.languageCode]; + String? get next => localizedValues['next']![locale.languageCode]; + String? get finish => localizedValues['finish']![locale.languageCode]; - String get pending => localizedValues['pending'][locale.languageCode]; + String? get previous => localizedValues['previous']![locale.languageCode]; - String get leaveStartDate => - localizedValues['leave-start-date'][locale.languageCode]; + String? get emptyMessage => localizedValues['empty-message']![locale.languageCode]; - String get daysSickleave => - localizedValues['days-sick-leave'][locale.languageCode]; + String? get healthRecordInformation => localizedValues['healthRecordInformation']![locale.languageCode]; - String get extend => localizedValues['extend'][locale.languageCode]; + String? get chiefComplaintLength => localizedValues['chiefComplaintLength']![locale.languageCode]; - String get extendSickLeave => - localizedValues['extend-sickleave'][locale.languageCode]; + String? get referTo => localizedValues['referTo']![locale.languageCode]; - String get targetPatient => - localizedValues['patient-target'][locale.languageCode]; + String? get referredFrom => localizedValues['referredFrom']![locale.languageCode]; + String? get refClinic => localizedValues['refClinic']![locale.languageCode]; - String get noPrescription => - localizedValues['no-priscription-listed'][locale.languageCode]; + String? get branch => localizedValues['branch']![locale.languageCode]; - String get next => localizedValues['next'][locale.languageCode]; - String get finish => localizedValues['finish'][locale.languageCode]; + String? get chooseAppointment => localizedValues['chooseAppointment']![locale.languageCode]; - String get previous => localizedValues['previous'][locale.languageCode]; + String? get appointmentNo => localizedValues['appointmentNo']![locale.languageCode]; - String get emptyMessage => - localizedValues['empty-message'][locale.languageCode]; + String? get refer => localizedValues['refer']![locale.languageCode]; - String get healthRecordInformation => - localizedValues['healthRecordInformation'][locale.languageCode]; + String? get rejected => localizedValues['rejected']![locale.languageCode]; - String get chiefComplaintLength => - localizedValues['chiefComplaintLength'][locale.languageCode]; + String? get sameBranch => localizedValues['sameBranch']![locale.languageCode]; - String get referTo => localizedValues['referTo'][locale.languageCode]; + String? get otherBranch => localizedValues['otherBranch']![locale.languageCode]; - String get referredFrom => - localizedValues['referredFrom'][locale.languageCode]; - String get refClinic => localizedValues['refClinic'][locale.languageCode]; + String? get dr => localizedValues['dr']![locale.languageCode]; - String get branch => localizedValues['branch'][locale.languageCode]; + String? get previewHealth => localizedValues['previewHealth']![locale.languageCode]; - String get chooseAppointment => - localizedValues['chooseAppointment'][locale.languageCode]; + String? get summaryReport => localizedValues['summaryReport']![locale.languageCode]; - String get appointmentNo => - localizedValues['appointmentNo'][locale.languageCode]; + String? get accept => localizedValues['accept']![locale.languageCode]; - String get refer => localizedValues['refer'][locale.languageCode]; + String? get reject => localizedValues['reject']![locale.languageCode]; - String get rejected => localizedValues['rejected'][locale.languageCode]; + String? get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg']![locale.languageCode]; - String get sameBranch => localizedValues['sameBranch'][locale.languageCode]; + String? get referralPatient => localizedValues['referralPatient']![locale.languageCode]; - String get otherBranch => localizedValues['otherBranch'][locale.languageCode]; + String? get noPrescriptionListed => localizedValues['noPrescriptionListed']![locale.languageCode]; - String get dr => localizedValues['dr'][locale.languageCode]; + String? get addNow => localizedValues['addNow']![locale.languageCode]; - String get previewHealth => - localizedValues['previewHealth'][locale.languageCode]; + String? get orderType => localizedValues['orderType']![locale.languageCode]; - String get summaryReport => - localizedValues['summaryReport'][locale.languageCode]; + String? get strength => localizedValues['strength']![locale.languageCode]; - String get accept => localizedValues['accept'][locale.languageCode]; + String? get doseTime => localizedValues['doseTime']![locale.languageCode]; - String get reject => localizedValues['reject'][locale.languageCode]; + String? get indication => localizedValues['indication']![locale.languageCode]; - String get noAppointmentsErrorMsg => - localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; + String? get duration => localizedValues['duration']![locale.languageCode]; - String get referralPatient => - localizedValues['referralPatient'][locale.languageCode]; + String? get instruction => localizedValues['instruction']![locale.languageCode]; - String get noPrescriptionListed => - localizedValues['noPrescriptionListed'][locale.languageCode]; + String? get rescheduleLeaves => localizedValues['reschedule-leave']![locale.languageCode]; - String get addNow => localizedValues['addNow'][locale.languageCode]; + String? get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave']![locale.languageCode]; + String? get myQRCode => localizedValues['myQRCode']![locale.languageCode]; - String get orderType => localizedValues['orderType'][locale.languageCode]; + String? get addMedication => localizedValues['addMedication']![locale.languageCode]; - String get strength => localizedValues['strength'][locale.languageCode]; + String? get route => localizedValues['route']![locale.languageCode]; - String get doseTime => localizedValues['doseTime'][locale.languageCode]; + String? get noReScheduleLeave => localizedValues['no-reschedule-leave']![locale.languageCode]; - String get indication => localizedValues['indication'][locale.languageCode]; + String? get weight => localizedValues['weight']![locale.languageCode]; - String get duration => localizedValues['duration'][locale.languageCode]; + String? get kg => localizedValues['kg']![locale.languageCode]; - String get instruction => localizedValues['instruction'][locale.languageCode]; + String? get height => localizedValues['height']![locale.languageCode]; - String get rescheduleLeaves => - localizedValues['reschedule-leave'][locale.languageCode]; + String? get cm => localizedValues['cm']![locale.languageCode]; - String get applyOrRescheduleLeave => - localizedValues['applyOrRescheduleLeave'][locale.languageCode]; - String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; + String? get idealBodyWeight => localizedValues['idealBodyWeight']![locale.languageCode]; - String get addMedication => - localizedValues['addMedication'][locale.languageCode]; + String? get waistSize => localizedValues['waistSize']![locale.languageCode]; - String get route => localizedValues['route'][locale.languageCode]; + String? get inch => localizedValues['inch']![locale.languageCode]; - String get noReScheduleLeave => - localizedValues['no-reschedule-leave'][locale.languageCode]; + String? get headCircum => localizedValues['headCircum']![locale.languageCode]; - String get weight => localizedValues['weight'][locale.languageCode]; + String? get leanBodyWeight => localizedValues['leanBodyWeight']![locale.languageCode]; - String get kg => localizedValues['kg'][locale.languageCode]; + String? get bodyMassIndex => localizedValues['bodyMassIndex']![locale.languageCode]; - String get height => localizedValues['height'][locale.languageCode]; + String? get yourBodyMassIndex => localizedValues['yourBodyMassIndex']![locale.languageCode]; + String? get bmiUnderWeight => localizedValues['bmiUnderWeight']![locale.languageCode]; + String? get bmiHealthy => localizedValues['bmiHealthy']![locale.languageCode]; + String? get bmiOverWeight => localizedValues['bmiOverWeight']![locale.languageCode]; + String? get bmiObese => localizedValues['bmiObese']![locale.languageCode]; + String? get bmiObeseExtreme => localizedValues['bmiObeseExtreme']![locale.languageCode]; - String get cm => localizedValues['cm'][locale.languageCode]; + String? get method => localizedValues['method']![locale.languageCode]; - String get idealBodyWeight => - localizedValues['idealBodyWeight'][locale.languageCode]; + String? get pulseBeats => localizedValues['pulseBeats']![locale.languageCode]; - String get waistSize => localizedValues['waistSize'][locale.languageCode]; + String? get rhythm => localizedValues['rhythm']![locale.languageCode]; - String get inch => localizedValues['inch'][locale.languageCode]; + String? get respBeats => localizedValues['respBeats']![locale.languageCode]; - String get headCircum => localizedValues['headCircum'][locale.languageCode]; + String? get patternOfRespiration => localizedValues['patternOfRespiration']![locale.languageCode]; - String get leanBodyWeight => - localizedValues['leanBodyWeight'][locale.languageCode]; + String? get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole']![locale.languageCode]; - String get bodyMassIndex => - localizedValues['bodyMassIndex'][locale.languageCode]; + String? get cuffLocation => localizedValues['cuffLocation']![locale.languageCode]; - String get yourBodyMassIndex => - localizedValues['yourBodyMassIndex'][locale.languageCode]; - String get bmiUnderWeight => - localizedValues['bmiUnderWeight'][locale.languageCode]; - String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; - String get bmiOverWeight => - localizedValues['bmiOverWeight'][locale.languageCode]; - String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; - String get bmiObeseExtreme => - localizedValues['bmiObeseExtreme'][locale.languageCode]; + String? get cuffSize => localizedValues['cuffSize']![locale.languageCode]; - String get method => localizedValues['method'][locale.languageCode]; + String? get patientPosition => localizedValues['patientPosition']![locale.languageCode]; - String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode]; + String? get fio2 => localizedValues['fio2']![locale.languageCode]; - String get rhythm => localizedValues['rhythm'][locale.languageCode]; + String? get sao2 => localizedValues['sao2']![locale.languageCode]; - String get respBeats => localizedValues['respBeats'][locale.languageCode]; + String? get painManagement => localizedValues['painManagement']![locale.languageCode]; - String get patternOfRespiration => - localizedValues['patternOfRespiration'][locale.languageCode]; + String? get holiday => localizedValues['holiday']![locale.languageCode]; - String get bloodPressureDiastoleAndSystole => - localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; + String? get to => localizedValues['to']![locale.languageCode]; - String get cuffLocation => - localizedValues['cuffLocation'][locale.languageCode]; + String? get coveringDoctor => localizedValues['coveringDoctor']![locale.languageCode]; - String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; + String? get requestLeave => localizedValues['requestLeave']![locale.languageCode]; - String get patientPosition => - localizedValues['patientPosition'][locale.languageCode]; + String? get pleaseEnterDate => localizedValues['pleaseEnterDate']![locale.languageCode]; - String get fio2 => localizedValues['fio2'][locale.languageCode]; + String? get pleaseEnterNoOfDays => localizedValues['pleaseEnterNoOfDays']![locale.languageCode]; - String get sao2 => localizedValues['sao2'][locale.languageCode]; + String? get pleaseEnterRemarks => localizedValues['pleaseEnterRemarks']![locale.languageCode]; - String get painManagement => - localizedValues['painManagement'][locale.languageCode]; + String? get update => localizedValues['update']![locale.languageCode]; - String get holiday => localizedValues['holiday'][locale.languageCode]; + String? get admission => localizedValues['admission']![locale.languageCode]; - String get to => localizedValues['to'][locale.languageCode]; + String? get request => localizedValues['request']![locale.languageCode]; - String get coveringDoctor => - localizedValues['coveringDoctor'][locale.languageCode]; + String? get admissionRequest => localizedValues['admissionRequest']![locale.languageCode]; - String get requestLeave => - localizedValues['requestLeave'][locale.languageCode]; + String? get patientDetails => localizedValues['patientDetails']![locale.languageCode]; - String get pleaseEnterDate => - localizedValues['pleaseEnterDate'][locale.languageCode]; + String? get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail']![locale.languageCode]; - String get pleaseEnterNoOfDays => - localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; + String? get referringDate => localizedValues['referringDate']![locale.languageCode]; - String get pleaseEnterRemarks => - localizedValues['pleaseEnterRemarks'][locale.languageCode]; + String? get referringDoctor => localizedValues['referringDoctor']![locale.languageCode]; - String get update => localizedValues['update'][locale.languageCode]; + String? get otherInformation => localizedValues['otherInformation']![locale.languageCode]; - String get admission => localizedValues['admission'][locale.languageCode]; + String? get expectedDays => localizedValues['expectedDays']![locale.languageCode]; - String get request => localizedValues['request'][locale.languageCode]; + String? get expectedAdmissionDate => localizedValues['expectedAdmissionDate']![locale.languageCode]; - String get admissionRequest => - localizedValues['admissionRequest'][locale.languageCode]; + String? get emergencyAdmission => localizedValues['emergencyAdmission']![locale.languageCode]; + String? get isSickLeaveRequired => localizedValues['isSickLeaveRequired']![locale.languageCode]; - String get patientDetails => - localizedValues['patientDetails'][locale.languageCode]; + String? get patientPregnant => localizedValues['patientPregnant']![locale.languageCode]; - String get specialityAndDoctorDetail => - localizedValues['specialityAndDoctorDetail'][locale.languageCode]; + String? get treatmentLine => localizedValues['treatmentLine']![locale.languageCode]; - String get referringDate => - localizedValues['referringDate'][locale.languageCode]; + String? get ward => localizedValues['ward']![locale.languageCode]; - String get referringDoctor => - localizedValues['referringDoctor'][locale.languageCode]; + String? get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred']![locale.languageCode]; - String get otherInformation => - localizedValues['otherInformation'][locale.languageCode]; + String? get admissionType => localizedValues['admissionType']![locale.languageCode]; - String get expectedDays => - localizedValues['expectedDays'][locale.languageCode]; + String? get diagnosis => localizedValues['diagnosis']![locale.languageCode]; - String get expectedAdmissionDate => - localizedValues['expectedAdmissionDate'][locale.languageCode]; + String? get allergies => localizedValues['allergies']![locale.languageCode]; - String get emergencyAdmission => - localizedValues['emergencyAdmission'][locale.languageCode]; - String get isSickLeaveRequired => - localizedValues['isSickLeaveRequired'][locale.languageCode]; + String? get preOperativeOrders => localizedValues['preOperativeOrders']![locale.languageCode]; - String get patientPregnant => - localizedValues['patientPregnant'][locale.languageCode]; + String? get elementForImprovement => localizedValues['elementForImprovement']![locale.languageCode]; - String get treatmentLine => - localizedValues['treatmentLine'][locale.languageCode]; + String? get dischargeDate => localizedValues['dischargeDate']![locale.languageCode]; - String get ward => localizedValues['ward'][locale.languageCode]; + String? get dietType => localizedValues['dietType']![locale.languageCode]; - String get preAnesthesiaReferred => - localizedValues['preAnesthesiaReferred'][locale.languageCode]; + String? get dietTypeRemarks => localizedValues['dietTypeRemarks']![locale.languageCode]; - String get admissionType => - localizedValues['admissionType'][locale.languageCode]; + String? get save => localizedValues['save']![locale.languageCode]; - String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; + String? get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost']![locale.languageCode]; + String? get postPlans => localizedValues['postPlans']![locale.languageCode]; - String get allergies => localizedValues['allergies'][locale.languageCode]; + String? get ucaf => localizedValues['ucaf']![locale.languageCode]; - String get preOperativeOrders => - localizedValues['preOperativeOrders'][locale.languageCode]; + String? get emergencyCase => localizedValues['emergencyCase']![locale.languageCode]; - String get elementForImprovement => - localizedValues['elementForImprovement'][locale.languageCode]; + String? get durationOfIllness => localizedValues['durationOfIllness']![locale.languageCode]; - String get dischargeDate => - localizedValues['dischargeDate'][locale.languageCode]; + String? get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms']![locale.languageCode]; - String get dietType => localizedValues['dietType'][locale.languageCode]; + String? get patientFeelsPainInHisBackAndCough => + localizedValues['patientFeelsPainInHisBackAndCough']![locale.languageCode]; - String get dietTypeRemarks => - localizedValues['dietTypeRemarks'][locale.languageCode]; + String? get additionalTextComplaints => localizedValues['additionalTextComplaints']![locale.languageCode]; - String get save => localizedValues['save'][locale.languageCode]; + String? get otherConditions => localizedValues['otherConditions']![locale.languageCode]; - String get postPlansEstimatedCost => - localizedValues['postPlansEstimatedCost'][locale.languageCode]; - String get postPlans => localizedValues['postPlans'][locale.languageCode]; + String? get other => localizedValues['other']![locale.languageCode]; - String get ucaf => localizedValues['ucaf'][locale.languageCode]; + String? get how => localizedValues['how']![locale.languageCode]; - String get emergencyCase => - localizedValues['emergencyCase'][locale.languageCode]; + String? get when => localizedValues['when']![locale.languageCode]; - String get durationOfIllness => - localizedValues['durationOfIllness'][locale.languageCode]; + String? get where => localizedValues['where']![locale.languageCode]; - String get chiefComplaintsAndSymptoms => - localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; + String? get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement']![locale.languageCode]; - String get patientFeelsPainInHisBackAndCough => - localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; + String? get significantSigns => localizedValues['significantSigns']![locale.languageCode]; - String get additionalTextComplaints => - localizedValues['additionalTextComplaints'][locale.languageCode]; + String? get backAbdomen => localizedValues['backAbdomen']![locale.languageCode]; - String get otherConditions => - localizedValues['otherConditions'][locale.languageCode]; + String? get reasons => localizedValues['reasons']![locale.languageCode]; - String get other => localizedValues['other'][locale.languageCode]; + String? get createNew => localizedValues['createNew']![locale.languageCode]; - String get how => localizedValues['how'][locale.languageCode]; + String? get episode => localizedValues['episode']![locale.languageCode]; - String get when => localizedValues['when'][locale.languageCode]; + String? get medications => localizedValues['medications']![locale.languageCode]; - String get where => localizedValues['where'][locale.languageCode]; + String? get procedures => localizedValues['procedures']![locale.languageCode]; - String get specifyPossibleLineManagement => - localizedValues['specifyPossibleLineManagement'][locale.languageCode]; + String? get chiefComplaints => localizedValues['chiefComplaints']![locale.languageCode]; - String get significantSigns => - localizedValues['significantSigns'][locale.languageCode]; + String? get histories => localizedValues['histories']![locale.languageCode]; - String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; + String? get allergiesSoap => localizedValues['allergiesSoap']![locale.languageCode]; - String get reasons => localizedValues['reasons'][locale.languageCode]; + String? get addChiefComplaints => localizedValues['addChiefComplaints']![locale.languageCode]; - String get createNew => localizedValues['createNew'][locale.languageCode]; + String? get historyOfPresentIllness => localizedValues['historyOfPresentIllness']![locale.languageCode]; - String get episode => localizedValues['episode'][locale.languageCode]; + String? get requiredMsg => localizedValues['requiredMsg']![locale.languageCode]; - String get medications => localizedValues['medications'][locale.languageCode]; + String? get addHistory => localizedValues['addHistory']![locale.languageCode]; - String get procedures => localizedValues['procedures'][locale.languageCode]; + String? get searchHistory => localizedValues['searchHistory']![locale.languageCode]; - String get chiefComplaints => - localizedValues['chiefComplaints'][locale.languageCode]; + String? get addSelectedHistories => localizedValues['addSelectedHistories']![locale.languageCode]; - String get histories => localizedValues['histories'][locale.languageCode]; + String? get addAllergies => localizedValues['addAllergies']![locale.languageCode]; - String get allergiesSoap => - localizedValues['allergiesSoap'][locale.languageCode]; + String? get itemExist => localizedValues['itemExist']![locale.languageCode]; - String get addChiefComplaints => - localizedValues['addChiefComplaints'][locale.languageCode]; + String? get selectAllergy => localizedValues['selectAllergy']![locale.languageCode]; - String get historyOfPresentIllness => - localizedValues['historyOfPresentIllness'][locale.languageCode]; + String? get selectSeverity => localizedValues['selectSeverity']![locale.languageCode]; - String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; + String? get leaveCreated => localizedValues['leaveCreated']![locale.languageCode]; - String get addHistory => localizedValues['addHistory'][locale.languageCode]; + String? get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg']![locale.languageCode]; - String get searchHistory => - localizedValues['searchHistory'][locale.languageCode]; + String? get referralEmptyMsg => localizedValues['referralEmptyMsg']![locale.languageCode]; - String get addSelectedHistories => - localizedValues['addSelectedHistories'][locale.languageCode]; + String? get referralSuccessMsg => localizedValues['referralSuccessMsg']![locale.languageCode]; - String get addAllergies => - localizedValues['addAllergies'][locale.languageCode]; + String? get diagnoseType => localizedValues['diagnoseType']![locale.languageCode]; - String get itemExist => localizedValues['itemExist'][locale.languageCode]; + String? get condition => localizedValues['condition']![locale.languageCode]; - String get selectAllergy => - localizedValues['selectAllergy'][locale.languageCode]; + String? get id => localizedValues['id']![locale.languageCode]; - String get selectSeverity => - localizedValues['selectSeverity'][locale.languageCode]; + String? get quantity => localizedValues['quantity']![locale.languageCode]; - String get leaveCreated => - localizedValues['leaveCreated'][locale.languageCode]; + String? get durDays => localizedValues['durDays']![locale.languageCode]; - String get vitalSignEmptyMsg => - localizedValues['vitalSignEmptyMsg'][locale.languageCode]; + String? get codeNo => localizedValues['codeNo']![locale.languageCode]; - String get referralEmptyMsg => - localizedValues['referralEmptyMsg'][locale.languageCode]; + String? get covered => localizedValues['covered']![locale.languageCode]; - String get referralSuccessMsg => - localizedValues['referralSuccessMsg'][locale.languageCode]; + String? get approvalRequired => localizedValues['approvalRequired']![locale.languageCode]; - String get diagnoseType => - localizedValues['diagnoseType'][locale.languageCode]; + String? get uncoveredByDoctor => localizedValues['uncoveredByDoctor']![locale.languageCode]; - String get condition => localizedValues['condition'][locale.languageCode]; + String? get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg']![locale.languageCode]; - String get id => localizedValues['id'][locale.languageCode]; + String? get moreVerification => localizedValues['more-verify']![locale.languageCode]; - String get quantity => localizedValues['quantity'][locale.languageCode]; + String? get welcomeBack => localizedValues['welcome-back']![locale.languageCode]; - String get durDays => localizedValues['durDays'][locale.languageCode]; + String? get accountInfo => localizedValues['account-info']![locale.languageCode]; - String get codeNo => localizedValues['codeNo'][locale.languageCode]; + String? get useAnotherAccount => localizedValues['another-acc']![locale.languageCode]; - String get covered => localizedValues['covered'][locale.languageCode]; + String? get verifyLoginWith => localizedValues['verify-login-with']![locale.languageCode]; - String get approvalRequired => - localizedValues['approvalRequired'][locale.languageCode]; + String? get register => localizedValues['register-user']![locale.languageCode]; - String get uncoveredByDoctor => - localizedValues['uncoveredByDoctor'][locale.languageCode]; + String? get verifyFingerprint => localizedValues['verify-with-fingerprint']![locale.languageCode]; - String get chiefComplaintEmptyMsg => - localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String? get verifyFaceID => localizedValues['verify-with-faceid']![locale.languageCode]; - String get moreVerification => - localizedValues['more-verify'][locale.languageCode]; + String? get verifySMS => localizedValues['verify-with-sms']![locale.languageCode]; + String? get verifyWith => localizedValues['verify-with']![locale.languageCode]; - String get welcomeBack => - localizedValues['welcome-back'][locale.languageCode]; + String? get verifyWhatsApp => localizedValues['verify-with-whatsapp']![locale.languageCode]; - String get accountInfo => - localizedValues['account-info'][locale.languageCode]; + String? get lastLoginAt => localizedValues['last-login']![locale.languageCode]; - String get useAnotherAccount => - localizedValues['another-acc'][locale.languageCode]; + String? get lastLoginWith => localizedValues['last-login-with']![locale.languageCode]; - String get verifyLoginWith => - localizedValues['verify-login-with'][locale.languageCode]; + String? get verifyFingerprint2 => localizedValues['verify-fingerprint']![locale.languageCode]; - String get register => localizedValues['register-user'][locale.languageCode]; + String? get verificationMessage => localizedValues['verification_message']![locale.languageCode]; - String get verifyFingerprint => - localizedValues['verify-with-fingerprint'][locale.languageCode]; + String? get validationMessage => localizedValues['validation_message']![locale.languageCode]; - String get verifyFaceID => - localizedValues['verify-with-faceid'][locale.languageCode]; + String? get addAssessment => localizedValues['addAssessment']![locale.languageCode]; - String get verifySMS => - localizedValues['verify-with-sms'][locale.languageCode]; - String get verifyWith => localizedValues['verify-with'][locale.languageCode]; + String? get assessment => localizedValues['assessment']![locale.languageCode]; - String get verifyWhatsApp => - localizedValues['verify-with-whatsapp'][locale.languageCode]; + String? get physicalSystemExamination => localizedValues['physicalSystemExamination']![locale.languageCode]; - String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; + String? get searchExamination => localizedValues['searchExamination']![locale.languageCode]; - String get lastLoginWith => - localizedValues['last-login-with'][locale.languageCode]; + String? get addExamination => localizedValues['addExamination']![locale.languageCode]; - String get verifyFingerprint2 => - localizedValues['verify-fingerprint'][locale.languageCode]; + String? get doc => localizedValues['doc']![locale.languageCode]; - String get verificationMessage => - localizedValues['verification_message'][locale.languageCode]; + String? get allergicTO => localizedValues['allergicTO']![locale.languageCode]; - String get validationMessage => - localizedValues['validation_message'][locale.languageCode]; + String? get normal => localizedValues['normal']![locale.languageCode]; + String? get notExamined => localizedValues['notExamined']![locale.languageCode]; - String get addAssessment => - localizedValues['addAssessment'][locale.languageCode]; + String? get abnormal => localizedValues['abnormal']![locale.languageCode]; - String get assessment => localizedValues['assessment'][locale.languageCode]; + String? get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg']![locale.languageCode]; - String get physicalSystemExamination => - localizedValues['physicalSystemExamination'][locale.languageCode]; + String? get systolicLng => localizedValues['systolic-lng']![locale.languageCode]; - String get searchExamination => - localizedValues['searchExamination'][locale.languageCode]; + String? get diastolicLng => localizedValues['diastolic-lng']![locale.languageCode]; - String get addExamination => - localizedValues['addExamination'][locale.languageCode]; + String? get mass => localizedValues['mass']![locale.languageCode]; - String get doc => localizedValues['doc'][locale.languageCode]; + String? get tempC => localizedValues['temp-c']![locale.languageCode]; - String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; + String? get bpm => localizedValues['bpm']![locale.languageCode]; - String get normal => localizedValues['normal'][locale.languageCode]; - String get notExamined => localizedValues['notExamined'][locale.languageCode]; + String? get respirationSigns => localizedValues['respiration-signs']![locale.languageCode]; - String get abnormal => localizedValues['abnormal'][locale.languageCode]; + String? get sysDias => localizedValues['sys-dias']![locale.languageCode]; - String get patientNoDetailErrMsg => - localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + String? get body => localizedValues['body']![locale.languageCode]; - String get systolicLng => - localizedValues['systolic-lng'][locale.languageCode]; + String? get respirationRate => localizedValues['respirationRate']![locale.languageCode]; - String get diastolicLng => - localizedValues['diastolic-lng'][locale.languageCode]; + String? get heart => localizedValues['heart']![locale.languageCode]; - String get mass => localizedValues['mass'][locale.languageCode]; + String? get medicalReport => localizedValues['medicalReport']![locale.languageCode]; - String get tempC => localizedValues['temp-c'][locale.languageCode]; + String? get visitDate => localizedValues['visitDate']![locale.languageCode]; - String get bpm => localizedValues['bpm'][locale.languageCode]; + String? get test => localizedValues['test']![locale.languageCode]; - String get respirationSigns => - localizedValues['respiration-signs'][locale.languageCode]; + String? get addMoreProcedure => localizedValues['addMoreProcedure']![locale.languageCode]; - String get sysDias => localizedValues['sys-dias'][locale.languageCode]; + String? get regular => localizedValues['regular']![locale.languageCode]; - String get body => localizedValues['body'][locale.languageCode]; + String? get searchProcedures => localizedValues['searchProcedures']![locale.languageCode]; - String get respirationRate => - localizedValues['respirationRate'][locale.languageCode]; + String? get procedureCategorise => localizedValues['procedureCategorise']![locale.languageCode]; - String get heart => localizedValues['heart'][locale.languageCode]; + String? get selectProcedures => localizedValues['selectProcedures']![locale.languageCode]; - String get medicalReport => - localizedValues['medicalReport'][locale.languageCode]; + String? get addSelectedProcedures => localizedValues['addSelectedProcedures']![locale.languageCode]; + String? get addProcedures => localizedValues['addProcedures']![locale.languageCode]; - String get visitDate => localizedValues['visitDate'][locale.languageCode]; + String? get updateProcedure => localizedValues['updateProcedure']![locale.languageCode]; - String get test => localizedValues['test'][locale.languageCode]; + String? get orderProcedure => localizedValues['orderProcedure']![locale.languageCode]; - String get addMoreProcedure => - localizedValues['addMoreProcedure'][locale.languageCode]; + String? get nameOrICD => localizedValues['nameOrICD']![locale.languageCode]; - String get regular => localizedValues['regular'][locale.languageCode]; + String? get dType => localizedValues['dType']![locale.languageCode]; - String get searchProcedures => - localizedValues['searchProcedures'][locale.languageCode]; + String? get addAssessmentDetails => localizedValues['addAssessmentDetails']![locale.languageCode]; - String get procedureCategorise => - localizedValues['procedureCategorise'][locale.languageCode]; + String? get progressNoteSOAP => localizedValues['progressNoteSOAP']![locale.languageCode]; - String get selectProcedures => - localizedValues['selectProcedures'][locale.languageCode]; + String? get addProgressNote => localizedValues['addProgressNote']![locale.languageCode]; - String get addSelectedProcedures => - localizedValues['addSelectedProcedures'][locale.languageCode]; - String get addProcedures => - localizedValues['addProcedures'][locale.languageCode]; + String? get createdBy => localizedValues['createdBy']![locale.languageCode]; - String get updateProcedure => - localizedValues['updateProcedure'][locale.languageCode]; + String? get editedBy => localizedValues['editedBy']![locale.languageCode]; - String get orderProcedure => - localizedValues['orderProcedure'][locale.languageCode]; + String? get currentMedications => localizedValues['currentMedications']![locale.languageCode]; - String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; + String? get noItem => localizedValues['noItem']![locale.languageCode]; - String get dType => localizedValues['dType'][locale.languageCode]; + String? get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg']![locale.languageCode]; - String get addAssessmentDetails => - localizedValues['addAssessmentDetails'][locale.languageCode]; + String? get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty']![locale.languageCode]; - String get progressNoteSOAP => - localizedValues['progressNoteSOAP'][locale.languageCode]; + String? get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday']![locale.languageCode]; - String get addProgressNote => - localizedValues['addProgressNote'][locale.languageCode]; + String? get active => localizedValues['active']![locale.languageCode]; - String get createdBy => localizedValues['createdBy'][locale.languageCode]; + String? get hold => localizedValues['hold']![locale.languageCode]; - String get editedBy => localizedValues['editedBy'][locale.languageCode]; + String? get loading => localizedValues['loading']![locale.languageCode]; - String get currentMedications => - localizedValues['currentMedications'][locale.languageCode]; + String? get assessmentErrorMsg => localizedValues['assessmentErrorMsg']![locale.languageCode]; - String get noItem => localizedValues['noItem'][locale.languageCode]; + String? get examinationErrorMsg => localizedValues['examinationErrorMsg']![locale.languageCode]; - String get postUcafSuccessMsg => - localizedValues['postUcafSuccessMsg'][locale.languageCode]; + String? get progressNoteErrorMsg => localizedValues['progressNoteErrorMsg']![locale.languageCode]; - String get vitalSignDetailEmpty => - localizedValues['vitalSignDetailEmpty'][locale.languageCode]; + String? get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg']![locale.languageCode]; + String? get ICDName => localizedValues['ICDName']![locale.languageCode]; - String get onlyOfftimeHoliday => - localizedValues['onlyOfftimeHoliday'][locale.languageCode]; + String? get referralStatus => localizedValues['referralStatus']![locale.languageCode]; - String get active => localizedValues['active'][locale.languageCode]; + String? get referralRemark => localizedValues['referralRemark']![locale.languageCode]; + String? get offTime => localizedValues['offTime']![locale.languageCode]; - String get hold => localizedValues['hold'][locale.languageCode]; + String? get icd => localizedValues['icd']![locale.languageCode]; + String? get days => localizedValues['days']![locale.languageCode]; + String? get hr => localizedValues['hr']![locale.languageCode]; + String? get min => localizedValues['min']![locale.languageCode]; + String? get months => localizedValues['months']![locale.languageCode]; + String? get years => localizedValues['years']![locale.languageCode]; + String? get referralStatusHold => localizedValues['referralStatusHold']![locale.languageCode]; + String? get referralStatusActive => localizedValues['referralStatusActive']![locale.languageCode]; + String? get referralStatusCancelled => localizedValues['referralStatusCancelled']![locale.languageCode]; + String? get referralStatusCompleted => localizedValues['referralStatusCompleted']![locale.languageCode]; + String? get referralStatusNotSeen => localizedValues['referralStatusNotSeen']![locale.languageCode]; + String? get clinicSearch => localizedValues['clinicSearch']![locale.languageCode]; + String? get doctorSearch => localizedValues['doctorSearch']![locale.languageCode]; + String? get referralResponse => localizedValues['referralResponse']![locale.languageCode]; + String? get estimatedCost => localizedValues['estimatedCost']![locale.languageCode]; + String? get diagnosisDetail => localizedValues['diagnosisDetail']![locale.languageCode]; + String? get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept']![locale.languageCode]; + String? get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject']![locale.languageCode]; - String get loading => localizedValues['loading'][locale.languageCode]; + String? get patientName => localizedValues['patient-name']![locale.languageCode]; - String get assessmentErrorMsg => - localizedValues['assessmentErrorMsg'][locale.languageCode]; - - String get examinationErrorMsg => - localizedValues['examinationErrorMsg'][locale.languageCode]; - - String get progressNoteErrorMsg => - localizedValues['progressNoteErrorMsg'][locale.languageCode]; - - String get chiefComplaintErrorMsg => - localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; - String get ICDName => localizedValues['ICDName'][locale.languageCode]; - - String get referralStatus => - localizedValues['referralStatus'][locale.languageCode]; - - String get referralRemark => - localizedValues['referralRemark'][locale.languageCode]; - String get offTime => localizedValues['offTime'][locale.languageCode]; - - String get icd => localizedValues['icd'][locale.languageCode]; - String get days => localizedValues['days'][locale.languageCode]; - String get hr => localizedValues['hr'][locale.languageCode]; - String get min => localizedValues['min'][locale.languageCode]; - String get months => localizedValues['months'][locale.languageCode]; - String get years => localizedValues['years'][locale.languageCode]; - String get referralStatusHold => - localizedValues['referralStatusHold'][locale.languageCode]; - String get referralStatusActive => - localizedValues['referralStatusActive'][locale.languageCode]; - String get referralStatusCancelled => - localizedValues['referralStatusCancelled'][locale.languageCode]; - String get referralStatusCompleted => - localizedValues['referralStatusCompleted'][locale.languageCode]; - String get referralStatusNotSeen => - localizedValues['referralStatusNotSeen'][locale.languageCode]; - String get clinicSearch => - localizedValues['clinicSearch'][locale.languageCode]; - String get doctorSearch => - localizedValues['doctorSearch'][locale.languageCode]; - String get referralResponse => - localizedValues['referralResponse'][locale.languageCode]; - String get estimatedCost => - localizedValues['estimatedCost'][locale.languageCode]; - String get diagnosisDetail => - localizedValues['diagnosisDetail'][locale.languageCode]; - String get referralSuccessMsgAccept => - localizedValues['referralSuccessMsgAccept'][locale.languageCode]; - String get referralSuccessMsgReject => - localizedValues['referralSuccessMsgReject'][locale.languageCode]; - - String get patientName => - localizedValues['patient-name'][locale.languageCode]; - - String get appointmentNumber => - localizedValues['appointmentNumber'][locale.languageCode]; - String get sickLeaveComments => - localizedValues['sickLeaveComments'][locale.languageCode]; - String get pastMedicalHistory => - localizedValues['pastMedicalHistory'][locale.languageCode]; - String get pastSurgicalHistory => - localizedValues['pastSurgicalHistory'][locale.languageCode]; - String get complications => - localizedValues['complications'][locale.languageCode]; - String get floor => localizedValues['floor'][locale.languageCode]; - String get roomCategory => - localizedValues['roomCategory'][locale.languageCode]; - String get otherDepartmentsInterventions => - localizedValues['otherDepartmentsInterventions'][locale.languageCode]; - String get otherProcedure => - localizedValues['otherProcedure'][locale.languageCode]; - String get admissionRequestSuccessMsg => - localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; - String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; - String get doctorResponse => - localizedValues['doctorResponse'][locale.languageCode]; - String get sickleaveonhold => - localizedValues['sickleaveonhold'][locale.languageCode]; - String get noClinic => localizedValues['no-clinic'][locale.languageCode]; - - String get otherStatistic => - localizedValues['otherStatistic'][locale.languageCode]; - - String get patientsreferral => - localizedValues['ptientsreferral'][locale.languageCode]; - String get myPatientsReferral => - localizedValues['myPatientsReferral'][locale.languageCode]; - String get arrivalpatient => - localizedValues['arrivalpatient'][locale.languageCode]; - String get searchmedicinepatient => - localizedValues['searchmedicinepatient'][locale.languageCode]; - String get appointmentDate => - localizedValues['appointmentDate'][locale.languageCode]; - String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; - - String get details => localizedValues['details'][locale.languageCode]; - String get liveCare => localizedValues['liveCare'][locale.languageCode]; - String get outpatient => localizedValues['out-patient'][locale.languageCode]; - String get billNo => localizedValues['BillNo'][locale.languageCode]; - String get labResults => localizedValues['labResults'][locale.languageCode]; - String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; - String get specialResult => - localizedValues['SpecialResult'][locale.languageCode]; - String get noDataAvailable => - localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => - localizedValues['show-more-btn'][locale.languageCode]; - String get showDetail => localizedValues['showDetail'][locale.languageCode]; - String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; - - String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; - String get reschedule => localizedValues['reschedule'][locale.languageCode]; - String get leaves => localizedValues['leaves'][locale.languageCode]; - String get openRad => localizedValues['open-rad'][locale.languageCode]; - - String get totalApproval => - localizedValues['totalApproval'][locale.languageCode]; - String get procedureStatus => - localizedValues['procedureStatus'][locale.languageCode]; - String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; - String get companyName => localizedValues['companyName'][locale.languageCode]; - String get procedureName => - localizedValues['procedureName'][locale.languageCode]; - String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; - String get prescriptions => - localizedValues['prescriptions'][locale.languageCode]; - String get notes => localizedValues['notes'][locale.languageCode]; - String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; - String get searchWithOther => - localizedValues['searchWithOther'][locale.languageCode]; - String get hideOtherCriteria => - localizedValues['hideOtherCriteria'][locale.languageCode]; - String get applyForReschedule => - localizedValues['applyForReschedule'][locale.languageCode]; - - String get startDate => localizedValues['startDate'][locale.languageCode]; - String get endDate => localizedValues['endDate'][locale.languageCode]; - - String get addReschedule => - localizedValues['add-reschedule'][locale.languageCode]; - String get updateReschedule => - localizedValues['update-reschedule'][locale.languageCode]; - String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; - String get accepted => localizedValues['accepted'][locale.languageCode]; - String get cancelled => localizedValues['cancelled'][locale.languageCode]; - String get unReplied => localizedValues['unReplied'][locale.languageCode]; - String get replied => localizedValues['replied'][locale.languageCode]; - String get typeHereToReply => - localizedValues['typeHereToReply'][locale.languageCode]; - String get searchHere => localizedValues['searchHere'][locale.languageCode]; - String get remove => localizedValues['remove'][locale.languageCode]; - String get inProgress => localizedValues['inProgress'][locale.languageCode]; - String get completed => localizedValues['Completed'][locale.languageCode]; - String get locked => localizedValues['Locked'][locale.languageCode]; - - String get step => localizedValues['step'][locale.languageCode]; - String get fieldRequired => - localizedValues['fieldRequired'][locale.languageCode]; - String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; - String get changeOfSchedule => - localizedValues['changeOfSchedule'][locale.languageCode]; - String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; - String get enterCredentials => - localizedValues['enter_credentials'][locale.languageCode]; - String get patpatientIDMobilenationalientID => - localizedValues['patientIDMobilenational'][locale.languageCode]; - - String get updateNow => localizedValues['updateNow'][locale.languageCode]; - String get updateTheApp => - localizedValues['updateTheApp'][locale.languageCode]; - String get admissionDate => - localizedValues['admission-date'][locale.languageCode]; - String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; - String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; - String get replayBefore => - localizedValues['replayBefore'][locale.languageCode]; - String get trySaying => localizedValues["try-saying"][locale.languageCode]; - String get acknowledged => - localizedValues['acknowledged'][locale.languageCode]; - String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; - String get pleaseEnterProcedure => - localizedValues["pleaseEnterProcedure"][locale.languageCode]; - String get fillTheMandatoryProcedureDetails => - localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; - String get atLeastThreeCharacters => - localizedValues["atLeastThreeCharacters"][locale.languageCode]; - String get searchProcedureHere => - localizedValues["searchProcedureHere"][locale.languageCode]; - String get noInsuranceApprovalFound => - localizedValues["noInsuranceApprovalFound"][locale.languageCode]; - String get procedure => localizedValues["procedure"][locale.languageCode]; - String get stopDate => localizedValues["stopDate"][locale.languageCode]; - String get processed => localizedValues["processed"][locale.languageCode]; - String get direction => localizedValues["direction"][locale.languageCode]; - String get refill => localizedValues["refill"][locale.languageCode]; - String get medicationHasBeenAdded => - localizedValues["medicationHasBeenAdded"][locale.languageCode]; - String get newPrescriptionOrder => - localizedValues["newPrescriptionOrder"][locale.languageCode]; - String get pleaseFillAllFields => - localizedValues["pleaseFillAllFields"][locale.languageCode]; - String get narcoticMedicineCanOnlyBePrescribedFromVida => - localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] - [locale.languageCode]; - String get only5DigitsAllowedForStrength => - localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; - String get unit => localizedValues["unit"][locale.languageCode]; - String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; - String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; - String get applyForRadiologyOrder => - localizedValues["applyForRadiologyOrder"][locale.languageCode]; - String get applyForNewLabOrder => - localizedValues["applyForNewLabOrder"][locale.languageCode]; - String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; - String get addRadiologyOrder => - localizedValues["addRadiologyOrder"][locale.languageCode]; - String get newRadiologyOrder => - localizedValues["newRadiologyOrder"][locale.languageCode]; - String get orderDate => localizedValues["orderDate"][locale.languageCode]; - String get examType => localizedValues["examType"][locale.languageCode]; - String get health => localizedValues["health"][locale.languageCode]; - String get summary => localizedValues["summary"][locale.languageCode]; - String get applyForNewPrescriptionsOrder => - localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; - String get noPrescriptionsFound => - localizedValues["noPrescriptionsFound"][locale.languageCode]; - String get noMedicalFileFound => - localizedValues["noMedicalFileFound"][locale.languageCode]; - String get insurance22 => localizedValues["insurance22"][locale.languageCode]; - String get approvals22 => localizedValues["approvals22"][locale.languageCode]; - String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => - localizedValues["graphDetails"][locale.languageCode]; - String get discharged => localizedValues["discharged"][locale.languageCode]; - String get addNewOrderSheet => - localizedValues["addNewOrderSheet"][locale.languageCode]; - String get addNewProgressNote => - localizedValues["addNewProgressNote"][locale.languageCode]; - String get notePending => localizedValues["notePending"][locale.languageCode]; - String get noteCanceled => - localizedValues["noteCanceled"][locale.languageCode]; - String get noteVerified => - localizedValues["noteVerified"][locale.languageCode]; - String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; - String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; - String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; - - String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode]; - - String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; - String get order => localizedValues["order"][locale.languageCode]; - String get sheet => localizedValues["sheet"][locale.languageCode]; - String get medical => localizedValues["medical"][locale.languageCode]; - String get report => localizedValues["report"][locale.languageCode]; - String get discharge => localizedValues["discharge"][locale.languageCode]; - String get none => localizedValues["none"][locale.languageCode]; - String get notRepliedYet => - localizedValues["notRepliedYet"][locale.languageCode]; - String get clearText => localizedValues["clearText"][locale.languageCode]; - String get medicalReportAdd => - localizedValues['medicalReportAdd'][locale.languageCode]; - String get medicalReportVerify => - localizedValues['medicalReportVerify'][locale.languageCode]; - String get comments => localizedValues['comments'][locale.languageCode]; - String get initiateCall => - localizedValues['initiateCall'][locale.languageCode]; - String get endCall => localizedValues['endCall'][locale.languageCode]; - - String get transferTo => localizedValues['transferTo'][locale.languageCode]; - String get admin => localizedValues['admin'][locale.languageCode]; - String get instructions => - localizedValues['instructions'][locale.languageCode]; - String get sendLC => localizedValues['sendLC'][locale.languageCode]; - String get endLC => localizedValues['endLC'][locale.languageCode]; - String get consultation => - localizedValues['consultation'][locale.languageCode]; - String get resume => localizedValues['resume'][locale.languageCode]; - String get theCall => localizedValues['theCall'][locale.languageCode]; - String get createNewMedicalReport => - localizedValues['createNewMedicalReport'][locale.languageCode]; - String get historyPhysicalFinding => - localizedValues['historyPhysicalFinding'][locale.languageCode]; - String get laboratoryPhysicalData => - localizedValues['laboratoryPhysicalData'][locale.languageCode]; - String get impressionRecommendation => - localizedValues['impressionRecommendation'][locale.languageCode]; - String get onHold => localizedValues['onHold'][locale.languageCode]; - String get verified => localizedValues['verified'][locale.languageCode]; - String get favoriteTemplates => - localizedValues['favoriteTemplates'][locale.languageCode]; - String get allProcedures => - localizedValues['allProcedures'][locale.languageCode]; - String get allRadiology => - localizedValues['allRadiology'][locale.languageCode]; - String get allLab => localizedValues['allLab'][locale.languageCode]; - String get allPrescription => - localizedValues['allPrescription'][locale.languageCode]; - String get addPrescription => - localizedValues['addPrescription'][locale.languageCode]; - String get edit => localizedValues['edit'][locale.languageCode]; - String get summeryReply => - localizedValues['summeryReply'][locale.languageCode]; - String get severityValidationError => - localizedValues['severityValidationError'][locale.languageCode]; - String get textCopiedSuccessfully => - localizedValues['textCopiedSuccessfully'][locale.languageCode]; - String get roomNo => localizedValues['roomNo'][locale.languageCode]; - String get seeMore => localizedValues['seeMore'][locale.languageCode]; - String get replayCallStatus => - localizedValues['replayCallStatus'][locale.languageCode]; - String get patientArrived => - localizedValues['patientArrived'][locale.languageCode]; - String get calledAndNoResponse => - localizedValues['calledAndNoResponse'][locale.languageCode]; - String get underProcess => - localizedValues['underProcess'][locale.languageCode]; - String get textResponse => - localizedValues['textResponse'][locale.languageCode]; - String get special => localizedValues['special'][locale.languageCode]; - String get requestType => localizedValues['requestType'][locale.languageCode]; - String get allClinic => localizedValues['allClinic'][locale.languageCode]; - String get notReplied => localizedValues['notReplied'][locale.languageCode]; - String get registerNewPatient => - localizedValues['registerNewPatient'][locale.languageCode]; - String get registeraPatient => - localizedValues['registeraPatient'][locale.languageCode]; - String get operationTimeStart => - localizedValues['operationTimeStart'][locale.languageCode]; - String get operationDate => - localizedValues['operationDate'][locale.languageCode]; - String get reservation => localizedValues['reservation'][locale.languageCode]; - String get anesthetist => localizedValues['anesthetist'][locale.languageCode]; - String get bloodTransfusedDetail => - localizedValues['bloodTransfusedDetail'][locale.languageCode]; - String get circulatingNurse => - localizedValues['circulatingNurse'][locale.languageCode]; - String get scrubNurse => localizedValues['scrubNurse'][locale.languageCode]; - String get otherSpecimen => - localizedValues['otherSpecimen'][locale.languageCode]; - String get microbiologySpecimen => - localizedValues['microbiologySpecimen'][locale.languageCode]; - String get histopathSpecimen => - localizedValues['histopathSpecimen'][locale.languageCode]; - String get bloodLossDetail => - localizedValues['bloodLossDetail'][locale.languageCode]; - String get complicationDetails1 => - localizedValues['complicationDetails1'][locale.languageCode]; - String get postOperationInstruction => - localizedValues['postOperationInstruction'][locale.languageCode]; - String get surgeryProcedure => - localizedValues['surgeryProcedure'][locale.languageCode]; - String get finding => localizedValues['finding'][locale.languageCode]; - String get preOperationDiagnosis => - localizedValues['preOperationDiagnosis'][locale.languageCode]; - String get postOperationDiagnosis => - localizedValues['postOperationDiagnosis'][locale.languageCode]; - String get surgeon => localizedValues['surgeon'][locale.languageCode]; - String get assistant => localizedValues['assistant'][locale.languageCode]; - String get askForIdentification => - localizedValues['askForIdentification'][locale.languageCode]; - String get iDNumber => localizedValues['iDNumber'][locale.languageCode]; - String get calender => localizedValues['calender'][locale.languageCode]; - String get gregorian => localizedValues['gregorian'][locale.languageCode]; - String get hijri => localizedValues['hijri'][locale.languageCode]; - String get birthdate => localizedValues['birthdate'][locale.languageCode]; - String get activation => localizedValues['activation'][locale.languageCode]; - String get confirmation => - localizedValues['confirmation'][locale.languageCode]; - String get diabetic => localizedValues['diabetic'][locale.languageCode]; - String get chart => localizedValues['chart'][locale.languageCode]; - - String get investigation => - localizedValues['investigation'][locale.languageCode]; - String get conditionOnDischarge => - localizedValues['conditionOnDischarge'][locale.languageCode]; - String get planedProcedure => - localizedValues['planedProcedure'][locale.languageCode]; - String get moreDetails => localizedValues['moreDetails'][locale.languageCode]; + String? get appointmentNumber => localizedValues['appointmentNumber']![locale.languageCode]; + String? get sickLeaveComments => localizedValues['sickLeaveComments']![locale.languageCode]; + String? get pastMedicalHistory => localizedValues['pastMedicalHistory']![locale.languageCode]; + String? get pastSurgicalHistory => localizedValues['pastSurgicalHistory']![locale.languageCode]; + String? get complications => localizedValues['complications']![locale.languageCode]; + String? get floor => localizedValues['floor']![locale.languageCode]; + String? get roomCategory => localizedValues['roomCategory']![locale.languageCode]; + String? get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions']![locale.languageCode]; + String? get otherProcedure => localizedValues['otherProcedure']![locale.languageCode]; + String? get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg']![locale.languageCode]; + String? get infoStatus => localizedValues['infoStatus']![locale.languageCode]; + String? get doctorResponse => localizedValues['doctorResponse']![locale.languageCode]; + String? get sickleaveonhold => localizedValues['sickleaveonhold']![locale.languageCode]; + String? get noClinic => localizedValues['no-clinic']![locale.languageCode]; + + String? get otherStatistic => localizedValues['otherStatistic']![locale.languageCode]; + + String? get patientsreferral => localizedValues['ptientsreferral']![locale.languageCode]; + String? get myPatientsReferral => localizedValues['myPatientsReferral']![locale.languageCode]; + String? get arrivalpatient => localizedValues['arrivalpatient']![locale.languageCode]; + String? get searchmedicinepatient => localizedValues['searchmedicinepatient']![locale.languageCode]; + String? get appointmentDate => localizedValues['appointmentDate']![locale.languageCode]; + String? get arrivedP => localizedValues['arrived_p']![locale.languageCode]; + + String? get details => localizedValues['details']![locale.languageCode]; + String? get liveCare => localizedValues['liveCare']![locale.languageCode]; + String? get outpatient => localizedValues['out-patient']![locale.languageCode]; + String? get billNo => localizedValues['BillNo']![locale.languageCode]; + String? get labResults => localizedValues['labResults']![locale.languageCode]; + String? get sendSuc => localizedValues['sendSuc']![locale.languageCode]; + String? get specialResult => localizedValues['SpecialResult']![locale.languageCode]; + String? get noDataAvailable => localizedValues['noDataAvailable']![locale.languageCode]; + String? get showMoreBtn => localizedValues['show-more-btn']![locale.languageCode]; + String? get showDetail => localizedValues['showDetail']![locale.languageCode]; + String? get viewProfile => localizedValues['viewProfile']![locale.languageCode]; + + String? get fileNumber => localizedValues['fileNumber']![locale.languageCode]; + String? get reschedule => localizedValues['reschedule']![locale.languageCode]; + String? get leaves => localizedValues['leaves']![locale.languageCode]; + String? get openRad => localizedValues['open-rad']![locale.languageCode]; + + String? get totalApproval => localizedValues['totalApproval']![locale.languageCode]; + String? get procedureStatus => localizedValues['procedureStatus']![locale.languageCode]; + String? get unusedCount => localizedValues['unusedCount']![locale.languageCode]; + String? get companyName => localizedValues['companyName']![locale.languageCode]; + String? get procedureName => localizedValues['procedureName']![locale.languageCode]; + String? get usageStatus => localizedValues['usageStatus']![locale.languageCode]; + String? get prescriptions => localizedValues['prescriptions']![locale.languageCode]; + String? get notes => localizedValues['notes']![locale.languageCode]; + String? get dailyDoses => localizedValues['dailyDoses']![locale.languageCode]; + String? get searchWithOther => localizedValues['searchWithOther']![locale.languageCode]; + String? get hideOtherCriteria => localizedValues['hideOtherCriteria']![locale.languageCode]; + String? get applyForReschedule => localizedValues['applyForReschedule']![locale.languageCode]; + + String? get startDate => localizedValues['startDate']![locale.languageCode]; + String? get endDate => localizedValues['endDate']![locale.languageCode]; + + String? get addReschedule => localizedValues['add-reschedule']![locale.languageCode]; + String? get updateReschedule => localizedValues['update-reschedule']![locale.languageCode]; + String? get sickLeave => localizedValues['sick_leave']![locale.languageCode]; + String? get accepted => localizedValues['accepted']![locale.languageCode]; + String? get cancelled => localizedValues['cancelled']![locale.languageCode]; + String? get unReplied => localizedValues['unReplied']![locale.languageCode]; + String? get replied => localizedValues['replied']![locale.languageCode]; + String? get typeHereToReply => localizedValues['typeHereToReply']![locale.languageCode]; + String? get searchHere => localizedValues['searchHere']![locale.languageCode]; + String? get remove => localizedValues['remove']![locale.languageCode]; + String? get inProgress => localizedValues['inProgress']![locale.languageCode]; + String? get completed => localizedValues['Completed']![locale.languageCode]; + String? get locked => localizedValues['Locked']![locale.languageCode]; + + String? get step => localizedValues['step']![locale.languageCode]; + String? get fieldRequired => localizedValues['fieldRequired']![locale.languageCode]; + String? get noSickLeave => localizedValues['no-sickleve']![locale.languageCode]; + String? get changeOfSchedule => localizedValues['changeOfSchedule']![locale.languageCode]; + String? get newSchedule => localizedValues['newSchedule']![locale.languageCode]; + String? get enterCredentials => localizedValues['enter_credentials']![locale.languageCode]; + String? get patpatientIDMobilenationalientID => localizedValues['patientIDMobilenational']![locale.languageCode]; + + String? get updateNow => localizedValues['updateNow']![locale.languageCode]; + String? get updateTheApp => localizedValues['updateTheApp']![locale.languageCode]; + String? get admissionDate => localizedValues['admission-date']![locale.languageCode]; + String? get noOfDays => localizedValues['noOfDays']![locale.languageCode]; + String? get numOfDays => localizedValues['numOfDays']![locale.languageCode]; + String? get replayBefore => localizedValues['replayBefore']![locale.languageCode]; + String? get trySaying => localizedValues["try-saying"]![locale.languageCode]; + String? get acknowledged => localizedValues['acknowledged']![locale.languageCode]; + String? get didntCatch => localizedValues["didntCatch"]![locale.languageCode]; + String? get pleaseEnterProcedure => localizedValues["pleaseEnterProcedure"]![locale.languageCode]; + String? get fillTheMandatoryProcedureDetails => + localizedValues["fillTheMandatoryProcedureDetails"]![locale.languageCode]; + String? get atLeastThreeCharacters => localizedValues["atLeastThreeCharacters"]![locale.languageCode]; + String? get searchProcedureHere => localizedValues["searchProcedureHere"]![locale.languageCode]; + String? get noInsuranceApprovalFound => localizedValues["noInsuranceApprovalFound"]![locale.languageCode]; + String? get procedure => localizedValues["procedure"]![locale.languageCode]; + String? get stopDate => localizedValues["stopDate"]![locale.languageCode]; + String? get processed => localizedValues["processed"]![locale.languageCode]; + String? get direction => localizedValues["direction"]![locale.languageCode]; + String? get refill => localizedValues["refill"]![locale.languageCode]; + String? get medicationHasBeenAdded => localizedValues["medicationHasBeenAdded"]![locale.languageCode]; + String? get newPrescriptionOrder => localizedValues["newPrescriptionOrder"]![locale.languageCode]; + String? get pleaseFillAllFields => localizedValues["pleaseFillAllFields"]![locale.languageCode]; + String? get narcoticMedicineCanOnlyBePrescribedFromVida => + localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"]![locale.languageCode]; + String? get only5DigitsAllowedForStrength => localizedValues["only5DigitsAllowedForStrength"]![locale.languageCode]; + String? get unit => localizedValues["unit"]![locale.languageCode]; + String? get boxQuantity => localizedValues["boxQuantity"]![locale.languageCode]; + String? get orderTestOr => localizedValues["orderTestOr"]![locale.languageCode]; + String? get applyForRadiologyOrder => localizedValues["applyForRadiologyOrder"]![locale.languageCode]; + String? get applyForNewLabOrder => localizedValues["applyForNewLabOrder"]![locale.languageCode]; + String? get addLabOrder => localizedValues["addLabOrder"]![locale.languageCode]; + String? get addRadiologyOrder => localizedValues["addRadiologyOrder"]![locale.languageCode]; + String? get newRadiologyOrder => localizedValues["newRadiologyOrder"]![locale.languageCode]; + String? get orderDate => localizedValues["orderDate"]![locale.languageCode]; + String? get examType => localizedValues["examType"]![locale.languageCode]; + String? get health => localizedValues["health"]![locale.languageCode]; + String? get summary => localizedValues["summary"]![locale.languageCode]; + String? get applyForNewPrescriptionsOrder => localizedValues["applyForNewPrescriptionsOrder"]![locale.languageCode]; + String? get noPrescriptionsFound => localizedValues["noPrescriptionsFound"]![locale.languageCode]; + String? get noMedicalFileFound => localizedValues["noMedicalFileFound"]![locale.languageCode]; + String? get insurance22 => localizedValues["insurance22"]![locale.languageCode]; + String? get approvals22 => localizedValues["approvals22"]![locale.languageCode]; + String? get severe => localizedValues["severe"]![locale.languageCode]; + String? get graphDetails => localizedValues["graphDetails"]![locale.languageCode]; + String? get discharged => localizedValues["discharged"]![locale.languageCode]; + String? get addNewOrderSheet => localizedValues["addNewOrderSheet"]![locale.languageCode]; + String? get addNewProgressNote => localizedValues["addNewProgressNote"]![locale.languageCode]; + String? get notePending => localizedValues["notePending"]![locale.languageCode]; + String? get noteCanceled => localizedValues["noteCanceled"]![locale.languageCode]; + String? get noteVerified => localizedValues["noteVerified"]![locale.languageCode]; + String? get noteVerify => localizedValues["noteVerify"]![locale.languageCode]; + String? get noteConfirm => localizedValues["noteConfirm"]![locale.languageCode]; + String? get noteAdd => localizedValues["noteAdd"]![locale.languageCode]; + + String? get noteUpdate => localizedValues["noteUpdate"]![locale.languageCode]; + + String? get orderSheet => localizedValues["orderSheet"]![locale.languageCode]; + String? get order => localizedValues["order"]![locale.languageCode]; + String? get sheet => localizedValues["sheet"]![locale.languageCode]; + String? get medical => localizedValues["medical"]![locale.languageCode]; + String? get report => localizedValues["report"]![locale.languageCode]; + String? get discharge => localizedValues["discharge"]![locale.languageCode]; + String? get none => localizedValues["none"]![locale.languageCode]; + String? get notRepliedYet => localizedValues["notRepliedYet"]![locale.languageCode]; + String? get clearText => localizedValues["clearText"]![locale.languageCode]; + String? get medicalReportAdd => localizedValues['medicalReportAdd']![locale.languageCode]; + String? get medicalReportVerify => localizedValues['medicalReportVerify']![locale.languageCode]; + String? get comments => localizedValues['comments']![locale.languageCode]; + String? get initiateCall => localizedValues['initiateCall']![locale.languageCode]; + String? get endCall => localizedValues['endCall']![locale.languageCode]; + + String? get transferTo => localizedValues['transferTo']![locale.languageCode]; + String? get admin => localizedValues['admin']![locale.languageCode]; + String? get instructions => localizedValues['instructions']![locale.languageCode]; + String? get sendLC => localizedValues['sendLC']![locale.languageCode]; + String? get endLC => localizedValues['endLC']![locale.languageCode]; + String? get consultation => localizedValues['consultation']![locale.languageCode]; + String? get resume => localizedValues['resume']![locale.languageCode]; + String? get theCall => localizedValues['theCall']![locale.languageCode]; + String? get createNewMedicalReport => localizedValues['createNewMedicalReport']![locale.languageCode]; + String? get historyPhysicalFinding => localizedValues['historyPhysicalFinding']![locale.languageCode]; + String? get laboratoryPhysicalData => localizedValues['laboratoryPhysicalData']![locale.languageCode]; + String? get impressionRecommendation => localizedValues['impressionRecommendation']![locale.languageCode]; + String? get onHold => localizedValues['onHold']![locale.languageCode]; + String? get verified => localizedValues['verified']![locale.languageCode]; + String? get favoriteTemplates => localizedValues['favoriteTemplates']![locale.languageCode]; + String? get allProcedures => localizedValues['allProcedures']![locale.languageCode]; + String? get allRadiology => localizedValues['allRadiology']![locale.languageCode]; + String? get allLab => localizedValues['allLab']![locale.languageCode]; + String? get allPrescription => localizedValues['allPrescription']![locale.languageCode]; + String? get addPrescription => localizedValues['addPrescription']![locale.languageCode]; + String? get edit => localizedValues['edit']![locale.languageCode]; + String? get summeryReply => localizedValues['summeryReply']![locale.languageCode]; + String? get severityValidationError => localizedValues['severityValidationError']![locale.languageCode]; + String? get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully']![locale.languageCode]; + String? get roomNo => localizedValues['roomNo']![locale.languageCode]; + String? get seeMore => localizedValues['seeMore']![locale.languageCode]; + String? get replayCallStatus => localizedValues['replayCallStatus']![locale.languageCode]; + String? get patientArrived => localizedValues['patientArrived']![locale.languageCode]; + String? get calledAndNoResponse => localizedValues['calledAndNoResponse']![locale.languageCode]; + String? get underProcess => localizedValues['underProcess']![locale.languageCode]; + String? get textResponse => localizedValues['textResponse']![locale.languageCode]; + String? get special => localizedValues['special']![locale.languageCode]; + String? get requestType => localizedValues['requestType']![locale.languageCode]; + String? get allClinic => localizedValues['allClinic']![locale.languageCode]; + String? get notReplied => localizedValues['notReplied']![locale.languageCode]; + String? get registerNewPatient => localizedValues['registerNewPatient']![locale.languageCode]; + String? get registeraPatient => localizedValues['registeraPatient']![locale.languageCode]; + String? get operationTimeStart => + localizedValues['operationTimeStart']![locale.languageCode]; + String? get operationDate => + localizedValues['operationDate']![locale.languageCode]; + String? get reservation => localizedValues['reservation']![locale.languageCode]; + String? get anesthetist => localizedValues['anesthetist']![locale.languageCode]; + String? get bloodTransfusedDetail => + localizedValues['bloodTransfusedDetail']![locale.languageCode]; + String? get circulatingNurse => + localizedValues['circulatingNurse']![locale.languageCode]; + String? get scrubNurse => localizedValues['scrubNurse']![locale.languageCode]; + String? get otherSpecimen => + localizedValues['otherSpecimen']![locale.languageCode]; + String? get microbiologySpecimen => + localizedValues['microbiologySpecimen']![locale.languageCode]; + String? get histopathSpecimen => + localizedValues['histopathSpecimen']![locale.languageCode]; + String? get bloodLossDetail => + localizedValues['bloodLossDetail']![locale.languageCode]; + String? get complicationDetails1 => + localizedValues['complicationDetails1']![locale.languageCode]; + String? get postOperationInstruction => + localizedValues['postOperationInstruction']![locale.languageCode]; + String? get surgeryProcedure => + localizedValues['surgeryProcedure']![locale.languageCode]; + String? get finding => localizedValues['finding']![locale.languageCode]; + String? get preOperationDiagnosis => + localizedValues['preOperationDiagnosis']![locale.languageCode]; + String? get postOperationDiagnosis => + localizedValues['postOperationDiagnosis']![locale.languageCode]; + String? get surgeon => localizedValues['surgeon']![locale.languageCode]; + String? get assistant => localizedValues['assistant']![locale.languageCode]; + String? get askForIdentification => + localizedValues['askForIdentification']![locale.languageCode]; + String? get iDNumber => localizedValues['iDNumber']![locale.languageCode]; + String? get calender => localizedValues['calender']![locale.languageCode]; + String? get gregorian => localizedValues['gregorian']![locale.languageCode]; + String? get hijri => localizedValues['hijri']![locale.languageCode]; + String? get birthdate => localizedValues['birthdate']![locale.languageCode]; + String? get activation => localizedValues['activation']![locale.languageCode]; + String? get confirmation => + localizedValues['confirmation']![locale.languageCode]; + String? get diabetic => localizedValues['diabetic']![locale.languageCode]; + String? get chart => localizedValues['chart']![locale.languageCode]; + + String? get investigation => + localizedValues['investigation']![locale.languageCode]; + String? get conditionOnDischarge => + localizedValues['conditionOnDischarge']![locale.languageCode]; + String? get planedProcedure => + localizedValues['planedProcedure']![locale.languageCode]; + String? get moreDetails => localizedValues['moreDetails']![locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 9839d0ad..24649efc 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -7,7 +7,7 @@ import 'package:hexcolor/hexcolor.dart'; // class MethodTypeCard extends StatelessWidget { // const MethodTypeCard({ -// Key key, +// Key ? key, // this.assetPath, // this.onTap, // this.label, this.height = 20, this.isSvg = true, @@ -71,11 +71,11 @@ import 'package:hexcolor/hexcolor.dart'; class MethodTypeCard extends StatelessWidget { const MethodTypeCard({ - Key key, - this.assetPath, - this.onTap, - this.label, - this.height = 20, this.isSvg = true, + Key? key, + required this.assetPath, + required this.onTap, + required this.label, + this.height = 20, this.isSvg =true, }) : super(key: key); final String assetPath; final GestureTapCallback onTap; diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 4e99d316..cc28b2ea 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -16,7 +16,7 @@ class SMSOTP { final Function onFailure; final context; - int remainingTime = 600; + late int remainingTime = 600; SMSOTP( this.context, @@ -26,7 +26,7 @@ class SMSOTP { this.onFailure, ); - final verifyAccountForm = GlobalKey(); + late final verifyAccountForm = GlobalKey(); TextEditingController digit1 = TextEditingController(text: ""); TextEditingController digit2 = TextEditingController(text: ""); @@ -43,10 +43,10 @@ class SMSOTP { final focusD2 = FocusNode(); final focusD3 = FocusNode(); final focusD4 = FocusNode(); - String errorMsg; - ProjectViewModel projectProvider; - String displayTime = ''; - bool isClosed = false; + late String errorMsg; + late ProjectViewModel projectProvider; + late String displayTime = ''; + late bool isClosed = false; displayDialog(BuildContext context) async { double dialogWidth = MediaQuery.of(context).size.width * 0.90; double dialogInputWidth = (dialogWidth / 4) - @@ -126,7 +126,7 @@ class SMSOTP { padding: EdgeInsets.only(top: 5, right: 5), child: AppText( TranslationBase.of(context) - .verificationMessage + + .verificationMessage! + ' XXXXXX' + mobileNo.toString().substring( mobileNo.toString().length - 3), @@ -311,7 +311,7 @@ class SMSOTP { children: [ AppText( TranslationBase.of(context) - .validationMessage + + .validationMessage! + ' ', textAlign: TextAlign.start, fontWeight: FontWeight.w700, @@ -357,15 +357,15 @@ class SMSOTP { counterText: " ", enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -375,7 +375,7 @@ class SMSOTP { } // ignore: missing_return - String validateCodeDigit(value) { + String? validateCodeDigit(value) { if (value.isEmpty) { return ' '; } else if (value.length == 3) { @@ -386,27 +386,21 @@ class SMSOTP { } checkValue() async { - if (verifyAccountForm.currentState.validate()) { - onSuccess(digit1.text.toString() + - digit2.text.toString() + - digit3.text.toString() + - digit4.text.toString()); + if (verifyAccountForm.currentState!.validate()) { + onSuccess(digit1.text.toString() + digit2.text.toString() + digit3.text.toString() + digit4.text.toString()); this.isClosed = true; } } getSecondsAsDigitalClock(int inputSeconds) { - var sec_num = - int.parse(inputSeconds.toString()); // don't forget the second param + var sec_num = int.parse(inputSeconds.toString()); // don't forget the second param var hours = (sec_num / 3600).floor(); var minutes = ((sec_num - hours * 3600) / 60).floor(); var seconds = sec_num - hours * 3600 - minutes * 60; var minutesString = ""; var secondsString = ""; - minutesString = - minutes < 10 ? "0" + minutes.toString() : minutes.toString(); - secondsString = - seconds < 10 ? "0" + seconds.toString() : seconds.toString(); + minutesString = minutes < 10 ? "0" + minutes.toString() : minutes.toString(); + secondsString = seconds < 10 ? "0" + seconds.toString() : seconds.toString(); return minutesString + ":" + secondsString; } diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 97fbb42b..737909f8 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -9,16 +9,16 @@ import 'package:provider/provider.dart'; class VerificationMethodsList extends StatefulWidget { final AuthMethodTypes authMethodType; - final Function(AuthMethodTypes type, bool isActive) authenticateUser; - final Function onShowMore; + final Function(AuthMethodTypes type, bool isActive)? authenticateUser; + final GestureTapCallback? onShowMore; final AuthenticationViewModel authenticationViewModel; const VerificationMethodsList( - {Key key, - this.authMethodType, + {Key? key, + required this.authMethodType, this.authenticateUser, this.onShowMore, - this.authenticationViewModel}) + required this.authenticationViewModel}) : super(key: key); @override @@ -28,7 +28,7 @@ class VerificationMethodsList extends StatefulWidget { class _VerificationMethodsListState extends State { final LocalAuthentication auth = LocalAuthentication(); - ProjectViewModel projectsProvider; + ProjectViewModel? projectsProvider; @override Widget build(BuildContext context) { @@ -39,58 +39,54 @@ class _VerificationMethodsListState extends State { return MethodTypeCard( assetPath: 'assets/images/svgs/verification/verify-whtsapp.svg', onTap: () => - {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, + {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)}, label: TranslationBase .of(context) - .verifyWith+ TranslationBase.of(context).verifyWhatsApp, + .verifyWith!+TranslationBase.of(context)!.verifyWhatsApp!, ); break; case AuthMethodTypes.SMS: return MethodTypeCard( assetPath: "assets/images/svgs/verification/verify-sms.svg", - onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, + onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)}, label:TranslationBase .of(context) - .verifyWith+ TranslationBase.of(context).verifySMS, + .verifyWith!+ TranslationBase.of(context)!.verifySMS!, ); break; case AuthMethodTypes.Fingerprint: return MethodTypeCard( assetPath: 'assets/images/svgs/verification/verify-finger.svg', onTap: () async { - if (await widget.authenticationViewModel - .checkIfBiometricAvailable(BiometricType.fingerprint)) { - - widget.authenticateUser(AuthMethodTypes.Fingerprint, true); + if (await widget.authenticationViewModel.checkIfBiometricAvailable(BiometricType.fingerprint)) { + widget.authenticateUser!(AuthMethodTypes.Fingerprint, true); } }, label: TranslationBase .of(context) - .verifyWith+TranslationBase.of(context).verifyFingerprint, + .verifyWith!+TranslationBase.of(context).verifyFingerprint!, ); break; case AuthMethodTypes.FaceID: return MethodTypeCard( assetPath: 'assets/images/svgs/verification/verify-face.svg', onTap: () async { - if (await widget.authenticationViewModel - .checkIfBiometricAvailable(BiometricType.face)) { - widget.authenticateUser(AuthMethodTypes.FaceID, true); + if (await widget.authenticationViewModel.checkIfBiometricAvailable(BiometricType.face)) { + widget.authenticateUser!(AuthMethodTypes.FaceID, true); } }, label: TranslationBase .of(context) - .verifyWith+TranslationBase.of(context).verifyFaceID, + .verifyWith!+TranslationBase.of(context).verifyFaceID!, ); break; default: return MethodTypeCard( assetPath: 'assets/images/login/more_icon.png', - onTap: widget.onShowMore, - isSvg: false, - label: TranslationBase.of(context).moreVerification, - height: 0, + onTap: widget.onShowMore!, + label: TranslationBase.of(context).moreVerification!, + // height: 40, ); } } diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart deleted file mode 100644 index aa532306..00000000 --- a/lib/widgets/charts/app_bar_chart.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/material.dart'; - -class AppBarChart extends StatelessWidget { - const AppBarChart({ - Key key, - @required this.seriesList, - }) : super(key: key); - - final List seriesList; - - @override - Widget build(BuildContext context) { - return Container( - height: 400, - margin: EdgeInsets.only(top: 60), - child: charts.BarChart( - seriesList, - // animate: animate, - - /// Customize the primary measure axis using a small tick renderer. - /// Use String instead of num for ordinal domain axis - /// (typically bar charts). - primaryMeasureAxis: new charts.NumericAxisSpec( - renderSpec: new charts.GridlineRendererSpec( - // Display the measure axis labels below the gridline. - // - // 'Before' & 'after' follow the axis value direction. - // Vertical axes draw 'before' below & 'after' above the tick. - // Horizontal axes draw 'before' left & 'after' right the tick. - labelAnchor: charts.TickLabelAnchor.before, - - // Left justify the text in the axis. - // - // Note: outside means that the secondary measure axis would right - // justify. - labelJustification: - charts.TickLabelJustification.outside, - )), - ), - ); - } -} diff --git a/lib/widgets/charts/app_line_chart.dart b/lib/widgets/charts/app_line_chart.dart index 554b63fa..0367792f 100644 --- a/lib/widgets/charts/app_line_chart.dart +++ b/lib/widgets/charts/app_line_chart.dart @@ -17,9 +17,9 @@ class AppLineChart extends StatelessWidget { final bool stacked; AppLineChart( - {Key key, - @required this.seriesList, - this.chartTitle, + {Key? key, + required this.seriesList, + required this.chartTitle, this.animate = true, this.includeArea = false, this.stacked = true}); diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart index 670284a1..08e8a04e 100644 --- a/lib/widgets/charts/app_time_series_chart.dart +++ b/lib/widgets/charts/app_time_series_chart.dart @@ -12,11 +12,11 @@ import 'package:flutter/material.dart'; /// [endDate] the end date class AppTimeSeriesChart extends StatelessWidget { AppTimeSeriesChart({ - Key key, - @required this.seriesList, + Key? key, + required this.seriesList, this.chartName = '', - this.startDate, - this.endDate, + required this.startDate, + required this.endDate, }); final String chartName; diff --git a/lib/widgets/dashboard/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart index 659e4562..bf91fb09 100644 --- a/lib/widgets/dashboard/dashboard_item_texts_widget.dart +++ b/lib/widgets/dashboard/dashboard_item_texts_widget.dart @@ -26,7 +26,7 @@ class DashboardItemTexts extends StatefulWidget { } class _DashboardItemTextsState extends State { - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); diff --git a/lib/widgets/dashboard/guage_chart.dart b/lib/widgets/dashboard/guage_chart.dart index 6769c568..7140555b 100644 --- a/lib/widgets/dashboard/guage_chart.dart +++ b/lib/widgets/dashboard/guage_chart.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; class GaugeChart extends StatelessWidget { final List seriesList; - final bool animate; + final bool? animate; GaugeChart(this.seriesList, {this.animate}); diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 6b3d87d5..9ef4d83c 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -15,12 +15,12 @@ class GetOutPatientStack extends StatelessWidget { double barHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightLarge?20:17); - value.summaryoptions.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + value.summaryoptions.sort((Summaryoptions a, Summaryoptions b) => b.value! - a.value!); value.summaryoptions - .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + .sort((Summaryoptions a, Summaryoptions b) => b.value! - a.value!); - var list = new List(); + var list = []; value.summaryoptions.forEach((result) => {list.add(getStack(result, value.summaryoptions.first.value,context,barHeight))}); return Container( @@ -89,7 +89,7 @@ class GetOutPatientStack extends StatelessWidget { gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds. - colors: [Color(0x8FF5F6FA), Colors.red[100]], // red to yellow + colors: [Color(0x8FF5F6FA), Colors.red[50]!], // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), borderRadius: BorderRadius.circular(4), @@ -103,7 +103,7 @@ class GetOutPatientStack extends StatelessWidget { child: Container( child: SizedBox(), padding: EdgeInsets.all(10), - height: max != 0 ? ((barHeight) * value.value) / max : 0, + height: max != 0 ? ((barHeight) * value.value!) / max : 0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), color: Color(0xFFD02127).withOpacity(0.39), diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index 820dcd37..aea5f3ae 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -6,8 +6,8 @@ import 'package:flutter/material.dart'; class RowCounts extends StatelessWidget { final name; final int count; + final double? height; final Color c; - final double height; RowCounts(this.name, this.count, this.c, {this.height}); diff --git a/lib/widgets/data_display/list/custom_Item.dart b/lib/widgets/data_display/list/custom_Item.dart index c11af999..61457302 100644 --- a/lib/widgets/data_display/list/custom_Item.dart +++ b/lib/widgets/data_display/list/custom_Item.dart @@ -27,17 +27,17 @@ class CustomItem extends StatelessWidget { final BoxDecoration decoration; CustomItem( - {Key key, - this.startIcon, + {Key? key, + required this.startIcon, this.disabled: false, - this.onTap, - this.startIconColor, + required this.onTap, + required this.startIconColor, this.endIcon = EvaIcons.chevronRight, - this.padding, - this.child, - this.endIconColor, + required this.padding, + required this.child, + required this.endIconColor, this.endIconSize = 20, - this.decoration, + required this.decoration, this.startIconSize = 19}) : super(key: key); diff --git a/lib/widgets/data_display/list/flexible_container.dart b/lib/widgets/data_display/list/flexible_container.dart index a35fa279..4758a931 100644 --- a/lib/widgets/data_display/list/flexible_container.dart +++ b/lib/widgets/data_display/list/flexible_container.dart @@ -14,15 +14,15 @@ import 'package:flutter/material.dart'; class FlexibleContainer extends StatelessWidget { final double widthFactor; final double heightFactor; - final EdgeInsets padding; + final EdgeInsets? padding; final Widget child; FlexibleContainer({ - Key key, + Key? key, this.widthFactor = 0.9, this.heightFactor = 1, this.padding, - this.child, + required this.child, }) : super(key: key); @override diff --git a/lib/widgets/dialog/AskPermissionDialog.dart b/lib/widgets/dialog/AskPermissionDialog.dart index 58718373..f7a23925 100644 --- a/lib/widgets/dialog/AskPermissionDialog.dart +++ b/lib/widgets/dialog/AskPermissionDialog.dart @@ -10,7 +10,7 @@ class AskPermissionDialog extends StatefulWidget { final String type; final Function onTapGrant; - AskPermissionDialog({this.type, this.onTapGrant}); + AskPermissionDialog({required this.type, required this.onTapGrant}); @override _AskPermissionDialogState createState() => _AskPermissionDialogState(); diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index c4343a4b..70723cae 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class LabResultWidget extends StatefulWidget { final List labResult; - LabResultWidget({Key key, this.labResult}); + LabResultWidget({Key? key, required this.labResult}); @override _LabResultWidgetState createState() => _LabResultWidgetState(); @@ -31,7 +31,7 @@ class _LabResultWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).generalResult, + TranslationBase.of(context).generalResult!, fontSize: 2.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -137,7 +137,7 @@ class _LabResultWidgetState extends State { child: Center( child: AppText( '${result.description}', - color: Colors.grey[800], + color: Colors.grey![800], ), ), height: 60, @@ -147,16 +147,14 @@ class _LabResultWidgetState extends State { child: Container( child: Center( child: AppText('${result.resultValue}', - color: Colors.grey[800]), + color: Colors.grey![800]), ), height: 60), ), Expanded( child: Container( child: Center( - child: AppText( - '${result.referenceRange}', - color: Colors.grey[800]), + child: AppText('${result.referenceRange}', color: Colors.grey[800]), ), height: 60), ), diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index 453cff30..ce4db69e 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -19,11 +19,11 @@ class MyReferralPatientWidget extends StatefulWidget { final Function expandClick; MyReferralPatientWidget( - {Key key, - this.myReferralPatientModel, - this.model, - this.isExpand, - this.expandClick}); + {Key? key, + required this.myReferralPatientModel, + required this.model, + required this.isExpand, + required this.expandClick}); @override _MyReferralPatientWidgetState createState() => @@ -33,8 +33,8 @@ class MyReferralPatientWidget extends StatefulWidget { class _MyReferralPatientWidgetState extends State { bool _isLoading = false; final _formKey = GlobalKey(); - String error; - TextEditingController answerController; + late String error; + late TextEditingController answerController; @override void initState() { @@ -102,7 +102,7 @@ class _MyReferralPatientWidgetState extends State { Row( children: [ AppText( - TranslationBase.of(context).fileNo, + TranslationBase.of(context).fileNo!, fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -127,7 +127,7 @@ class _MyReferralPatientWidgetState extends State { margin: EdgeInsets.symmetric(horizontal: 8, vertical: 8), child: InkWell( - onTap: widget.expandClick, + onTap: widget.expandClick(), child: Image.asset( "assets/images/ic_circle_arrow.png", width: 25, @@ -170,7 +170,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context).referralDoctor, + TranslationBase.of(context).referralDoctor!, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -213,7 +213,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context).referringClinic, + TranslationBase.of(context).referringClinic!, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -268,7 +268,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context).frequency, + TranslationBase.of(context).frequency!, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -311,7 +311,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context).maxResponseTime, + TranslationBase.of(context).maxResponseTime!, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -323,7 +323,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime)}', + '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime!)}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.normal, textAlign: TextAlign.start, @@ -365,8 +365,8 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context) - .clinicDetailsandRemarks, + TranslationBase.of(context)! + .clinicDetailsandRemarks!, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -414,7 +414,7 @@ class _MyReferralPatientWidgetState extends State { controller: answerController, maxLines: 3, minLines: 2, - hintText: TranslationBase.of(context).answerThePatient, + hintText: TranslationBase.of(context).answerThePatient!, fontWeight: FontWeight.normal, readOnly: _isLoading, validator: (value) { @@ -431,10 +431,10 @@ class _MyReferralPatientWidgetState extends State { width: double.infinity, margin: EdgeInsets.only(left: 10, right: 10), child: AppButton( - title : TranslationBase.of(context).replay, + title : TranslationBase.of(context).replay!, onPressed: () async { final form = _formKey.currentState; - if (form.validate()) { + if (form!.validate()) { try { await widget.model.replay( answerController.text.toString(), diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 5c21f9ad..f13eb968 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -13,13 +13,13 @@ import 'package:provider/provider.dart'; class MyScheduleWidget extends StatelessWidget { final ListDoctorWorkingHoursTable workingHoursTable; - MyScheduleWidget({Key key, this.workingHoursTable}); + MyScheduleWidget({Key? key, required this.workingHoursTable}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); List workingHours = Helpers.getWorkingHours( - workingHoursTable.workingHours, + workingHoursTable.workingHours!, ); return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -34,13 +34,15 @@ class MyScheduleWidget extends StatelessWidget { height: 10, ), AppText( - projectViewModel.isArabic?AppDateUtils.getWeekDayArabic(workingHoursTable.date.weekday): AppDateUtils.getWeekDay(workingHoursTable.date.weekday) , + projectViewModel.isArabic + ? AppDateUtils.getWeekDayArabic(workingHoursTable.date!.weekday) + : AppDateUtils.getWeekDay(workingHoursTable.date!.weekday), fontSize: 16, fontFamily: 'Poppins', // fontSize: 18 ), AppText( - ' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', + ' ${workingHoursTable.date!.day} ${(AppDateUtils.getMonth(workingHoursTable.date!.month).toString().substring(0, 3))}', fontSize: 14, fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -52,15 +54,14 @@ class MyScheduleWidget extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.55, child: CardWithBgWidget( - bgColor: AppDateUtils.isToday(workingHoursTable.date) - ? AppGlobal.appGreenColor - : Colors.transparent, + bgColor: AppDateUtils.isToday(workingHoursTable.date!) ? Colors.green[500]! : Colors.transparent, + // hasBorder: false, widget: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (AppDateUtils.isToday(workingHoursTable.date)) + if (AppDateUtils.isToday(workingHoursTable.date!)) AppText( "Today", fontSize: 1.8 * SizeConfig.textMultiplier, diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index f4f78c08..482a251b 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -18,11 +18,11 @@ import '../shared/rounded_container_widget.dart'; */ class MedicineItemWidget extends StatefulWidget { - final String label; + final String? label; final Color backgroundColor; final bool showBorder; final Color borderColor; - final String url; + final String? url; MedicineItemWidget( {@required this.label, @@ -52,7 +52,7 @@ class _MedicineItemWidgetState extends State { child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(7)), child: Image.network( - widget.url, + widget.url!, height: SizeConfig.imageSizeMultiplier * 15, width: SizeConfig.imageSizeMultiplier * 15, fit: BoxFit.cover, @@ -62,9 +62,7 @@ class _MedicineItemWidgetState extends State { Expanded( child: Padding( padding: EdgeInsets.all(5), - child: Align( - alignment: Alignment.centerLeft, - child: AppText(widget.label)))), + child: Align(alignment: Alignment.centerLeft, child: AppText(widget.label)))), Icon(EvaIcons.eye) ], ), diff --git a/lib/widgets/patients/clinic_list_dropdwon.dart b/lib/widgets/patients/clinic_list_dropdwon.dart deleted file mode 100644 index c903bd7b..00000000 --- a/lib/widgets/patients/clinic_list_dropdwon.dart +++ /dev/null @@ -1,99 +0,0 @@ -// ignore: must_be_immutable -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class ClinicList extends StatelessWidget { - - ProjectViewModel projectsProvider; - final int clinicId; - final Function (int value) onClinicChange; - - ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); - - @override - Widget build(BuildContext context) { - // authProvider = Provider.of(context); - - projectsProvider = Provider.of(context); - return Container( - child: - projectsProvider - .doctorClinicsList.length > - 0 - ? FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width *0.8, - child: Center( - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: - Colors.white, - iconEnabledColor: - Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[ - 0] - .clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item.clinicName, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors - .black, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue){ - onClinicChange(newValue); - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: - TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), - ), - ), - ], - ), - ) - : AppText( - TranslationBase - .of(context) - .noClinic), - ); - } -} \ No newline at end of file diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart deleted file mode 100644 index d2a68acd..00000000 --- a/lib/widgets/patients/dynamic_elements.dart +++ /dev/null @@ -1,163 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; - -class DynamicElements extends StatefulWidget { - final PatientModel _patientSearchFormValues; - final bool isFormSubmitted; - DynamicElements(this._patientSearchFormValues, this.isFormSubmitted); - @override - _DynamicElementsState createState() => _DynamicElementsState(); -} - -class _DynamicElementsState extends State { - TextEditingController _toDateController = new TextEditingController(); - TextEditingController _fromDateController = new TextEditingController(); - void _presentDatePicker(id) { - showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime(2019), - lastDate: DateTime.now(), - ).then((pickedDate) { - if (pickedDate == null) { - return; - } - setState(() { - print(id); - var selectedDate = DateFormat.yMd().format(pickedDate); - - if (id == '_selectedFromDate') { - // _fromDateController.text = selectedDate; - selectedDate = pickedDate.year.toString() + - "-" + - pickedDate.month.toString().padLeft(2, '0') + - "-" + - pickedDate.day.toString().padLeft(2, '0'); - - _fromDateController.text = selectedDate; - } else { - selectedDate = pickedDate.year.toString() + - "-" + - pickedDate.month.toString().padLeft(2, '0') + - "-" + - pickedDate.day.toString().padLeft(2, '0'); - - _toDateController.text = selectedDate; - // _toDateController.text = selectedDate; - } - }); - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - InputDecoration textFieldSelectorDecoration( - {String hintText, - String selectedText, - bool isDropDown, - IconData icon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - return LayoutBuilder( - builder: (ctx, constraints) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - borderColor: Colors.white, - onTap: () => _presentDatePicker('_selectedFromDate'), - hintText: TranslationBase.of(context).fromDate, - controller: _fromDateController, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_fromDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.From = "0"; - } else { - widget._patientSearchFormValues.From = - _fromDateController.text.replaceAll("/", "-"); - } - }, - readOnly: true, - )), - SizedBox( - height: 5, - ), - if (widget._patientSearchFormValues.From == "0" && - widget.isFormSubmitted) - CustomValidationError(), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), - borderRadius: BorderRadius.all(Radius.circular(6.0))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - readOnly: true, - borderColor: Colors.white, - hintText: TranslationBase.of(context).toDate, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_toDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.To = "0"; - } else { - widget._patientSearchFormValues.To = - _toDateController.text.replaceAll("/", "-"); - } - }, - )), - if (widget._patientSearchFormValues.To == "0" && - widget.isFormSubmitted) - CustomValidationError(), - SizedBox( - height: 10, - ), - ], - ); - }, - ); - } -} diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 0e077895..e3e784d5 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -11,24 +11,24 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PatientReferralItemWidget extends StatelessWidget { - final String referralStatus; - final int referralStatusCode; - final String patientName; - final int patientGender; - final String referredDate; - final String referredTime; - final String patientID; + final String? referralStatus; + final int? referralStatusCode; + final String? patientName; + final int? patientGender; + final String? referredDate; + final String? referredTime; + final String? patientID; final isSameBranch; - final bool isReferral; - final bool isReferralClinic; - final String referralClinic; - final String remark; - final String nationality; - final String nationalityFlag; - final String doctorAvatar; - final String referralDoctorName; - final String clinicDescription; - final Widget infoIcon; + final bool? isReferral; + final bool? isReferralClinic; + final String? referralClinic; + final String? remark; + final String? nationality; + final String? nationalityFlag; + final String? doctorAvatar; + final String? referralDoctorName; + final String? clinicDescription; + final Widget? infoIcon; PatientReferralItemWidget( {this.referralStatus, @@ -67,8 +67,8 @@ class PatientReferralItemWidget extends StatelessWidget { : referralStatusCode == 46 ? AppGlobal.appGreenColor : referralStatusCode == 4 - ? Colors.red[700] - : Colors.red[900], + ? Colors.red[700]! + : Colors.red[900]!, hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -80,7 +80,7 @@ class PatientReferralItemWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - referralStatus != null ? referralStatus : "", + referralStatus != null ? referralStatus! : "", fontFamily: 'Poppins', fontSize: 10.0, letterSpacing: -0.4, @@ -92,11 +92,11 @@ class PatientReferralItemWidget extends StatelessWidget { : referralStatusCode == 46 ? AppGlobal.appGreenColor : referralStatusCode == 4 - ? Colors.red[700] - : Colors.red[900], + ? Colors.red[700]! + : Colors.red[900]!, ), AppText( - referredDate, + referredDate!, fontFamily: 'Poppins', fontWeight: FontWeight.w600, letterSpacing: -0.48, @@ -110,7 +110,7 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ Expanded( child: AppText( - patientName, + patientName!, fontSize: 16.0, fontWeight: FontWeight.w600, color: Color(0xff2E303A), @@ -132,7 +132,7 @@ class PatientReferralItemWidget extends StatelessWidget { width: 4, ), AppText( - referredTime, + referredTime!, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 12.0, @@ -153,8 +153,8 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ CustomRow( label: - TranslationBase.of(context).fileNumber, - value: patientID, + TranslationBase.of(context).fileNumber!, + value: patientID!, ), ], ), @@ -165,15 +165,15 @@ class PatientReferralItemWidget extends StatelessWidget { CustomRow( label: isSameBranch ? TranslationBase.of(context) - .referredFrom - : TranslationBase.of(context).refClinic, - value: !isReferralClinic + .referredFrom! + : TranslationBase.of(context).refClinic!, + value: !isReferralClinic! ? isSameBranch ? TranslationBase.of(context) - .sameBranch + .sameBranch! : TranslationBase.of(context) - .otherBranch - : " " + referralClinic, + .otherBranch! + : " " + referralClinic!, ), ], ), @@ -183,7 +183,7 @@ class PatientReferralItemWidget extends StatelessWidget { Row( children: [ AppText( - nationality != null ? nationality : "", + nationality != null ? nationality! : "", fontWeight: FontWeight.w600, color: Color(0xFF2E303A), fontSize: 10.0, @@ -193,12 +193,10 @@ class PatientReferralItemWidget extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - nationalityFlag, + nationalityFlag!, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text(''); }, )) @@ -212,7 +210,7 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ CustomRow( - label: TranslationBase.of(context).remarks + " : ", + label: TranslationBase.of(context).remarks! + " : ", value: remark ?? "", ), ], @@ -223,7 +221,7 @@ class PatientReferralItemWidget extends StatelessWidget { Container( margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( - isReferral + isReferral! ? 'assets/images/patient/ic_ref_arrow_up.png' : 'assets/images/patient/ic_ref_arrow_left.png', height: 50, @@ -241,12 +239,10 @@ class PatientReferralItemWidget extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - doctorAvatar, + doctorAvatar!, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -278,7 +274,7 @@ class PatientReferralItemWidget extends StatelessWidget { ), if (clinicDescription != null) AppText( - clinicDescription, + clinicDescription??"", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 10.0, diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 85069187..d28297e6 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -51,6 +51,7 @@ class PatientCard extends StatelessWidget { ? patientInfo.nationalityId : ""; + ProjectViewModel projectViewModel = Provider.of(context); return Container( width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), @@ -76,7 +77,7 @@ class PatientCard extends StatelessWidget { : isInpatient ? Colors.white : !isFromSearch - ? Colors.red[800] + ? Colors.red[800]! : Colors.white, widget: Container( decoration: BoxDecoration( @@ -134,8 +135,8 @@ class PatientCard extends StatelessWidget { PatientStatus( label: TranslationBase.of(context) - .notArrived, - color: Colors.red[800], + .notArrived!, + color: Colors.red[800]!, ), SizedBox( width: 8, @@ -169,8 +170,8 @@ class PatientCard extends StatelessWidget { PatientStatus( label: TranslationBase.of( context) - .notArrived, - color: Colors.red[800], + .notArrived!, + color: Colors.red[800]!, ), SizedBox( width: 8, @@ -202,8 +203,8 @@ class PatientCard extends StatelessWidget { this.arrivalType == '1' ? AppText( patientInfo.startTime != null - ? patientInfo.startTime - : patientInfo.startTimes, + ? patientInfo.startTime! + : patientInfo.startTimes!, fontFamily: 'Poppins', fontWeight: FontWeight.w400, ) @@ -212,7 +213,7 @@ class PatientCard extends StatelessWidget { padding: EdgeInsets.only(right: 9), child: AppText( - "${AppDateUtils.getStartTime(patientInfo.startTime)}", + "${AppDateUtils.getStartTime(patientInfo.startTime!)}", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 11, @@ -222,11 +223,11 @@ class PatientCard extends StatelessWidget { : (patientInfo.appointmentDate != null && patientInfo - .appointmentDate.isNotEmpty) + .appointmentDate!.isNotEmpty!) ? Container( padding: EdgeInsets.only(right: 9), child: AppText( - " ${AppDateUtils.getStartTime(patientInfo.startTime)}", + " ${AppDateUtils.getStartTime(patientInfo!.startTime!)}", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 11, @@ -296,7 +297,7 @@ class PatientCard extends StatelessWidget { ), ]), ), - if (nationalityName.isNotEmpty) + if (nationalityName!.isNotEmpty) Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.end, @@ -381,14 +382,14 @@ class PatientCard extends StatelessWidget { // SizedBox(height: 10,), CustomRow( label: TranslationBase.of(context) - .fileNumber, + .fileNumber!, value: patientInfo.patientId.toString(), ), CustomRow( - label: TranslationBase.of(context).age + + label: TranslationBase.of(context).age! + " : ", value: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}", ), patientInfo.arrivedOn != null @@ -416,13 +417,13 @@ class PatientCard extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .arrivedP + + .arrivedP! + " : ", value: AppDateUtils .getDayMonthYearDateFormatted( AppDateUtils .convertStringToDate( - patientInfo.arrivedOn, + patientInfo!.arrivedOn!, ), isMonthShort: true, ), @@ -431,7 +432,7 @@ class PatientCard extends StatelessWidget { ) : (patientInfo.appointmentDate != null && - patientInfo.appointmentDate + patientInfo!.appointmentDate! .isNotEmpty) ? Column( crossAxisAlignment: @@ -442,11 +443,11 @@ class PatientCard extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .appointmentDate + + .appointmentDate! + " : ", value: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( - patientInfo - .appointmentDate, + patientInfo! + .appointmentDate!, ), isMonthShort: true)}", ), ], @@ -459,7 +460,7 @@ class PatientCard extends StatelessWidget { patientInfo.admissionDate == null ? "" : TranslationBase.of(context) - .admissionDate + + .admissionDate! + " : ", value: patientInfo.admissionDate == null @@ -469,15 +470,15 @@ class PatientCard extends StatelessWidget { if (patientInfo.admissionDate != null) CustomRow( label: TranslationBase.of(context) - .numOfDays + + .numOfDays!+ " : ", value: - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}", ), if (patientInfo.admissionDate != null) CustomRow( label: TranslationBase.of(context) - .clinicName + + .clinicName! + " : ", value: "${patientInfo.clinicDescription}", @@ -485,7 +486,7 @@ class PatientCard extends StatelessWidget { if (patientInfo.admissionDate != null) CustomRow( label: TranslationBase.of(context) - .roomNo + + .roomNo! + " : ", value: "${patientInfo.roomId}", ), @@ -494,9 +495,9 @@ class PatientCard extends StatelessWidget { children: [ CustomRow( label: TranslationBase.of(context) - .clinic + + .clinic! + " : ", - value: patientInfo.clinicName, + value: patientInfo!.clinicName!, ), ], ), @@ -576,17 +577,17 @@ class PatientCard extends StatelessWidget { class PatientStatus extends StatelessWidget { PatientStatus({ - Key key, + Key ? key, this.label, this.color, }) : super(key: key); - final String label; - final Color color; + final String? label; + final Color? color; @override Widget build(BuildContext context) { return AppText( - label, + label??"", color: color ?? AppGlobal.appGreenColor, fontWeight: FontWeight.w600, fontFamily: 'Poppins', diff --git a/lib/widgets/patients/patient_card/ShowTimer.dart b/lib/widgets/patients/patient_card/ShowTimer.dart index b769588b..165bbbd9 100644 --- a/lib/widgets/patients/patient_card/ShowTimer.dart +++ b/lib/widgets/patients/patient_card/ShowTimer.dart @@ -9,7 +9,7 @@ class ShowTimer extends StatefulWidget { const ShowTimer({ - Key key, this.patientInfo, + Key? key, required this.patientInfo, }) : super(key: key); @override @@ -50,7 +50,7 @@ class _ShowTimerState extends State { generateShowTimerString() { DateTime now = DateTime.now(); - DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime); + DateTime liveCareDate = DateTime.parse(widget.patientInfo!.arrivalTime!); String timer = AppDateUtils.differenceBetweenDateAndCurrent( liveCareDate, context, isShowSecond: true, isShowDays: false); diff --git a/lib/widgets/patients/patient_service_title.dart b/lib/widgets/patients/patient_service_title.dart index 08ce9293..839d5ab7 100644 --- a/lib/widgets/patients/patient_service_title.dart +++ b/lib/widgets/patients/patient_service_title.dart @@ -6,7 +6,7 @@ class ServiceTitle extends StatefulWidget { final String title; final String subTitle; - const ServiceTitle({Key key, this.title, this.subTitle}) : super(key: key); + const ServiceTitle({Key ? key, required this.title, required this.subTitle}) : super(key: key); @override _ServiceTitleState createState() => _ServiceTitleState(); diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index a3c4492f..a9e7b60b 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -11,35 +11,35 @@ import 'package:provider/provider.dart'; // ignore: must_be_immutable class PatientProfileButton extends StatelessWidget { - final String nameLine1; - final String nameLine2; + final String? nameLine1; + final String? nameLine2; final String icon; final dynamic route; final PatiantInformtion patient; final String patientType; String arrivalType; final bool isInPatient; - String from; - String to; + String? from; + String? to; final String url = "assets/images/"; final bool isDisable; final bool isLoading; - final Function onTap; + final GestureTapCallback? onTap; final bool isDischargedPatient; final bool isSelectInpatient; final bool isDartIcon; - final IconData dartIcon; - final bool isFromLiveCare; - final Color color; + final IconData? dartIcon; + final bool? isFromLiveCare; + final Color? color; PatientProfileButton({ - Key key, - this.patient, - this.patientType, - this.arrivalType, - this.nameLine1, - this.nameLine2, - this.icon, + Key? key, + required this.patient, + required this.patientType, + required this.arrivalType, + this.nameLine1, + this.nameLine2, + required this.icon, this.route, this.isDisable = false, this.onTap, @@ -100,7 +100,7 @@ class PatientProfileButton extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - !projectsProvider.isArabic ? this.nameLine1 : nameLine2, + !projectsProvider.isArabic ? this.nameLine1! : nameLine2!??'', color: color ?? AppGlobal.appTextColor, letterSpacing: -0.33, fontWeight: FontWeight.w600, @@ -108,7 +108,7 @@ class PatientProfileButton extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 1.30, ), AppText( - !projectsProvider.isArabic ? this.nameLine2 : nameLine1, + !projectsProvider.isArabic ? this.nameLine2! : nameLine1!??'', color: color ?? Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, diff --git a/lib/widgets/patients/profile/Profile_general_info_Widget.dart b/lib/widgets/patients/profile/Profile_general_info_Widget.dart deleted file mode 100644 index e0eb5b12..00000000 --- a/lib/widgets/patients/profile/Profile_general_info_Widget.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:flutter/material.dart'; - -import './profile_general_info_content_widget.dart'; -import '../../../config/size_config.dart'; -import '../../shared/rounded_container_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:21/4/2020 - *@param: - *@return: ProfileGeneralInfoWidget - *@desc: Profile General Info Widget class - */ -class ProfileGeneralInfoWidget extends StatelessWidget { - ProfileGeneralInfoWidget({Key key, this.patient}) : super(key: key); - - PatiantInformtion patient; - - @override - Widget build(BuildContext context) { - // PatientsProvider patientsProv = Provider.of(context); - // patient = patientsProv.getSelectedPatient(); - return RoundedContainer( - child: ListView( - children: [ - ProfileGeneralInfoContentWidget( - title: "Age", - info: '${patient.age}', - ), - ProfileGeneralInfoContentWidget( - title: "Contact Number", - info: '${patient.mobileNumber}', - ), - ProfileGeneralInfoContentWidget( - title: "Email", - info: '${patient.emailAddress}', - ), - ], - ), - width: SizeConfig.screenWidth * 0.70, - height: SizeConfig.screenHeight * 0.25, - ); - } -} diff --git a/lib/widgets/patients/profile/add-order/addNewOrder.dart b/lib/widgets/patients/profile/add-order/addNewOrder.dart index cc9223f6..8b643536 100644 --- a/lib/widgets/patients/profile/add-order/addNewOrder.dart +++ b/lib/widgets/patients/profile/add-order/addNewOrder.dart @@ -3,12 +3,12 @@ import 'package:flutter/material.dart'; class AddNewOrder extends StatelessWidget { const AddNewOrder({ - Key key, - this.onTap, - this.label, + Key? key, + required this.onTap, + required this.label, }) : super(key: key); - final Function onTap; + final GestureTapCallback onTap; final String label; @override diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index 80f54e12..8af1c320 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -5,8 +5,8 @@ import 'package:flutter/material.dart'; class LargeAvatar extends StatelessWidget { LargeAvatar( - {Key key, - this.name, + {Key? key, + required this.name, this.url, this.disableProfileView: false, this.radius = 60.0, @@ -15,14 +15,14 @@ class LargeAvatar extends StatelessWidget { : super(key: key); final String name; - final String url; + final String? url; final bool disableProfileView; final double radius; final double width; final double height; Widget _getAvatar() { - if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { + if (url != null && url!.isNotEmpty && Uri.parse(url!).isAbsolute) { return CircleAvatar( radius: SizeConfig.imageSizeMultiplier * 12, @@ -31,7 +31,7 @@ class LargeAvatar extends StatelessWidget { borderRadius:BorderRadius.circular(50), child: Image.network( - url, + url!, fit: BoxFit.fill, width: 700, ), @@ -71,8 +71,8 @@ class LargeAvatar extends StatelessWidget { begin: Alignment(-1, -1), end: Alignment(1, 1), colors: [ - Colors.grey[100], - Colors.grey[800], + Colors.grey[100]!, + Colors.grey[800]!, ]), boxShadow: [ BoxShadow( diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 46b8ed7f..bb546bef 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -24,7 +24,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final bool isDischargedPatient; final bool isFromLiveCare; - final Stream videoCallDurationStream; + final Stream? videoCallDurationStream; PatientProfileHeaderNewDesignAppBar( this.patient, this.patientType, this.arrivalType, @@ -38,9 +38,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget Widget build(BuildContext context) { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + gender = patient.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient!.gender!; } return Container( padding: EdgeInsets.only( @@ -76,7 +76,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget " " + Helpers.capitalize(patient.lastName)) : Helpers.capitalize(patient.fullName ?? - patient.patientDetails.fullName), + patient.patientDetails!.fullName!), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -99,7 +99,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget eventCategory: "Patient Profile Header", eventAction: "Call Patient", ); - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -121,7 +121,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), child: Text( - snapshot.data, + snapshot!.data!, style: TextStyle(color: Colors.white), ), ), @@ -161,15 +161,15 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget children: [ patient.patientStatusType == 43 ? AppText( - TranslationBase.of(context).arrivedP, + TranslationBase.of(context).arrivedP!, color: AppGlobal.appGreenColor, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, ) : AppText( - TranslationBase.of(context).notArrived, - color: Colors.red[800], + TranslationBase.of(context).notArrived!, + color: Colors.red[800]!, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, @@ -177,7 +177,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget arrivalType == '1' || patient.arrivedOn == null ? AppText( patient.startTime != null - ? patient.startTime + ? patient.startTime! : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -186,7 +186,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget patient.arrivedOn != null ? AppDateUtils .convertStringToDateFormat( - patient.arrivedOn, + patient!.arrivedOn!, 'MM-dd-yyyy HH:mm') : '', fontFamily: 'Poppins', @@ -203,7 +203,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + + TranslationBase.of(context).appointmentDate!+ " : ", fontSize: 14, ), @@ -273,12 +273,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient!.nationalityFlagURL!, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext? context, + Object? exception, + StackTrace? stackTrace) { return Text(''); }, )) @@ -289,9 +289,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ], ), HeaderRow( - label: TranslationBase.of(context).age + " : ", + label: TranslationBase.of(context).age! + " : ", value: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), if (isInpatient) Column( @@ -300,7 +300,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget HeaderRow( label: patient.admissionDate == null ? "" - : TranslationBase.of(context).admissionDate + + : TranslationBase.of(context).admissionDate! + " : ", value: patient.admissionDate == null ? "" @@ -310,8 +310,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && patient.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + ? "${AppDateUtils.getDateTimeFromServerFormat(patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient!.admissionDate!)).inDays + 1}", ) ], ) @@ -326,7 +326,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget } convertDateFormat2(String str) { - String newDate; + late String newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -343,7 +343,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget date.day.toString().padLeft(2, '0'); } - return newDate ?? ''; + return newDate??''; } isToday(date) { diff --git a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart index 52af839c..dd6d869e 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -14,8 +14,7 @@ import 'large_avatar.dart'; class PrescriptionInPatientWidget extends StatelessWidget { final List prescriptionReportForInPatientList; - PrescriptionInPatientWidget( - {Key key, this.prescriptionReportForInPatientList}); + PrescriptionInPatientWidget({Key? key, required this.prescriptionReportForInPatientList}); @override Widget build(BuildContext context) { @@ -43,13 +42,13 @@ class PrescriptionInPatientWidget extends StatelessWidget { ), Padding( child: AppText( - TranslationBase.of(context).noPrescription, + TranslationBase.of(context).noPrescription!, fontWeight: FontWeight.bold, ), padding: EdgeInsets.all(10), ), AppText( - TranslationBase.of(context).applyNow, + TranslationBase.of(context).applyNow!, fontWeight: FontWeight.bold, color: HexColor('#B8382C'), ) @@ -78,9 +77,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { Row( children: [ LargeAvatar( - name: - prescriptionReportForInPatientList[index] - .createdByName, + name: prescriptionReportForInPatientList[index].createdByName ?? "", radius: 10, width: 70, ), diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index 50afbdcf..81a6d629 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -14,7 +14,7 @@ import 'large_avatar.dart'; class PrescriptionOutPatientWidget extends StatelessWidget { final List patientPrescriptionsList; - PrescriptionOutPatientWidget({Key key, this.patientPrescriptionsList}); + PrescriptionOutPatientWidget({Key? key, required this.patientPrescriptionsList}); @override Widget build(BuildContext context) { @@ -42,13 +42,13 @@ class PrescriptionOutPatientWidget extends StatelessWidget { ), Padding( child: AppText( - TranslationBase.of(context).noPrescription, + TranslationBase.of(context).noPrescription!, fontWeight: FontWeight.bold, ), padding: EdgeInsets.all(10), ), AppText( - TranslationBase.of(context).applyNow, + TranslationBase.of(context).applyNow!, fontWeight: FontWeight.bold, color: HexColor('#B8382C'), ) @@ -82,10 +82,8 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Row( children: [ LargeAvatar( - url: patientPrescriptionsList[index] - .doctorImageURL, - name: patientPrescriptionsList[index] - .doctorName, + url: patientPrescriptionsList[index].doctorImageURL, + name: patientPrescriptionsList[index].doctorName ?? "", radius: 10, width: 70, ), diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 0a405d8d..52762560 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -34,7 +34,7 @@ class ProfileWelcomeWidget extends StatelessWidget { child: ClipRRect( borderRadius: BorderRadius.circular(20), child: CachedNetworkImage( - imageUrl: authenticationViewModel.doctorProfile.doctorImageURL, + imageUrl: authenticationViewModel.doctorProfile!.doctorImageURL ?? "", fit: BoxFit.fill, width: 75, height: 75, diff --git a/lib/widgets/patients/profile/profile_general_info_content_widget.dart b/lib/widgets/patients/profile/profile_general_info_content_widget.dart deleted file mode 100644 index f5c70ae6..00000000 --- a/lib/widgets/patients/profile/profile_general_info_content_widget.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../config/size_config.dart'; -import '../../shared/app_texts_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:22/4/2020 - *@param: title, info - *@return:ProfileGeneralInfoContentWidget - *@desc: Profile General Info Content Widget - */ -class ProfileGeneralInfoContentWidget extends StatelessWidget { - String title; - String info; - - ProfileGeneralInfoContentWidget({this.title, this.info}); - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 14), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - AppText( - title, - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.w700, - color: HexColor('#58434F'), - ), - AppText( - info, - color: HexColor('#707070'), - fontSize: SizeConfig.textMultiplier * 2, - ) - ], - ), - ); - } -} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index fec33a62..23a0a2b5 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -16,7 +16,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { final bool isInpatient; ProfileMedicalInfoWidget( - {Key key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient}); + {Key? key, required this.patient, required this.patientType, required this.arrivalType, required this.from, required this.to, this.isInpatient = false}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart deleted file mode 100644 index a7ab2412..00000000 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ /dev/null @@ -1,176 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/routes.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { - final String from; - final String to; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final bool isInpatient; - final bool isDischargedPatient; - - ProfileMedicalInfoWidgetInPatient( - {Key key, - this.patient, - this.patientType, - this.arrivalType, - this.from, - this.to, - this.isInpatient, - this.isDischargedPatient = false}); - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'assets/images/svgs/profile_screen/vital signs.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'assets/images/svgs/profile_screen/lab results.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'assets/images/svgs/profile_screen/health summary.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'assets/images/svgs/profile_screen/order prescription.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: "Sheet", //TranslationBase.of(context).orders, - icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'assets/images/svgs/profile_screen/Order Procedures.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: HEALTH_SUMMARY, - nameLine1: "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'assets/images/svgs/profile_screen/health summary.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: HEALTH_SUMMARY, - nameLine1: "Medical", //Health - //TranslationBase.of(context).medicalReport, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'assets/images/svgs/profile_screen/health summary.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'assets/images/svgs/profile_screen/insurance approval.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), - ], - ), - ); - } -} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index c6c2c464..fe2e0803 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -8,27 +8,35 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class ProfileMedicalInfoWidgetSearch extends StatelessWidget { +class ProfileMedicalInfoWidgetSearch extends StatefulWidget { final String? from; final String? to; final PatiantInformtion patient; final String patientType; - final String arrivalType; + final String? arrivalType; final bool isInpatient; - final bool isDischargedPatient; + final bool? isDischargedPatient; ProfileMedicalInfoWidgetSearch( - {Key key, - this.patient, - this.patientType, + {Key? key, + required this.patient, + required this.patientType, this.arrivalType, this.from, this.to, - this.isInpatient , + this.isInpatient = false, this.isDischargedPatient}); - TabController _tabController; + + @override + _ProfileMedicalInfoWidgetSearchState createState() => _ProfileMedicalInfoWidgetSearchState(); +} + +class _ProfileMedicalInfoWidgetSearchState extends State + with SingleTickerProviderStateMixin { + late TabController _tabController; + void initState() { - _tabController = TabController(length: 2); + _tabController = TabController(length: 2, vsync: this); } void dispose() { @@ -41,7 +49,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { onModelReady: (model) async {}, builder: (_, model, w) => DefaultTabController( length: 2, - initialIndex: isInpatient ? 0 : 1, + initialIndex: widget.isInpatient! ? 0 : 1, child: SizedBox( height: MediaQuery.of(context).size.height * 1.0, width: double.infinity, @@ -55,22 +63,21 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { crossAxisCount: 3, children: [ PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + from: widget.from, + to: widget.to, + nameLine1: TranslationBase.of(context).vital??'', + nameLine2: TranslationBase.of(context).signs??'', route: VITAL_SIGN_DETAILS, icon: 'assets/images/svgs/profile_screen/vital signs.svg'), // if (selectedPatientType != 7) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, @@ -78,128 +85,128 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { "Summary", //TranslationBase.of(context).summaryReport, icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context).lab??'', + nameLine2: TranslationBase.of(context).result??"", icon: 'assets/images/svgs/profile_screen/lab results.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + isInPatient: widget.isInpatient, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, + nameLine1: TranslationBase.of(context).radiology??"", + nameLine2: TranslationBase.of(context).service??"", icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", route: PATIENT_ECG, nameLine1: TranslationBase.of(context).patient, nameLine2: "ECG", icon: 'assets/images/svgs/profile_screen/ECG.svg'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, + nameLine1: TranslationBase.of(context).orders??"", + nameLine2: TranslationBase.of(context).prescription??'', icon: 'assets/images/svgs/profile_screen/order prescription.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", route: ORDER_PROCEDURE, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'assets/images/svgs/profile_screen/Order Procedures.svg'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, icon: 'assets/images/svgs/profile_screen/insurance approval.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", route: ADD_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (widget.patient.appointmentNo != null && + widget.patient.appointmentNo != 0) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", route: PATIENT_UCAF_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, + widget.patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).ucaf, icon: 'assets/images/svgs/profile_screen/UCAF.svg'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (widget.patient.appointmentNo != null && + widget.patient.appointmentNo != 0) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", route: REFER_PATIENT_TO_DOCTOR, isDisable: - patient.patientStatusType != 43 ? true : false, + widget.patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).referral, nameLine2: TranslationBase.of(context).patient, icon: 'assets/images/svgs/profile_screen/refer patient.svg'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (widget.patient.appointmentNo != null && + widget.patient.appointmentNo != 0) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", route: PATIENT_ADMISSION_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, + widget.patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'assets/images/svgs/profile_screen/admission req.svg'), - if (isInpatient) + if (widget.isInpatient) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", route: PROGRESS_NOTE, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), - if (isInpatient) + if (widget.isInpatient) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", route: ORDER_NOTE, nameLine1: "Order", //"Text", nameLine2: "Sheet", diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index b8314b03..767f1a63 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -12,7 +12,7 @@ class VitalSignDetailsWidget extends StatefulWidget { final String viewKey; VitalSignDetailsWidget( - {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); + {Key? key, required this.vitalList, required this.title1, required this.title2, required this.viewKey}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -38,7 +38,7 @@ class _VitalSignDetailsWidgetState extends State { children: [ Table( border: TableBorder.symmetric( - inside: BorderSide(width: 2.0,color: Colors.grey[300]), + inside: BorderSide(width: 2.0, color: Colors.grey[300]!), ), children: fullData(), ), @@ -90,7 +90,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: AppText( - '${AppDateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${AppDateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + '${AppDateUtils.getWeekDay(vital.vitalSignDate!.weekday!)}, ${vital.vitalSignDate!.day} ${AppDateUtils.getMonth(vital.vitalSignDate!.month)}, ${vital.vitalSignDate!.year} ', textAlign: TextAlign.center, ), ), diff --git a/lib/widgets/shared/StarRating.dart b/lib/widgets/shared/StarRating.dart index f391e7bf..1caded9b 100644 --- a/lib/widgets/shared/StarRating.dart +++ b/lib/widgets/shared/StarRating.dart @@ -8,30 +8,21 @@ class StarRating extends StatelessWidget { final int totalCount; final bool forceStars; - StarRating( - {Key key, - this.totalAverage: 0.0, - this.size: 16.0, - this.totalCount = 5, - this.forceStars = false}) + StarRating({Key? key, this.totalAverage: 0.0, this.size: 16.0, this.totalCount = 5, this.forceStars = false}) : super(key: key); @override Widget build(BuildContext context) { return Row(mainAxisAlignment: MainAxisAlignment.start, children: [ - if (!forceStars && (totalAverage == null || totalAverage == 0)) - AppText("New", style: "caption"), + if (!forceStars && (totalAverage == null || totalAverage == 0)) AppText("New", style: "caption"), if (forceStars || (totalAverage != null && totalAverage > 0)) ...List.generate( 5, (index) => Padding( padding: EdgeInsets.only(right: 1.0), - child: Icon( - (index + 1) <= (totalAverage ?? 0) - ? EvaIcons.star - : EvaIcons.starOutline, + child: Icon((index + 1) <= (totalAverage) ? EvaIcons.star : EvaIcons.starOutline, size: size, - color: (index + 1) <= (totalAverage ?? 0) + color: (index + 1) <= (totalAverage) ? Color.fromRGBO(255, 186, 0, 1.0) : Theme.of(context).hintColor), )), diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 3674e144..00fc4edb 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -4,8 +4,7 @@ import 'package:flutter/services.dart'; class NumberTextInputFormatter extends TextInputFormatter { @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { + TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { final int newTextLength = newValue.text.length; int selectionIndex = newValue.selection.end; int usedSubstringIndex = 0; @@ -27,8 +26,7 @@ class NumberTextInputFormatter extends TextInputFormatter { if (newValue.selection.end >= 10) selectionIndex++; } // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); + if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex)); return TextEditingValue( text: newText.toString(), selection: TextSelection.collapsed(offset: selectionIndex), @@ -39,87 +37,90 @@ class NumberTextInputFormatter extends TextInputFormatter { final _mobileFormatter = NumberTextInputFormatter(); class TextFields extends StatefulWidget { - TextFields( - {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction = TextInputAction.done, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 16.0, - this.fontWeight = FontWeight.w700, - this.autoValidate = false, - this.fillColor, - this.hintColor, - this.hasBorder = true, - this.onTapTextFields, - this.hasLabelText = false, - this.showLabelText = false, this.borderRadius= 8.0, this.borderColor, this.borderWidth = 1, }) - : super(key: key); + TextFields({ + Key? key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction = TextInputAction.done, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.fillColor, + this.hintColor, + this.hasBorder = true, + this.onTapTextFields, + this.hasLabelText = false, + this.showLabelText = false, + this.borderRadius = 8.0, + this.borderColor, + this.borderWidth = 1, + }) : super(key: key); - final String hintText; - final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final Function onTapTextFields; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; - final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; - final bool maxLengthEnforced; - final bool bare; - final TextInputAction inputAction; - final double fontSize; - final FontWeight fontWeight; - final bool keepPadding; - final TextCapitalization textCapitalization; - final List inputFormatters; - final bool autoValidate; - final EdgeInsets padding; - final bool focus; - final bool borderOnlyError; - final Color hintColor; - final Color fillColor; - final bool hasBorder; - final bool showLabelText; - Color borderColor; - final double borderRadius; - final double borderWidth; - bool hasLabelText; + final String? hintText; + final String? initialValue; + final String? type; + final bool? autoFocus; + final IconData? suffixIcon; + final Color? suffixIconColor; + final Icon? prefixIcon; + final VoidCallback? onTap; + final GestureTapCallback? onTapTextFields; + final TextEditingController? controller; + final TextInputType? keyboardType; + final FormFieldValidator? validator; + final FormFieldSetter? onSaved; + final GestureTapCallback? onSuffixTap; + final Function? onChanged; + final ValueChanged? onSubmit; + final bool? readOnly; + final int? maxLength; + final int? minLines; + final int? maxLines; + final bool? maxLengthEnforced; + final bool? bare; + final TextInputAction? inputAction; + final double? fontSize; + final FontWeight? fontWeight; + final bool? keepPadding; + final TextCapitalization? textCapitalization; + final List? inputFormatters; + final bool? autoValidate; + final EdgeInsets? padding; + final bool? focus; + final bool? borderOnlyError; + final Color? hintColor; + final Color? fillColor; + final bool? hasBorder; + final bool? showLabelText; + Color? borderColor; + final double? borderRadius; + final double? borderWidth; + bool? hasLabelText; @override _TextFieldsState createState() => _TextFieldsState(); @@ -142,7 +143,7 @@ class _TextFieldsState extends State { @override void didUpdateWidget(TextFields oldWidget) { - if (widget.focus) _focusNode.requestFocus(); + if (widget.focus!) _focusNode.requestFocus(); super.didUpdateWidget(oldWidget); } @@ -152,7 +153,7 @@ class _TextFieldsState extends State { super.dispose(); } - Widget _buildSuffixIcon() { + Widget? _buildSuffixIcon() { switch (widget.type) { case "password": { @@ -160,40 +161,35 @@ class _TextFieldsState extends State { padding: const EdgeInsets.only(right: 8.0), child: view ? InkWell( - onTap: () { - this.setState(() { - view = false; - }); - }, - child: Icon(EvaIcons.eye, - size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) + onTap: () { + this.setState(() { + view = false; + }); + }, + child: Icon(EvaIcons.eye, size: 24.0, color: Color?.fromRGBO(78, 62, 253, 1.0))) : InkWell( - onTap: () { - this.setState(() { - view = true; - }); - }, - child: Icon(EvaIcons.eyeOff, - size: 24.0, color: Colors.grey[500]))); + onTap: () { + this.setState(() { + view = true; + }); + }, + child: Icon(EvaIcons.eyeOff, size: 24.0, color: Colors.grey[500]))); } break; default: if (widget.suffixIcon != null) return InkWell( - onTap: widget.onSuffixTap, + onTap: widget.onSuffixTap??null, child: Icon(widget.suffixIcon, - size: 22.0, - color: widget.suffixIconColor != null - ? widget.suffixIconColor - : Colors.grey[500])); + size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); else return null; } } - bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly) { + bool? _determineReadOnly() { + if (widget.readOnly != null && widget.readOnly!) { _focusNode.unfocus(); return true; } else { @@ -203,44 +199,43 @@ class _TextFieldsState extends State { @override Widget build(BuildContext context) { - - widget.borderColor = widget.borderColor?? Colors.grey; + widget.borderColor = widget.borderColor ?? Colors.grey; return (AnimatedContainer( duration: Duration(milliseconds: 300), - decoration: widget.bare + decoration: widget.bare! ? null : BoxDecoration(boxShadow: [ - // BoxShadow( - // color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), - // offset: Offset(0.0, 13.0), - // blurRadius: focus ? 34.0 : 12.0) - BoxShadow( - color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0), - offset: Offset(0.0, 13.0), - blurRadius: focus ? 34.0 : 12.0) - ]), + // BoxShadow( + // color: Color?.fromRGBO(70, 68, 167, focus ? 0.20 : 0), + // offset: Offset(0.0, 13.0), + // blurRadius: focus ? 34.0 : 12.0) + BoxShadow( + color: Color?.fromRGBO(110, 68, 80, focus ? 0.20 : 0), + offset: Offset(0.0, 13.0), + blurRadius: focus ? 34.0 : 12.0) + ]), child: Column( children: [ TextFormField( onTap: widget.onTapTextFields, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - // autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, - onFieldSubmitted: widget.inputAction == TextInputAction.next - ? (widget.onSubmit != null - ? widget.onSubmit - : (val) { - _focusNode.nextFocus(); - }) + // autovalidate: widget.autoValidate!, + textCapitalization: widget.textCapitalization!, + onFieldSubmitted: widget.inputAction! == TextInputAction.next + ? (widget.onSubmit! != null + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) : widget.onSubmit, textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, + maxLengthEnforced: widget.maxLengthEnforced!, initialValue: widget.initialValue, onChanged: (value) { - if (widget.showLabelText) { + if (widget.showLabelText!) { if ((value == null || value == '')) { setState(() { widget.hasLabelText = false; @@ -251,27 +246,29 @@ class _TextFieldsState extends State { }); } } - if (widget.onChanged != null) widget.onChanged(value); + if (widget.onChanged != null) widget.onChanged!(value); }, focusNode: _focusNode, maxLength: widget.maxLength ?? null, controller: widget.controller, keyboardType: widget.keyboardType, - readOnly: _determineReadOnly(), + readOnly: _determineReadOnly()!, obscureText: widget.type == "password" && !view ? true : false, autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText1.copyWith( - fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: Theme.of(context) + .textTheme + .bodyText1! + .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ - // WhitelistingTextInputFormatter.digitsOnly, - _mobileFormatter, - ] + // WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] : widget.inputFormatters, decoration: InputDecoration( - labelText: widget.hasLabelText ? widget.hintText : null, + labelText: widget.hasLabelText! ? widget.hintText : null, labelStyle: TextStyle( fontSize: widget.fontSize, fontWeight: widget.fontWeight, @@ -281,68 +278,54 @@ class _TextFieldsState extends State { hintText: widget.hintText, hintStyle: TextStyle( fontSize: widget.fontSize, - fontWeight: widget.fontWeight, color: widget.hintColor ?? Theme.of(context).hintColor, ), contentPadding: widget.padding != null ? widget.padding : EdgeInsets.symmetric( - vertical: - (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, - horizontal: 16.0), + vertical: (widget.bare! && !widget.keepPadding!) ? 0.0 : 10.0, horizontal: 16.0), filled: true, - fillColor: widget.bare - ? Colors.transparent - : Theme.of(context).backgroundColor, + fillColor: widget.bare! ? Colors.transparent : Theme.of(context).backgroundColor, suffixIcon: _buildSuffixIcon(), prefixIcon: widget.prefixIcon, errorStyle: TextStyle( - fontSize: 12.0, - fontWeight: widget.fontWeight, - height: widget.borderOnlyError ? 0.0 : null), + fontSize: 12.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError! ? 0.0 : null), errorBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) + borderSide: widget.hasBorder! + ? BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + borderRadius: widget.hasBorder! + ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) : BorderRadius.circular(0.0), ), focusedErrorBorder: OutlineInputBorder( - borderSide: widget.hasBorder + borderSide: widget.hasBorder! ? BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) + color: Theme.of(context).errorColor.withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), + borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!)), focusedBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + borderSide: widget.hasBorder! + ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + borderRadius: widget.hasBorder! + ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) : BorderRadius.circular(0.0), ), disabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + borderSide: widget.hasBorder! + ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + borderRadius: widget.hasBorder! + ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + borderSide: widget.hasBorder! + ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + borderRadius: widget.hasBorder! + ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) : BorderRadius.circular(0.0), ), ), diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 4444cf0a..82ecf103 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -24,7 +24,7 @@ class AppDrawer extends StatefulWidget { class _AppDrawerState extends State { Helpers helpers = new Helpers(); - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { @@ -77,7 +77,7 @@ class _AppDrawerState extends State { onTap: () { // TODO: return it back when its needed // Navigator.of(context).pushNamed(PROFILE, arguments: { - // 'title': authProvider.doctorProfile.doctorName, + // 'title': authProvider.doctorProfile!.doctorName, // "doctorProfileall": authProvider.doctorProfile // }); }, @@ -87,11 +87,11 @@ class _AppDrawerState extends State { Padding( padding: EdgeInsets.only(top: 8.0), child: AppText( - TranslationBase.of(context).dr + + TranslationBase.of(context).dr!+ capitalizeOnlyFirstLater( authenticationViewModel - .doctorProfile.doctorName - .replaceAll("DR.", "") + .doctorProfile!.doctorName! + .replaceAll!("DR.", "") .toLowerCase()), fontWeight: FontWeight.w700, color: Color(0xFF2E303A), @@ -103,8 +103,8 @@ class _AppDrawerState extends State { Padding( padding: EdgeInsets.only(top: 0), child: AppText( - authenticationViewModel - .doctorProfile?.clinicDescription, + authenticationViewModel! + .doctorProfile?.clinicDescription!!, fontWeight: FontWeight.w500, color: Color(0xFF2E303A), fontSize: 16, @@ -118,7 +118,7 @@ class _AppDrawerState extends State { SizedBox(height: 40), InkWell( child: DrawerItem( - TranslationBase.of(context).applyOrRescheduleLeave, + TranslationBase.of(context).applyOrRescheduleLeave!, icon: DoctorApp.reschedule__1, // subTitle: , @@ -138,7 +138,9 @@ class _AppDrawerState extends State { SizedBox(height: 15), InkWell( child: DrawerItem( - TranslationBase.of(context).myQRCode, + TranslationBase + .of(context) + .myQRCode!, icon: DoctorApp.qr_code_3, // subTitle: , ), @@ -165,8 +167,12 @@ class _AppDrawerState extends State { InkWell( child: DrawerItem( projectsProvider.isArabic - ? TranslationBase.of(context).lanEnglish - : TranslationBase.of(context).lanArabic, + ? TranslationBase + .of(context) + .lanEnglish ?? "" + : TranslationBase + .of(context) + .lanArabic ?? "", // icon: DoctorApp.qr_code, assetLink: projectsProvider.isArabic ? 'assets/images/usa-flag.png' @@ -182,7 +188,9 @@ class _AppDrawerState extends State { SizedBox(height: 10), InkWell( child: DrawerItem( - TranslationBase.of(context).logout, + TranslationBase + .of(context) + .logout!, icon: DoctorApp.logout_1, ), onTap: () async { diff --git a/lib/widgets/shared/app_expandable_notifier.dart b/lib/widgets/shared/app_expandable_notifier.dart deleted file mode 100644 index 76a7f57e..00000000 --- a/lib/widgets/shared/app_expandable_notifier.dart +++ /dev/null @@ -1,58 +0,0 @@ -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:expandable/expandable.dart'; -import 'package:flutter/material.dart'; - -class AppExpandableNotifier extends StatelessWidget { - final Widget headerWid; - final Widget bodyWid; - - AppExpandableNotifier({this.headerWid, this.bodyWid}); - - @override - Widget build(BuildContext context) { - return ExpandableNotifier( - child: Padding( - padding: const EdgeInsets.all(10), - child: Card( - clipBehavior: Clip.antiAlias, - child: Column( - children: [ - SizedBox( - child: headerWid, - ), - ScrollOnExpand( - scrollOnExpand: true, - scrollOnCollapse: false, - child: ExpandablePanel( - theme: const ExpandableThemeData( - headerAlignment: ExpandablePanelHeaderAlignment.center, - tapBodyToCollapse: true, - ), - header: Padding( - padding: EdgeInsets.all(10), - child: Text( - "${TranslationBase.of(context).graphDetails}", - style: TextStyle(fontWeight: FontWeight.bold), - )), - collapsed: Text(''), - expanded: bodyWid, - builder: (_, collapsed, expanded) { - return Padding( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - child: Expandable( - collapsed: collapsed, - expanded: expanded, - theme: const ExpandableThemeData(crossFadePoint: 0), - ), - ); - }, - ), - ), - ], - ), - ), - ), - initialExpanded: true, - ); - } -} diff --git a/lib/widgets/shared/app_expandable_notifier_new.dart b/lib/widgets/shared/app_expandable_notifier_new.dart deleted file mode 100644 index 848f5265..00000000 --- a/lib/widgets/shared/app_expandable_notifier_new.dart +++ /dev/null @@ -1,127 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:expandable/expandable.dart'; -import 'package:flutter/material.dart'; - - -/// App Expandable Notifier with animation -/// [headerWidget] widget want to show in the header -/// [bodyWidget] widget want to show in the body -/// [title] the widget title -/// [collapsed] The widget shown in the collapsed state -class AppExpandableNotifier extends StatefulWidget { - final Widget headerWidget; - final Widget bodyWidget; - final String title; - final Widget collapsed; - final bool isExpand; - bool expandFlag = false; - var controller = new ExpandableController(); - AppExpandableNotifier( - {this.headerWidget, - this.bodyWidget, - this.title, - this.collapsed, - this.isExpand = false}); - - _AppExpandableNotifier createState() => _AppExpandableNotifier(); -} - -class _AppExpandableNotifier extends State { - - @override - void initState() { - setState(() { - if (widget.isExpand) { - widget.expandFlag = widget.isExpand; - widget.controller.expanded = true; - } - }); - super.initState(); - } - - @override - Widget build(BuildContext context) { - - return ExpandableNotifier( - child: Padding( - padding: const EdgeInsets.only(left: 10, right: 10, top: 4), - child: Card( - color: Colors.grey[200], - clipBehavior: Clip.antiAlias, - child: Column( - children: [ - SizedBox( - child: widget.headerWidget, - ), - ScrollOnExpand( - scrollOnExpand: true, - scrollOnCollapse: false, - child: ExpandablePanel( - hasIcon: false, - theme: const ExpandableThemeData( - headerAlignment: ExpandablePanelHeaderAlignment.center, - tapBodyToCollapse: true, - ), - header: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.all(10), - child: Text( - widget.title ?? TranslationBase.of(context).details, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2, - ), - ), - ), - ), - IconButton( - icon: new Container( - height: 28.0, - width: 30.0, - decoration: new BoxDecoration( - color: Theme.of(context).primaryColor, - shape: BoxShape.circle, - ), - child: new Center( - child: new Icon( - widget.expandFlag - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.white, - size: 30.0, - ), - ), - ), - onPressed: () { - setState(() { - widget.expandFlag = !widget.expandFlag; - widget.controller.expanded = widget.expandFlag; - }); - }), - ]), - collapsed: widget.collapsed ?? Container(), - expanded: widget.bodyWidget, - builder: (_, collapsed, expanded) { - return Padding( - padding: EdgeInsets.only(left: 5, right: 5, bottom: 5), - child: Expandable( - controller: widget.controller, - collapsed: collapsed, - expanded: expanded, - theme: const ExpandableThemeData(crossFadePoint: 0), - ), - ); - }, - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/app_loader_widget.dart b/lib/widgets/shared/app_loader_widget.dart index 4b6d753b..0940a76e 100644 --- a/lib/widgets/shared/app_loader_widget.dart +++ b/lib/widgets/shared/app_loader_widget.dart @@ -1,13 +1,12 @@ import 'package:flutter/material.dart'; -import 'package:progress_hud_v2/progress_hud.dart'; import 'loader/gif_loader_container.dart'; class AppLoaderWidget extends StatefulWidget { - AppLoaderWidget({Key key, this.title, this.containerColor}) : super(key: key); + AppLoaderWidget({Key? key, this.title, this.containerColor}) : super(key: key); - final String title; - final Color containerColor; + final String? title; + final Color? containerColor; @override _AppLoaderWidgetState createState() => new _AppLoaderWidgetState(); diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index b930c21a..2e36a6c7 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -2,7 +2,9 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -12,18 +14,20 @@ import 'network_base_view.dart'; class AppScaffold extends StatelessWidget { final String appBarTitle; - final Widget body; + final Widget? body; final bool isLoading; final bool isShowAppBar; - final BaseViewModel baseViewModel; - final Widget bottomSheet; - final Color backgroundColor; - final Widget appBar; - final Widget drawer; - final Widget bottomNavigationBar; - final String subtitle; + final BaseViewModel? baseViewModel; + final Widget? bottomSheet; + final Color? backgroundColor; + final PreferredSizeWidget? appBar; + final Widget? drawer; + final Widget? bottomNavigationBar; + final String? subtitle; final bool isHomeIcon; final bool extendBody; + final PatientProfileAppBarModel? patientProfileAppBarModel; + AppScaffold( {this.appBarTitle = '', this.body, @@ -33,7 +37,9 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - this.appBar, this.subtitle, this.drawer, this.extendBody = false, this.bottomNavigationBar}); + this.subtitle, + this.patientProfileAppBarModel, + this.drawer, this.extendBody = false, this.bottomNavigationBar, this.appBar}); @override Widget build(BuildContext context) { @@ -49,21 +55,26 @@ class AppScaffold extends StatelessWidget { extendBody: extendBody, bottomNavigationBar: bottomNavigationBar, appBar: isShowAppBar - ? appBar ?? - AppBar( - elevation: 0, - backgroundColor: Colors.white, //HexColor('#515B5D'), - textTheme: TextTheme( - headline6: TextStyle( - color: Colors.black87, - fontSize: 16.8, - )), - title: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ + ? patientProfileAppBarModel != null ? PatientProfileAppBar(patientProfileAppBarModel!.patient!, + patientProfileAppBarModel: patientProfileAppBarModel!,) : appBar ?? + AppBar( + elevation: 0, + backgroundColor: Colors.white, + //HexColor('#515B5D'), + textTheme: TextTheme( + headline6: TextStyle( + color: Colors.black87, + fontSize: 16.8, + )), + title: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ Text(appBarTitle.toUpperCase()), - if(subtitle!=null) - Text(subtitle,style: TextStyle(fontSize: 12,color: Colors.red),), + if (subtitle != null) + Text( + subtitle!, + style: TextStyle(fontSize: 12, color: Colors.red), + ), ], ), leading: Builder(builder: (BuildContext context) { @@ -93,8 +104,7 @@ class AppScaffold extends StatelessWidget { baseViewModel: baseViewModel, child: body, ) - : Stack( - children: [body, buildAppLoaderWidget(isLoading)]) + : Stack(children: [body!, buildAppLoaderWidget(isLoading)]) : Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index f612e9e0..f09120ec 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -7,33 +7,33 @@ import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; class AppText extends StatefulWidget { - final String text; - final String variant; - final Color color; - final FontWeight fontWeight; - final double fontSize; - final double fontHeight; - final String fontFamily; - final int maxLength; - final bool italic; - final double margin; - final double marginTop; - final double marginRight; - final double marginBottom; - final double marginLeft; - final double letterSpacing; - final TextAlign textAlign; - final bool bold; - final bool regular; - final bool medium; - final int maxLines; - final bool readMore; - final String style; - final bool allowExpand; - final bool visibility; - final TextOverflow textOverflow; - final TextDecoration textDecoration; - final bool isCopyable; + final String? text; + final String? variant; + final Color? color; + final FontWeight? fontWeight; + final double? fontSize; + final double? fontHeight; + final String? fontFamily; + final int? maxLength; + final bool? italic; + final double? margin; + final double? marginTop; + final double? marginRight; + final double? marginBottom; + final double? marginLeft; + final double? letterSpacing; + final TextAlign? textAlign; + final bool? bold; + final bool? regular; + final bool? medium; + final int? maxLines; + final bool? readMore; + final String? style; + final bool? allowExpand; + final bool? visibility; + final TextOverflow? textOverflow; + final TextDecoration? textDecoration; + final bool? isCopyable; AppText( this.text, { @@ -77,9 +77,9 @@ class _AppTextState extends State { void didUpdateWidget(covariant AppText oldWidget) { setState(() { if (widget.style == "overline") - text = widget.text.toUpperCase(); + text = widget.text!.toUpperCase(); else { - text = widget.text; + text = widget.text!; } }); super.didUpdateWidget(oldWidget); @@ -87,11 +87,11 @@ class _AppTextState extends State { @override void initState() { - hidden = widget.readMore; + hidden = widget.readMore!; if (widget.style == "overline") - text = widget.text.toUpperCase(); + text = widget.text!.toUpperCase(); else { - text = widget.text; + text = widget.text!; } super.initState(); } @@ -101,12 +101,9 @@ class _AppTextState extends State { return GestureDetector( child: Container( margin: widget.margin != null - ? EdgeInsets.all(widget.margin) + ? EdgeInsets.all(widget.margin!) : EdgeInsets.only( - top: widget.marginTop, - right: widget.marginRight, - bottom: widget.marginBottom, - left: widget.marginLeft), + top: widget.marginTop!, right: widget.marginRight!, bottom: widget.marginBottom!, left: widget.marginLeft!), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -114,7 +111,7 @@ class _AppTextState extends State { Stack( children: [ _textWidget(), - if (widget.readMore && text.length > widget.maxLength && hidden) + if (widget.readMore! && text.length > widget.maxLength! && hidden) Positioned( bottom: 0, left: 0, @@ -133,9 +130,7 @@ class _AppTextState extends State { ) ], ), - if (widget.allowExpand && - widget.readMore && - text.length > widget.maxLength) + if (widget.allowExpand! && widget.readMore! && text.length > widget.maxLength!) Padding( padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), child: InkWell( @@ -165,20 +160,14 @@ class _AppTextState extends State { } Widget _textWidget() { - if (widget.isCopyable) { + if (widget.isCopyable!) { return Theme( data: ThemeData( textSelectionColor: Colors.lightBlueAccent, ), child: Container( child: SelectableText( - !hidden - ? text - : (text.substring( - 0, - text.length > widget.maxLength - ? widget.maxLength - : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)), textAlign: widget.textAlign, // overflow: widget.maxLines != null // ? ((widget.maxLines > 1) @@ -188,12 +177,12 @@ class _AppTextState extends State { maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color != null ? widget.color : Color(0xff2E303A), fontSize: widget.fontSize ?? _getFontSize(), @@ -212,24 +201,24 @@ class _AppTextState extends State { ? text : (text.substring( 0, - text.length > widget.maxLength + text.length > widget.maxLength! ? widget.maxLength : text.length)), textAlign: widget.textAlign, overflow: widget.maxLines != null - ? ((widget.maxLines > 1) + ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.letterSpacing ?? @@ -245,27 +234,27 @@ class _AppTextState extends State { TextStyle _getFontStyle() { switch (widget.style) { case "headline2": - return Theme.of(context).textTheme.headline2; + return Theme.of(context).textTheme.headline2!; case "headline3": - return Theme.of(context).textTheme.headline3; + return Theme.of(context).textTheme.headline3!; case "headline4": - return Theme.of(context).textTheme.headline4; + return Theme.of(context).textTheme.headline4!; case "headline5": - return Theme.of(context).textTheme.headline5; + return Theme.of(context).textTheme.headline5!; case "headline6": - return Theme.of(context).textTheme.headline6; + return Theme.of(context).textTheme.headline6!; case "bodyText2": - return Theme.of(context).textTheme.bodyText2; + return Theme.of(context).textTheme.bodyText2!; case "bodyText_15": - return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0); + return Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: 15.0); case "bodyText1": - return Theme.of(context).textTheme.bodyText1; + return Theme.of(context).textTheme.bodyText1!; case "caption": - return Theme.of(context).textTheme.caption; + return Theme.of(context).textTheme.caption!; case "overline": - return Theme.of(context).textTheme.overline; + return Theme.of(context).textTheme.overline!; case "button": - return Theme.of(context).textTheme.button; + return Theme.of(context).textTheme.button!; default: return TextStyle(); } @@ -350,7 +339,7 @@ class _AppTextState extends State { return FontWeight.w500; } } else { - return null; + return FontWeight.normal; } } } diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index dca59ee0..0130f1d2 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -13,7 +13,7 @@ class BottomNavBar extends StatefulWidget { DashboardViewModel dashboardViewModel = DashboardViewModel(); - BottomNavBar({Key key, this.changeIndex, this.index}) : super(key: key); + BottomNavBar({Key? key, required this.changeIndex, required this.index}) : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 36037413..31fa112a 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -20,16 +20,18 @@ class BottomNavigationItem extends StatelessWidget { final String? name; final DashboardViewModel? dashboardViewModel; + String svgPath; + BottomNavigationItem( {this.icon, this.activeIcon, - this.changeIndex, + required this.changeIndex, this.index, - this.currentIndex, + required this.currentIndex, this.name, this.dashboardViewModel, - this.svgPath}); + required this.svgPath}); @override Widget build(BuildContext context) { @@ -89,7 +91,7 @@ class BottomNavigationItem extends StatelessWidget { ], ), if (currentIndex == 3 && - dashboardViewModel.notRepliedCount != 0) + dashboardViewModel?.notRepliedCount != 0) Positioned( right: 18.0, bottom: 40.0, @@ -102,7 +104,7 @@ class BottomNavigationItem extends StatelessWidget { badgeContent: Container( // padding: EdgeInsets.all(2.0), child: AppText( - dashboardViewModel.notRepliedCount.toString(), + dashboardViewModel?.notRepliedCount.toString(), color: Colors.white, fontSize: 12.0), ), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index bb43dc8c..7109b6cb 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -8,23 +8,23 @@ import 'package:hexcolor/hexcolor.dart'; import '../app_texts_widget.dart'; class AppButton extends StatefulWidget { - final GestureTapCallback onPressed; - final String title; - final IconData iconData; - final Widget icon; - final Color color; - final double fontSize; - final double padding; - final Color fontColor; - final bool loading; - final bool disabled; - final FontWeight fontWeight; - final bool hasBorder; - final Color borderColor; - final double radius; - final double vPadding; - final double hPadding; - final double height; + final GestureTapCallback? onPressed; + final String? title; + final IconData? iconData; + final Widget? icon; + final Color? color; + final double? fontSize; + final double? padding; + final Color? fontColor; + final bool? loading; + final bool? disabled; + final FontWeight? fontWeight; + final bool? hasBorder; + final Color? borderColor; + final double? radius; + final double? vPadding; + final double? hPadding; + final double? height; AppButton({ @required this.onPressed, @@ -56,21 +56,20 @@ class _AppButtonState extends State { // height: MediaQuery.of(context).size.height * 0.075, height: widget.height, child: IgnorePointer( - ignoring: widget.loading || widget.disabled, + ignoring: widget.loading! || widget.disabled!, child: RawMaterialButton( - fillColor: widget.disabled + fillColor: widget.disabled! ? Colors.grey : widget.color != null ? widget.color : HexColor("#D02127"), splashColor: widget.color, child: Padding( - padding: (widget.hPadding > 0 || widget.vPadding > 0) - ? EdgeInsets.symmetric( - vertical: widget.vPadding, horizontal: widget.hPadding) + padding: (widget.hPadding! > 0 || widget.vPadding! > 0) + ? EdgeInsets.symmetric(vertical: widget.vPadding!, horizontal: widget.hPadding!) : EdgeInsets.only( - top: widget.padding, - bottom: widget.padding, + top: widget.padding!, + bottom: widget.padding!, //right: SizeConfig.widthMultiplier * widget.padding, //left: SizeConfig.widthMultiplier * widget.padding ), @@ -89,7 +88,7 @@ class _AppButtonState extends State { SizedBox( width: 5.0, ), - widget.loading + widget.loading! ? Padding( padding: EdgeInsets.all(2.6), child: SizedBox( @@ -98,7 +97,7 @@ class _AppButtonState extends State { child: CircularProgressIndicator( backgroundColor: Colors.white, valueColor: AlwaysStoppedAnimation( - Colors.grey[300], + Colors.grey[300]!, ), ), ), @@ -115,17 +114,17 @@ class _AppButtonState extends State { ], ), ), - onPressed: widget.disabled ? () {} : widget.onPressed, + onPressed: widget.disabled! ? () {} : widget.onPressed, shape: RoundedRectangleBorder( side: BorderSide( - color: widget.hasBorder + color: (widget.hasBorder! ? widget.borderColor - : widget.disabled - ? Colors.grey - : widget.color ?? Color(0xFFB8382C), + : widget.disabled! + ? Colors.grey! + : widget.color) ?? Color(0xFFB8382C), width: 0.8, ), - borderRadius: BorderRadius.all(Radius.circular(widget.radius))), + borderRadius: BorderRadius.all(Radius.circular(widget.radius!))), ), ), ); diff --git a/lib/widgets/shared/buttons/button_bottom_sheet.dart b/lib/widgets/shared/buttons/button_bottom_sheet.dart index 3c5cc32d..6ecae98a 100644 --- a/lib/widgets/shared/buttons/button_bottom_sheet.dart +++ b/lib/widgets/shared/buttons/button_bottom_sheet.dart @@ -3,25 +3,25 @@ import 'package:flutter/material.dart'; import 'app_buttons_widget.dart'; class ButtonBottomSheet extends StatelessWidget { + final GestureTapCallback? onPressed; + final String? title; + final IconData? iconData; + final Widget? icon; + final Color? color; + final double? fontSize; + final double? padding; + final Color? fontColor; + final bool? loading; + final bool? disabled; + final FontWeight? fontWeight; + final bool? hasBorder; + final Color? borderColor; + final double? radius; + final double? vPadding; + final double? hPadding; - final GestureTapCallback onPressed; - final String title; - final IconData iconData; - final Widget icon; - final Color color; - final double fontSize; - final double padding; - final Color fontColor; - final bool loading; - final bool disabled; - final FontWeight fontWeight; - final bool hasBorder; - final Color borderColor; - final double radius; - final double vPadding; - final double hPadding; - - ButtonBottomSheet({@required this.onPressed, + ButtonBottomSheet({ + @required this.onPressed, this.title, this.iconData, this.icon, diff --git a/lib/widgets/shared/buttons/secondary_button.dart b/lib/widgets/shared/buttons/secondary_button.dart index 48c65baf..2851cdbb 100644 --- a/lib/widgets/shared/buttons/secondary_button.dart +++ b/lib/widgets/shared/buttons/secondary_button.dart @@ -15,7 +15,7 @@ import 'package:provider/provider.dart'; /// [noBorderRadius] remove border radius class SecondaryButton extends StatefulWidget { SecondaryButton( - {Key key, + {Key? key, this.label = "", this.icon, this.iconOnly = false, @@ -30,12 +30,12 @@ class SecondaryButton extends StatefulWidget { : super(key: key); final String label; - final Widget icon; - final VoidCallback onTap; + final Widget? icon; + final VoidCallback? onTap; final bool loading; - final Color color; + final Color? color; final Color textColor; - final Color borderColor; + final Color? borderColor; final bool small; final bool iconOnly; final bool disabled; @@ -45,15 +45,14 @@ class SecondaryButton extends StatefulWidget { _SecondaryButtonState createState() => _SecondaryButtonState(); } -class _SecondaryButtonState extends State - with TickerProviderStateMixin { +class _SecondaryButtonState extends State with TickerProviderStateMixin { double _buttonSize = 1.0; - AnimationController _animationController; - Animation _animation; + late AnimationController _animationController; + late Animation _animation; double _rippleSize = 0.0; - AnimationController _rippleController; - Animation _rippleAnimation; + late AnimationController _rippleController; + late Animation _rippleAnimation; @override void initState() { @@ -142,7 +141,7 @@ class _SecondaryButtonState extends State _animationController.forward(); }, onTap: () => { - widget.disabled ? null : widget.onTap(), + widget.disabled ? null : widget.onTap!(), }, // onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context), behavior: HitTestBehavior.opaque, @@ -151,8 +150,7 @@ class _SecondaryButtonState extends State child: Container( decoration: BoxDecoration( border: widget.borderColor != null - ? Border.all( - color: widget.borderColor.withOpacity(0.1), width: 2.0) + ? Border.all(color: widget.borderColor!.withOpacity(0.1), width: 2.0) : null, borderRadius: BorderRadius.all(Radius.circular(100.0)), boxShadow: [ @@ -224,9 +222,8 @@ class _SecondaryButtonState extends State width: 19.0, child: CircularProgressIndicator( backgroundColor: Colors.white, - valueColor: - AlwaysStoppedAnimation( - Colors.grey[300], + valueColor: AlwaysStoppedAnimation( + Colors.grey[300]!, ), ), ), diff --git a/lib/widgets/shared/card_with_bgNew_widget.dart b/lib/widgets/shared/card_with_bgNew_widget.dart index 00b836bc..bd3439e5 100644 --- a/lib/widgets/shared/card_with_bgNew_widget.dart +++ b/lib/widgets/shared/card_with_bgNew_widget.dart @@ -12,7 +12,7 @@ import 'package:hexcolor/hexcolor.dart'; class CardWithBgWidgetNew extends StatelessWidget { final Widget widget; - CardWithBgWidgetNew({@required this.widget}); + CardWithBgWidgetNew({required this.widget}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index d7513975..6bf57eba 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -11,8 +11,8 @@ class CardWithBgWidget extends StatelessWidget { final double marginSymmetric; CardWithBgWidget( - {@required this.widget, - this.bgColor, + { required this.widget, + required this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, diff --git a/lib/widgets/shared/charts/app_line_chart.dart b/lib/widgets/shared/charts/app_line_chart.dart deleted file mode 100644 index 422468d7..00000000 --- a/lib/widgets/shared/charts/app_line_chart.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/material.dart'; - -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: AppLineChart - */ -class AppLineChart extends StatelessWidget { - const AppLineChart({ - Key key, - @required this.seriesList, - this.chartTitle, - }) : super(key: key); - - final List seriesList; - - final String chartTitle; - - @override - Widget build(BuildContext context) { - return Container( - child: Column( - children: [ - Text( - 'Body Mass Index', - style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold), - ), - Expanded( - child: charts.LineChart(seriesList, - defaultRenderer: new charts.LineRendererConfig( - includeArea: false, stacked: true), - animate: true), - ), - ], - ), - ); - } -} diff --git a/lib/widgets/shared/charts/app_time_series_chart.dart b/lib/widgets/shared/charts/app_time_series_chart.dart deleted file mode 100644 index f4bd354e..00000000 --- a/lib/widgets/shared/charts/app_time_series_chart.dart +++ /dev/null @@ -1,121 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/material.dart'; - -import '../../../config/size_config.dart'; -import '../../../models/patient/vital_sign/vital_sign_res_model.dart'; -import '../../../widgets/shared/rounded_container_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: AppTimeSeriesChart - */ -class AppTimeSeriesChart extends StatelessWidget { - AppTimeSeriesChart( - {Key key, - @required this.vitalList, - @required this.viewKey, - this.chartName = ''}); - - final List vitalList; - final String chartName; - final String viewKey; - List seriesList; - - @override - Widget build(BuildContext context) { - seriesList = generateData(); - return RoundedContainer( - height: SizeConfig.realScreenHeight * 0.47, - child: Column( - children: [ - Text( - chartName, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 3), - ), - Container( - height: SizeConfig.realScreenHeight * 0.37, - child: Center( - child: Container( - child: charts.TimeSeriesChart( - seriesList, - animate: true, - behaviors: [ - new charts.RangeAnnotation( - [ - new charts.RangeAnnotationSegment( - DateTime( - vitalList[vitalList.length - 1] - .vitalSignDate - .year, - vitalList[vitalList.length - 1] - .vitalSignDate - .month + - 3, - vitalList[vitalList.length - 1] - .vitalSignDate - .day), - vitalList[0].vitalSignDate, - charts.RangeAnnotationAxisType.domain), - ], - ), - ], - ), - ), - ), - ), - ], - ), - ); - } - - /* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: generateData - */ - generateData() { - final List data = []; - if (vitalList.length > 0) { - vitalList.forEach( - (element) { - data.add( - TimeSeriesSales( - new DateTime(element.vitalSignDate.year, - element.vitalSignDate.month, element.vitalSignDate.day), - element.toJson()[viewKey].toInt(), - ), - ); - }, - ); - } - return [ - new charts.Series( - id: 'Sales', - domainFn: (TimeSeriesSales sales, _) => sales.time, - measureFn: (TimeSeriesSales sales, _) => sales.sales, - data: data, - ) - ]; - } -} - -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: TimeSeriesSales - */ -class TimeSeriesSales { - final DateTime time; - final int sales; - - TimeSeriesSales(this.time, this.sales); -} diff --git a/lib/widgets/shared/dialogs/ShowImageDialog.dart b/lib/widgets/shared/dialogs/ShowImageDialog.dart index 302366b7..b4365248 100644 --- a/lib/widgets/shared/dialogs/ShowImageDialog.dart +++ b/lib/widgets/shared/dialogs/ShowImageDialog.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; class ShowImageDialog extends StatelessWidget { final String imageUrl; - const ShowImageDialog({Key key, this.imageUrl}) : super(key: key); + const ShowImageDialog({Key? key, required this.imageUrl}) : super(key: key); @override Widget build(BuildContext context) { return SimpleDialog( diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index dfaf9143..01675194 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -9,16 +9,16 @@ class ListSelectDialog extends StatefulWidget { final okText; final Function(dynamic) okFunction; dynamic selectedValue; - final Widget searchWidget; + final Widget? searchWidget; final bool usingSearch; - final String hintSearchText; + final String? hintSearchText; ListSelectDialog({ - @required this.list, - @required this.attributeName, - @required this.attributeValueId, + required this.list, + required this.attributeName, + required this.attributeValueId, @required this.okText, - @required this.okFunction, + required this.okFunction, this.searchWidget, this.usingSearch = false, this.hintSearchText, @@ -29,7 +29,7 @@ class ListSelectDialog extends StatefulWidget { } class _ListSelectDialogState extends State { - List items = List(); + List items = []; @override void initState() { @@ -46,7 +46,7 @@ class _ListSelectDialogState extends State { showAlertDialog(BuildContext context) { // set up the buttons Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), + child: Text(TranslationBase.of(context).cancel ?? ""), onPressed: () { Navigator.of(context).pop(); }); @@ -73,13 +73,13 @@ class _ListSelectDialogState extends State { height: MediaQuery.of(context).size.height * 0.5, child: Column( children: [ - if (widget.searchWidget != null) widget.searchWidget, + if (widget.searchWidget != null) widget.searchWidget!, if (widget.usingSearch) Container( height: MediaQuery.of(context).size.height * 0.070, child: TextField( decoration: Helpers.textFieldSelectorDecoration( - widget.hintSearchText ?? TranslationBase.of(context).search, null, false, + widget.hintSearchText ?? TranslationBase.of(context).search??"", "", false, suffixIcon: Icon( Icons.search, )), @@ -122,10 +122,10 @@ class _ListSelectDialogState extends State { } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.list); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 7c12b54a..e185d31c 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -12,15 +12,11 @@ class MasterKeyDailog extends StatefulWidget { final List list; final okText; final Function(MasterKeyModel) okFunction; - MasterKeyModel selectedValue; + MasterKeyModel? selectedValue; final bool isICD; MasterKeyDailog( - {@required this.list, - @required this.okText, - @required this.okFunction, - this.selectedValue, - this.isICD = false}); + {required this.list, required this.okText, required this.okFunction, this.selectedValue, this.isICD = false}); @override _MasterKeyDailogState createState() => _MasterKeyDailogState(); @@ -42,14 +38,14 @@ class _MasterKeyDailogState extends State { showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { // set up the buttons Widget cancelButton = FlatButton( - child: AppText(TranslationBase.of(context).cancel, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),), + child: AppText(TranslationBase.of(context)!.cancel!, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),), onPressed: () { Navigator.of(context).pop(); }); Widget continueButton = FlatButton( child: AppText(this.widget.okText, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),), onPressed: () { - this.widget.okFunction(widget.selectedValue); + this.widget.okFunction(widget.selectedValue!); Navigator.of(context).pop(); }); // set up the AlertDialog @@ -72,23 +68,15 @@ class _MasterKeyDailogState extends State { children: [ ...widget.list .map((item) => RadioListTile( - title: AppText( - '${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + - (widget.isICD ? '/${item.code}' : ''), - - ), - groupValue: widget.isICD - ? widget.selectedValue.code.toString() - : widget.selectedValue.id.toString(), - value: widget.isICD - ? widget.selectedValue.code.toString() - : item.id.toString(), + title: AppText('${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + + (widget.isICD ? '/${item.code}' : ''),), + groupValue: + widget.isICD ? widget.selectedValue!.code.toString() : widget.selectedValue!.id.toString(), + value: widget.isICD ? widget.selectedValue!.code.toString() : item.id.toString(), activeColor: Colors.blue.shade700, selected: widget.isICD - ? item.code.toString() == - widget.selectedValue.code.toString() - : item.id.toString() == - widget.selectedValue.id.toString(), + ? item.code.toString() == widget.selectedValue!.code.toString() + : item.id.toString() == widget.selectedValue!.id.toString(), onChanged: (val) { setState(() { widget.selectedValue = item; diff --git a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart deleted file mode 100644 index 68dce5a4..00000000 --- a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart +++ /dev/null @@ -1,92 +0,0 @@ -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:flutter/material.dart'; - -class ListSelectDialog extends StatefulWidget { - final List list; - final String attributeName; - final String attributeValueId; - final okText; - final Function(dynamic) okFunction; - dynamic selectedValue; - - ListSelectDialog( - {@required this.list, - @required this.attributeName, - @required this.attributeValueId, - @required this.okText, - @required this.okFunction}); - - @override - _ListSelectDialogState createState() => _ListSelectDialogState(); -} - -class _ListSelectDialogState extends State { - @override - void initState() { - super.initState(); - widget.selectedValue = widget.selectedValue ?? widget.list[0]; - } - - @override - Widget build(BuildContext context) { - return showAlertDialog(context); - } - - showAlertDialog(BuildContext context) { - // set up the buttons - Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), - onPressed: () { - Navigator.of(context).pop(); - }); - Widget continueButton = FlatButton( - child: Text(this.widget.okText), - onPressed: () { - this.widget.okFunction(widget.selectedValue); - Navigator.of(context).pop(); - }); -// set up the AlertDialog - AlertDialog alert = AlertDialog( - // title: Text(widget.title), - content: createDialogList(), - actions: [ - cancelButton, - continueButton, - ], - ); - return alert; - } - - Widget createDialogList() { - return Container( - height: MediaQuery.of(context).size.height * 0.5, - child: SingleChildScrollView( - child: Column( - children: [ - ...widget.list - .map((item) => RadioListTile( - title: Text("${item[widget.attributeName].toString()}"), - groupValue: widget.selectedValue[widget.attributeValueId] - .toString(), - value: item[widget.attributeValueId].toString(), - activeColor: Colors.blue.shade700, - selected: item[widget.attributeValueId].toString() == - widget.selectedValue[widget.attributeValueId] - .toString(), - onChanged: (val) { - setState(() { - widget.selectedValue = item; - }); - }, - )) - .toList() - ], - ), - ), - ); - } - - static closeAlertDialog(BuildContext context) { - Navigator.of(context).pop(); - } -} diff --git a/lib/widgets/shared/divider_with_spaces_around.dart b/lib/widgets/shared/divider_with_spaces_around.dart index b43557cb..a126d128 100644 --- a/lib/widgets/shared/divider_with_spaces_around.dart +++ b/lib/widgets/shared/divider_with_spaces_around.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; class DividerWithSpacesAround extends StatelessWidget { DividerWithSpacesAround({ - Key key, this.height = 0, + Key ? key, this.height = 0, }); final double height ; diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 5bd12bb8..cd8ba762 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -13,9 +13,9 @@ class DoctorCard extends StatelessWidget { final String branch; final DateTime appointmentDate; final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; + final String? invoiceNO; + final String? orderNo; + final GestureTapCallback? onTap; final bool isPrescriptions; final String clinic; final bool isShowEye; @@ -23,15 +23,15 @@ class DoctorCard extends StatelessWidget { final bool isNoMargin; DoctorCard( - {this.doctorName, - this.branch, - this.profileUrl, + {required this.doctorName, + required this.branch, + required this.profileUrl, this.invoiceNO, this.onTap, - this.appointmentDate, + required this.appointmentDate, this.orderNo, this.isPrescriptions = false, - this.clinic, + required this.clinic, this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false}); @override @@ -59,7 +59,7 @@ class DoctorCard extends StatelessWidget { children: [ Expanded( child: AppText( - doctorName ?? "", + doctorName, fontSize: 15, bold: true, )), @@ -73,7 +73,7 @@ class DoctorCard extends StatelessWidget { fontWeight: FontWeight.w600, fontSize: 14, ), - if (!isPrescriptions&& isShowTime) + if (!isPrescriptions && isShowTime) AppText( '${AppDateUtils.getHour(appointmentDate)}', fontWeight: FontWeight.w600, @@ -110,7 +110,7 @@ class DoctorCard extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).orderNo + + TranslationBase.of(context).orderNo??"" + " ", color: Colors.grey[500], fontSize: 14, @@ -126,7 +126,7 @@ class DoctorCard extends StatelessWidget { children: [ AppText( TranslationBase.of(context) - .invoiceNo + + .invoiceNo! + " ", fontSize: 14, color: Colors.grey[500], @@ -142,7 +142,7 @@ class DoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).clinic + + TranslationBase.of(context).clinic! + ": ", color: Colors.grey[500], fontSize: 14, @@ -160,7 +160,7 @@ class DoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).branch + + TranslationBase.of(context).branch!+ ": ", fontSize: 14, color: Colors.grey[500], diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index abb8efcc..7f88f820 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -10,22 +10,25 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class DoctorCardInsurance extends StatelessWidget { - final String doctorName; - final String approvalNo; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; - final bool isInsurance; - final String clinic; - final String approvalStatus; - final String patientOut; - final String branch2; + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final GestureTapCallback? onTap; + final bool? isPrescriptions; + final String? clinic; + final String? approvalStatus; + final String? patientOut; + final String? branch2; + + final bool? isInsurance; + final String? approvalNo; DoctorCardInsurance( {this.doctorName, - this.approvalNo, + this.branch, this.profileUrl, this.invoiceNO, this.onTap, @@ -35,7 +38,7 @@ class DoctorCardInsurance extends StatelessWidget { this.clinic, this.approvalStatus, this.patientOut, - this.branch2}); + this.branch2, this.isPrescriptions, this.approvalNo}); @override Widget build(BuildContext context) { @@ -129,7 +132,7 @@ class DoctorCardInsurance extends StatelessWidget { children: [ Container( child: LargeAvatar( - name: doctorName, + name: doctorName??"", url: profileUrl, ), width: 55, @@ -142,36 +145,36 @@ class DoctorCardInsurance extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (orderNo != null && !isInsurance) + if (orderNo != null && !isInsurance!) CustomRow( label: 'Invoice:', - value: invoiceNO, + value: invoiceNO??"", ), - if (invoiceNO != null && !isInsurance) + if (invoiceNO != null && !isInsurance!) CustomRow( label: 'Invoice:', - value: invoiceNO, + value: invoiceNO??'', ), - if (isInsurance) + if (isInsurance!) CustomRow( label: - TranslationBase.of(context).clinic + + TranslationBase.of(context).clinic! + ": ", - value: clinic, + value: clinic??'', ), if (branch2 != null) CustomRow( label: - TranslationBase.of(context).branch + + TranslationBase.of(context).branch! + ": ", - value: branch2, + value: branch2??'', ), if (approvalNo != null) CustomRow( label: TranslationBase.of(context) - .approvalNo + + .approvalNo! + ": ", - value: approvalNo, + value: approvalNo!, ), ]), ), diff --git a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart index 2c476ec8..4dbd7d79 100644 --- a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart +++ b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; class DrAppCircularProgressIndeicator extends StatelessWidget { const DrAppCircularProgressIndeicator({ - Key key, + Key ? key, }) : super(key: key); @override diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 46497e17..75b889f5 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -8,12 +8,12 @@ import '../shared/app_texts_widget.dart'; class DrawerItem extends StatefulWidget { final String title; final String subTitle; - final IconData icon; - final Color color; - final String assetLink; + final IconData? icon; + final Color? color; + final String? assetLink; + final double? drawerWidth; - DrawerItem(this.title, - {this.icon, this.color, this.subTitle = '', this.assetLink}); + DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink, this.drawerWidth}); @override _DrawerItemState createState() => _DrawerItemState(); @@ -31,7 +31,7 @@ class _DrawerItemState extends State { Container( height: 20, width: 20, - child: Image.asset(widget.assetLink), + child: Image.asset(widget.assetLink!), ), if (widget.assetLink == null) Icon( diff --git a/lib/widgets/shared/errors/dr_app_embedded_error.dart b/lib/widgets/shared/errors/dr_app_embedded_error.dart index de9fd698..72fbe92c 100644 --- a/lib/widgets/shared/errors/dr_app_embedded_error.dart +++ b/lib/widgets/shared/errors/dr_app_embedded_error.dart @@ -11,8 +11,8 @@ import '../app_texts_widget.dart'; */ class DrAppEmbeddedError extends StatelessWidget { const DrAppEmbeddedError({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); final String error; diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index 2930ae84..86798937 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -5,8 +5,8 @@ import '../app_texts_widget.dart'; class ErrorMessage extends StatelessWidget { const ErrorMessage({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); final String error; diff --git a/lib/widgets/shared/expandable-widget-header-body.dart b/lib/widgets/shared/expandable-widget-header-body.dart index 20d95bcd..9f92432d 100644 --- a/lib/widgets/shared/expandable-widget-header-body.dart +++ b/lib/widgets/shared/expandable-widget-header-body.dart @@ -2,10 +2,10 @@ import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; class HeaderBodyExpandableNotifier extends StatefulWidget { - final Widget headerWidget; - final Widget bodyWidget; - final Widget collapsed; - final bool isExpand; + final Widget? headerWidget; + final Widget? bodyWidget; + final Widget? collapsed; + final bool? isExpand; bool expandFlag = false; var controller = new ExpandableController(); @@ -28,7 +28,7 @@ class _HeaderBodyExpandableNotifierState Widget build(BuildContext context) { setState(() { if (widget.isExpand == true) { - widget.expandFlag = widget.isExpand; + widget.expandFlag = widget.isExpand!; widget.controller.expanded = true; } }); @@ -50,7 +50,7 @@ class _HeaderBodyExpandableNotifierState ), // header: widget.headerWidget, collapsed: Container(), - expanded: widget.bodyWidget, + expanded: widget.bodyWidget!, builder: (_, collapsed, expanded) { return Padding( padding: EdgeInsets.only(left: 0, right: 0, bottom: 0), diff --git a/lib/widgets/shared/loader/gif_loader_container.dart b/lib/widgets/shared/loader/gif_loader_container.dart index b2c2224b..d8a67921 100644 --- a/lib/widgets/shared/loader/gif_loader_container.dart +++ b/lib/widgets/shared/loader/gif_loader_container.dart @@ -6,17 +6,15 @@ class GifLoaderContainer extends StatefulWidget { _GifLoaderContainerState createState() => _GifLoaderContainerState(); } -class _GifLoaderContainerState extends State - with TickerProviderStateMixin { - GifController controller1; +class _GifLoaderContainerState extends State with TickerProviderStateMixin { + late GifController controller1; @override void initState() { controller1 = GifController(vsync: this); - WidgetsBinding.instance.addPostFrameCallback((_) { - controller1.repeat( - min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); + WidgetsBinding.instance!.addPostFrameCallback((_) { + controller1.repeat(min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); }); super.initState(); } diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index c61913a4..e13806aa 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -19,17 +19,17 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget { final Function(MasterKeyModel) addHistory; final bool Function(MasterKeyModel) isServiceSelected; final List masterList; - final String buttonName; - final String hintSearchText; + final String? buttonName; + final String? hintSearchText; MasterKeyCheckboxSearchWidget( - {Key key, - this.model, - this.addSelectedHistories, - this.removeHistory, - this.masterList, - this.addHistory, - this.isServiceSelected, + {Key? key, + required this.model, + required this.addSelectedHistories, + required this.removeHistory, + required this.masterList, + required this.addHistory, + required this.isServiceSelected, this.buttonName, this.hintSearchText}) : super(key: key); @@ -41,7 +41,7 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget { class _MasterKeyCheckboxSearchWidgetState extends State { - List items = List(); + List items = []; TextEditingController filteredSearchController = TextEditingController(); @@ -86,10 +86,11 @@ class _MasterKeyCheckboxSearchWidgetState filterSearchResults(value); }, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( - Icons.search, - color: Colors.black, - )), + Icons.search, + color: Colors.black, + )), ), // SizedBox(height: 15,), @@ -113,13 +114,11 @@ class _MasterKeyCheckboxSearchWidgetState child: Row( children: [ Checkbox( - value: widget - .isServiceSelected(historyInfo), + value: widget.isServiceSelected(historyInfo), activeColor: Colors.red[800], - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isServiceSelected( - historyInfo)) { + if (widget.isServiceSelected(historyInfo)) { widget.removeHistory(historyInfo); } else { widget.addHistory(historyInfo); @@ -162,13 +161,13 @@ class _MasterKeyCheckboxSearchWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || - item.nameEn.toLowerCase().contains(query.toLowerCase())) { + if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || + item.nameEn!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index 32232628..68b6c1cd 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -7,10 +7,10 @@ import 'app_loader_widget.dart'; import 'errors/error_message.dart'; class NetworkBaseView extends StatelessWidget { - final BaseViewModel baseViewModel; - final Widget child; + final BaseViewModel? baseViewModel; + final Widget? child; - NetworkBaseView({Key key, this.baseViewModel, this.child}); + NetworkBaseView({Key? key, this.baseViewModel, this.child}); @override Widget build(BuildContext context) { @@ -21,7 +21,7 @@ class NetworkBaseView extends StatelessWidget { } buildBaseViewWidget() { - switch (baseViewModel.state) { + switch (baseViewModel!.state) { case ViewState.ErrorLocal: case ViewState.Idle: case ViewState.BusyLocal: @@ -31,7 +31,9 @@ class NetworkBaseView extends StatelessWidget { return AppLoaderWidget(); break; case ViewState.Error: - return ErrorMessage(error: baseViewModel.error ,); + return ErrorMessage( + error: baseViewModel!.error, + ); break; } } diff --git a/lib/widgets/shared/profile_image_widget.dart b/lib/widgets/shared/profile_image_widget.dart index 3db93f9d..70a7356f 100644 --- a/lib/widgets/shared/profile_image_widget.dart +++ b/lib/widgets/shared/profile_image_widget.dart @@ -10,21 +10,15 @@ import 'package:flutter/material.dart'; *@desc: Profile Image Widget class */ class ProfileImageWidget extends StatelessWidget { - String url; - String name; - String des; - double height; - double width; - Color color; - double fontsize; + String? url; + String? name; + String? des; + double? height; + double? width; + Color? color; + double? fontsize; ProfileImageWidget( - {this.url, - this.name, - this.des, - this.height, - this.width, - this.fontsize, - this.color = Colors.black}); + {this.url, this.name, this.des, this.height, this.width, this.fontsize, this.color = Colors.black}); @override Widget build(BuildContext context) { @@ -42,7 +36,7 @@ class ProfileImageWidget extends StatelessWidget { borderRadius:BorderRadius.circular(50), child: Image.network( - url, + url!, fit: BoxFit.fill, width: 700, ), diff --git a/lib/widgets/shared/rounded_container_widget.dart b/lib/widgets/shared/rounded_container_widget.dart index 9c622dd3..3f8804de 100644 --- a/lib/widgets/shared/rounded_container_widget.dart +++ b/lib/widgets/shared/rounded_container_widget.dart @@ -1,24 +1,24 @@ import 'package:flutter/material.dart'; class RoundedContainer extends StatefulWidget { - final double width; - final double height; - final double raduis; - final Color backgroundColor; - final EdgeInsets margin; - final double elevation; - final bool showBorder; - final Color borderColor; - final double shadowWidth; - final double shadowSpreadRadius; - final double shadowDy; - final bool customCornerRaduis; - final double topLeft; - final double bottomRight; - final double topRight; - final double bottomLeft; - final Widget child; - final double borderWidth; + final double? width; + final double? height; + final double? raduis; + final Color? backgroundColor; + final EdgeInsets? margin; + final double? elevation; + final bool? showBorder; + final Color? borderColor; + final double? shadowWidth; + final double? shadowSpreadRadius; + final double? shadowDy; + final bool? customCornerRaduis; + final double? topLeft; + final double? bottomRight; + final double? topRight; + final double? bottomLeft; + final Widget? child; + final double? borderWidth; RoundedContainer( {@required this.child, @@ -54,22 +54,21 @@ class _RoundedContainerState extends State { decoration: widget.showBorder == true ? BoxDecoration( color: Colors.white/*Theme.of(context).primaryColor*/, - border: Border.all( - color: widget.borderColor, width: widget.borderWidth), - borderRadius: widget.customCornerRaduis + border: Border.all(color: widget.borderColor!, width: widget.borderWidth!), + borderRadius: widget.customCornerRaduis! ? BorderRadius.only( - topLeft: Radius.circular(widget.topLeft), - topRight: Radius.circular(widget.topRight), - bottomRight: Radius.circular(widget.bottomRight), - bottomLeft: Radius.circular(widget.bottomLeft)) - : BorderRadius.circular(widget.raduis), + topLeft: Radius.circular(widget.topLeft!), + topRight: Radius.circular(widget.topRight!), + bottomRight: Radius.circular(widget.bottomRight!), + bottomLeft: Radius.circular(widget.bottomLeft!)) + : BorderRadius.circular(widget.raduis!), boxShadow: [ BoxShadow( - color: Colors.grey.withOpacity(widget.shadowWidth), - spreadRadius: widget.shadowSpreadRadius, + color: Colors.grey.withOpacity(widget.shadowWidth!), + spreadRadius: widget.shadowSpreadRadius!, blurRadius: 5, offset: Offset( - 0, widget.shadowDy), // changes position of shadow + 0, widget.shadowDy!), // changes position of shadow ), ], ) @@ -77,13 +76,13 @@ class _RoundedContainerState extends State { child: Card( margin: EdgeInsets.all(0), shape: RoundedRectangleBorder( - borderRadius: widget.customCornerRaduis + borderRadius: widget.customCornerRaduis! ? BorderRadius.only( - topLeft: Radius.circular(widget.topLeft), - topRight: Radius.circular(widget.topRight), - bottomRight: Radius.circular(widget.bottomRight), - bottomLeft: Radius.circular(widget.bottomLeft)) - : BorderRadius.circular(widget.raduis), + topLeft: Radius.circular(widget.topLeft!), + topRight: Radius.circular(widget.topRight!), + bottomRight: Radius.circular(widget.bottomRight!), + bottomLeft: Radius.circular(widget.bottomLeft!)) + : BorderRadius.circular(widget.raduis!), ), color: widget.backgroundColor, child: widget.child, diff --git a/lib/widgets/shared/speech-text-popup.dart b/lib/widgets/shared/speech-text-popup.dart index dad7e2d1..82583ad0 100644 --- a/lib/widgets/shared/speech-text-popup.dart +++ b/lib/widgets/shared/speech-text-popup.dart @@ -15,7 +15,7 @@ class SpeechToText { static var dialog; static stt.SpeechToText speech = stt.SpeechToText(); SpeechToText({ - @required this.context, + required this.context, }); showAlertDialog(BuildContext context) { @@ -44,7 +44,7 @@ typedef Disposer = void Function(); class MyStatefulBuilder extends StatefulWidget { const MyStatefulBuilder({ // @required this.builder, - @required this.dispose, + required this.dispose, }); //final StatefulWidgetBuilder builder; @@ -57,7 +57,7 @@ class MyStatefulBuilder extends StatefulWidget { class _MyStatefulBuilderState extends State { var event = RobotProvider(); var searchText; - static StreamSubscription streamSubscription; + static StreamSubscription? streamSubscription; static var isClosed = false; @override void initState() { @@ -135,7 +135,7 @@ class _MyStatefulBuilderState extends State { child: InkWell( child: Container( decoration: BoxDecoration( - border: Border.all(color: Colors.grey[300])), + border: Border.all(color: Colors.grey[300]!)), padding: EdgeInsets.all(5), child: AppText( 'Try Again', diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 30a5234a..9e6e1361 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -26,9 +26,9 @@ class AppTextFieldCustom extends StatefulWidget { final Function(String)? onChanged; final VoidCallback? onFieldSubmitted; - final String validationError; - final bool isPrscription; - final bool isSecure; + final String? validationError; + final bool? isPrscription; + final bool? isSecure; final bool focus; final bool isSearchTextField; @@ -94,10 +94,8 @@ class _AppTextFieldCustomState extends State { return Column( children: [ Container( - height: widget.height != 0 && widget.maxLines == 1 - ? widget.height + 8 - : MediaQuery.of(context).size.height * 0.098, - decoration: widget.hasBorder + height: widget.height != 0 && widget.maxLines == 1 ? widget.height! + 8 : null, + decoration: widget.hasBorder! ? TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), widget.validationError == null @@ -127,7 +125,7 @@ class _AppTextFieldCustomState extends State { // widget.controller.text != "") || // widget.dropDownText != null) AppText( - widget.hintText, + widget.hintText!, // marginTop: widget.hasHintmargin ? 0 : 30, color: Color(0xFF2E303A), fontSize: widget.isPrscription == false @@ -143,7 +141,7 @@ class _AppTextFieldCustomState extends State { ? Container( height: widget.height != 0 && widget.maxLines == 1 - ? widget.height - 22 + ? widget.height!- 22 : MediaQuery.of(context).size.height * 0.045, child: TextFormField( @@ -154,7 +152,8 @@ class _AppTextFieldCustomState extends State { textAlignVertical: TextAlignVertical.top, decoration: TextFieldsUtils .textFieldSelectorDecoration( - widget.hintText, null, true), + widget.hintText!, + "", true), style: TextStyle( fontSize: 14.0, //SizeConfig.textMultiplier * 1.7, @@ -178,14 +177,14 @@ class _AppTextFieldCustomState extends State { onChanged: (value) { setState(() {}); if (widget.onChanged != null) { - widget.onChanged(value); + widget.onChanged!(value); } }, onFieldSubmitted: (_)=>widget.onFieldSubmitted, - obscureText: widget.isSecure), + obscureText: widget.isSecure!), ) : AppText( - widget.dropDownText, + widget!.dropDownText!, fontFamily: 'Poppins', color: Color(0xFF575757), fontSize: SizeConfig.textMultiplier * 1.7, @@ -194,12 +193,12 @@ class _AppTextFieldCustomState extends State { ), ), ), - widget.isTextFieldHasSuffix + widget.isTextFieldHasSuffix! ? widget.suffixIcon != null ? Container( margin: EdgeInsets.only( bottom: widget.isSearchTextField - ? (widget.controller.text.isEmpty || + ? (widget.controller!.text.isEmpty || widget.controller == null) ? 10 : 25 @@ -219,8 +218,7 @@ class _AppTextFieldCustomState extends State { ), ), ), - if (widget.validationError != null && widget.validationError.isNotEmpty) - TextFieldsError(error: widget.validationError), + if (widget.validationError != null && widget.validationError!.isNotEmpty) TextFieldsError(error: widget!.validationError!), ], ); } diff --git a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart index 9d82bdad..a32588db 100644 --- a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart +++ b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart @@ -9,7 +9,7 @@ import 'app-textfield-custom.dart'; class AppTextFieldCustomSearch extends StatelessWidget { const AppTextFieldCustomSearch({ - Key key, + Key? key, this.onChangeFun, this.positionedChild, this.marginTop, @@ -26,19 +26,18 @@ class AppTextFieldCustomSearch extends StatelessWidget { final Function(String)? onChangeFun; final Function(String)? onFieldSubmitted; - final Widget positionedChild; - final IconButton suffixIcon; - final double marginTop; - final String validationError; - final String hintText; + final Widget ?positionedChild; + final IconButton? suffixIcon; + final double? marginTop; + final String? validationError; + final String? hintText; - final TextInputType inputType; - final List inputFormatters; + final TextInputType? inputType; + final List? inputFormatters; @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return Container( - margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop), + margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop!), child: Stack( children: [ AppTextFieldCustom( @@ -60,7 +59,7 @@ class AppTextFieldCustomSearch extends StatelessWidget { onFieldSubmitted: ()=>onFieldSubmitted, validationError: validationError), if (positionedChild != null) - projectViewModel.isArabic?Positioned(left: 35, top: 5, child: positionedChild):Positioned(right: 35, top: 5, child: positionedChild) + Positioned(right: 35, top: 5, child: positionedChild!) ], ), ); diff --git a/lib/widgets/shared/text_fields/app_text_form_field.dart b/lib/widgets/shared/text_fields/app_text_form_field.dart index 7d3a06da..b58f8176 100644 --- a/lib/widgets/shared/text_fields/app_text_form_field.dart +++ b/lib/widgets/shared/text_fields/app_text_form_field.dart @@ -6,22 +6,22 @@ import 'package:hexcolor/hexcolor.dart'; class AppTextFormField extends FormField { AppTextFormField( - {FormFieldSetter onSaved, - String inputFormatter, - FormFieldValidator validator, - ValueChanged onChanged, - GestureTapCallback onTap, + {FormFieldSetter? onSaved, + String? inputFormatter, + FormFieldValidator? validator, + ValueChanged? onChanged, + GestureTapCallback? onTap, bool obscureText = false, - TextEditingController controller, + TextEditingController? controller, bool autovalidate = true, - TextInputType textInputType, - String hintText, - FocusNode focusNode, - TextInputAction textInputAction=TextInputAction.done, - ValueChanged onFieldSubmitted, - IconButton prefix, - String labelText, - IconData suffixIcon, + TextInputType? textInputType, + String? hintText, + FocusNode? focusNode, + TextInputAction textInputAction = TextInputAction.done, + ValueChanged? onFieldSubmitted, + IconButton? prefix, + String? labelText, + IconData? suffixIcon, bool readOnly = false, borderColor}) : super( @@ -83,7 +83,7 @@ class AppTextFormField extends FormField { ), state.hasError ? Text( - state.errorText, + state.errorText ?? "", style: TextStyle(color: Colors.red), ) : Container() diff --git a/lib/widgets/shared/text_fields/auto_complete_text_field.dart b/lib/widgets/shared/text_fields/auto_complete_text_field.dart index 3b563f3f..d85b3468 100644 --- a/lib/widgets/shared/text_fields/auto_complete_text_field.dart +++ b/lib/widgets/shared/text_fields/auto_complete_text_field.dart @@ -8,9 +8,9 @@ class CustomAutoCompleteTextField extends StatelessWidget { final Widget child; const CustomAutoCompleteTextField({ - Key key, - this.isShowError, - this.child, + Key? key, + required this.isShowError, + required this.child, }) : super(key: key); @@ -31,7 +31,7 @@ class CustomAutoCompleteTextField extends StatelessWidget { ), if (isShowError) TextFieldsError( - error: TranslationBase.of(context).emptyMessage, + error: TranslationBase.of(context).emptyMessage ?? "", ) ], ), diff --git a/lib/widgets/shared/text_fields/country_textfield_custom.dart b/lib/widgets/shared/text_fields/country_textfield_custom.dart index baed4995..145ece5e 100644 --- a/lib/widgets/shared/text_fields/country_textfield_custom.dart +++ b/lib/widgets/shared/text_fields/country_textfield_custom.dart @@ -7,16 +7,16 @@ import 'package:flutter/material.dart'; class CountryTextField extends StatefulWidget { final dynamic element; - final String elementError; - final List elementList; - final String keyName; - final String keyId; - final String hintText; - final double width; - final Function(dynamic) okFunction; + final String? elementError; + final List? elementList; + final String? keyName; + final String? keyId; + final String? hintText; + final double? width; + final Function(dynamic)? okFunction; CountryTextField( - {Key key, + {Key? key, @required this.element, @required this.elementError, this.width, @@ -41,14 +41,14 @@ class _CountryTextfieldState extends State { ? () { Helpers.hideKeyboard(context); ListSelectDialog dialog = ListSelectDialog( - list: widget.elementList, + list: widget.elementList!, attributeName: '${widget.keyName}', - attributeValueId: widget.elementList.length == 1 - ? widget.elementList[0]['${widget.keyId}'] + attributeValueId: widget.elementList!.length == 1 + ? widget.elementList![0]['${widget.keyId}'] : '${widget.keyId}', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) => - widget.okFunction(selectedValue), + widget.okFunction!(selectedValue), ); showDialog( barrierDismissible: false, @@ -61,14 +61,14 @@ class _CountryTextfieldState extends State { : null, child: AppTextFieldCustom( hintText: widget.hintText, - dropDownText: widget.elementList.length == 1 - ? widget.elementList[0]['${widget.keyName}'] + dropDownText: widget.elementList!.length == 1 + ? widget.elementList![0]['${widget.keyName}'] : widget.element != null ? widget.element['${widget.keyName}'] : null, isTextFieldHasSuffix: true, validationError: - widget.elementList.length != 1 ? widget.elementError : null, + widget.elementList!.length != 1 ? widget.elementError : null, enabled: false, ), ), diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index 71359604..3b9db9c6 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -12,7 +12,16 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; import '../speech-text-popup.dart'; class HtmlRichEditor extends StatefulWidget { - HtmlRichEditor({ + final String hint; + final String? initialText; + final double height; + final BoxDecoration? decoration; + final bool darkMode; + final bool showBottomToolbar; + final List? toolbar; + final HtmlEditorController controller; + + HtmlRichEditor({ key, this.hint = "Your text here...", this.initialText, @@ -21,22 +30,15 @@ class HtmlRichEditor extends StatefulWidget { this.darkMode = false, this.showBottomToolbar = false, this.toolbar, + required this.controller, }) : super(key: key); - final String hint; - final String initialText; - final double height; - final BoxDecoration decoration; - final bool darkMode; - final bool showBottomToolbar; - final List toolbar; - @override _HtmlRichEditorState createState() => _HtmlRichEditorState(); } class _HtmlRichEditorState extends State { - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); @@ -64,51 +66,42 @@ class _HtmlRichEditorState extends State { return Stack( children: [ HtmlEditor( - hint: widget.hint, - height: widget.height, - initialText: widget.initialText, - showBottomToolbar: widget.showBottomToolbar, - darkMode: widget.darkMode, - decoration: widget.decoration ?? - BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.all( - Radius.circular(30.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), - toolbar: widget.toolbar ?? - const [ - // Style(), - Font(buttons: [ - FontButtons.bold, - FontButtons.italic, - FontButtons.underline, - ]), - // ColorBar(buttons: [ColorButtons.color]), - Paragraph(buttons: [ - ParagraphButtons.ul, - ParagraphButtons.ol, - ParagraphButtons.paragraph - ]), - // Insert(buttons: [InsertButtons.link, InsertButtons.picture, InsertButtons.video, InsertButtons.table]), - // Misc(buttons: [MiscButtons.fullscreen, MiscButtons.codeview, MiscButtons.help]) - ], - ), + controller: widget.controller, + htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [ + StyleButtons(), + FontSettingButtons(), + FontButtons(), + // ColorButtons(), + ListButtons(), + ParagraphButtons(), + // InsertButtons(), + // OtherButtons(), + ]), + htmlEditorOptions: HtmlEditorOptions( + hint: widget.hint, + initialText: widget.initialText, + darkMode: widget.darkMode, + ), + otherOptions: OtherOptions( + height: widget.height, + decoration: widget.decoration ?? + BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.all( + Radius.circular(30.0), + ), + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + )), Positioned( - top: - 50, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, + top: 50, //MediaQuery.of(context).size.height * 0, + right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ], @@ -121,8 +114,7 @@ class _HtmlRichEditorState extends State { onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -150,15 +142,15 @@ class _HtmlRichEditorState extends State { ].request(); } - void resultListener(result)async { + void resultListener(result) async { recognizedWord = result.recognizedWords; event.setValue({"searchText": recognizedWord}); - String txt = await HtmlEditor.getText(); + String txt = await widget.controller.getText(); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - HtmlEditor.setText(txt+recognizedWord); + widget.controller.setText(txt + recognizedWord); }); } else { print(result.finalResult); diff --git a/lib/widgets/shared/text_fields/new_text_Field.dart b/lib/widgets/shared/text_fields/new_text_Field.dart index 6392efe9..a01d21a8 100644 --- a/lib/widgets/shared/text_fields/new_text_Field.dart +++ b/lib/widgets/shared/text_fields/new_text_Field.dart @@ -41,77 +41,88 @@ final _mobileFormatter = NumberTextInputFormatter(); class NewTextFields extends StatefulWidget { NewTextFields( - {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 15.0, - this.fontWeight = FontWeight.w500, - this.autoValidate = false, - this.hintColor, - this.isEnabled = true}) + {Key? key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 15.0, + this.fontWeight = FontWeight.w500, + this.autoValidate = false, + this.hintColor, + this.isEnabled = true, + this.onTapTextFields, + this.fillColor, + this.hasBorder, + this.showLabelText, + this.borderRadius, + this.borderWidth}) : super(key: key); - - final String hintText; - - // final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; - final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; - final bool maxLengthEnforced; - final bool bare; - final bool isEnabled; - final TextInputAction inputAction; - final double fontSize; - final FontWeight fontWeight; - final bool keepPadding; - final TextCapitalization textCapitalization; - final List inputFormatters; - final bool autoValidate; - final EdgeInsets padding; - final bool focus; - final bool borderOnlyError; - final Color hintColor; - final String initialValue; + final String? hintText; + final String? initialValue; + final String? type; + final bool? autoFocus; + final bool? isEnabled; + final IconData? suffixIcon; + final Color? suffixIconColor; + final Icon? prefixIcon; + final VoidCallback? onTap; + final GestureTapCallback? onTapTextFields; + final TextEditingController? controller; + final TextInputType? keyboardType; + final FormFieldValidator? validator; + final FormFieldSetter? onSaved; + final GestureTapCallback? onSuffixTap; + final ValueChanged? onChanged; + final ValueChanged? onSubmit; + final bool? readOnly; + final int? maxLength; + final int? minLines; + final int? maxLines; + final bool? maxLengthEnforced; + final bool? bare; + final TextInputAction? inputAction; + final double? fontSize; + final FontWeight? fontWeight; + final bool? keepPadding; + final TextCapitalization? textCapitalization; + final List? inputFormatters; + final bool? autoValidate; + final EdgeInsets? padding; + final bool? focus; + final bool? borderOnlyError; + final Color? hintColor; + final Color? fillColor; + final bool? hasBorder; + final bool? showLabelText; + Color? borderColor; + final double? borderRadius; + final double? borderWidth; + bool? hasLabelText; @override _NewTextFieldsState createState() => _NewTextFieldsState(); } @@ -133,7 +144,7 @@ class _NewTextFieldsState extends State { @override void didUpdateWidget(NewTextFields oldWidget) { - if (widget.focus) _focusNode.requestFocus(); + if (widget.focus!) _focusNode.requestFocus(); super.didUpdateWidget(oldWidget); } @@ -144,7 +155,7 @@ class _NewTextFieldsState extends State { } bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly) { + if (widget.readOnly != null && widget.readOnly!) { _focusNode.unfocus(); return true; } else { @@ -172,8 +183,8 @@ class _NewTextFieldsState extends State { initialValue: widget.initialValue, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - // autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, + // autovalidate: widget.autoValidate!, + textCapitalization: widget.textCapitalization!, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null ? widget.onSubmit @@ -184,8 +195,8 @@ class _NewTextFieldsState extends State { textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, - onChanged: widget.onChanged, + // maxLengthEnforced: widget.maxLengthEnforced!, + onChanged: widget.onChanged!, focusNode: _focusNode, maxLength: widget.maxLength ?? null, controller: widget.controller, @@ -195,8 +206,11 @@ class _NewTextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.body2.copyWith( - fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), fontFamily: 'Poppins'), + style: Theme.of(context).textTheme.bodyText1!.copyWith( + fontSize: widget.fontSize, + fontWeight: widget.fontWeight, + color: Color(0xFF575757), + fontFamily: 'Poppins'), inputFormatters: widget.keyboardType == TextInputType.phone ? [ // WhitelistingTextInputFormatter.digitsOnly, diff --git a/lib/widgets/shared/text_fields/text_field_error.dart b/lib/widgets/shared/text_fields/text_field_error.dart index 9c781db0..b327388c 100644 --- a/lib/widgets/shared/text_fields/text_field_error.dart +++ b/lib/widgets/shared/text_fields/text_field_error.dart @@ -6,8 +6,8 @@ import '../app_texts_widget.dart'; class TextFieldsError extends StatelessWidget { const TextFieldsError({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); final String error; diff --git a/lib/widgets/shared/text_fields/text_fields_utils.dart b/lib/widgets/shared/text_fields/text_fields_utils.dart index 23ae13a8..85d25475 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -1,9 +1,8 @@ import 'package:flutter/material.dart'; class TextFieldsUtils { - static BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor, - {double borderWidth = -1, double borderRadius = 10.0}) { + static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, + {double borderWidth = -1, double borderRadius = 12}) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -15,9 +14,8 @@ class TextFieldsUtils { ); } - static InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData suffixIcon, Color dropDownColor}) { + static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {IconData? suffixIcon, Color? dropDownColor}) { return InputDecoration( isDense: true, contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index 21875e4d..dbc9ef56 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -5,21 +5,17 @@ import '../app_texts_widget.dart'; class CustomRow extends StatelessWidget { const CustomRow({ - Key key, - this.label, - this.value, - this.labelSize, - this.valueSize, - this.width, - this.isCopyable = true, + Key? key, + this.label, + required this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true, }) : super(key: key); - final String label; + final String? label; final String value; - final double labelSize; - final double valueSize; - final double width; - final bool isCopyable; + final double? labelSize; + final double? valueSize; + final double? width; + final bool? isCopyable; @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart b/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart deleted file mode 100644 index 8a4891fd..00000000 --- a/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:flutter/material.dart'; - -/// Displays an overlay Widget anchored directly above the center of this -/// [AnchoredOverlay]. -/// -/// The overlay Widget is created by invoking the provided [overlayBuilder]. -/// -/// The [anchor] position is provided to the [overlayBuilder], but the builder -/// does not have to respect it. In other words, the [overlayBuilder] can -/// interpret the meaning of "anchor" however it wants - the overlay will not -/// be forced to be centered about the [anchor]. -/// -/// The overlay built by this [AnchoredOverlay] can be conditionally shown -/// and hidden by settings the [showOverlay] property to true or false. -/// -/// The [overlayBuilder] is invoked every time this Widget is rebuilt. -/// -class AnchoredOverlay extends StatelessWidget { - final bool showOverlay; - final Widget Function(BuildContext, Rect anchorBounds, Offset anchor) - overlayBuilder; - final Widget child; - - AnchoredOverlay({ - key, - this.showOverlay = false, - this.overlayBuilder, - this.child, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { - return OverlayBuilder( - showOverlay: showOverlay, - overlayBuilder: (BuildContext overlayContext) { - // To calculate the "anchor" point we grab the render box of - // our parent Container and then we find the center of that box. - RenderBox box = context.findRenderObject() as RenderBox; - final topLeft = - box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - final Rect anchorBounds = Rect.fromLTRB( - topLeft.dx, - topLeft.dy, - bottomRight.dx, - bottomRight.dy, - ); - final anchorCenter = box.size.center(topLeft); - return overlayBuilder(overlayContext, anchorBounds, anchorCenter); - }, - child: child, - ); - }, - ); - } -} - -// -// Displays an overlay Widget as constructed by the given [overlayBuilder]. -// -// The overlay built by the [overlayBuilder] can be conditionally shown and hidden by settings the [showOverlay] -// property to true or false. -// -// The [overlayBuilder] is invoked every time this Widget is rebuilt. -// -// Implementation note: the reason we rebuild the overlay every time our state changes is because there doesn't seem -// to be any better way to invalidate the overlay itself than to invalidate this Widget. -// Remember, overlay Widgets exist in [OverlayEntry]s which are inaccessible to outside Widgets. -// But if a better approach is found then feel free to use it. -// -class OverlayBuilder extends StatefulWidget { - final bool showOverlay; - final Widget Function(BuildContext) overlayBuilder; - final Widget child; - - OverlayBuilder({ - key, - this.showOverlay = false, - this.overlayBuilder, - this.child, - }) : super(key: key); - - @override - _OverlayBuilderState createState() => _OverlayBuilderState(); -} - -class _OverlayBuilderState extends State { - OverlayEntry _overlayEntry; - - @override - void initState() { - super.initState(); - - if (widget.showOverlay) { - WidgetsBinding.instance.addPostFrameCallback((_) => showOverlay()); - } - } - - @override - void didUpdateWidget(OverlayBuilder oldWidget) { - super.didUpdateWidget(oldWidget); - WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay()); - } - - @override - void reassemble() { - super.reassemble(); - WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay()); - } - - @override - void dispose() { - if (isShowingOverlay()) { - hideOverlay(); - } - - super.dispose(); - } - - bool isShowingOverlay() => _overlayEntry != null; - - void showOverlay() { - if (_overlayEntry == null) { - // Create the overlay. - _overlayEntry = OverlayEntry( - builder: widget.overlayBuilder, - ); - addToOverlay(_overlayEntry); - } else { - // Rebuild overlay. - buildOverlay(); - } - } - - void addToOverlay(OverlayEntry overlayEntry) async { - Overlay.of(context).insert(overlayEntry); - final overlay = Overlay.of(context); - if (overlayEntry == null) - WidgetsBinding.instance - .addPostFrameCallback((_) => overlay.insert(overlayEntry)); - } - - void hideOverlay() { - if (_overlayEntry != null) { - _overlayEntry.remove(); - _overlayEntry = null; - } - } - - void syncWidgetAndOverlay() { - if (isShowingOverlay() && !widget.showOverlay) { - hideOverlay(); - } else if (!isShowingOverlay() && widget.showOverlay) { - showOverlay(); - } - } - - void buildOverlay() async { - WidgetsBinding.instance - .addPostFrameCallback((_) => _overlayEntry?.markNeedsBuild()); - } - - @override - Widget build(BuildContext context) { - buildOverlay(); - - return widget.child; - } -} diff --git a/lib/widgets/shared/user-guid/app_get_position.dart b/lib/widgets/shared/user-guid/app_get_position.dart deleted file mode 100644 index c0430994..00000000 --- a/lib/widgets/shared/user-guid/app_get_position.dart +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ -import 'package:flutter/material.dart'; - -class GetPosition { - final GlobalKey key; - - GetPosition({this.key}); - - Rect getRect() { - RenderBox box = key.currentContext.findRenderObject(); - - final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - - Rect rect = Rect.fromLTRB( - topLeft.dx, - topLeft.dy, - bottomRight.dx, - bottomRight.dy, - ); - return rect; - } - - ///Get the bottom position of the widget - double getBottom() { - RenderBox box = key.currentContext.findRenderObject(); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - return bottomRight.dy; - } - - ///Get the top position of the widget - double getTop() { - RenderBox box = key.currentContext.findRenderObject(); - final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - return topLeft.dy; - } - - ///Get the left position of the widget - double getLeft() { - RenderBox box = key.currentContext.findRenderObject(); - final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - return topLeft.dx; - } - - ///Get the right position of the widget - double getRight() { - RenderBox box = key.currentContext.findRenderObject(); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - return bottomRight.dx; - } - - double getHeight() { - return getBottom() - getTop(); - } - - double getWidth() { - return getRight() - getLeft(); - } - - double getCenter() { - return (getLeft() + getRight()) / 2; - } -} diff --git a/lib/widgets/shared/user-guid/app_shape_painter.dart b/lib/widgets/shared/user-guid/app_shape_painter.dart deleted file mode 100644 index 925d18d0..00000000 --- a/lib/widgets/shared/user-guid/app_shape_painter.dart +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:flutter/material.dart'; - -class ShapePainter extends CustomPainter { - Rect rect; - final ShapeBorder shapeBorder; - final Color color; - final double opacity; - - ShapePainter({ - @required this.rect, - this.color, - this.shapeBorder, - this.opacity, - }); - - @override - void paint(Canvas canvas, Size size) { - final paint = Paint(); - paint.color = color.withOpacity(opacity); - RRect outer = - RRect.fromLTRBR(0, 0, size.width, size.height, Radius.circular(0)); - - double radius = shapeBorder == CircleBorder() ? 50 : 3; - - RRect inner = RRect.fromRectAndRadius(rect, Radius.circular(radius)); - canvas.drawDRRect(outer, inner, paint); - } - - @override - bool shouldRepaint(CustomPainter oldDelegate) => false; -} diff --git a/lib/widgets/shared/user-guid/app_showcase.dart b/lib/widgets/shared/user-guid/app_showcase.dart deleted file mode 100644 index 38625279..00000000 --- a/lib/widgets/shared/user-guid/app_showcase.dart +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; - -import 'app_anchored_overlay_widget.dart'; -import 'app_get_position.dart'; -import 'app_shape_painter.dart'; -import 'app_showcase_widget.dart'; -import 'app_tool_tip_widget.dart'; - -class AppShowcase extends StatefulWidget { - final Widget child; - final String title; - final String description; - final ShapeBorder shapeBorder; - final TextStyle titleTextStyle; - final TextStyle descTextStyle; - final GlobalKey key; - final Color overlayColor; - final double overlayOpacity; - final Widget container; - final Color showcaseBackgroundColor; - final Color textColor; - final bool showArrow; - final double height; - final double width; - final Duration animationDuration; - final VoidCallback onToolTipClick; - final VoidCallback onTargetClick; - final VoidCallback onSkipClick; - final bool disposeOnTap; - final bool disableAnimation; - - const AppShowcase( - {@required this.key, - @required this.child, - this.title, - @required this.description, - this.shapeBorder, - this.overlayColor = Colors.black, - this.overlayOpacity = 0.75, - this.titleTextStyle, - this.descTextStyle, - this.showcaseBackgroundColor = Colors.white, - this.textColor = Colors.black, - this.showArrow = true, - this.onTargetClick, - this.onSkipClick, - this.disposeOnTap, - this.animationDuration = const Duration(milliseconds: 2000), - this.disableAnimation = false}) - : height = null, - width = null, - container = null, - this.onToolTipClick = null, - assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0, - "overlay opacity should be >= 0.0 and <= 1.0."), - assert( - onTargetClick == null - ? true - : (disposeOnTap == null ? false : true), - "disposeOnTap is required if you're using onTargetClick"), - assert( - disposeOnTap == null - ? true - : (onTargetClick == null ? false : true), - "onTargetClick is required if you're using disposeOnTap"), - assert(key != null || - child != null || - title != null || - showArrow != null || - description != null || - shapeBorder != null || - overlayColor != null || - titleTextStyle != null || - descTextStyle != null || - showcaseBackgroundColor != null || - textColor != null || - shapeBorder != null || - animationDuration != null); - - const AppShowcase.withWidget( - {this.key, - @required this.child, - @required this.container, - @required this.height, - @required this.width, - this.title, - this.description, - this.shapeBorder, - this.overlayColor = Colors.black, - this.overlayOpacity = 0.75, - this.titleTextStyle, - this.descTextStyle, - this.showcaseBackgroundColor = Colors.white, - this.textColor = Colors.black, - this.onTargetClick, - this.onSkipClick, - this.disposeOnTap, - this.animationDuration = const Duration(milliseconds: 2000), - this.disableAnimation = false}) - : this.showArrow = false, - this.onToolTipClick = null, - assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0, - "overlay opacity should be >= 0.0 and <= 1.0."), - assert(key != null || - child != null || - title != null || - description != null || - shapeBorder != null || - overlayColor != null || - titleTextStyle != null || - descTextStyle != null || - showcaseBackgroundColor != null || - textColor != null || - shapeBorder != null || - animationDuration != null); - - @override - _AppShowcaseState createState() => _AppShowcaseState(); -} - -class _AppShowcaseState extends State - with TickerProviderStateMixin { - bool _showShowCase = false; - Animation _slideAnimation; - AnimationController _slideAnimationController; - - GetPosition position; - - @override - void initState() { - super.initState(); - - _slideAnimationController = AnimationController( - duration: widget.animationDuration, - vsync: this, - )..addStatusListener((AnimationStatus status) { - if (status == AnimationStatus.completed) { - _slideAnimationController.reverse(); - } - if (_slideAnimationController.isDismissed) { - if (!widget.disableAnimation) { - _slideAnimationController.forward(); - } - } - }); - - _slideAnimation = CurvedAnimation( - parent: _slideAnimationController, - curve: Curves.easeInOut, - ); - - position = GetPosition(key: widget.key); - } - - @override - void dispose() { - _slideAnimationController.dispose(); - super.dispose(); - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - showOverlay(); - } - - /// - /// show overlay if there is any target widget - /// - void showOverlay() { - GlobalKey activeStep = ShowCaseWidget.activeTargetWidget(context); - setState(() { - _showShowCase = activeStep == widget.key; - }); - - if (activeStep == widget.key) { - if (!widget.disableAnimation) { - _slideAnimationController.forward(); - } - } - } - - @override - Widget build(BuildContext context) { - Size size = MediaQuery.of(context).size; - return AnchoredOverlay( - overlayBuilder: (BuildContext context, Rect rectBound, Offset offset) => - buildOverlayOnTarget(offset, rectBound.size, rectBound, size), - showOverlay: true, - child: widget.child, - ); - } - - _nextIfAny() { - ShowCaseWidget.of(context).completed(widget.key); - if (!widget.disableAnimation) { - _slideAnimationController.forward(); - } - } - - _getOnTargetTap() { - if (widget.disposeOnTap == true) { - return widget.onTargetClick == null - ? () { - ShowCaseWidget.of(context).dismiss(); - } - : () { - ShowCaseWidget.of(context).dismiss(); - widget.onTargetClick(); - }; - } else { - return widget.onTargetClick ?? _nextIfAny; - } - } - - _getOnTooltipTap() { - if (widget.disposeOnTap == true) { - return widget.onToolTipClick == null - ? () { - ShowCaseWidget.of(context).dismiss(); - } - : () { - ShowCaseWidget.of(context).dismiss(); - widget.onToolTipClick(); - }; - } else { - return widget.onToolTipClick ?? () {}; - } - } - - buildOverlayOnTarget( - Offset offset, - Size size, - Rect rectBound, - Size screenSize, - ) => - Visibility( - visible: _showShowCase, - maintainAnimation: true, - maintainState: true, - child: Stack( - children: [ - GestureDetector( - onTap: _nextIfAny, - child: Container( - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height, - child: CustomPaint( - painter: ShapePainter( - opacity: widget.overlayOpacity, - rect: position.getRect(), - shapeBorder: widget.shapeBorder, - color: widget.overlayColor), - ), - ), - ), - _TargetWidget( - offset: offset, - size: size, - onTap: _getOnTargetTap(), - shapeBorder: widget.shapeBorder, - ), - AppToolTipWidget( - position: position, - offset: offset, - screenSize: screenSize, - title: widget.title, - description: widget.description, - animationOffset: _slideAnimation, - titleTextStyle: widget.titleTextStyle, - descTextStyle: widget.descTextStyle, - container: widget.container, - tooltipColor: widget.showcaseBackgroundColor, - textColor: widget.textColor, - showArrow: widget.showArrow, - contentHeight: widget.height, - contentWidth: widget.width, - onTooltipTap: _getOnTooltipTap(), - ), - GestureDetector( - child: AppText( - "Skip", - color: Colors.white, - fontSize: 20, - marginRight: 15, - marginLeft: 15, - marginTop: 15, - ), - onTap: widget.onSkipClick) - ], - ), - ); -} - -class _TargetWidget extends StatelessWidget { - final Offset offset; - final Size size; - final Animation widthAnimation; - final VoidCallback onTap; - final ShapeBorder shapeBorder; - - _TargetWidget({ - Key key, - @required this.offset, - this.size, - this.widthAnimation, - this.onTap, - this.shapeBorder, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return Positioned( - top: offset.dy, - left: offset.dx, - child: FractionalTranslation( - translation: const Offset(-0.5, -0.5), - child: GestureDetector( - onTap: onTap, - child: Container( - height: size.height + 16, - width: size.width + 16, - decoration: ShapeDecoration( - shape: shapeBorder ?? - RoundedRectangleBorder( - borderRadius: const BorderRadius.all( - Radius.circular(8), - ), - ), - ), - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/user-guid/app_showcase_widget.dart b/lib/widgets/shared/user-guid/app_showcase_widget.dart deleted file mode 100644 index 07577b3b..00000000 --- a/lib/widgets/shared/user-guid/app_showcase_widget.dart +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:flutter/material.dart'; - -class ShowCaseWidget extends StatefulWidget { - final Builder builder; - final VoidCallback onFinish; - - const ShowCaseWidget({@required this.builder, this.onFinish}); - - static activeTargetWidget(BuildContext context) { - return context - .dependOnInheritedWidgetOfExactType<_InheritedShowCaseView>() - .activeWidgetIds; - } - - static ShowCaseWidgetState of(BuildContext context) { - ShowCaseWidgetState state = - context.findAncestorStateOfType(); - if (state != null) { - return context.findAncestorStateOfType(); - } else { - throw Exception('Please provide ShowCaseView context'); - } - } - - @override - ShowCaseWidgetState createState() => ShowCaseWidgetState(); -} - -class ShowCaseWidgetState extends State { - List ids; - int activeWidgetId; - - void startShowCase(List widgetIds) { - setState(() { - this.ids = widgetIds; - activeWidgetId = 0; - }); - } - - void completed(GlobalKey id) { - if (ids != null && ids[activeWidgetId] == id) { - setState(() { - ++activeWidgetId; - - if (activeWidgetId >= ids.length) { - _cleanupAfterSteps(); - if (widget.onFinish != null) { - widget.onFinish(); - } - } - }); - } - } - - void dismiss() { - setState(() { - _cleanupAfterSteps(); - }); - } - - void _cleanupAfterSteps() { - ids = null; - activeWidgetId = null; - } - - @override - Widget build(BuildContext context) { - return _InheritedShowCaseView( - child: widget.builder, - activeWidgetIds: ids?.elementAt(activeWidgetId), - ); - } -} - -class _InheritedShowCaseView extends InheritedWidget { - final GlobalKey activeWidgetIds; - - _InheritedShowCaseView({ - @required this.activeWidgetIds, - @required child, - }) : super(child: child); - - @override - bool updateShouldNotify(_InheritedShowCaseView oldWidget) => - oldWidget.activeWidgetIds != activeWidgetIds; -} diff --git a/lib/widgets/shared/user-guid/app_tool_tip_widget.dart b/lib/widgets/shared/user-guid/app_tool_tip_widget.dart deleted file mode 100644 index 285caa8e..00000000 --- a/lib/widgets/shared/user-guid/app_tool_tip_widget.dart +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; - -import 'app_get_position.dart'; - -class AppToolTipWidget extends StatelessWidget { - final GetPosition position; - final Offset offset; - final Size screenSize; - final String title; - final String description; - final Animation animationOffset; - final TextStyle titleTextStyle; - final TextStyle descTextStyle; - final Widget container; - final Color tooltipColor; - final Color textColor; - final bool showArrow; - final double contentHeight; - final double contentWidth; - static bool isArrowUp; - final VoidCallback onTooltipTap; - - AppToolTipWidget({ - this.position, - this.offset, - this.screenSize, - this.title, - this.description, - this.animationOffset, - this.titleTextStyle, - this.descTextStyle, - this.container, - this.tooltipColor, - this.textColor, - this.showArrow, - this.contentHeight, - this.contentWidth, - this.onTooltipTap, - }); - - bool isCloseToTopOrBottom(Offset position) { - double height = 120; - if (contentHeight != null) { - height = contentHeight; - } - return (screenSize.height - position.dy) <= height; - } - - String findPositionForContent(Offset position) { - if (isCloseToTopOrBottom(position)) { - return 'ABOVE'; - } else { - return 'BELOW'; - } - } - - double _getTooltipWidth() { - double titleLength = title == null ? 0 : (title.length * 10.0); - double descriptionLength = (description.length * 7.0); - if (titleLength > descriptionLength) { - return titleLength + 10; - } else { - return descriptionLength + 10; - } - } - - bool _isLeft() { - double screenWidth = screenSize.width / 3; - return !(screenWidth <= position.getCenter()); - } - - bool _isRight() { - double screenWidth = screenSize.width / 3; - return ((screenWidth * 2) <= position.getCenter()); - } - - double _getLeft() { - if (_isLeft()) { - double leftPadding = position.getCenter() - (_getTooltipWidth() * 0.1); - if (leftPadding + _getTooltipWidth() > screenSize.width) { - leftPadding = (screenSize.width - 20) - _getTooltipWidth(); - } - if (leftPadding < 20) { - leftPadding = 14; - } - return leftPadding; - } else if (!(_isRight())) { - return position.getCenter() - (_getTooltipWidth() * 0.5); - } else { - return null; - } - } - - double _getRight() { - if (_isRight()) { - double rightPadding = position.getCenter() + (_getTooltipWidth() / 2); - if (rightPadding + _getTooltipWidth() > screenSize.width) { - rightPadding = 14; - } - return rightPadding; - } else if (!(_isLeft())) { - return position.getCenter() - (_getTooltipWidth() * 0.5); - } else { - return null; - } - } - - double _getSpace() { - double space = position.getCenter() - (contentWidth / 2); - if (space + contentWidth > screenSize.width) { - space = screenSize.width - contentWidth - 8; - } else if (space < (contentWidth / 2)) { - space = 16; - } - return space; - } - - @override - Widget build(BuildContext context) { - final contentOrientation = findPositionForContent(offset); - final contentOffsetMultiplier = contentOrientation == "BELOW" ? 1.0 : -1.0; - isArrowUp = contentOffsetMultiplier == 1.0 ? true : false; - - final contentY = isArrowUp - ? position.getBottom() + (contentOffsetMultiplier * 3) - : position.getTop() + (contentOffsetMultiplier * 3); - - final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); - - double paddingTop = isArrowUp ? 22 : 0; - double paddingBottom = isArrowUp ? 0 : 27; - - if (!showArrow) { - paddingTop = 10; - paddingBottom = 10; - } - - if (container == null) { - return Stack( - children: [ - showArrow ? _getArrow(contentOffsetMultiplier) : Container(), - Positioned( - top: contentY, - left: _getLeft(), - right: _getRight(), - child: FractionalTranslation( - translation: Offset(0.0, contentFractionalOffset), - child: SlideTransition( - position: Tween( - begin: Offset(0.0, contentFractionalOffset / 10), - end: Offset(0.0, 0.100), - ).animate(animationOffset), - child: Material( - color: Colors.transparent, - child: Container( - padding: - EdgeInsets.only(top: paddingTop, bottom: paddingBottom), - child: ClipRRect( - borderRadius: BorderRadius.circular(8), - child: GestureDetector( - onTap: onTooltipTap, - child: Container( - width: _getTooltipWidth(), - padding: EdgeInsets.symmetric(vertical: 8), - color: tooltipColor, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: Column( - crossAxisAlignment: title != null - ? CrossAxisAlignment.start - : CrossAxisAlignment.center, - children: [ - title != null - ? Row( - children: [ - Padding( - padding: - const EdgeInsets.all(8.0), - child: Icon( - DoctorApp.search_patient), - ), - AppText( - title, - color: textColor, - margin: 2, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ], - ) - : Container(), - AppText( - description, - color: textColor, - margin: 8, - ), - ], - ), - ) - ], - ), - ), - ), - ), - ), - ), - ), - ), - ) - ], - ); - } else { - return Stack( - children: [ - Positioned( - left: _getSpace(), - top: contentY - 10, - child: FractionalTranslation( - translation: Offset(0.0, contentFractionalOffset), - child: SlideTransition( - position: Tween( - begin: Offset(0.0, contentFractionalOffset / 5), - end: Offset(0.0, 0.100), - ).animate(animationOffset), - child: Material( - color: Colors.transparent, - child: GestureDetector( - onTap: onTooltipTap, - child: Container( - padding: EdgeInsets.only( - top: paddingTop, - ), - color: Colors.transparent, - child: Center( - child: container, - ), - ), - ), - ), - ), - ), - ), - ], - ); - } - } - - Widget _getArrow(contentOffsetMultiplier) { - final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); - return Positioned( - top: isArrowUp ? position.getBottom() : position.getTop() - 1, - left: position.getCenter() - 24, - child: FractionalTranslation( - translation: Offset(0.0, contentFractionalOffset), - child: SlideTransition( - position: Tween( - begin: Offset(0.0, contentFractionalOffset / 5), - end: Offset(0.0, 0.150), - ).animate(animationOffset), - child: isArrowUp - ? Icon( - Icons.arrow_drop_up, - color: tooltipColor, - size: 50, - ) - : Icon( - Icons.arrow_drop_down, - color: tooltipColor, - size: 50, - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/user-guid/custom_validation_error.dart b/lib/widgets/shared/user-guid/custom_validation_error.dart index fd1f2125..c444bba7 100644 --- a/lib/widgets/shared/user-guid/custom_validation_error.dart +++ b/lib/widgets/shared/user-guid/custom_validation_error.dart @@ -5,9 +5,9 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class CustomValidationError extends StatelessWidget { - String error; + String? error; CustomValidationError({ - Key key, this.error, + Key ? key, this.error, }) : super(key: key); @override diff --git a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart index 9197a4a1..e5d4c647 100644 --- a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart +++ b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart @@ -7,15 +7,15 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class InPatientDoctorCard extends StatelessWidget { - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; - final bool isPrescriptions; - final String clinic; + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final VoidCallback? onTap; + final bool? isPrescriptions; + final String? clinic; final createdBy; InPatientDoctorCard( @@ -63,14 +63,14 @@ class InPatientDoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), - if (!isPrescriptions) + if (!isPrescriptions!) AppText( - '${AppDateUtils.getHour(appointmentDate)}', + '${AppDateUtils.getHour(appointmentDate!)}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, diff --git a/lib/widgets/transitions/fade_page.dart b/lib/widgets/transitions/fade_page.dart index 7cd3826c..2330894b 100644 --- a/lib/widgets/transitions/fade_page.dart +++ b/lib/widgets/transitions/fade_page.dart @@ -4,30 +4,25 @@ import 'package:flutter/material.dart'; /// [page] class FadePage extends PageRouteBuilder { final Widget page; - FadePage({this.page}) - : super( - opaque: false, - settings: RouteSettings(name: page.runtimeType.toString()), - fullscreenDialog: true, - barrierDismissible: true, - barrierColor: Colors.black.withOpacity(0.8), - pageBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - ) => - page, - transitionDuration: Duration(milliseconds: 300), - transitionsBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - Widget child, - ) { - return FadeTransition( - opacity: animation, - child: child - ); - } - ); + FadePage({required this.page}) + : super( + opaque: false, + settings: RouteSettings(name: page.runtimeType.toString()),fullscreenDialog: true, + barrierDismissible: true, + barrierColor: Colors.black.withOpacity(0.8), + pageBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) => + page, + transitionDuration: Duration(milliseconds: 300), + transitionsBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child, + ) { + return FadeTransition(opacity: animation, child: child); + }); } \ No newline at end of file diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart index ee0b7473..1893a172 100644 --- a/lib/widgets/transitions/slide_up_page.dart +++ b/lib/widgets/transitions/slide_up_page.dart @@ -9,9 +9,9 @@ class SlideUpPageRoute extends PageRouteBuilder { final Widget widget; final bool fullscreenDialog; final bool opaque; - final String settingRoute; + final String? settingRoute; - SlideUpPageRoute({this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) + SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) : super( pageBuilder: ( BuildContext context, diff --git a/pubspec.yaml b/pubspec.yaml index 13e6eb7f..c5b14f46 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -63,7 +63,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.3 # SVG - #flutter_svg: ^0.17.4 + #flutter_svg: ^1.0.0 percent_indicator: ^3.0.1 #Dependency Injection @@ -138,6 +138,10 @@ flutter: - assets/images/ - assets/images/dashboard/ - assets/images/login/ + - assets/images/svgs/ + - assets/images/svgs/verification/ + - assets/images/svgs/profile_screen/ + - assets/images/svgs/bottom_nav/ - assets/images/patient/ - assets/images/patient/vital_signs/ @@ -160,6 +164,8 @@ flutter: weight: 400 - asset: assets/fonts/Poppins/Poppins-Medium.ttf weight: 500 + - asset: assets/fonts/Poppins/Poppins-SemiBold.ttf + weight: 600 - asset: assets/fonts/Poppins/Poppins-Bold.ttf weight: 700 - asset: assets/fonts/Poppins/Poppins-Bold.ttf