diff --git a/android/build.gradle b/android/build.gradle index 51c49a99..bf0f679d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.0.0' + classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.3' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index bfae97b2..296b146b 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Jun 13 08:51:58 EEST 2021 +#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-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index c31cbe8e..66be39bf 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -260,78 +260,9 @@ files = ( ); inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/DKImagePickerController/DKImagePickerController.framework", - "${BUILT_PRODUCTS_DIR}/DKPhotoGallery/DKPhotoGallery.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework", - "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework", - "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", - "${BUILT_PRODUCTS_DIR}/MTBBarcodeScanner/MTBBarcodeScanner.framework", - "${BUILT_PRODUCTS_DIR}/OrderedSet/OrderedSet.framework", - "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", - "${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework", - "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", - "${BUILT_PRODUCTS_DIR}/SwiftyGif/SwiftyGif.framework", - "${BUILT_PRODUCTS_DIR}/Try/Try.framework", - "${BUILT_PRODUCTS_DIR}/barcode_scan_fix/barcode_scan_fix.framework", - "${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework", - "${BUILT_PRODUCTS_DIR}/device_info/device_info.framework", - "${BUILT_PRODUCTS_DIR}/file_picker/file_picker.framework", - "${BUILT_PRODUCTS_DIR}/flutter_flexible_toast/flutter_flexible_toast.framework", - "${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework", - "${BUILT_PRODUCTS_DIR}/flutter_keyboard_visibility/flutter_keyboard_visibility.framework", - "${BUILT_PRODUCTS_DIR}/hexcolor/hexcolor.framework", - "${BUILT_PRODUCTS_DIR}/imei_plugin/imei_plugin.framework", - "${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework", - "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework", - "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", - "${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework", - "${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework", - "${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework", - "${BUILT_PRODUCTS_DIR}/video_player/video_player.framework", - "${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework", - "${BUILT_PRODUCTS_DIR}/webview_flutter/webview_flutter.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKImagePickerController.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKPhotoGallery.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MTBBarcodeScanner.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OrderedSet.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyGif.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Try.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/barcode_scan_fix.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_picker.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_flexible_toast.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_keyboard_visibility.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hexcolor.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/imei_plugin.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a6..1d526a16 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "group:Runner.xcodeproj"> diff --git a/lib/UpdatePage.dart b/lib/UpdatePage.dart index b3202c52..16284ed1 100644 --- a/lib/UpdatePage.dart +++ b/lib/UpdatePage.dart @@ -10,11 +10,12 @@ 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) { @@ -29,27 +30,18 @@ class UpdatePage extends StatelessWidget { children: [ Image.asset( 'assets/images/update_rocket_image.png', - width: double.maxFinite, - fit: BoxFit.fill, + width: double.maxFinite,fit: BoxFit.fill, ), Image.asset('assets/images/HMG_logo.png'), - SizedBox( - height: 8, - ), + SizedBox(height: 8,), AppText( - TranslationBase.of(context).updateTheApp!.toUpperCase(), - fontSize: 17, + TranslationBase.of(context).updateTheApp.toUpperCase(),fontSize: 17, fontWeight: FontWeight.w600, ), - SizedBox( - height: 12, - ), + SizedBox(height: 12,), Padding( padding: const EdgeInsets.all(8.0), - child: AppText( - message ?? "Update the app", - fontSize: 12, - ), + child: AppText(message??"Update the app",fontSize: 12,), ) ], ), @@ -60,14 +52,14 @@ class UpdatePage extends StatelessWidget { // padding: const EdgeInsets.all(8.0), margin: EdgeInsets.all(15), child: SecondaryButton( - color: Colors.red[800]!, + 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 1414c78f..af4e6e97 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, - {required Map body, - required Function(dynamic response, int statusCode) onSuccess, - required Function(String error, int statusCode) onFailure, + {Map body, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, bool isAllowAny = false, bool isLiveCare = false, bool isFallLanguage = false}) async { @@ -36,28 +36,30 @@ 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) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile.doctorID; + DoctorProfileModel 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) { @@ -80,10 +82,12 @@ 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); @@ -103,22 +107,30 @@ class BaseAppClient { var asd = json.encode(body); var asd2; if (await Helpers.checkConnection()) { - final response = await http.post(Uri.parse(url), - body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}); + final response = await http.post(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); } @@ -144,18 +156,22 @@ class BaseAppClient { } postPatient(String endPoint, - {required Map body, - required Function(dynamic response, int statusCode) onSuccess, - required Function(String error, int statusCode) onFailure, - PatiantInformtion? patient, + {Map body, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + @required 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'] @@ -175,11 +191,12 @@ 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; @@ -187,7 +204,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; @@ -195,13 +212,15 @@ 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 @@ -217,7 +236,8 @@ class BaseAppClient { var asd = json.encode(body); var asd2; if (await Helpers.checkConnection()) { - final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); + final response = await http.post(url.trim(), + body: json.encode(body), headers: headers); final int statusCode = response.statusCode; print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { @@ -229,7 +249,8 @@ 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) { @@ -245,20 +266,28 @@ 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 { @@ -268,7 +297,9 @@ 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); } } } @@ -291,8 +322,12 @@ 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/config.dart b/lib/config/config.dart index 55c65680..0511f1cd 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 9c40e638..a4eb5dbc 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -647,7 +647,7 @@ const Map> localizedValues = { "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف طلب جديد"}, - "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة جديدة"}, + "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة جديدة"}, "notePending": {"en": "Pending", "ar": "قيد الانتظار"}, "noteCanceled": {"en": "Canceled", "ar": "ألغي"}, "noteVerified": {"en": "Verified", "ar": "تم التحقق"}, diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index c6ec4fdd..abb3ddd6 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -5,14 +5,14 @@ class SizeConfig { static double _blockWidth = 0; static double _blockHeight = 0; - 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 double realScreenWidth; + static double realScreenHeight; + static double screenWidth; + static double screenHeight; + static double textMultiplier; + static double imageSizeMultiplier; + static double heightMultiplier; + static double widthMultiplier; static bool isPortrait = true; static bool isMobilePortrait = false; @@ -25,7 +25,6 @@ class SizeConfig { void init(BoxConstraints constraints, Orientation orientation) { realScreenHeight = constraints.maxHeight; realScreenWidth = constraints.maxWidth; - if (constraints.maxWidth <= MAX_SMALL_SCREEN) { isMobile = true; } @@ -48,17 +47,21 @@ 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; heightMultiplier = _blockHeight; @@ -76,7 +79,7 @@ class SizeConfig { } - static getTextMultiplierBasedOnWidth({double? width}) { + static getTextMultiplierBasedOnWidth({double width}) { // TODO handel LandScape case if (width != null) { return width / 100; @@ -84,7 +87,7 @@ class SizeConfig { return widthMultiplier; } -static getWidthMultiplier({double? width}) { + static getWidthMultiplier({double width}) { // TODO handel LandScape case if (width != null) { return width / 100; @@ -92,11 +95,12 @@ static getWidthMultiplier({double? width}) { return widthMultiplier; } - static getHeightMultiplier({double? height}) { + static getHeightMultiplier({double height}) { // TODO handel LandScape case if (height != null) { return height / 100; } return heightMultiplier; } + } diff --git a/lib/core/insurance_approval_request_model.dart b/lib/core/insurance_approval_request_model.dart index 11f7804e..02f71ecb 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 16202cac..4b95c1b0 100644 --- a/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart +++ b/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart @@ -1,56 +1,56 @@ 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; + 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; + bool isDentalAllowedBackend; + int deviceTypeID; + String dOB; + int isHijri; + String healthId; CheckActivationCodeModel( {this.patientMobileNumber, - this.mobileNo, - this.projectOutSA, - this.loginType, - this.zipCode, - this.isRegister, - this.logInTokenID, - this.searchType, - this.patientID, - this.nationalID, - this.patientIdentificationID, - this.forRegisteration, - this.activationCode, - this.versionID, - this.channel, - this.languageID, - 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.forRegisteration, + this.activationCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); CheckActivationCodeModel.fromJson(Map json) { patientMobileNumber = json['PatientMobileNumber']; diff --git a/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart index 89e1bfd6..3465cf8d 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 1f00fba0..f05131ef 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 a1a25e17..158bd1e2 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']; @@ -233,9 +233,9 @@ class GetPatientInfoResponseModel { occupation = json['Occupation']; pCDTransactionDataResultList = json['PCDTransactionDataResultList']; pCDGetVidaPatientForManualVerificationList = - json['PCD_GetVidaPatientForManualVerificationList']; + json['PCD_GetVidaPatientForManualVerificationList']; pCDNHICHMGPatientDetailsMatchCalulationList = - json['PCD_NHIC_HMG_PatientDetailsMatchCalulationList']; + json['PCD_NHIC_HMG_PatientDetailsMatchCalulationList']; pCDReturnValue = json['PCD_ReturnValue']; patientStatus = json['PatientStatus']; placeofBirth = json['PlaceofBirth']; @@ -248,11 +248,11 @@ class GetPatientInfoResponseModel { thirdNameAr = json['ThirdNameAr']; thirdNameEn = json['ThirdNameEn']; yakeenVidaPatientDataStatisticsByPatientIdList = - json['YakeenVidaPatientDataStatisticsByPatientIdList']; + json['YakeenVidaPatientDataStatisticsByPatientIdList']; yakeenVidaPatientDataStatisticsList = - json['YakeenVidaPatientDataStatisticsList']; + json['YakeenVidaPatientDataStatisticsList']; yakeenVidaPatientDataStatisticsPrefferedList = - json['YakeenVidaPatientDataStatisticsPrefferedList']; + json['YakeenVidaPatientDataStatisticsPrefferedList']; accessToken = json['accessToken']; categoryCode = json['categoryCode']; categoryNameAr = json['categoryNameAr']; diff --git a/lib/core/model/PatientRegistration/PatientRegistrationModel.dart b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart index a73ecb0b..83ff53d7 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 af08661f..8244a95f 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 881f318a..c47a813a 100644 --- a/lib/core/model/Prescriptions/Prescriptions.dart +++ b/lib/core/model/Prescriptions/Prescriptions.dart @@ -1,40 +1,40 @@ 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, @@ -69,10 +69,9 @@ class Prescriptions { this.nationalityFlagURL, this.noOfPatientsRate, this.qR, - this.speciality, - this.isLiveCareAppointment}); + this.speciality,this.isLiveCareAppointment}); - Prescriptions.fromJson(Map json) { + Prescriptions.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -106,11 +105,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; @@ -150,10 +149,10 @@ class Prescriptions { } class PrescriptionsList { - String? filterName = ""; - List prescriptionsList =[]; + String filterName = ""; + List prescriptionsList = List(); - PrescriptionsList({this.filterName, required Prescriptions prescriptions}) { + PrescriptionsList({this.filterName, 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 4644131e..8ba07f2a 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 71c1305a..7c906643 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 3f67e659..f6e88bf7 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 c6b013d3..3adaef7e 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; - 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; + 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; 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 9609a0df..06a524ed 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 =[]; + prescriptionRequestModel = new List(); 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 f32556bc..c66bc8a4 100644 --- a/lib/core/model/Prescriptions/prescription_in_patient.dart +++ b/lib/core/model/Prescriptions/prescription_in_patient.dart @@ -1,50 +1,50 @@ 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( diff --git a/lib/core/model/Prescriptions/prescription_model.dart b/lib/core/model/Prescriptions/prescription_model.dart index 89959394..92574c66 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 = []; + entityList = new List(); 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; diff --git a/lib/core/model/Prescriptions/prescription_report.dart b/lib/core/model/Prescriptions/prescription_report.dart index 4b5d574a..006a6fad 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 96f811de..01b9a5c9 100644 --- a/lib/core/model/Prescriptions/prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/prescription_report_enh.dart @@ -1,38 +1,37 @@ class PrescriptionReportEnh { - String ? address; + String address; dynamic appodynamicmentNo; - int ? appointmentNo; - String ? clinic; + String clinic; dynamic companyName; - int ? days; - String ? doctorName; - int ? doseDailyQuantity; - String ? frequency; - int ? frequencyNumber; + dynamic days; + String doctorName; + dynamic doseDailyQuantity; + String frequency; + dynamic 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 1177431d..a45878d8 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 afe38aa1..f51420ec 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; @@ -34,35 +34,35 @@ class PrescriptionsOrder { PrescriptionsOrder( {this.iD, - this.patientID, - this.patientOutSA, - this.isOutPatient, - this.projectID, - this.nearestProjectID, - this.longitude, - this.latitude, - this.appointmentNo, - this.dischargeID, - this.lineItemNo, - this.status, - this.description, - this.descriptionN, - this.createdOn, - this.serviceID, - this.createdBy, - this.editedOn, - this.editedBy, - this.channel, - this.clientRequestID, - this.returnedToQueue, - this.pickupDateTime, - this.pickupLocationName, - this.dropoffLocationName, - this.realRRTHaveTransactions, - this.nearestProjectDescription, - this.nearestProjectDescriptionN, - this.projectDescription, - this.projectDescriptionN}); + this.patientID, + this.patientOutSA, + this.isOutPatient, + this.projectID, + this.nearestProjectID, + this.longitude, + this.latitude, + this.appointmentNo, + this.dischargeID, + this.lineItemNo, + this.status, + this.description, + this.descriptionN, + this.createdOn, + this.serviceID, + this.createdBy, + this.editedOn, + this.editedBy, + this.channel, + this.clientRequestID, + this.returnedToQueue, + this.pickupDateTime, + this.pickupLocationName, + this.dropoffLocationName, + this.realRRTHaveTransactions, + this.nearestProjectDescription, + this.nearestProjectDescriptionN, + this.projectDescription, + this.projectDescriptionN}); PrescriptionsOrder.fromJson(Map json) { iD = json['ID']; 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 7b453b9b..739bb838 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 b7ade7d4..c8323740 100644 --- a/lib/core/model/Prescriptions/request_prescription_report.dart +++ b/lib/core/model/Prescriptions/request_prescription_report.dart @@ -1,46 +1,46 @@ 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, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.appointmentNo, - this.setupID, - this.episodeID, - this.clinicID, - this.projectID, - this.dischargeNo}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + 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 fc048a95..4905fc2a 100644 --- a/lib/core/model/Prescriptions/request_prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/request_prescription_report_enh.dart @@ -1,46 +1,45 @@ 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, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.appointmentNo, - this.setupID, - this.episodeID, - this.clinicID, - this.projectID, - this.dischargeNo}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + 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 94fe46cc..1ab5a990 100644 --- a/lib/core/model/admissionRequest/admission-request.dart +++ b/lib/core/model/admissionRequest/admission-request.dart @@ -1,45 +1,45 @@ class AdmissionRequest { - 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; + 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; AdmissionRequest( {this.patientMRN, @@ -110,7 +110,8 @@ 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']; @@ -122,17 +123,17 @@ class AdmissionRequest { pastMedicalHistory = json['pastMedicalHistory']; pastSurgicalHistory = json['pastSurgicalHistory']; if (json['admissionRequestDiagnoses'] != null) { - admissionRequestDiagnoses = []; + admissionRequestDiagnoses = new List(); json['admissionRequestDiagnoses'].forEach((v) { - admissionRequestDiagnoses!.add(v); + admissionRequestDiagnoses.add(v); // admissionRequestDiagnoses // .add(new AdmissionRequestDiagnoses.fromJson(v)); }); } if (json['admissionRequestProcedures'] != null) { - admissionRequestProcedures = []; + admissionRequestProcedures = new List(); json['admissionRequestProcedures'].forEach((v) { - admissionRequestProcedures!.add(v); + admissionRequestProcedures.add(v); // admissionRequestProcedures // .add(new AdmissionRequestProcedures.fromJson(v)); }); @@ -163,13 +164,16 @@ 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; @@ -185,7 +189,8 @@ 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 e5a03264..05d34645 100644 --- a/lib/core/model/admissionRequest/clinic-model.dart +++ b/lib/core/model/admissionRequest/clinic-model.dart @@ -1,16 +1,16 @@ class Clinic { - late int? clinicGroupID; - late String? clinicGroupName; - late int? clinicID; - late String? clinicNameArabic; - late String? clinicNameEnglish; + int clinicGroupID; + String clinicGroupName; + int clinicID; + String clinicNameArabic; + 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,4 +29,5 @@ 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 8f7b9fe5..606758d3 100644 --- a/lib/core/model/admissionRequest/ward-model.dart +++ b/lib/core/model/admissionRequest/ward-model.dart @@ -1,9 +1,9 @@ class WardModel{ - late String ? description; - late String ? descriptionN; - late int ? floorID; - late bool ? isActive; + String description; + String descriptionN; + int floorID; + 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 13d64f6a..85d7f1d3 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 { - late int? channel; - late int? loginDoctorID; - late int? languageID; - late double? versionID; - late int? memberID; - late int? facilityId; - late String? generalid; - late String? otpSendType; + int channel; + int languageID; + int loginDoctorID; + double versionID; + int memberID; + int facilityId; + String generalid; + 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 51fb5ab3..dae31f8c 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,19 +1,18 @@ class ActivationCodeForVerificationScreenModel { - 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; - + 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; 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 3fa2f69b..e39518e6 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 { - late String? authenticationTokenID; - late List? listDoctorsClinic; - List? listDoctorProfile; - late MemberInformation? memberInformation; - String? vidaAuthTokenID; - String? vidaRefreshTokenID; + String authenticationTokenID; + List listDoctorsClinic; + List listDoctorProfile; + 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 = []; + listDoctorsClinic = new List(); json['List_DoctorsClinic'].forEach((v) { - listDoctorsClinic!.add(new ListDoctorsClinic.fromJson(v)); + listDoctorsClinic.add(new ListDoctorsClinic.fromJson(v)); }); } if (json['List_DoctorProfile'] != null) { - listDoctorProfile = []; + listDoctorProfile = new List(); 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 { - late dynamic setupID; - late int? projectID; - late int? doctorID; - late int? clinicID; - late bool? isActive; - late String? clinicName; + Null setupID; + int projectID; + int doctorID; + int clinicID; + bool isActive; + String clinicName; ListDoctorsClinic( {this.setupID, @@ -97,15 +97,15 @@ class ListDoctorsClinic { } class MemberInformation { - 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; + List clinics; + int doctorId; + String email; + int employeeId; + int memberId; + Null memberName; + Null memberNameArabic; + String preferredLanguage; + List roles; MemberInformation( {this.clinics, @@ -120,9 +120,9 @@ class MemberInformation { MemberInformation.fromJson(Map json) { if (json['clinics'] != null) { - clinics = []; + clinics = new List(); 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 = []; + roles = new List(); 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 { - late bool? defaultClinic; - late int? id; - late String? name; + bool defaultClinic; + int id; + String name; Clinics({this.defaultClinic, this.id, this.name}); @@ -182,8 +182,8 @@ class Clinics { } class Roles { - late String? name; - late int? roleId; + String name; + 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 fee596fe..94502a71 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 95ff1e74..eb37e736 100644 --- a/lib/core/model/auth/imei_details.dart +++ b/lib/core/model/auth/imei_details.dart @@ -1,34 +1,33 @@ class GetIMEIDetailsModel { - 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; - + 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; 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 5e54b127..25e22b7a 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 { - 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; + 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; 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 c834580b..117060e4 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 { - 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; + int doctorID; + List listMemberInformation; + String logInTokenID; + String mobileNumber; + Null sELECTDeviceIMEIbyIMEIList; + int userID; + String zipCode; + bool isActiveCode; + bool isSMSSent; NewLoginInformationModel( {this.doctorID, @@ -23,9 +23,9 @@ class NewLoginInformationModel { NewLoginInformationModel.fromJson(Map json) { doctorID = json['DoctorID']; if (json['List_MemberInformation'] != null) { - listMemberInformation = []; + listMemberInformation = new List(); 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 { - 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; + Null setupID; + int memberID; + String memberName; + Null memberNameN; + String preferredLang; + String pIN; + String saltHash; + int referenceID; + int employeeID; + int roleID; + 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 db971954..ceaf4c65 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 24e75bb7..80281854 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 8a9cfbe1..26641e61 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 34a8e997..7fad3106 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 1e5dd8fd..fa2c1ca2 100644 --- a/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart @@ -1,18 +1,18 @@ 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, - this.admissionNo, - this.dateChart, - this.resultValue, - this.createdBy, - this.createdOn}); + this.admissionNo, + this.dateChart, + this.resultValue, + this.createdBy, + this.createdOn}); GetDiabeticChartValuesResponseModel.fromJson(Map json) { resultType = json['ResultType']; diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart index bea61fc9..310cfb50 100644 --- a/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart @@ -1,16 +1,16 @@ 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, - this.admissionNo, - this.setupID, - this.patientType, - this.patientTypeID}); + this.admissionNo, + this.setupID, + this.patientType, + this.patientTypeID}); GetDiagnosisForInPatientRequestModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart index 491ac591..1ec48964 100644 --- a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart @@ -1,27 +1,26 @@ 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, - this.diagnosisTypeID, - this.conditionID, - this.complexDiagnosis, - this.asciiDesc, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, - this.createdByName}); + this.diagnosisTypeID, + this.conditionID, + this.complexDiagnosis, + this.asciiDesc, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, this.createdByName}); GetDiagnosisForInPatientResponseModel.fromJson(Map json) { iCDCode10ID = json['ICDCode10ID']; diff --git a/lib/core/model/hospitals/get_hospitals_request_model.dart b/lib/core/model/hospitals/get_hospitals_request_model.dart index 550f8ca8..8a5f1bc1 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 1109b58b..edbc3fe5 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 f2c89cfb..b09807d6 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, @@ -33,7 +33,7 @@ class HospitalsModel { this.projectOutSA, this.usingInDoctorApp}); - HospitalsModel.fromJson(Map json) { + HospitalsModel.fromJson(Map json) { desciption = json['Desciption']; desciptionN = json['DesciptionN']; iD = json['ID']; @@ -52,8 +52,8 @@ class HospitalsModel { usingInDoctorApp = json['UsingInDoctorApp']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Desciption'] = this.desciption; data['DesciptionN'] = this.desciptionN; data['ID'] = this.iD; diff --git a/lib/core/model/insurance/insurance_approval.dart b/lib/core/model/insurance/insurance_approval.dart index 69e88a2e..a3717c42 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 =[]; + apporvalDetails = new List(); 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 722d34c7..f185a8bf 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 = []; + apporvalDetails = new List(); 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 { - 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; + 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; ApporvalDetails( {this.setupID, diff --git a/lib/core/model/labs/LabOrderResult.dart b/lib/core/model/labs/LabOrderResult.dart index 7fc4432f..ecb4ae65 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 4d4221e1..7c4221ca 100644 --- a/lib/core/model/labs/LabResultHistory.dart +++ b/lib/core/model/labs/LabResultHistory.dart @@ -1,54 +1,54 @@ 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, - this.femaleInterpretativeData, - this.gender, - this.isCertificateAllowed, - this.lineItemNo, - this.maleInterpretativeData, - this.notes, - this.orderLineItemNo, - this.orderNo, - this.packageID, - this.patientID, - this.projectID, - this.referanceRange, - this.resultValue, - this.resultValueBasedLineItemNo, - this.resultValueFlag, - this.sampleCollectedOn, - this.sampleReceivedOn, - this.setupID, - this.superVerifiedOn, - this.testCode, - this.uOM, - this.verifiedOn, - this.verifiedOnDateTime}); + this.femaleInterpretativeData, + this.gender, + this.isCertificateAllowed, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.orderLineItemNo, + this.orderNo, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.resultValueBasedLineItemNo, + this.resultValueFlag, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); LabResultHistory.fromJson(Map json) { description = json['Description']; @@ -105,4 +105,4 @@ class LabResultHistory { data['VerifiedOnDateTime'] = this.verifiedOnDateTime; return data; } -} +} \ No newline at end of file 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 a177e16e..ffdc5ee5 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 950f0e96..d5df1405 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 0cc48aef..ee9f981d 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? sampleCollectedOn; - String? sampleReceivedOn; - String? setupID; - String? maxValue; - String? minValue; + String notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String maxValue; + String minValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; 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,17 +110,18 @@ class LabResult { } else { return 0; } - } catch (e) { + }catch (e){ return 0; } + } } class LabResultList { String filterName = ""; - List patientLabResultList = []; + List patientLabResultList = List(); - LabResultList({required this.filterName, required LabResult lab}) { + LabResultList({this.filterName, 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 08f81f16..af60f86f 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; - 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; + 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; PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -149,10 +149,10 @@ class PatientLabOrders { class PatientLabOrdersList { String filterName = ""; - List patientLabOrdersList = []; + List patientLabOrdersList = List(); PatientLabOrdersList( - {required this.filterName, required PatientLabOrders patientDoctorAppointment}) { + {this.filterName, 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 f86dd56f..2fbcb832 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; - dynamic resultDataTxt; + String invoiceNo; + String moduleID; + String resultData; + String resultDataHTML; + Null 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 4f746277..ce9263ef 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 100f92b5..b48cf0e1 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 66f5e2a0..118da906 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -1,56 +1,56 @@ 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, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.to, - this.dateofBirth, - this.patientIditificationNum, - this.patientMobileNumber, - this.patientName, - this.setupID, - this.projectName, - this.clinicName, - this.doctorName, - this.projectID, - this.invoiceNo, - this.orderDate}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.to, + this.dateofBirth, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.setupID, + this.projectName, + this.clinicName, + this.doctorName, + this.projectID, + this.invoiceNo, + this.orderDate}); RequestSendLabReportEmail.fromJson(Map json) { versionID = json['VersionID']; diff --git a/lib/core/model/live_care/AlternativeServicesList.dart b/lib/core/model/live_care/AlternativeServicesList.dart index 28d70805..11f27b95 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 { - late List _alternativeServicesList; + List _alternativeServicesList; getServicesList(){ return _alternativeServicesList; diff --git a/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart b/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart index a99c9649..dc1f25b3 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 f96016d7..1d63e885 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,12 +1,11 @@ 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}); + AddPatientToDoctorListRequestModel({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa}); AddPatientToDoctorListRequestModel.fromJson(Map json) { vCID = json['VC_ID']; 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 90ea0ff1..e14d4223 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 53737499..deebb2af 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 = []; + entityList = new List(); 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 = []; + timelines = new List(); 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 = []; + timeLineEvents = new List(); 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 = []; + consulations = new List(); 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 = []; + lstAssessments = new List(); json['lstAssessments'].forEach((v) { - lstAssessments!.add(new LstAssessments.fromJson(v)); + lstAssessments.add(new LstAssessments.fromJson(v)); }); } if (json['lstCheifComplaint'] != null) { - lstCheifComplaint = []; + lstCheifComplaint = new List(); json['lstCheifComplaint'].forEach((v) { - lstCheifComplaint!.add(new LstCheifComplaint.fromJson(v)); + lstCheifComplaint.add(new LstCheifComplaint.fromJson(v)); }); } if (json['lstPhysicalExam'] != null) { - lstPhysicalExam = []; + lstPhysicalExam = new List(); json['lstPhysicalExam'].forEach((v) { - lstPhysicalExam!.add(new LstPhysicalExam.fromJson(v)); + lstPhysicalExam.add(new LstPhysicalExam.fromJson(v)); }); } if (json['lstProcedure'] != null) { - lstProcedure = []; + lstProcedure = new List(); json['lstProcedure'].forEach((v) { - lstProcedure!.add(new LstProcedure.fromJson(v)); + lstProcedure.add(new LstProcedure.fromJson(v)); }); } if (json['lstMedicalHistory'] != null) { - lstMedicalHistory = []; + lstMedicalHistory = new List(); 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 01a2abf2..8703141a 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 5d1709ca..ce076705 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 b7fd7aa5..4335053c 100644 --- a/lib/core/model/note/GetNursingProgressNoteRequestModel.dart +++ b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart @@ -1,18 +1,14 @@ 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 aaf9c7ab..fb7fbcec 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 713de924..797f9b6d 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; - dynamic 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; + Null 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 a3189e39..20fd4b86 100644 --- a/lib/core/model/note/update_note_model.dart +++ b/lib/core/model/note/update_note_model.dart @@ -1,40 +1,40 @@ 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, - this.createdBy, - this.admissionNo, - this.lineItemNo, - this.notes, - this.verifiedNote, - this.cancelledNote, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA, - this.patientTypeID}); + this.createdBy, + this.admissionNo, + this.lineItemNo, + this.notes, + this.verifiedNote, + this.cancelledNote, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.patientTypeID}); UpdateNoteReqModel.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/core/model/patient_muse/PatientMuseResultsModel.dart b/lib/core/model/patient_muse/PatientMuseResultsModel.dart index 970d48cb..401fd1a7 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 c2c1bab8..dcb9b31c 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 e14c7768..b3e8ae9c 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 abd6a2b3..698178e3 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, @@ -56,7 +56,7 @@ class ProcedureTempleteRequestModel { this.vidaRefreshTokenID, this.deviceTypeID}); - ProcedureTempleteRequestModel.fromJson(Map json) { + ProcedureTempleteRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; firstName = json['FirstName']; middleName = json['MiddleName']; diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart index e4df9963..9e6f847f 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 = []; + entityList = new List(); 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,20 +29,20 @@ 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, @@ -60,7 +60,7 @@ class EntityList { 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 5b0d4695..c3c7718f 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 = []; + entityList = new List(); 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,31 +29,31 @@ 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, @@ -82,7 +82,7 @@ class EntityList { 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 dbfb75cd..5178ab14 100644 --- a/lib/core/model/procedure/get_ordered_procedure_request_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_request_model.dart @@ -1,10 +1,9 @@ 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 516c8e42..5c83b49b 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 = []; + entityList = new List(); 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,18 +28,18 @@ 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, @@ -55,7 +55,7 @@ class EntityList { 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 832fbadb..6202a520 100644 --- a/lib/core/model/procedure/get_procedure_req_model.dart +++ b/lib/core/model/procedure/get_procedure_req_model.dart @@ -1,11 +1,11 @@ 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, diff --git a/lib/core/model/procedure/post_procedure_req_model.dart b/lib/core/model/procedure/post_procedure_req_model.dart index 44ef9775..b12563f8 100644 --- a/lib/core/model/procedure/post_procedure_req_model.dart +++ b/lib/core/model/procedure/post_procedure_req_model.dart @@ -1,11 +1,11 @@ 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, @@ -19,9 +19,9 @@ class PostProcedureReqModel { appointmentNo = json['AppointmentNo']; episodeID = json['EpisodeID']; if (json['Procedures'] != null) { - procedures = []; + procedures = new List(); 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 = []; + controls = new List(); 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 50048080..849e84e5 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 = []; + entityList = new List(); 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 38a05693..3b12d646 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 13316fa8..1fc797ae 100644 --- a/lib/core/model/procedure/procedure_template_details_model.dart +++ b/lib/core/model/procedure/procedure_template_details_model.dart @@ -1,29 +1,29 @@ 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, @@ -52,7 +52,7 @@ class ProcedureTempleteDetailsModel { 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 =[]; - String? templateName; - int? templateId; + List procedureTemplate = List(); + String templateName; + int templateId; ProcedureTempleteDetailsModelList( - {this.templateName, this.templateId, required ProcedureTempleteDetailsModel template}) { + {this.templateName, this.templateId, 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 c5504cdd..6df6fc73 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, @@ -58,7 +58,7 @@ class ProcedureTempleteDetailsRequestModel { this.vidaRefreshTokenID, this.deviceTypeID}); - ProcedureTempleteDetailsRequestModel.fromJson(Map json) { + ProcedureTempleteDetailsRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; firstName = json['FirstName']; templateID = json['TemplateID']; diff --git a/lib/core/model/procedure/procedure_valadate_model.dart b/lib/core/model/procedure/procedure_valadate_model.dart index 431d369a..3a3e23cf 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 = []; + entityList = new List(); 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 581ff41f..0b872b93 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 a6b92d16..aee39879 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 = []; + controls = new List(); 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 4c16151c..e09f269a 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,10 +39,10 @@ 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, @@ -186,9 +186,9 @@ class FinalRadiology { class FinalRadiologyList { dynamic filterName = ""; - List finalRadiologyList = []; + List finalRadiologyList = List(); - FinalRadiologyList({this.filterName, required FinalRadiology finalRadiology}) { + FinalRadiologyList({this.filterName, 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 b42bc723..9e3458d5 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, @@ -42,7 +42,7 @@ class RequestPatientRadOrdersDetails { this.patientTypeID, this.patientType}); - RequestPatientRadOrdersDetails.fromJson(Map json) { + RequestPatientRadOrdersDetails.fromJson(Map json) { projectID = json['ProjectID']; orderNo = json['OrderNo']; invoiceNo = json['InvoiceNo']; @@ -65,8 +65,8 @@ class RequestPatientRadOrdersDetails { patientType = json['PatientType']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.projectID; data['OrderNo'] = this.orderNo; data['InvoiceNo'] = this.invoiceNo; 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 3b9e961a..6d68653d 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 d104ccae..dff63bfc 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 6f68a6d7..4f00f455 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -2,75 +2,75 @@ 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, @@ -113,38 +113,29 @@ class MyReferralPatientModel { 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.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']; @@ -228,10 +219,11 @@ 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; @@ -306,6 +298,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 885653a1..08b98a99 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 0e0bc161..b3ad1f03 100644 --- a/lib/core/model/referral/ReferralRequest.dart +++ b/lib/core/model/referral/ReferralRequest.dart @@ -1,56 +1,56 @@ 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, - this.referralClinic, - this.referralDoctor, - this.createdBy, - this.editedBy, - this.patientID, - this.patientTypeID, - this.referringClinic, - this.referringDoctor, - this.projectID, - this.admissionNo, - this.referringDoctorRemarks, - this.priority, - this.frequency, - this.extension, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.referralClinic, + this.referralDoctor, + this.createdBy, + this.editedBy, + this.patientID, + this.patientTypeID, + this.referringClinic, + this.referringDoctor, + this.projectID, + this.admissionNo, + this.referringDoctorRemarks, + this.priority, + this.frequency, + this.extension, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); - ReferralRequest.fromJson(Map json) { + ReferralRequest.fromJson(Map json) { roomID = json['RoomID']; referralClinic = json['ReferralClinic']; referralDoctor = json['ReferralDoctor']; diff --git a/lib/core/model/referral/add_referred_remarks_request.dart b/lib/core/model/referral/add_referred_remarks_request.dart index 5b7edbc6..14089513 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 24079b5e..a42a8b47 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 a95988db..0a93a4f1 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 = []; + frequencies = new List(); json['frequencies'].forEach((v) { - frequencies!.add(new Frequencies.fromJson(v)); + frequencies.add(new Frequencies.fromJson(v)); }); } if (json['routes'] != null) { - routes = []; + routes = new List(); json['routes'].forEach((v) { - routes!.add(new Routes.fromJson(v)); + routes.add(new Routes.fromJson(v)); }); } if (json['strengths'] != null) { - strengths = []; + strengths = new List(); 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 7ec3e21e..7460044b 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 aa7739a2..396526c1 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 = []; + entityList = new List(); 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 8c725c86..b64e7d18 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 8087481c..26bb76bd 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,16 +1,12 @@ 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 cca30c3d..1e79833c 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; @@ -84,7 +84,7 @@ class SickLeavePatientModel { this.remarks, this.status}); - SickLeavePatientModel.fromJson(Map json) { + SickLeavePatientModel.fromJson(Map json) { setupID = json['SetupID']; isExtendedLeave = json['isExtendedLeave']; noOfDays = json['noOfDays']; @@ -121,14 +121,14 @@ class SickLeavePatientModel { patientName = json['PatientName']; projectName = json['ProjectName']; qR = json['QR']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); strRequestDate = json['StrRequestDate']; startDate = json['StartDate'] ?? json['startDate']; endDate = json['EndDate']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['status'] = this.status; data['isExtendedLeave'] = this.isExtendedLeave; 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 9987c4ff..69b18f41 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, @@ -28,7 +28,7 @@ class SickLeavePatientRequestModel { this.sessionID, this.patientMRN}); - SickLeavePatientRequestModel.fromJson(Map json) { + SickLeavePatientRequestModel.fromJson(Map json) { versionID = json['VersionID']; patientMRN = json['PatientMRN']; channel = json['Channel']; diff --git a/lib/core/service/AnalyticsService.dart b/lib/core/service/AnalyticsService.dart index b5ffb318..0ad669ab 100644 --- a/lib/core/service/AnalyticsService.dart +++ b/lib/core/service/AnalyticsService.dart @@ -7,7 +7,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 182adb6c..5690c01e 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,{required Object arguments}) { - return navigatorKey.currentState!.pushNamed(routeName,arguments: arguments); + Future navigateTo(String routeName,{Object arguments}) { + return navigatorKey.currentState.pushNamed(routeName,arguments: arguments); } - Future pushReplacementNamed(String routeName,{required Object arguments}) { - return navigatorKey.currentState!.pushReplacementNamed(routeName,arguments: arguments); + Future pushReplacementNamed(String routeName,{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 5f29325a..236bcd42 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 { - late GetPatientInfoResponseModel getPatientInfoResponseModel; - late String logInTokenID; + GetPatientInfoResponseModel getPatientInfoResponseModel; + String logInTokenID; checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { @@ -39,12 +39,13 @@ class PatientRegistrationService extends BaseService { } sendActivationCodeByOTPNotificationType( - { - required int otpType, - required PatientRegistrationViewModel model, - required CheckPatientForRegistrationModel + {SendActivationCodeByOTPNotificationTypeForRegistrationModel + registrationModel, + int otpType, + PatientRegistrationViewModel model, + CheckPatientForRegistrationModel checkPatientForRegistrationModel}) async { - SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel = + registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel( oTPSendType: otpType, patientIdentificationID: checkPatientForRegistrationModel diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 697b78e3..31cc2cd6 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{ - - late StartCallRes startCallRes; - late PatiantInformtion patient; - LiveCarePatientServices _liveCarePatientServices = locator(); +class VideoCallService extends BaseService { + StartCallRes startCallRes; + 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 @@ -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 7771bea6..49e89881 100644 --- a/lib/core/service/authentication_service.dart +++ b/lib/core/service/authentication_service.dart @@ -17,29 +17,28 @@ class AuthenticationService extends BaseService { List get dashboardItemsList => _imeiDetails; NewLoginInformationModel _loginInfo = NewLoginInformationModel(); NewLoginInformationModel get loginInfo => _loginInfo; - SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = - SendActivationCodeForDoctorAppResponseModel(); + SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel(); - SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => - _activationCodeVerificationScreenRes; + SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _activationCodeVerificationScreenRes; - SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = - SendActivationCodeForDoctorAppResponseModel(); + SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel(); SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes; - CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = - CheckActivationCodeForDoctorAppResponseModel(); + CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); - CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => - _checkActivationCodeForDoctorAppRes; + CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _checkActivationCodeForDoctorAppRes; Map _insertDeviceImeiRes = {}; List _doctorProfilesList = []; List get doctorProfilesList => _doctorProfilesList; + + + Future selectDeviceImei(imei) async { try { - await baseAppClient.post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SELECT_DEVICE_IMEI, + onSuccess: (dynamic response, int statusCode) { _imeiDetails = []; response['List_DoctorDeviceDetails'].forEach((v) { _imeiDetails.add(GetIMEIDetailsModel.fromJson(v)); @@ -50,7 +49,7 @@ class AuthenticationService extends BaseService { }, body: {"IMEI": imei, "TokenID": "@dm!n"}); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } } @@ -58,7 +57,8 @@ class AuthenticationService extends BaseService { hasError = false; _loginInfo = NewLoginInformationModel(); try { - await baseAppClient.post(LOGIN_URL, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(LOGIN_URL, + onSuccess: (dynamic response, int statusCode) { _loginInfo = NewLoginInformationModel.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; @@ -66,8 +66,9 @@ class AuthenticationService extends BaseService { }, body: userInfo.toJson()); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } + } Future sendActivationCodeVerificationScreen(ActivationCodeForVerificationScreenModel activationCodeModel) async { @@ -76,81 +77,88 @@ class AuthenticationService extends BaseService { try { await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN, onSuccess: (dynamic response, int statusCode) { - _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: activationCodeModel.toJson()); + _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } + } - Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel) async { + Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel)async { hasError = false; _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel(); try { - await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { - _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: activationCodeModel.toJson()); + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, + onSuccess: (dynamic response, int statusCode) { + _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } } - Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel) async { + Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel)async { hasError = false; _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); try { - await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { - _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: checkActivationCodeRequestModel.toJson()); + await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, + onSuccess: (dynamic response, int statusCode) { + _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: checkActivationCodeRequestModel.toJson()); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } + } - Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel) async { + + Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel)async { hasError = false; - // insertIMEIDetailsModel.tokenID = "@dm!n"; + // insertIMEIDetailsModel.tokenID = "@dm!n"; _insertDeviceImeiRes = {}; try { - await baseAppClient.post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { - _insertDeviceImeiRes = response; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: insertIMEIDetailsModel.toJson()); + await baseAppClient.post(INSERT_DEVICE_IMEI, + onSuccess: (dynamic response, int statusCode) { + _insertDeviceImeiRes = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: insertIMEIDetailsModel.toJson()); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } } - Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel) async { + Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel)async { hasError = false; try { - await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) { - _doctorProfilesList.clear(); - response['DoctorProfileList'].forEach((v) { - _doctorProfilesList.add(DoctorProfileModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: profileReqModel.toJson()); + await baseAppClient.post(GET_DOC_PROFILES, + onSuccess: (dynamic response, int statusCode) { + _doctorProfilesList.clear(); + response['DoctorProfileList'].forEach((v) { + _doctorProfilesList.add(DoctorProfileModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: profileReqModel.toJson()); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } } } diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 05d1d1ab..58526da7 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,16 +1,15 @@ 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 = []; @@ -19,20 +18,24 @@ 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); - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile!; + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } } } if (doctorProfile == null) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile!; + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } } return null; } else { @@ -40,38 +43,5 @@ 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 5516923a..ad3ec887 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 a06a8974..b21768f9 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 inPatientList = []; + List myInPatientList = List(); + List inPatientList = List(); 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 efa24209..f8a7579d 100644 --- a/lib/core/service/hospitals/hospitals_service.dart +++ b/lib/core/service/hospitals/hospitals_service.dart @@ -4,7 +4,8 @@ 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 hospitals =List(); Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { hasError = false; diff --git a/lib/core/service/patient/DischargedPatientService.dart b/lib/core/service/patient/DischargedPatientService.dart index 6566a57d..2b353016 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 myDischargedPatients = List(); - List myDischargeReferralPatients = []; + List myDischargeReferralPatients = List(); 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,7 +28,8 @@ 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)); @@ -44,7 +45,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"; @@ -60,7 +61,8 @@ 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 b390556d..10af0ea2 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -30,7 +30,8 @@ class LiveCarePatientServices extends BaseService { var transferToAdminResponse = {}; var isLoginResponse = {}; - late StartCallRes _startCallRes; + StartCallRes _startCallRes; + StartCallRes get startCallRes => _startCallRes; Future getPendingPatientERForDoctorApp( @@ -47,7 +48,7 @@ class LiveCarePatientServices extends BaseService { /// add new items. localPatientList.forEach((element) { - if ((_patientList.singleWhere((it) => it.patientId == element.patientId)) == null) { + if ((_patientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { _patientList.add(element); } }); @@ -55,7 +56,7 @@ class LiveCarePatientServices extends BaseService { /// remove items. List removedPatientList = []; _patientList.forEach((element) { - if ((localPatientList.singleWhere((it) => it.patientId == element.patientId)) == null) { + if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { removedPatientList.add(element); } }); @@ -99,10 +100,7 @@ class LiveCarePatientServices extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: { - "VC_ID": vcID, - "AltServiceList": altServiceList,"generalid": GENERAL_ID - }, isLiveCare: _isLive); + }, body: {"VC_ID": vcID, "AltServiceList": altServiceList, "generalid": GENERAL_ID}, isLiveCare: _isLive); } Future transferToAdmin(int vcID, String notes) async { @@ -124,15 +122,15 @@ class LiveCarePatientServices extends BaseService { await baseAppClient.post(SEND_SMS_INSTRUCTIONS, onSuccess: (dynamic response, int statusCode) { transferToAdminResponse = response; }, onFailure: (String error, int statusCode) { - hasError =true; + hasError = true; super.error = error; }, 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) { @@ -155,12 +153,12 @@ class LiveCarePatientServices extends BaseService { }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive); } - Future addPatientToDoctorList({required int vcID}) async { + Future addPatientToDoctorList({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; @@ -173,11 +171,11 @@ class LiveCarePatientServices extends BaseService { }, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive); } - Future removePatientFromDoctorList({required int vcID}) async { + Future removePatientFromDoctorList({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 f1185786..35729def 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 myReferralPatients = List(); 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 893b6260..c34de9e0 100644 --- a/lib/core/service/patient/PatientMuseService.dart +++ b/lib/core/service/patient/PatientMuseService.dart @@ -3,15 +3,16 @@ 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 patientMuseResultsModelList = List(); - 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; body['PatientID'] = patientID; hasError = false; - await baseAppClient.post(GET_ECG, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ECG, + onSuccess: (dynamic response, int statusCode) { patientMuseResultsModelList.clear(); response['HIS_GetPatientMuseResultsList'].forEach((v) { patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v)); diff --git a/lib/core/service/patient/ReferralService.dart b/lib/core/service/patient/ReferralService.dart index 25469dc2..69e2a810 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 5d4caa50..5b659631 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 doctorsList = List(); List listMyReferredPatientModel = []; List pendingReferralList = []; List patientReferralList = []; @@ -57,7 +57,8 @@ 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; @@ -84,7 +85,8 @@ class PatientReferralService extends LookupService { Future getClinicsList(int projectId) async { hasError = false; - ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); + ClinicByProjectIdRequest _clinicByProjectIdRequest = + ClinicByProjectIdRequest(); _clinicByProjectIdRequest.projectID = projectId; await baseAppClient.post( @@ -102,9 +104,11 @@ 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; @@ -125,8 +129,9 @@ 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, @@ -136,7 +141,8 @@ 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; } @@ -156,7 +162,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, @@ -184,10 +190,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, @@ -196,7 +202,8 @@ 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); }); }, @@ -221,7 +228,8 @@ 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); }); }, @@ -234,9 +242,10 @@ 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; @@ -246,7 +255,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, @@ -261,14 +270,15 @@ class PatientReferralService extends LookupService { ); } - Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID, - String remarks) async { + Future makeReferral(PatiantInformtion patient, String isoStringDate, + int projectID, int clinicID, int doctorID, String remarks) async { hasError = false; Map body = Map(); List physiotheraphyGoalsList = []; listOfPhysiotherapyGoals.forEach((element) { - physiotheraphyGoalsList.add({"goalId": element.id, "remarks": element.remarks}); + physiotheraphyGoalsList + .add({"goalId": element.id, "remarks": element.remarks}); }); body['PatientMRN'] = patient.patientMRN ?? patient.patientId; @@ -317,7 +327,8 @@ 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 32b27ae1..bc7f1283 100644 --- a/lib/core/service/patient/patientInPatientService.dart +++ b/lib/core/service/patient/patientInPatientService.dart @@ -4,15 +4,16 @@ 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 myInPatientList = []; + List inPatientList = List(); + List myInPatientList = List(); - 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; } @@ -26,7 +27,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 0e05c628..f79e342c 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 myInPatientList = []; + List inPatientList = List(); + List myInPatientList = List(); 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; + 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 782e220f..a92ef0eb 100644 --- a/lib/core/service/patient/profile/discharge_summary_servive.dart +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -18,8 +18,7 @@ class DischargeSummaryService extends BaseService { _allDischargeSummaryList; Future getPendingDischargeSummary( - {required GetDischargeSummaryReqModel - getDischargeSummaryReqModel}) async { + {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { hasError = false; await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY, onSuccess: (dynamic response, int statusCode) { @@ -37,7 +36,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) { @@ -50,6 +49,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 3a39a4b8..7ac4ade7 100644 --- a/lib/core/service/patient/profile/operation_report_servive.dart +++ b/lib/core/service/patient/profile/operation_report_servive.dart @@ -11,11 +11,12 @@ class OperationReportService extends BaseService { List get reservationList => _reservationList; List _operationDetailsList = []; - List get operationDetailsList => - _operationDetailsList; + List get operationDetailsList => _operationDetailsList; - Future getReservations({required int patientId}) async { - GetReservationsRequestModel getReservationsRequestModel = + Future getReservations( + {GetReservationsRequestModel getReservationsRequestModel, + int patientId}) async { + getReservationsRequestModel = GetReservationsRequestModel(patientID: patientId, doctorID: ""); hasError = false; @@ -34,9 +35,10 @@ class OperationReportService extends BaseService { }, body: getReservationsRequestModel.toJson()); } - Future getOperationReportDetails({ - required GetOperationDetailsRequestModel getOperationReportRequestModel, - }) async { + Future getOperationReportDetails( + {GetOperationDetailsRequestModel getOperationReportRequestModel, + }) async { + hasError = false; await baseAppClient.post(GET_OPERATION_DETAILS, onSuccess: (dynamic response, int statusCode) { @@ -44,8 +46,7 @@ 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/admission_request/patient-admission-request-service.dart b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart index bc952162..c97f8426 100644 --- a/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart +++ b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart @@ -222,7 +222,6 @@ class AdmissionRequestService extends LookupService { POST_ADMISSION_REQUEST, onSuccess: (dynamic response, int statusCode) { print(response["admissionResponse"]["success"]); - AdmissionRequest admissionRequest = AdmissionRequest.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart index 2a1574f4..2bb9dac7 100644 --- a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart +++ b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart @@ -7,28 +7,37 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class InsuranceCardService extends BaseService { InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel( - isDentalAllowedBackend: false, patientTypeID: 1, patientType: 1, eXuldAPPNO: 0, projectID: 0); - InsuranceApprovalInPatientRequestModel _insuranceApprovalInPatientRequestModel = + isDentalAllowedBackend: false, + patientTypeID: 1, + patientType: 1, + eXuldAPPNO: 0, + projectID: 0); + InsuranceApprovalInPatientRequestModel + _insuranceApprovalInPatientRequestModel = InsuranceApprovalInPatientRequestModel(); - List _insuranceApproval = []; + List _insuranceApproval = List(); List get insuranceApproval => _insuranceApproval; - List _insuranceApprovalInPatient = []; - List get insuranceApprovalInPatient => _insuranceApprovalInPatient; + List _insuranceApprovalInPatient = List(); + 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; insuranceApprovalInPatient.clear(); - await baseAppClient.post(GET_INSURANCE_IN_PATIENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_INSURANCE_IN_PATIENT, + onSuccess: (dynamic response, int statusCode) { //prescriptionsList.clear(); response['List_ApprovalMain_InPatient'].forEach((prescriptions) { - insuranceApprovalInPatient.add(InsuranceApprovalInPatientModel.fromJson(prescriptions)); + insuranceApprovalInPatient + .add(InsuranceApprovalInPatientModel.fromJson(prescriptions)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -36,7 +45,8 @@ 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) { @@ -49,8 +59,8 @@ class InsuranceCardService extends BaseService { _insuranceApprovalModel.projectID = 0; // } - await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS, + patient: patient, onSuccess: (dynamic response, int statusCode) { print(response['HIS_Approval_List'].length); _insuranceApproval.clear(); _insuranceApproval.length = 0; 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 84861d5b..0a10eb31 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 _allSpecialLab = []; + List patientLabOrdersList = List(); + List _allSpecialLab = List(); 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 labResultList = []; - List labOrdersResultsList = []; - List labOrdersResultHistoryList = []; + List patientLabSpecialResult = List(); + List labResultList = List(); + List labOrdersResultsList = List(); + List labOrdersResultHistoryList = List(); 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( - {required PatientLabOrders patientLabOrder, required String procedureDescription, required PatiantInformtion patient}) async { + {PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -201,7 +201,7 @@ class LabsService extends BaseService { }, body: body); } - Future getAllSpecialLabResult({required int mrn}) async { + Future getAllSpecialLabResult({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 1af15e10..dfb9c3ae 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -13,11 +13,10 @@ 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)); @@ -94,7 +93,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 295d38ac..42cdafc6 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 _medicalFileList = List(); List get medicalFileList => _medicalFileList; MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel( @@ -13,13 +13,15 @@ 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; _medicalFileList.clear(); - await baseAppClient.post(GET_MEDICAL_FILE, onSuccess: (dynamic response, int statusCode) { - _medicalFileList.add(MedicalFileModel.fromJson(response['PatientFileList'])); + await baseAppClient.post(GET_MEDICAL_FILE, + onSuccess: (dynamic response, int statusCode) { + _medicalFileList + .add(MedicalFileModel.fromJson(response['PatientFileList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; 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 4a672412..ffbcae9b 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 _prescriptionList = List(); List get prescriptionList => _prescriptionList; - List _drugsList = []; + List _drugsList = List(); List get drugsList => _drugsList; List doctorsList = []; List allMedicationList = []; @@ -31,22 +31,27 @@ class PrescriptionService extends LookupService { dynamic boxQuantity; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); - ItemByMedicineRequestModel _itemByMedicineRequestModel = ItemByMedicineRequestModel(); + ItemByMedicineRequestModel _itemByMedicineRequestModel = + ItemByMedicineRequestModel(); SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( //search: ["Acetaminophen"], search: ["Amoxicillin"], ); - CalculateBoxQuantityRequestModel _boxQuantityRequestModel = CalculateBoxQuantityRequestModel(); + CalculateBoxQuantityRequestModel _boxQuantityRequestModel = + CalculateBoxQuantityRequestModel(); - PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel(); + PostPrescriptionReqModel _postPrescriptionReqModel = + PostPrescriptionReqModel(); - Future getItem({int? itemID}) async { - _itemByMedicineRequestModel = ItemByMedicineRequestModel(medicineCode: itemID); + Future getItem({int itemID}) async { + _itemByMedicineRequestModel = + ItemByMedicineRequestModel(medicineCode: itemID); hasError = false; - await baseAppClient.post(GET_ITEM_BY_MEDICINE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ITEM_BY_MEDICINE, + onSuccess: (dynamic response, int statusCode) { itemMedicineList = []; itemMedicineList = response['listItemByMedicineCode']['frequencies']; itemMedicineListRoute = response['listItemByMedicineCode']['routes']; @@ -57,9 +62,11 @@ class PrescriptionService extends LookupService { }, body: _itemByMedicineRequestModel.toJson()); } - Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { + Future getPatientAssessment( + GetAssessmentReqModel getAssessmentReqModel) async { hasError = false; - await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { print("Success"); patientAssessmentList.clear(); response['AssessmentList']['entityList'].forEach((v) { @@ -71,26 +78,29 @@ class PrescriptionService extends LookupService { }, body: getAssessmentReqModel.toJson()); } - Future getPrescription({int? mrn}) async { + Future getPrescription({int mrn}) async { _prescriptionReqModel = PrescriptionReqModel( patientMRN: mrn, ); hasError = false; _prescriptionList.clear(); - await baseAppClient.post(GET_PRESCRIPTION_LIST, onSuccess: (dynamic response, int statusCode) { - _prescriptionList.add(PrescriptionModel.fromJson(response['PrescriptionList'])); + await baseAppClient.post(GET_PRESCRIPTION_LIST, + onSuccess: (dynamic response, int statusCode) { + _prescriptionList + .add(PrescriptionModel.fromJson(response['PrescriptionList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: _prescriptionReqModel.toJson()); } - Future getDrugs({String? drugName}) async { - _drugRequestModel = SearchDrugRequestModel(search: [drugName!]); + Future getDrugs({String drugName}) async { + _drugRequestModel = SearchDrugRequestModel(search: [drugName]); hasError = false; - await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SEARCH_DRUG, + onSuccess: (dynamic response, int statusCode) { doctorsList = []; doctorsList = response['MedicationList']['entityList']; }, onFailure: (String error, int statusCode) { @@ -102,7 +112,8 @@ class PrescriptionService extends LookupService { Future getMedicationList({String drug = ''}) async { hasError = false; _drugRequestModel.search = ["$drug"]; - await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SEARCH_DRUG, + onSuccess: (dynamic response, int statusCode) { allMedicationList = []; response['MedicationList']['entityList'].forEach((v) { allMedicationList.add(GetMedicationResponseModel.fromJson(v)); @@ -113,7 +124,8 @@ class PrescriptionService extends LookupService { }, body: _drugRequestModel.toJson()); } - Future postPrescription(PostPrescriptionReqModel postProcedureReqModel) async { + Future postPrescription( + PostPrescriptionReqModel postProcedureReqModel) async { hasError = false; //_prescriptionList.clear(); await baseAppClient.post( @@ -129,7 +141,8 @@ class PrescriptionService extends LookupService { ); } - Future updatePrescription(PostPrescriptionReqModel updatePrescriptionReqModel) async { + Future updatePrescription( + PostPrescriptionReqModel updatePrescriptionReqModel) async { hasError = false; //_prescriptionList.clear(); await baseAppClient.post( @@ -145,8 +158,12 @@ class PrescriptionService extends LookupService { ); } - Future getDrugToDrug(VitalSignData vital, List lstAssessments, - List allergy, PatiantInformtion patient, List prescription) async { + Future getDrugToDrug( + VitalSignData vital, + List lstAssessments, + List allergy, + PatiantInformtion patient, + List prescription) async { // Map request = { // "Prescription": { // "objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"}, @@ -201,9 +218,10 @@ class PrescriptionService extends LookupService { "Prescription": { "objPatientInfo": { "Gender": patient.gender == 1 ? 'Male' : 'Female', - "Age": AppDateUtils.convertDateFromServerFormat(patient.dateofBirth!, 'dd/MM/yyyy') + "Age": AppDateUtils.convertDateFromServerFormat( + patient.dateofBirth, 'dd/MM/yyyy') }, - "objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg}, + "objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg}, "objPrescriptionItems": prescription, "objAllergies": getAllergiesObj(allergy), "objDiagnosis": getDiagnosisObj(lstAssessments), @@ -213,22 +231,29 @@ class PrescriptionService extends LookupService { }; hasError = false; - await baseAppClient.post(DRUG_TO_DRUG, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(DRUG_TO_DRUG, + onSuccess: (dynamic response, int statusCode) { drugToDrug = []; - drugToDrug = response['DrugToDrugResponse']['objPrescriptionCheckerResult']; + drugToDrug = + response['DrugToDrugResponse']['objPrescriptionCheckerResult']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, 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; - await baseAppClient.post(GET_BOX_QUANTITY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_BOX_QUANTITY, + onSuccess: (dynamic response, int statusCode) { boxQuantity = response['BoxQuantity']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -240,7 +265,10 @@ class PrescriptionService extends LookupService { var allergiesObj = []; allergies.forEach((element) { allergiesObj.add({ - "objProperties": {'Id': element.allergyDiseaseId, 'Name': element.allergyDiseaseName} + "objProperties": { + 'Id': element.allergyDiseaseId, + 'Name': element.allergyDiseaseName + } }); }); return allergiesObj; 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 bf3100c5..06de5a74 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 medicationForInPatient = []; - List prescriptionsOrderList = []; - List prescriptionInPatientList = []; + List prescriptionsList = List(); + List medicationForInPatient = List(); + List prescriptionsOrderList = List(); + List prescriptionInPatientList = List(); 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 prescriptionReportList = List(); - 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 pharmacyPrescriptionsList = List(); - 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 prescriptionReportEnhList = List(); - 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 } @@ -154,7 +154,7 @@ class PrescriptionsService extends BaseService { hasError = false; await baseAppClient.postPatient(isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient!, onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionReportEnhList.clear(); if (isInPatient) { @@ -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 5708b6b3..56a92de5 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 _procedureList = List(); List get procedureList => _procedureList; - List _valadteProcedureList = []; + List _valadteProcedureList = List(); List get valadteProcedureList => _valadteProcedureList; - List _categoriesList = []; + List _categoriesList = List(); List get categoriesList => _categoriesList; - List procedureslist = []; + List procedureslist = List(); List categoryList = []; - // List _templateList = []; + // List _templateList = List(); // List get templateList => _templateList; - List templateList = []; + List templateList = List(); - List _templateDetailsList = []; + List _templateDetailsList = List(); 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); } @@ -80,13 +80,16 @@ class ProcedureService extends BaseService { templateList.add(templateElement); } }); + // response['HIS_ProcedureTemplateList'].forEach((template) { + // _templateList.add(ProcedureTempleteModel.fromJson(template)); + // }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, 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; @@ -104,7 +107,7 @@ class ProcedureService extends BaseService { }, body: _procedureTempleteDetailsRequestModel.toJson()); } - Future getProcedure({int? mrn, required int appointmentNo}) async { + Future getProcedure({int mrn, int appointmentNo}) async { _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel( patientMRN: mrn, ); @@ -130,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 7ebbd348..f10f2253 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 finalRadiologyList = List(); 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 6efeba18..070fd862 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 _getAllsickLeave = List(); List get coveringDoctorsList => _coveringDoctors; List _coveringDoctors = []; @@ -29,8 +29,8 @@ class SickLeaveService extends BaseService { dynamic _postReschedule; - List getAllSickLeavePatient = []; - List getAllSickLeaveDoctor = []; + List getAllSickLeavePatient = List(); + List getAllSickLeaveDoctor = List(); 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 dbdb3855..ec127f8b 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, @@ -55,7 +55,8 @@ class SOAPService extends LookupService { Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async { hasError = false; - await baseAppClient.post(POST_EPISODE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_EPISODE, + onSuccess: (dynamic response, int statusCode) { print("Success"); episodeID = response['EpisodeID']; }, onFailure: (String error, int statusCode) { @@ -79,28 +80,33 @@ 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()); } - Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async { + Future postHistories( + PostHistoriesRequestModel postHistoriesRequestModel) async { hasError = false; - await baseAppClient.post(POST_HISTORY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_HISTORY, + 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: postHistoriesRequestModel.toJson()); } - Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { + Future postChiefComplaint( + PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { hasError = false; super.error =""; - await baseAppClient.post(POST_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -108,9 +114,11 @@ 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) { + await baseAppClient.post(POST_PHYSICAL_EXAM, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -118,9 +126,11 @@ class SOAPService extends LookupService { }, body: postPhysicalExamRequestModel.toJson()); } - Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async { + Future postProgressNote( + PostProgressNoteRequestModel postProgressNoteRequestModel) async { hasError = false; - await baseAppClient.post(POST_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_PROGRESS_NOTE, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -128,9 +138,11 @@ class SOAPService extends LookupService { }, body: postProgressNoteRequestModel.toJson()); } - Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async { + Future postAssessment( + PostAssessmentRequestModel postAssessmentRequestModel) async { hasError = false; - await baseAppClient.post(POST_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -141,7 +153,8 @@ class SOAPService extends LookupService { Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_ALLERGY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_ALLERGY, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -149,20 +162,24 @@ class SOAPService extends LookupService { }, body: patchAllergyRequestModel.toJson()); } - Future patchHistories(PostHistoriesRequestModel patchHistoriesRequestModel) async { + Future patchHistories( + PostHistoriesRequestModel patchHistoriesRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_HISTORY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_HISTORY, + 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: patchHistoriesRequestModel.toJson()); } - Future patchChiefComplaint(PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { + Future patchChiefComplaint( + PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { hasError = false; super.error =""; - await baseAppClient.post(PATCH_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -170,9 +187,11 @@ class SOAPService extends LookupService { }, body: patchChiefComplaintRequestModel.toJson()); } - Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { + Future patchPhysicalExam( + PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_PHYSICAL_EXAM, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -180,9 +199,11 @@ class SOAPService extends LookupService { }, body: patchPhysicalExamRequestModel.toJson()); } - Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async { + Future patchProgressNote( + PostProgressNoteRequestModel patchProgressNoteRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_PROGRESS_NOTE, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -190,9 +211,11 @@ class SOAPService extends LookupService { }, body: patchProgressNoteRequestModel.toJson()); } - Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { + Future patchAssessment( + PatchAssessmentReqModel patchAssessmentRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -203,7 +226,8 @@ class SOAPService extends LookupService { Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { hasError = false; - await baseAppClient.post(GET_ALLERGY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ALLERGY, + onSuccess: (dynamic response, int statusCode) { print("Success"); patientAllergiesList.clear(); @@ -216,9 +240,11 @@ class SOAPService extends LookupService { }, body: generalGetReqForSOAP.toJson()); } - Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { + Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, + {bool isFirst = false}) async { hasError = false; - await baseAppClient.post(GET_HISTORY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_HISTORY, + onSuccess: (dynamic response, int statusCode) { print("Success"); if (isFirst) patientHistoryList.clear(); response['List_History']['entityList'].forEach((v) { @@ -230,9 +256,11 @@ class SOAPService extends LookupService { }, body: getHistoryReqModel.toJson()); } - Future getPatientChiefComplaint(GetChiefComplaintReqModel getChiefComplaintReqModel) async { + Future getPatientChiefComplaint( + GetChiefComplaintReqModel getChiefComplaintReqModel) async { hasError = false; - await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { print("Success"); patientChiefComplaintList.clear(); response['List_ChiefComplaint']['entityList'].forEach((v) { @@ -244,9 +272,11 @@ class SOAPService extends LookupService { }, body: getChiefComplaintReqModel.toJson()); } - Future getPatientPhysicalExam(GetPhysicalExamReqModel getPhysicalExamReqModel) async { + Future getPatientPhysicalExam( + GetPhysicalExamReqModel getPhysicalExamReqModel) async { hasError = false; - await baseAppClient.post(GET_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PHYSICAL_EXAM, + onSuccess: (dynamic response, int statusCode) { patientPhysicalExamList.clear(); response['PhysicalExamList']['entityList'].forEach((v) { patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v)); @@ -257,9 +287,11 @@ class SOAPService extends LookupService { }, body: getPhysicalExamReqModel.toJson()); } - Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { + Future getPatientProgressNote( + GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { hasError = false; - await baseAppClient.post(GET_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PROGRESS_NOTE, + onSuccess: (dynamic response, int statusCode) { print("Success"); patientProgressNoteList.clear(); response['ProgressNoteList']['entityList'].forEach((v) { @@ -271,9 +303,11 @@ class SOAPService extends LookupService { }, body: getGetProgressNoteReqModel.toJson()); } - Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { + Future getPatientAssessment( + GetAssessmentReqModel getAssessmentReqModel) async { hasError = false; - await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { print("Success"); patientAssessmentList.clear(); response['AssessmentList']['entityList'].forEach((v) { 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 2028ed6b..53fa257e 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 { - late List patientChiefComplaintList; - late List patientVitalSignsHistory; + List patientChiefComplaintList; + List patientVitalSignsHistory; List patientAssessmentList = []; List orderProcedureList = []; - PrescriptionModel? prescriptionList; + PrescriptionModel prescriptionList; Future getPatientChiefComplaint(PatiantInformtion patient) async { hasError = false; @@ -22,13 +22,14 @@ class UcafService extends LookupService { body['EpisodeID'] = patient.episodeNo; body['DoctorID'] = ""; - patientChiefComplaintList = []; - await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { + patientChiefComplaintList = null; + await baseAppClient.post(GET_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { print("Success"); if (patientChiefComplaintList != null) { patientChiefComplaintList.clear(); } else { - patientChiefComplaintList = []; + patientChiefComplaintList = new List(); } response['List_ChiefComplaint']['entityList'].forEach((v) { patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); @@ -39,7 +40,8 @@ class UcafService extends LookupService { }, body: body); } - Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { + Future getInPatientVitalSignHistory( + PatiantInformtion patient, bool isInPatient) async { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; @@ -50,14 +52,14 @@ class UcafService extends LookupService { body['InOutPatientType'] = 2; } - patientVitalSignsHistory = []; + patientVitalSignsHistory = null; await baseAppClient.post( GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { if (patientVitalSignsHistory != null) { patientVitalSignsHistory.clear(); } else { - patientVitalSignsHistory = []; + patientVitalSignsHistory = new List(); } if (response['List_DoctorPatientVitalSign'] != null) { response['List_DoctorPatientVitalSign'].forEach((v) { @@ -73,7 +75,8 @@ class UcafService extends LookupService { ); } - Future getPatientVitalSignsHistory(PatiantInformtion patient, String fromDate, String toDate) async { + Future getPatientVitalSignsHistory( + PatiantInformtion patient, String fromDate, String toDate) async { hasError = false; Map body = Map(); body['PatientMRN'] = patient.patientId; // patient.patientMRN @@ -86,14 +89,14 @@ class UcafService extends LookupService { body['From'] = fromDate; body['To'] = toDate; - patientVitalSignsHistory = []; + patientVitalSignsHistory = null; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, onSuccess: (dynamic response, int statusCode) { if (patientVitalSignsHistory != null) { patientVitalSignsHistory.clear(); } else { - patientVitalSignsHistory = []; + patientVitalSignsHistory = new List(); } if (response['VitalSignsHistory'] != null) { response['VitalSignsHistory'].forEach((v) { @@ -116,7 +119,8 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { print("Success"); patientAssessmentList.clear(); response['AssessmentList']['entityList'].forEach((v) { @@ -138,8 +142,10 @@ class UcafService extends LookupService { hasError = false; prescriptionList = null; - await baseAppClient.post(GET_PRESCRIPTION_LIST, onSuccess: (dynamic response, int statusCode) { - prescriptionList = PrescriptionModel.fromJson(response['PrescriptionList']); + await baseAppClient.post(GET_PRESCRIPTION_LIST, + onSuccess: (dynamic response, int statusCode) { + prescriptionList = + PrescriptionModel.fromJson(response['PrescriptionList']); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -153,7 +159,8 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post(GET_ORDER_PROCEDURE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ORDER_PROCEDURE, + onSuccess: (dynamic response, int statusCode) { print("Success"); orderProcedureList.clear(); response['OrderedProcedureList']['entityList'].forEach((v) { @@ -171,7 +178,8 @@ class UcafService extends LookupService { body['PatientMRN'] = patient.patientMRN; body['AppointmentNo'] = patient.appointmentNo; - await baseAppClient.post(POST_UCAF, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_UCAF, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; 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 a6bf9649..1c07aa48 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 { @@ -21,7 +21,8 @@ class VitalSignsService extends BaseService { if (response['VitalSignsList'] != null) { if (response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0) { - patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]); + patientVitalSigns = VitalSignData.fromJson( + response['VitalSignsList']['entityList'][0]); } } }, @@ -33,7 +34,8 @@ class VitalSignsService extends BaseService { ); } - Future getPatientVitalSignsHistory(PatiantInformtion patient, String fromDate, String toDate) async { + Future getPatientVitalSignsHistory( + PatiantInformtion patient, String fromDate, String toDate) async { patientVitalSigns = null; hasError = false; Map body = Map(); @@ -52,14 +54,14 @@ class VitalSignsService extends BaseService { body['ProjectID'] = patient.projectId; } await baseAppClient.post( - GET_PATIENT_VITAL_SIGN, + GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); - if (response['List_DoctorPatientVitalSign'] != null) { - response['List_DoctorPatientVitalSign'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; @@ -82,16 +84,22 @@ class VitalSignsService extends BaseService { // body['InOutPatientType'] = 2; // } - await baseAppClient.postPatient(GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { - patientVitalSignsHistory.clear(); - if (response['List_DoctorPatientVitalSign'] != null) { - response['List_DoctorPatientVitalSign'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error.toString(); - }, body: body, patient: patient); + + await baseAppClient.postPatient( + GET_PATIENT_VITAL_SIGN, + onSuccess: (dynamic response, int statusCode) { + patientVitalSignsHistory.clear(); + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + });} + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, + body: body, + patient: patient + ); } } diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index 527f3d20..e6f35bb8 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 _pendingOrderList = List(); List get pendingOrderList => _pendingOrderList; - List _admissionOrderList = []; + List _admissionOrderList = List(); List get admissionOrderList => _admissionOrderList; Future getPendingOrders( - { - required int patientId, - required int admissionNo}) async { - PendingOrderRequestModel pendingOrderRequestModel = PendingOrderRequestModel( + {PendingOrderRequestModel pendingOrderRequestModel, + int patientId, + int admissionNo}) async { + pendingOrderRequestModel = PendingOrderRequestModel( patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, @@ -40,10 +40,10 @@ class PendingOrderService extends BaseService { } Future getAdmissionOrders( - { - required int patientId, - required int admissionNo}) async { - AdmissionOrdersRequestModel admissionOrdersRequestModel = AdmissionOrdersRequestModel( + {AdmissionOrdersRequestModel admissionOrdersRequestModel, + int patientId, + int admissionNo}) async { + admissionOrdersRequestModel = AdmissionOrdersRequestModel( patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 4d1ea631..9df347e2 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -6,9 +6,11 @@ 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 = []; @@ -17,9 +19,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()) || @@ -40,7 +42,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; @@ -52,7 +54,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 edc57abd..46f48d35 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({required int mrn}) async { + Future getInsuranceInPatient({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 54ae3ab8..53feedd1 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,33 +67,33 @@ class LiveCarePatientViewModel extends BaseViewModel { return token; } - Future startCall({required int vCID, required bool isReCall}) async { + Future startCall({int vCID, 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); } } - setSelectedCheckboxValues(AlternativeService? service, bool? isSelected) { - int index = alternativeServicesList.indexOf(service!); - if (index != -1) alternativeServicesList[index].isSelected = isSelected!; + setSelectedCheckboxValues(AlternativeService service, bool isSelected) { + int index = alternativeServicesList.indexOf(service); + if (index != -1) alternativeServicesList[index].isSelected = isSelected; notifyListeners(); } @@ -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 selectedServices = List(); 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({required PatiantInformtion patient, appointmentNo}) { + updateInCallPatient({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 996766ec..e7d343b4 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,17 +28,17 @@ 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); } Future insertMedicalReport(PatiantInformtion patient, String htmlText) async { - setState(ViewState.BusyLocal); + 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, int 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 80f917b7..312d6ebb 100644 --- a/lib/core/viewModel/PatientMuseViewModel.dart +++ b/lib/core/viewModel/PatientMuseViewModel.dart @@ -8,13 +8,17 @@ import '../../locator.dart'; class PatientMuseViewModel extends BaseViewModel { PatientMuseService _patientMuseService = locator(); - List get patientMuseResultsModelList => _patientMuseService.patientMuseResultsModelList; + 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); + 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/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index 31d84608..866f99a8 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -18,7 +18,7 @@ class PatientRegistrationViewModel extends BaseViewModel { GetPatientInfoResponseModel get getPatientInfoResponseModel => _patientRegistrationService.getPatientInfoResponseModel; - late CheckPatientForRegistrationModel checkPatientForRegistrationModel; + CheckPatientForRegistrationModel checkPatientForRegistrationModel; Future checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { @@ -30,7 +30,7 @@ class PatientRegistrationViewModel extends BaseViewModel { await _patientRegistrationService .checkPatientForRegistration(registrationModel); if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error!; + error = _patientRegistrationService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -135,17 +135,17 @@ class PatientRegistrationViewModel extends BaseViewModel { // await _patientRegistrationService. // getPatientInfo(getPatientInfoRequestModel); // if (_patientRegistrationService.hasError) { - // error = _patientRegistrationService.error!; + // error = _patientRegistrationService.error; // setState(ViewState.ErrorLocal); // } else setState(ViewState.Idle); } Future sendActivationCodeByOTPNotificationType( - {required SendActivationCodeByOTPNotificationTypeForRegistrationModel + {SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel, - required int otpType, - required PatientRegistrationViewModel user}) async { + int otpType, + PatientRegistrationViewModel user}) async { setState(ViewState.BusyLocal); print(checkPatientForRegistrationModel); print(checkPatientForRegistrationModel); @@ -155,7 +155,7 @@ class PatientRegistrationViewModel extends BaseViewModel { model: this, checkPatientForRegistrationModel: checkPatientForRegistrationModel); if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error!; + error = _patientRegistrationService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -191,7 +191,7 @@ class PatientRegistrationViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientRegistrationService.checkActivationCode(model); if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error!; + error = _patientRegistrationService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -201,7 +201,7 @@ class PatientRegistrationViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientRegistrationService.registrationPatient(registrationModel); if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error!; + error = _patientRegistrationService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index b54bdce0..5acc6f07 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 filteredMyInPatientItems = []; + List filteredInPatientItems = List(); + List filteredMyInPatientItems = List(); 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,10 +190,7 @@ class PatientSearchViewModel extends BaseViewModel { } } - sortInPatient( - {bool isDes = false, - required bool isAllClinic, - required bool isMyInPatient}) { + sortInPatient({bool isDes = false, bool isAllClinic, bool isMyInPatient}) { if (isMyInPatient ? myIinPatientList.length > 0 : isAllClinic @@ -206,12 +203,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); @@ -256,7 +253,7 @@ class PatientSearchViewModel extends BaseViewModel { InpatientClinicList.clear(); inPatientList.forEach((element) { if (!InpatientClinicList.contains(element.clinicDescription)) { - InpatientClinicList.add(element!.clinicDescription!); + InpatientClinicList.add(element.clinicDescription); } }); } @@ -284,7 +281,7 @@ class PatientSearchViewModel extends BaseViewModel { } } - filterByHospital({required int hospitalId}) { + filterByHospital({int hospitalId}) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { if (inPatientList[i].projectId == hospitalId) { @@ -294,7 +291,7 @@ class PatientSearchViewModel extends BaseViewModel { notifyListeners(); } - filterByClinic({required String clinicName}) { + filterByClinic({String clinicName}) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { if (inPatientList[i].clinicDescription == clinicName) { @@ -310,7 +307,7 @@ class PatientSearchViewModel extends BaseViewModel { } void filterSearchResults(String query, - {required bool isAllClinic, required bool isMyInPatient}) { + {bool isAllClinic, bool isMyInPatient}) { var strExist = query.length > 0 ? true : false; if (isMyInPatient) { @@ -322,13 +319,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()) || @@ -348,9 +345,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()) || @@ -375,11 +372,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(); @@ -410,7 +407,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 0e45825e..83cd43e3 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -47,41 +47,54 @@ class SOAPViewModel extends BaseViewModel { List get allergiesList => _SOAPService.allergiesList; - List get allergySeverityList => _SOAPService.allergySeverityList; + List get allergySeverityList => + _SOAPService.allergySeverityList; List get historyFamilyList => _SOAPService.historyFamilyList; - List get historyMedicalList => _SOAPService.historyMedicalList; + List get historyMedicalList => + _SOAPService.historyMedicalList; List get historySportList => _SOAPService.historySportList; List get historySocialList => _SOAPService.historySocialList; - List get historySurgicalList => _SOAPService.historySurgicalList; + List get historySurgicalList => + _SOAPService.historySurgicalList; - List get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList, ...historySportList]; + List get mergeHistorySurgicalWithHistorySportList => + [...historySurgicalList, ...historySportList]; - List get physicalExaminationList => _SOAPService.physicalExaminationList; + List get physicalExaminationList => + _SOAPService.physicalExaminationList; - List get listOfDiagnosisType => _SOAPService.listOfDiagnosisType; + List get listOfDiagnosisType => + _SOAPService.listOfDiagnosisType; - List get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition; + List get listOfDiagnosisCondition => + _SOAPService.listOfDiagnosisCondition; List get listOfICD10 => _SOAPService.listOfICD10; - List get patientChiefComplaintList => _SOAPService.patientChiefComplaintList; + List get patientChiefComplaintList => + _SOAPService.patientChiefComplaintList; - List get patientAllergiesList => _SOAPService.patientAllergiesList; + List get patientAllergiesList => + _SOAPService.patientAllergiesList; - List get patientHistoryList => _SOAPService.patientHistoryList; + List get patientHistoryList => + _SOAPService.patientHistoryList; - List get patientPhysicalExamList => _SOAPService.patientPhysicalExamList; + List get patientPhysicalExamList => + _SOAPService.patientPhysicalExamList; - List get patientProgressNoteList => _SOAPService.patientProgressNoteList; + List get patientProgressNoteList => + _SOAPService.patientProgressNoteList; - List get patientAssessmentList => _SOAPService.patientAssessmentList; + List get patientAssessmentList => + _SOAPService.patientAssessmentList; - int? get episodeID => _SOAPService.episodeID; + int get episodeID => _SOAPService.episodeID; bool isAddProgress = true; bool isAddExamInProgress = true; @@ -98,9 +111,10 @@ class SOAPViewModel extends BaseViewModel { get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel; - List get allMedicationList => _prescriptionService.allMedicationList; + List get allMedicationList => + _prescriptionService.allMedicationList; - late SubjectiveCallBack subjectiveCallBack; + SubjectiveCallBack subjectiveCallBack; setSubjectiveCallBack(SubjectiveCallBack callBack) { this.subjectiveCallBack = callBack; @@ -110,7 +124,7 @@ class SOAPViewModel extends BaseViewModel { subjectiveCallBack.nextFunction(model); } - late ObjectiveCallBack objectiveCallBack; + ObjectiveCallBack objectiveCallBack; setObjectiveCallBack(ObjectiveCallBack callBack) { this.objectiveCallBack = callBack; @@ -120,7 +134,7 @@ class SOAPViewModel extends BaseViewModel { objectiveCallBack.nextFunction(model); } - late AssessmentCallBack assessmentCallBack; + AssessmentCallBack assessmentCallBack; setAssessmentCallBack(AssessmentCallBack callBack) { this.assessmentCallBack = callBack; @@ -130,7 +144,7 @@ class SOAPViewModel extends BaseViewModel { assessmentCallBack.nextFunction(model); } - late PlanCallBack planCallBack; + PlanCallBack planCallBack; setPlanCallBack(PlanCallBack callBack) { this.planCallBack = callBack; @@ -144,22 +158,21 @@ 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); } - Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false}) async { + Future getMasterLookup(MasterKeysService masterKeys, + {bool isBusyLocal = false}) async { if (isBusyLocal) { setState(ViewState.Busy); } else setState(ViewState.Busy); await _SOAPService.getMasterLookup(masterKeys); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -169,8 +182,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); @@ -183,41 +195,40 @@ class SOAPViewModel extends BaseViewModel { await _SOAPService.postEpisodeForInPatient( postEpisodeForInpatientRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + Future postPhysicalExam( + PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async { + Future postProgressNote( + PostProgressNoteRequestModel postProgressNoteRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postProgressNote(postProgressNoteRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async { + Future postAssessment( + PostAssessmentRequestModel postAssessmentRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postAssessment(postAssessmentRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -228,44 +239,43 @@ 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); } - Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async { + Future patchProgressNote( + PostProgressNoteRequestModel patchProgressNoteRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchProgressNote(patchProgressNoteRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { + Future patchAssessment( + PatchAssessmentReqModel patchAssessmentRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchAssessment(patchAssessmentRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, {isLocalBusy = false}) async { + Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, + {isLocalBusy = false}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else setState(ViewState.Busy); await _SOAPService.getPatientAllergy(generalGetReqForSOAP); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else @@ -277,16 +287,21 @@ 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, @@ -299,37 +314,36 @@ 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); @@ -339,7 +353,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); @@ -350,11 +364,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; @@ -363,11 +377,13 @@ 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; @@ -376,7 +392,8 @@ 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; @@ -384,7 +401,8 @@ 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; @@ -392,7 +410,8 @@ 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; @@ -400,7 +419,8 @@ 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; @@ -416,7 +436,8 @@ 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; @@ -424,7 +445,8 @@ 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; @@ -439,7 +461,8 @@ 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; @@ -447,7 +470,8 @@ 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; @@ -480,9 +504,10 @@ 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 @@ -583,7 +608,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); @@ -643,7 +668,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); @@ -683,7 +708,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); @@ -707,7 +732,7 @@ class SOAPViewModel extends BaseViewModel { } if (_SOAPService.hasError) { - error = _SOAPService.error!; + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -715,11 +740,11 @@ class SOAPViewModel extends BaseViewModel { postSubjectServices( {patientInfo, - required String complaintsText, - required String medicationText, - required String illnessText, - required List myHistoryList, - required List myAllergiesList}) async { + String complaintsText, + String medicationText, + String illnessText, + List myHistoryList, + List myAllergiesList}) async { var services; PostChiefComplaintRequestModel postChiefComplaintRequestModel = @@ -765,7 +790,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); @@ -773,9 +798,9 @@ class SOAPViewModel extends BaseViewModel { PostChiefComplaintRequestModel createPostChiefComplaintRequestModel( {patientInfo, - required String complaintsText, - required String medicationText, - required String illnessText}) { + String complaintsText, + String medicationText, + String illnessText}) { return new PostChiefComplaintRequestModel( admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) @@ -793,13 +818,13 @@ class SOAPViewModel extends BaseViewModel { } PostHistoriesRequestModel createPostHistoriesRequestModel( - {patientInfo, required List myHistoryList}) { + {patientInfo, 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, @@ -821,7 +846,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, @@ -830,9 +855,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 4110b079..cad5fa87 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -26,7 +26,9 @@ 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'; @@ -43,39 +45,39 @@ class AuthenticationViewModel extends BaseViewModel { NewLoginInformationModel get loginInfo => _authService.loginInfo; - List get doctorProfilesList => - _authService.doctorProfilesList; + List get doctorProfilesList => _authService.doctorProfilesList; SendActivationCodeForDoctorAppResponseModel - get activationCodeVerificationScreenRes => - _authService.activationCodeVerificationScreenRes; + get activationCodeVerificationScreenRes => + _authService.activationCodeVerificationScreenRes; SendActivationCodeForDoctorAppResponseModel - get activationCodeForDoctorAppRes => - _authService.activationCodeForDoctorAppRes; + get activationCodeForDoctorAppRes => + _authService.activationCodeForDoctorAppRes; CheckActivationCodeForDoctorAppResponseModel - get checkActivationCodeForDoctorAppRes => - _authService.checkActivationCodeForDoctorAppRes; + get checkActivationCodeForDoctorAppRes => + _authService.checkActivationCodeForDoctorAppRes; - NewLoginInformationModel? loggedUser; - GetIMEIDetailsModel? user; + NewLoginInformationModel loggedUser; + GetIMEIDetailsModel user; UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); - late List _availableBiometrics; - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; + List _availableBiometrics; + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); bool isLogin = false; bool unverified = false; bool isFromLogin = false; APP_STATUS appStatus = APP_STATUS.LOADING; - String localToken = ""; - AuthenticationViewModel() { + String localToken =""; + AuthenticationViewModel({bool checkDeviceInfo = false}) { getDeviceInfoFromFirebase(); getDoctorProfile(); } + /// Insert Device IMEI Future insertDeviceImei(token) async { var loggedIn = await sharedPref.getObj(LOGGED_IN_USER); @@ -90,168 +92,155 @@ 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( - {required AuthMethodTypes authMethodType, - required String password}) async { + Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, 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( - {required String activationCode, bool isSilentLogin = false}) async { + Future checkActivationCodeForDoctorApp({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, - 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 ?? '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); if (_authService.hasError) { - error = _authService.error!; + error = _authService.error; setState(ViewState.ErrorLocal); } else { - await setDataAfterSendActivationSuccess( - checkActivationCodeForDoctorAppRes); + await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes); setState(ViewState.Idle); } } /// 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); } + /// get type name based on id. getType(type, context) { switch (type) { case 1: - return TranslationBase.of(context).verifySMS; + return TranslationBase + .of(context) + .verifySMS; break; case 3: - return TranslationBase.of(context).verifyFingerprint; + return TranslationBase + .of(context) + .verifyFingerprint; break; case 4: - return TranslationBase.of(context).verifyFaceID; + return TranslationBase + .of(context) + .verifyFaceID; break; case 2: return TranslationBase.of(context).verifyWhatsApp; @@ -263,16 +252,14 @@ 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 { @@ -310,12 +297,10 @@ 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); @@ -326,26 +311,32 @@ 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(); - for (var i = 0; i < _availableBiometrics.length; i++) { - if (biometricType == _availableBiometrics[i]) isAvailable = true; + if (_availableBiometrics != null) { + for (var i = 0; i < _availableBiometrics.length; i++) { + if (biometricType == _availableBiometrics[i]) isAvailable = true; + } } return isAvailable; } @@ -359,31 +350,30 @@ class AuthenticationViewModel extends BaseViewModel { } } - /// call firebase service to check if the user already login in before or not /// call firebase service to check if the user already login in before or not getDeviceInfoFromFirebase() async { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - _firebaseMessaging.requestPermission(); + _firebaseMessaging.requestNotificationPermissions(); } - 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); @@ -398,9 +388,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; @@ -410,13 +400,12 @@ class AuthenticationViewModel extends BaseViewModel { } return appStatus; } - - setAppStatus(APP_STATUS status) { + setAppStatus(APP_STATUS status){ this.appStatus = status; notifyListeners(); } - setUnverified(bool unverified, {bool isFromLogin = false}) { + setUnverified(bool unverified,{bool isFromLogin = false}){ this.unverified = unverified; this.isFromLogin = isFromLogin; notifyListeners(); @@ -424,21 +413,24 @@ 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 f4d052cf..d50a8d5a 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; @@ -25,19 +25,23 @@ class BaseViewModel extends ChangeNotifier { notifyListeners(); } - Future ?getDoctorProfile({bool isGetProfile = false}) async { + Future getDoctorProfile({bool isGetProfile = false}) async { if (isGetProfile) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } } } if (doctorProfile == null) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } } return null; } else { diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 2a064296..04e63dd9 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -13,24 +13,26 @@ import 'base_view_model.dart'; class DashboardViewModel extends BaseViewModel { - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); DashboardService _dashboardService = locator(); SpecialClinicsService _specialClinicsService = locator(); DoctorReplyService _doctorReplyService = locator(); - List get dashboardItemsList => _dashboardService.dashboardItemsList; + List get dashboardItemsList => + _dashboardService.dashboardItemsList; 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); @@ -42,7 +44,7 @@ List get specialClinicalCareList => ]); if (_dashboardService.hasError) { - error = _dashboardService.error!; + error = _dashboardService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -51,11 +53,17 @@ List get specialClinicalCareList => } Future setFirebaseNotification(AuthenticationViewModel authProvider) async { - _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); + _firebaseMessaging.requestNotificationPermissions( + const IosNotificationSettings( + sound: true, badge: true, alert: true, provisional: true)); + _firebaseMessaging.onIosSettingsRegistered + .listen((IosNotificationSettings settings) { + print("Settings registered: $settings"); + }); - _firebaseMessaging.getToken().then((String? token) async { + _firebaseMessaging.getToken().then((String token) async { if (token != '') { - // DEVICE_TOKEN = token!; + // DEVICE_TOKEN = token; authProvider.insertDeviceImei(token); } }); @@ -75,35 +83,36 @@ List get specialClinicalCareList => setState(ViewState.Busy); await _specialClinicsService.getSpecialClinicalCareList(); // if (_specialClinicsService.hasError) { - // error = _specialClinicsService.error!; + // error = _specialClinicsService.error; // setState(ViewState.Error); // } else // setState(ViewState.Idle); } - Future changeClinic(var clinicId, AuthenticationViewModel authProvider) async { + Future changeClinic( + int 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; @@ -118,7 +127,7 @@ List get specialClinicalCareList => 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 de03c6e3..707fb805 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 f2b2abe9..c0ce1bc4 100644 --- a/lib/core/viewModel/hospitals_view_model.dart +++ b/lib/core/viewModel/hospitals_view_model.dart @@ -1,21 +1,25 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart'; +import 'package:flutter/cupertino.dart'; import '../../locator.dart'; import 'base_view_model.dart'; + class HospitalViewModel extends BaseViewModel { HospitalsService _hospitalsService = locator(); - + // List get imeiDetails => _authService.dashboardItemsList; + // get loginInfo => _authService.loginInfo; Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel = - GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel =GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; 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 05393f33..d83aee2a 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 _patientLabOrdersListHospital = []; + List _patientLabOrdersListClinic = List(); + List _patientLabOrdersListHospital = List(); 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 labResultLists = List(); List get labResultListsCoustom { return labResultLists; } getLaboratoryResult( - {required String projectID, - required int clinicID, - required String invoiceNo, - required String orderNo, - required PatiantInformtion patient, - required bool isInpatient}) async { + {String projectID, + int clinicID, + String invoiceNo, + String orderNo, + PatiantInformtion patient, + bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult( invoiceNo: invoiceNo, @@ -101,21 +101,19 @@ 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({required PatientLabOrders patientLabOrder, - required PatiantInformtion patient, - required bool isInpatient}) async { + getPatientLabResult({PatientLabOrders patientLabOrder, PatiantInformtion patient, 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); @@ -130,25 +128,23 @@ 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({required PatientLabOrders patientLabOrder, - required String procedure, - required 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; }); } @@ -158,31 +154,31 @@ class LabsViewModel extends BaseViewModel { } getPatientLabResultHistoryByDescription( - {required PatientLabOrders patientLabOrder, required String procedureDescription, required PatiantInformtion patient}) async { + {PatientLabOrders patientLabOrder, String procedureDescription, 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({required PatientLabOrders patientLabOrder, required 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 getAllSpecialLabResult({required int patientId}) async { + Future getAllSpecialLabResult({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 cb734073..555e19cf 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, @@ -25,7 +25,7 @@ class GetRescheduleLeavesResponse { this.createdOn, this.statusDescription}); - GetRescheduleLeavesResponse.fromJson(Map json) { + GetRescheduleLeavesResponse.fromJson(Map json) { clinicId = json['clinicId']; coveringDoctorId = json['coveringDoctorId']; date = json['date']; @@ -40,8 +40,8 @@ class GetRescheduleLeavesResponse { statusDescription = json['statusDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['clinicId'] = this.clinicId; data['coveringDoctorId'] = this.coveringDoctorId; data['date'] = this.date; diff --git a/lib/core/viewModel/livecare_view_model.dart b/lib/core/viewModel/livecare_view_model.dart index eb96e687..de586e1e 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 = []; - late StartCallRes inCallResponse; + 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 406a4617..08e8ce90 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({required int mrn}) async { + Future getMedicalFile({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 f95702a5..8ccf1a70 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 templateList = List(); 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({required int itemID}) async { + Future getItem({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({required 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(); @@ -83,13 +83,13 @@ class MedicineViewModel extends BaseViewModel { } } - Future getPrescription({required 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); @@ -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,19 +179,18 @@ 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( - {required int itemCode, required int duration, required double strength, required int freq}) async { + Future getBoxQuantity({int itemCode, int duration, double strength, 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); @@ -201,7 +200,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 8e1cbca0..0868b601 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; - late AdmissionRequest admissionRequestData; + 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 b74c7d25..93635629 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -26,6 +26,7 @@ class PatientReferralViewModel extends BaseViewModel { MyReferralInPatientService _myReferralService = locator(); DischargedPatientService _dischargedPatientService = locator(); + List get myDischargeReferralPatient => _dischargedPatientService.myDischargeReferralPatients; @@ -53,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) { @@ -68,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(); @@ -78,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); @@ -90,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); @@ -100,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(); @@ -112,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; @@ -127,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); @@ -140,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); @@ -154,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); @@ -167,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 @@ -183,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 @@ -196,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(); @@ -206,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); @@ -217,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); @@ -225,21 +226,21 @@ class PatientReferralViewModel extends BaseViewModel { } Future makeInPatientReferral( - {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 { + {PatiantInformtion patient, + int projectID, + int clinicID, + int doctorID, + int frequencyCode, + int priority, + String referralDate, + String remarks, + 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, @@ -248,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); @@ -261,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); @@ -271,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(); @@ -283,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); @@ -292,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 "-"; } @@ -336,51 +337,51 @@ class PatientReferralViewModel extends BaseViewModel { PatiantInformtion getPatientFromReferralO(MyReferralPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); - patient.doctorId = referredPatient.doctorID!; - patient.doctorName = referredPatient.doctorName!; + patient.doctorId = referredPatient.doctorID; + patient.doctorName = referredPatient.doctorName; patient.patientId = referredPatient.patientID; - patient.firstName = referredPatient.firstName!; - patient.middleName = referredPatient.middleName!; - patient.lastName = referredPatient.lastName!; - patient.gender = referredPatient.gender!; - patient.dateofBirth = referredPatient.dateofBirth!; - patient.mobileNumber = referredPatient.mobileNumber!; - patient.emailAddress = referredPatient.emailAddress!; - patient.patientIdentificationNo = referredPatient.patientIdentificationNo!; - patient.patientType = referredPatient.patientType!; - patient.admissionNo = referredPatient.admissionNo!; - patient.admissionDate = referredPatient.admissionDate!; - patient.roomId = referredPatient.roomID!; - patient.bedId = referredPatient.bedID!; - patient.nationalityName = referredPatient.nationalityName!; - patient.nationalityFlagURL = referredPatient.nationalityFlagURL!; + patient.firstName = referredPatient.firstName; + patient.middleName = referredPatient.middleName; + patient.lastName = referredPatient.lastName; + patient.gender = referredPatient.gender; + patient.dateofBirth = referredPatient.dateofBirth; + patient.mobileNumber = referredPatient.mobileNumber; + patient.emailAddress = referredPatient.emailAddress; + patient.patientIdentificationNo = referredPatient.patientIdentificationNo; + patient.patientType = referredPatient.patientType; + patient.admissionNo = referredPatient.admissionNo; + patient.admissionDate = referredPatient.admissionDate; + patient.roomId = referredPatient.roomID; + patient.bedId = referredPatient.bedID; + patient.nationalityName = referredPatient.nationalityName; + patient.nationalityFlagURL = referredPatient.nationalityFlagURL; patient.age = referredPatient.age; - patient.clinicDescription = referredPatient.clinicDescription!; + patient.clinicDescription = referredPatient.clinicDescription; return patient; } PatiantInformtion getPatientFromDischargeReferralPatient(DischargeReferralPatient referredPatient) { PatiantInformtion patient = PatiantInformtion(); - patient.doctorId = referredPatient.doctorID!; - patient.doctorName = referredPatient.doctorName!; + patient.doctorId = referredPatient.doctorID; + patient.doctorName = referredPatient.doctorName; patient.patientId = referredPatient.patientID; - patient.firstName = referredPatient.firstName!; - patient.middleName = referredPatient.middleName!; - patient.lastName = referredPatient.lastName!; - patient.gender = referredPatient.gender!; - patient.dateofBirth = referredPatient.dateofBirth!; - patient.mobileNumber = referredPatient.mobileNumber!; - patient.emailAddress = referredPatient.emailAddress!; - patient.patientIdentificationNo = referredPatient.patientIdentificationNo!; - patient.patientType = referredPatient.patientType!; - patient.admissionNo = referredPatient.admissionNo!; - patient.admissionDate = referredPatient.admissionDate!; - patient.roomId = referredPatient.roomID!; - patient.bedId = referredPatient.bedID!; - patient.nationalityName = referredPatient.nationalityName!; + patient.firstName = referredPatient.firstName; + patient.middleName = referredPatient.middleName; + patient.lastName = referredPatient.lastName; + patient.gender = referredPatient.gender; + patient.dateofBirth = referredPatient.dateofBirth; + patient.mobileNumber = referredPatient.mobileNumber; + patient.emailAddress = referredPatient.emailAddress; + patient.patientIdentificationNo = referredPatient.patientIdentificationNo; + patient.patientType = referredPatient.patientType; + patient.admissionNo = referredPatient.admissionNo; + patient.admissionDate = referredPatient.admissionDate; + patient.roomId = referredPatient.roomID; + patient.bedId = referredPatient.bedID; + patient.nationalityName = referredPatient.nationalityName; patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL; patient.age = referredPatient.age; - patient.clinicDescription = referredPatient.clinicDescription!; + patient.clinicDescription = referredPatient.clinicDescription; return patient; } @@ -388,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 6ca5f94f..809c154f 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -18,23 +18,27 @@ import '../../locator.dart'; class UcafViewModel extends BaseViewModel { UcafService _ucafService = locator(); - List get patientChiefComplaintList => _ucafService.patientChiefComplaintList; + List get patientChiefComplaintList => + _ucafService.patientChiefComplaintList; - List get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory; + List get patientVitalSignsHistory => + _ucafService.patientVitalSignsHistory; - List get patientAssessmentList => _ucafService.patientAssessmentList; + List get patientAssessmentList => + _ucafService.patientAssessmentList; 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; - late Function saveUCAFOnTap; + Function saveUCAFOnTap; - late String selectedLanguage; + String selectedLanguage; String heightCm = "0"; String weightKg = "0"; String bodyMax = "0"; @@ -45,8 +49,8 @@ class UcafViewModel extends BaseViewModel { resetDataInFirst({bool firstPage = true}) { if(firstPage){ - _ucafService.patientVitalSignsHistory = []; - _ucafService.patientChiefComplaintList = []; + _ucafService.patientVitalSignsHistory = null; + _ucafService.patientChiefComplaintList = null; } _ucafService.patientAssessmentList = []; _ucafService.orderProcedureList = []; @@ -62,39 +66,48 @@ class UcafViewModel extends BaseViewModel { String from; String to; - - from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); - - to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + 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'); + } // 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') { + if (heightCm == "0" || heightCm == null || heightCm == 'null') { heightCm = element.heightCm.toString(); } - if (weightKg == "0" || weightKg == 'null') { + if (weightKg == "0" || weightKg == null || weightKg == 'null') { weightKg = element.weightKg.toString(); } - if (bodyMax == "0" || bodyMax == 'null') { + if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } - if (temperatureCelcius == "0" || temperatureCelcius == 'null') { + if (temperatureCelcius == "0" || + temperatureCelcius == null || + 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(); } }); @@ -108,18 +121,19 @@ 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); @@ -134,7 +148,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); @@ -147,7 +161,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); @@ -155,11 +169,13 @@ 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; @@ -167,7 +183,8 @@ 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; @@ -182,7 +199,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 83148044..bab2ff9f 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -11,9 +11,10 @@ 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; + List get patientVitalSignsHistory => + _vitalSignService.patientVitalSignsHistory; String heightCm = "0"; String weightKg = "0"; @@ -34,14 +35,15 @@ 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); } } - Future getPatientVitalSignHistory(PatiantInformtion patient, String from, String to, bool isInPatient) async { + Future getPatientVitalSignHistory(PatiantInformtion patient, String from, + String to, bool isInPatient) async { setState(ViewState.Busy); if (from == null || from == "0") { from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); @@ -57,7 +59,7 @@ class VitalSignsViewModel extends BaseViewModel { } if (_vitalSignService.hasError) { - error = _vitalSignService.error!; + error = _vitalSignService.error; setState(ViewState.Error); } else { patientVitalSignsHistory.forEach((element) { @@ -70,29 +72,50 @@ class VitalSignsViewModel extends BaseViewModel { if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } - if (temperatureCelcius == "0" || temperatureCelcius == null || temperatureCelcius == 'null') { + if (temperatureCelcius == "0" || + temperatureCelcius == null || + 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(); } - if (oxygenation == "0" || oxygenation == null || oxygenation == 'null') { - oxygenation = "${element.sAO2.toString()}"; /* - ${element.fIO2.toString()}*/ + if (oxygenation == "0" || + oxygenation == null || + oxygenation == 'null') { + oxygenation = + "${element.sAO2.toString()}"; /* - ${element.fIO2.toString()}*/ } if (painScore == null || painScore == "-") { - painScore = element.painScoreDesc.toString() != 'null' ? element.painScoreDesc.toString() : "-"; - painLocation = element.painLocation.toString() != 'null' ? element.painLocation.toString() : "-"; - painCharacter = element.painCharacter.toString() != 'null' ? element.painCharacter.toString() : "-"; - painDuration = element.painDuration.toString() != 'null' ? element.painDuration.toString() : "-"; - isPainDone = - element.isPainManagementDone.toString() != 'null' ? element.isPainManagementDone.toString() : "-"; - painFrequency = element.painFrequency.toString() != 'null' ? element.painFrequency.toString() : "-"; + painScore = element.painScoreDesc.toString() != 'null' + ? element.painScoreDesc.toString() + : "-"; + painLocation = element.painLocation.toString() != 'null' + ? element.painLocation.toString() + : "-"; + painCharacter = element.painCharacter.toString() != 'null' + ? element.painCharacter.toString() + : "-"; + painDuration = element.painDuration.toString() != 'null' + ? element.painDuration.toString() + : "-"; + isPainDone = element.isPainManagementDone.toString() != 'null' + ? element.isPainManagementDone.toString() + : "-"; + painFrequency = element.painFrequency.toString() != 'null' + ? element.painFrequency.toString() + : "-"; } }); setState(ViewState.Idle); @@ -140,6 +163,5 @@ class VitalSignsViewModel extends BaseViewModel { } else if (temperatureCelciusMethod == 5) { return "Temporal"; } - return ""; } } diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 2eb9772f..1d5f087a 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( - {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 { + {String selectedDoctorID, + String selectedClinicID, + int admissionNo, + String extension, + String priority, + String frequency, + String referringDoctorRemarks, + int patientID, + int patientTypeID, + String roomID, + 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 e89345ee..3f3e92be 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({required int patientId, required int admissionNo}) async { + Future getPendingOrders({int patientId, 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({required int patientId, required int admissionNo}) async { + Future getAdmissionOrders({int patientId, 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 53b95099..96645618 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 _prescriptionsOrderListHospital = []; + List _prescriptionsOrderListClinic = List(); + List _prescriptionsOrderListHospital = List(); 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 b1a23a14..2548a59c 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 _prescriptionsOrderListHospital = []; + List _prescriptionsOrderListClinic = List(); + List _prescriptionsOrderListHospital = List(); List get prescriptionReportList => _prescriptionsService.prescriptionReportList; @@ -32,13 +32,13 @@ class PrescriptionsViewModel extends BaseViewModel { List get medicationForInPatient => _prescriptionsService.medicationForInPatient; - List _medicationForInPatient = []; + List _medicationForInPatient = List(); 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 4de6bbe3..b576b7a4 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 _finalRadiologyListHospital = []; + List _finalRadiologyListClinic = List(); + List _finalRadiologyListHospital = List(); 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 templateList = List(); List get procedureTemplateDetails => _procedureService.templateDetailsList; - List _patientLabOrdersListClinic = []; - List _patientLabOrdersListHospital = []; + List _patientLabOrdersListClinic = List(); + List _patientLabOrdersListHospital = List(); - 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, appointmentNo: null); + await getProcedure(mrn: mrn); 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 labResultLists = List(); 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 controlsProcedure = List(); postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; - entityList!.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId!]; - List controls = []; + entityList.forEach((element) { + procedureValadteRequestModel.procedure = [element.procedureId]; + List controls = List(); 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 250f7cb7..9db5a6dd 100644 --- a/lib/core/viewModel/profile/discharge_summary_view_model.dart +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -14,44 +14,37 @@ class DischargeSummaryViewModel extends BaseViewModel { List get pendingDischargeSummaryList => _dischargeSummaryService.pendingDischargeSummaryList; + List get allDisChargeSummaryList => _dischargeSummaryService.allDischargeSummaryList; - Future getPendingDischargeSummary({ - required int patientId, - required int admissionNo, - }) async { - GetDischargeSummaryReqModel getDischargeSummaryReqModel = - GetDischargeSummaryReqModel( - admissionNo: admissionNo, patientID: patientId); + + Future getPendingDischargeSummary({int patientId, 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 1d37bc16..e3f4f430 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 087f5019..e7b7a80f 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -17,8 +17,8 @@ Helpers helpers = Helpers(); class ProjectViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); - late Locale _appLocale = Locale(currentLanguage); - String currentLanguage = 'en'; + Locale _appLocale; + String currentLanguage = 'ar'; bool _isArabic = false; bool isInternetConnection = true; List doctorClinicsList = []; @@ -30,11 +30,13 @@ class ProjectViewModel with ChangeNotifier { Locale get appLocal => _appLocale; bool get isArabic => _isArabic; - late StreamSubscription subscription; + StreamSubscription subscription; ProjectViewModel() { loadSharedPrefLanguage(); - subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { + subscription = Connectivity() + .onConnectivityChanged + .listen((ConnectivityResult result) { switch (result) { case ConnectivityResult.wifi: isInternetConnection = true; @@ -52,7 +54,7 @@ class ProjectViewModel with ChangeNotifier { void loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getString(APP_Language); - _appLocale = Locale(currentLanguage); + _appLocale = Locale(currentLanguage ?? 'en'); _isArabic = currentLanguage != null ? currentLanguage == 'ar' ? true @@ -92,7 +94,8 @@ class ProjectViewModel with ChangeNotifier { try { dynamic localRes; - await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, + onSuccess: (dynamic response, int statusCode) { doctorClinicsList = []; response['List_DoctorsClinic'].forEach((v) { doctorClinicsList.add(new ClinicModel.fromJson(v)); @@ -112,11 +115,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 8fbbfc7c..d656de6c 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -12,46 +12,57 @@ class RadiologyViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; RadiologyService _radiologyService = locator(); - List _finalRadiologyListClinic = []; - List _finalRadiologyListHospital = []; + List _finalRadiologyListClinic = List(); + List _finalRadiologyListHospital = List(); List get finalRadiologyList => - filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; + filterType == FilterType.Clinic + ? _finalRadiologyListClinic + : _finalRadiologyListHospital; - void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, + {isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); + await _radiologyService.getPatientRadOrders(patient, + isInPatient: isInPatient); if (_radiologyService.hasError) { - error = _radiologyService.error!; + error = _radiologyService.error; setState(ViewState.Error); } else { _radiologyService.finalRadiologyList.forEach((element) { - List finalRadiologyListClinic = _finalRadiologyListClinic - .where((elementClinic) => elementClinic.filterName == element.clinicDescription) - .toList(); + List finalRadiologyListClinic = + _finalRadiologyListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); if (finalRadiologyListClinic.length != 0) { - _finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] + _finalRadiologyListClinic[ + finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] .finalRadiologyList .add(element); } else { - _finalRadiologyListClinic - .add(FinalRadiologyList(filterName: element.clinicDescription, finalRadiology: element)); + _finalRadiologyListClinic.add(FinalRadiologyList( + filterName: element.clinicDescription, finalRadiology: element)); } // FinalRadiologyList list sort via project - List finalRadiologyListHospital = _finalRadiologyListHospital - .where( - (elementClinic) => elementClinic.filterName == element.projectName, - ) - .toList(); + List finalRadiologyListHospital = + _finalRadiologyListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); if (finalRadiologyListHospital.length != 0) { - _finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])] + _finalRadiologyListHospital[finalRadiologyListHospital + .indexOf(finalRadiologyListHospital[0])] .finalRadiologyList .add(element); } else { - _finalRadiologyListHospital.add(FinalRadiologyList(filterName: element.projectName, finalRadiology: element)); + _finalRadiologyListHospital.add(FinalRadiologyList( + filterName: element.projectName, finalRadiology: element)); } }); @@ -61,12 +72,19 @@ 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, lineItem: lineItem, projectId: projectId, patient: patient); + invoiceNo: invoiceNo, + lineItem: lineItem, + 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 c8993da0..892284e2 100644 --- a/lib/core/viewModel/referral_view_model.dart +++ b/lib/core/viewModel/referral_view_model.dart @@ -6,25 +6,28 @@ import '../../locator.dart'; import 'base_view_model.dart'; class ReferralPatientViewModel extends BaseViewModel { - ReferralPatientService _referralPatientService = locator(); + ReferralPatientService _referralPatientService = + locator(); - List get listMyReferralPatientModel => _referralPatientService.listMyReferralPatientModel; + List get listMyReferralPatientModel => + _referralPatientService.listMyReferralPatientModel; Future getMyReferralPatient() async { setState(ViewState.Busy); await _referralPatientService.getMyReferralPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future replay(String referredDoctorRemarks, MyReferralPatientModel model) async { + Future replay( + String referredDoctorRemarks, MyReferralPatientModel model) async { 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 02f98ef7..b49078c7 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 681d7321..3ee64c9b 100644 --- a/lib/core/viewModel/schedule_view_model.dart +++ b/lib/core/viewModel/schedule_view_model.dart @@ -8,13 +8,14 @@ import 'base_view_model.dart'; class ScheduleViewModel extends BaseViewModel { ScheduleService _scheduleService = locator(); - List get listDoctorWorkingHoursTable => _scheduleService.listDoctorWorkingHoursTable; + List get listDoctorWorkingHoursTable => + _scheduleService.listDoctorWorkingHoursTable; Future getDoctorSchedule() async { 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 181f5c94..7a7f4575 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -34,11 +34,12 @@ class SickLeaveViewModel extends BaseViewModel { ..._sickLeaveService.getAllSickLeavePatient, ..._sickLeaveService.getAllSickLeaveDoctor ]; + Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { setState(ViewState.BusyLocal); await _sickLeaveService.addSickLeave(addSickLeaveRequest); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -48,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); @@ -58,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); @@ -68,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); @@ -81,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 @@ -98,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 @@ -112,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); @@ -122,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); @@ -132,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); @@ -142,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); @@ -152,8 +153,8 @@ class SickLeaveViewModel extends BaseViewModel { //setState(ViewState.Busy); await _sickLeaveService.getCoveringDoctors(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; -// setState(ViewState.Error); + error = _sickLeaveService.error; + // setState(ViewState.Error); } //else // setState(ViewState.Idle); @@ -164,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); @@ -174,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 2c375a7a..a73be2e3 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -11,7 +11,7 @@ /// fonts: /// - asset: fonts/DoctorApp.ttf /// -/// +/// /// * MFG Labs, Copyright (C) 2012 by Daniel Bruce /// Author: MFG Labs /// License: SIL (http://scripts.sil.org/OFL) @@ -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); @@ -192,7 +192,6 @@ class DoctorApp { static const IconData verify_finger = IconData(0xe8a4, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData verify_whtsapp = IconData(0xe8a5, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData verify_sms = IconData(0xe8a6, fontFamily: _kFontFam, fontPackage: _kFontPkg); - /// static const IconData 124 = IconData(0xe8a7, fontFamily: _kFontFam, fontPackage: _kFontPkg); ///static const IconData 123 = IconData(0xe8a8, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData obese_bmi_r_1 = IconData(0xe8a9, fontFamily: _kFontFam, fontPackage: _kFontPkg); diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 1f168dab..72b5c857 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; 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/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'; @@ -16,7 +17,7 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State { int currentTab = 0; - late PageController pageController; + PageController pageController; _changeCurrentTab(int tab) { setState(() { @@ -39,11 +40,14 @@ class _LandingPageState extends State { elevation: 0, backgroundColor: Colors.grey[100], //textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), - title: currentTab != 0 ? Text(getText(currentTab).toUpperCase()) : SizedBox(), + title: currentTab != 0 + ? Text(getText(currentTab).toUpperCase()) + : SizedBox(), leading: Builder( builder: (BuildContext context) { return IconButton( - icon: Image.asset('assets/images/menu.png', height: 50, width: 50), + icon: Image.asset('assets/images/menu.png', + height: 50, width: 50), iconSize: 15, color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), @@ -94,7 +98,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 3e0e9cbc..c3493832 100644 --- a/lib/models/SOAP/Allergy_model.dart +++ b/lib/models/SOAP/Allergy_model.dart @@ -1,32 +1,32 @@ 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, - this.allergyDiseaseName, - this.allergyDiseaseType, - this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.episodeID, - this.isChecked, - this.isUpdatedByNurse, - this.severity, - this.severityName}); + this.allergyDiseaseName, + this.allergyDiseaseType, + this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.episodeID, + this.isChecked, + this.isUpdatedByNurse, + this.severity, + this.severityName}); - AllergyModel.fromJson(Map json) { + AllergyModel.fromJson(Map json) { allergyDiseaseId = json['allergyDiseaseId']; allergyDiseaseName = json['allergyDiseaseName']; allergyDiseaseType = json['allergyDiseaseType']; @@ -41,8 +41,8 @@ class AllergyModel { severityName = json['severityName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['allergyDiseaseId'] = this.allergyDiseaseId; data['allergyDiseaseName'] = this.allergyDiseaseName; data['allergyDiseaseType'] = this.allergyDiseaseType; diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 25c38d8f..f04fd8d4 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -1,12 +1,13 @@ 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}); + GetChiefComplaintReqModel( + {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo}); GetChiefComplaintReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -14,7 +15,7 @@ class GetChiefComplaintReqModel { episodeId = json['EpisodeId']; episodeID = json['EpisodeID']; doctorID = json['DoctorID']; - admissionNo = json['admissionNo']; + admissionNo = json['admissionNo']; } Map toJson() { diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart index f8a48ed0..85ada324 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart @@ -1,32 +1,32 @@ 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, - this.ccdate, - this.chiefComplaint, - this.clinicDescription, - this.clinicID, - this.currentMedication, - this.doctorID, - this.doctorName, - this.episodeId, - this.hopi, - this.patientMRN, - this.status}); + this.ccdate, + this.chiefComplaint, + this.clinicDescription, + this.clinicID, + this.currentMedication, + this.doctorID, + this.doctorName, + this.episodeId, + this.hopi, + this.patientMRN, + this.status}); - GetChiefComplaintResModel.fromJson(Map json) { + GetChiefComplaintResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; ccdate = json['ccdate']; chiefComplaint = json['chiefComplaint']; @@ -41,8 +41,8 @@ class GetChiefComplaintResModel { status = json['status']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['appointmentNo'] = this.appointmentNo; data['ccdate'] = this.ccdate; data['chiefComplaint'] = this.chiefComplaint; diff --git a/lib/models/SOAP/GeneralGetReqForSOAP.dart b/lib/models/SOAP/GeneralGetReqForSOAP.dart index 65ba7d6b..70e76313 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 745b169a..1eeca63e 100644 --- a/lib/models/SOAP/GetAllergiesResModel.dart +++ b/lib/models/SOAP/GetAllergiesResModel.dart @@ -1,32 +1,31 @@ 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, - this.allergyDiseaseName, - this.allergyDiseaseType, - this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.episodeID, - this.isChecked, - this.isUpdatedByNurse, - this.severity, - this.severityName, - this.remarks = ''}); + this.allergyDiseaseName, + this.allergyDiseaseType, + this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.episodeID, + this.isChecked, + this.isUpdatedByNurse, + this.severity, + this.severityName, this.remarks=''}); GetAllergiesResModel.fromJson(Map json) { allergyDiseaseId = json['allergyDiseaseId']; diff --git a/lib/models/SOAP/GetAssessmentReqModel.dart b/lib/models/SOAP/GetAssessmentReqModel.dart index fffe4f92..965382b5 100644 --- a/lib/models/SOAP/GetAssessmentReqModel.dart +++ b/lib/models/SOAP/GetAssessmentReqModel.dart @@ -1,22 +1,22 @@ 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; GetAssessmentReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to, - this.clinicID, - this.editedBy, - this.doctorID}); + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.editedBy, + this.doctorID}); GetAssessmentReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/SOAP/GetAssessmentResModel.dart b/lib/models/SOAP/GetAssessmentResModel.dart index fb92f994..4d1b1b68 100644 --- a/lib/models/SOAP/GetAssessmentResModel.dart +++ b/lib/models/SOAP/GetAssessmentResModel.dart @@ -1,36 +1,36 @@ 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, - this.asciiDesc, - this.clinicDescription, - this.clinicID, - this.complexDiagnosis, - this.conditionID, - this.createdBy, - this.createdOn, - this.diagnosisTypeID, - this.doctorID, - this.doctorName, - this.episodeId, - this.icdCode10ID, - this.patientMRN, - this.remarks}); + this.asciiDesc, + this.clinicDescription, + this.clinicID, + this.complexDiagnosis, + this.conditionID, + this.createdBy, + this.createdOn, + this.diagnosisTypeID, + this.doctorID, + this.doctorName, + this.episodeId, + this.icdCode10ID, + this.patientMRN, + this.remarks}); GetAssessmentResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetGetProgressNoteReqModel.dart b/lib/models/SOAP/GetGetProgressNoteReqModel.dart index 0a36bb94..1da4a8bf 100644 --- a/lib/models/SOAP/GetGetProgressNoteReqModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteReqModel.dart @@ -1,22 +1,22 @@ 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; GetGetProgressNoteReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to, - this.clinicID, - this.editedBy, - this.doctorID}); + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.editedBy, + this.doctorID}); GetGetProgressNoteReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -27,6 +27,7 @@ class GetGetProgressNoteReqModel { clinicID = json['ClinicID']; doctorID = json['DoctorID']; editedBy = json['EditedBy']; + } Map toJson() { diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/models/SOAP/GetGetProgressNoteResModel.dart index e5923ac8..4ae7ed8c 100644 --- a/lib/models/SOAP/GetGetProgressNoteResModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteResModel.dart @@ -1,28 +1,28 @@ -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, - this.createdBy, - this.createdByName, - this.createdOn, - this.dName, - this.editedByName, - this.editedOn, - this.episodeId, - this.mName, - this.patientMRN, - this.planNote}); + this.createdBy, + this.createdByName, + this.createdOn, + this.dName, + this.editedByName, + this.editedOn, + this.episodeId, + this.mName, + this.patientMRN, + this.planNote}); GetPatientProgressNoteResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/models/SOAP/GetHistoryReqModel.dart index b4a5f404..720b6342 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; @@ -30,6 +30,7 @@ class GetHistoryReqModel { doctorID = json['DoctorID']; appointmentNo = json['AppointmentNo']; editedBy = json['EditedBy']; + } Map toJson() { diff --git a/lib/models/SOAP/GetHistoryResModel.dart b/lib/models/SOAP/GetHistoryResModel.dart index 9773aea8..c4b4f129 100644 --- a/lib/models/SOAP/GetHistoryResModel.dart +++ b/lib/models/SOAP/GetHistoryResModel.dart @@ -1,20 +1,20 @@ 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, - this.episodeId, - this.historyId, - this.historyType, - this.isChecked, - this.patientMRN, - this.remarks}); + this.episodeId, + this.historyId, + this.historyType, + this.isChecked, + this.patientMRN, + this.remarks}); GetHistoryResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetPhysicalExamListResModel.dart b/lib/models/SOAP/GetPhysicalExamListResModel.dart index 952e3a5c..c97189b1 100644 --- a/lib/models/SOAP/GetPhysicalExamListResModel.dart +++ b/lib/models/SOAP/GetPhysicalExamListResModel.dart @@ -1,44 +1,44 @@ class GetPhysicalExamResModel { - 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; + 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; GetPhysicalExamResModel( {this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.editedBy, - this.editedByName, - this.editedOn, - this.episodeId, - this.examId, - this.examName, - this.examType, - this.examinationType, - this.examinationTypeName, - this.isAbnormal, - this.isNew, - this.isNormal, - this.notExamined, - this.patientMRN, - this.remarks}); + this.createdBy, + this.createdByName, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedOn, + this.episodeId, + this.examId, + this.examName, + this.examType, + this.examinationType, + this.examinationTypeName, + this.isAbnormal, + this.isNew, + this.isNormal, + this.notExamined, + this.patientMRN, + this.remarks}); GetPhysicalExamResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index ea2d8f97..710dafd1 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 c52a6a51..8cbf5cb7 100644 --- a/lib/models/SOAP/PatchAssessmentReqModel.dart +++ b/lib/models/SOAP/PatchAssessmentReqModel.dart @@ -1,24 +1,24 @@ 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, - this.appointmentNo, - this.episodeID, - this.icdcode10Id, - this.prevIcdCode10ID, - this.conditionId, - this.diagnosisTypeId, - this.complexDiagnosis, - this.remarks}); + this.appointmentNo, + this.episodeID, + this.icdcode10Id, + this.prevIcdCode10ID, + this.conditionId, + this.diagnosisTypeId, + this.complexDiagnosis, + this.remarks}); PatchAssessmentReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/SOAP/PostEpisodeReqModel.dart b/lib/models/SOAP/PostEpisodeReqModel.dart index 75402036..6d3ee45a 100644 --- a/lib/models/SOAP/PostEpisodeReqModel.dart +++ b/lib/models/SOAP/PostEpisodeReqModel.dart @@ -1,10 +1,14 @@ class PostEpisodeReqModel { - int? appointmentNo; - int? patientMRN; - int? doctorID; - String? vidaAuthTokenID; + int appointmentNo; + int patientMRN; + int doctorID; + String vidaAuthTokenID; - PostEpisodeReqModel({this.appointmentNo, this.patientMRN, this.doctorID, this.vidaAuthTokenID}); + PostEpisodeReqModel( + {this.appointmentNo, + this.patientMRN, + this.doctorID, + this.vidaAuthTokenID}); PostEpisodeReqModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; diff --git a/lib/models/SOAP/get_Allergies_request_model.dart b/lib/models/SOAP/get_Allergies_request_model.dart index 25177e3e..7676d530 100644 --- a/lib/models/SOAP/get_Allergies_request_model.dart +++ b/lib/models/SOAP/get_Allergies_request_model.dart @@ -1,11 +1,16 @@ 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, this.patientMRN, this.appointmentNo, this.episodeId, this.doctorID}); + GetAllergiesRequestModel( + {this.vidaAuthTokenID, + this.patientMRN, + this.appointmentNo, + this.episodeId, + this.doctorID}); GetAllergiesRequestModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; diff --git a/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart b/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart index 4d5efc98..2b49066e 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 b9ea104e..2dff7a60 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 0f1a4c5a..a1c32039 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,31 +8,31 @@ 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, - this.aliasN, - this.code, - this.description, - this.detail1, - this.detail2, - this.detail3, - this.detail4, - this.detail5, - this.groupID, - this.id, - this.nameAr, - this.nameEn, - this.remarks, - this.typeId, - this.valueList}); + this.aliasN, + this.code, + this.description, + this.detail1, + this.detail2, + this.detail3, + this.detail4, + this.detail5, + this.groupID, + this.id, + this.nameAr, + this.nameEn, + this.remarks, + this.typeId, + this.valueList}); MasterKeyModel.fromJson(Map json) { alias = json['alias']; diff --git a/lib/models/SOAP/order-procedure.dart b/lib/models/SOAP/order-procedure.dart index 24865e44..4e134a07 100644 --- a/lib/models/SOAP/order-procedure.dart +++ b/lib/models/SOAP/order-procedure.dart @@ -1,54 +1,55 @@ 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, - 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.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}); OrderProcedure.fromJson(Map json) { achiCode = json['achiCode']; @@ -105,4 +106,5 @@ class OrderProcedure { data['template'] = this.template; return data; } -} + +} \ No newline at end of file diff --git a/lib/models/SOAP/post_allergy_request_model.dart b/lib/models/SOAP/post_allergy_request_model.dart index 9488a965..6783d885 100644 --- a/lib/models/SOAP/post_allergy_request_model.dart +++ b/lib/models/SOAP/post_allergy_request_model.dart @@ -1,13 +1,16 @@ class PostAllergyRequestModel { - List? listHisProgNotePatientAllergyDiseaseVM; + List + listHisProgNotePatientAllergyDiseaseVM; PostAllergyRequestModel({this.listHisProgNotePatientAllergyDiseaseVM}); PostAllergyRequestModel.fromJson(Map json) { if (json['listHisProgNotePatientAllergyDiseaseVM'] != null) { - listHisProgNotePatientAllergyDiseaseVM = []; + listHisProgNotePatientAllergyDiseaseVM = + new List(); json['listHisProgNotePatientAllergyDiseaseVM'].forEach((v) { - listHisProgNotePatientAllergyDiseaseVM!.add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); + listHisProgNotePatientAllergyDiseaseVM + .add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); }); } } @@ -15,42 +18,44 @@ 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, - this.allergyDiseaseType, - this.allergyDiseaseId, - this.episodeId, - this.appointmentNo, - this.severity, - this.isChecked, - this.isUpdatedByNurse, - this.remarks, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn}); + this.allergyDiseaseType, + this.allergyDiseaseId, + this.episodeId, + this.appointmentNo, + this.severity, + this.isChecked, + this.isUpdatedByNurse, + this.remarks, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn}); ListHisProgNotePatientAllergyDiseaseVM.fromJson(Map json) { patientMRN = json['patientMRN']; diff --git a/lib/models/SOAP/post_assessment_request_model.dart b/lib/models/SOAP/post_assessment_request_model.dart index 3222f248..af577671 100644 --- a/lib/models/SOAP/post_assessment_request_model.dart +++ b/lib/models/SOAP/post_assessment_request_model.dart @@ -1,19 +1,23 @@ 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 = []; + icdCodeDetails = new List(); json['icdCodeDetails'].forEach((v) { - icdCodeDetails!.add(new IcdCodeDetails.fromJson(v)); + icdCodeDetails.add(new IcdCodeDetails.fromJson(v)); }); } } @@ -24,20 +28,26 @@ 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 56b97a92..682342df 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 89b6586d..d8be3fb2 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 = []; + listMedicalHistoryVM = new List(); json['listMedicalHistoryVM'].forEach((v) { - listMedicalHistoryVM!.add(new ListMedicalHistoryVM.fromJson(v)); + listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v)); }); } doctorID = json['DoctorID']; @@ -17,7 +17,8 @@ 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; @@ -25,22 +26,22 @@ 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, - this.historyType, - this.historyId, - this.episodeId, - this.appointmentNo, - this.isChecked, - this.remarks}); + this.historyType, + this.historyId, + this.episodeId, + this.appointmentNo, + this.isChecked, + this.remarks}); ListMedicalHistoryVM.fromJson(Map json) { patientMRN = json['patientMRN']; diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index 95baafda..f056f168 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -1,15 +1,16 @@ 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)); }); } } @@ -19,7 +20,7 @@ class PostPhysicalExamRequestModel { if (this.listHisProgNotePhysicalExaminationVM != null) { data['listHisProgNotePhysicalExaminationVM'] = this .listHisProgNotePhysicalExaminationVM - !.map((v) => v.toJson()) + .map((v) => v.toJson()) .toList(); } return data; @@ -27,31 +28,32 @@ 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.admissionNo, + this.examType, this.examId, this.patientMRN, this.isNormal, @@ -72,7 +74,9 @@ class ListHisProgNotePhysicalExaminationVM { 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']; @@ -95,7 +99,8 @@ 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 da603bee..2925819d 100644 --- a/lib/models/SOAP/post_progress_note_request_model.dart +++ b/lib/models/SOAP/post_progress_note_request_model.dart @@ -1,13 +1,18 @@ class PostProgressNoteRequestModel { - int? appointmentNo; - int? episodeId; - int? patientMRN; - String? planNote; + int appointmentNo; + int episodeId; + int patientMRN; + String planNote; dynamic doctorID; dynamic editedBy; PostProgressNoteRequestModel( - {this.appointmentNo, this.episodeId, this.patientMRN, this.planNote, this.doctorID, this.editedBy}); + {this.appointmentNo, + this.episodeId, + this.patientMRN, + this.planNote, + this.doctorID, + this.editedBy}); PostProgressNoteRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; diff --git a/lib/models/SOAP/selected_items/my_selected_allergy.dart b/lib/models/SOAP/selected_items/my_selected_allergy.dart index 01d47b22..512a4f64 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, @@ -19,4 +19,5 @@ class MySelectedAllergy { this.isLocal = true, this.createdBy, this.hasValidationError = false}); + } diff --git a/lib/models/SOAP/selected_items/my_selected_assement.dart b/lib/models/SOAP/selected_items/my_selected_assement.dart index acadceda..01572e6d 100644 --- a/lib/models/SOAP/selected_items/my_selected_assement.dart +++ b/lib/models/SOAP/selected_items/my_selected_assement.dart @@ -1,26 +1,24 @@ 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, this.selectedDiagnosisCondition, this.selectedDiagnosisType, - this.remark, - this.appointmentId, - this.createdBy, - this.createdOn, - this.doctorID, - this.doctorName, - this.icdCode10ID}); + this.remark, this.appointmentId, this.createdBy, + this.createdOn, + this.doctorID, + this.doctorName, + this.icdCode10ID}); } diff --git a/lib/models/SOAP/selected_items/my_selected_history.dart b/lib/models/SOAP/selected_items/my_selected_history.dart index 177fb46e..3769c418 100644 --- a/lib/models/SOAP/selected_items/my_selected_history.dart +++ b/lib/models/SOAP/selected_items/my_selected_history.dart @@ -3,8 +3,8 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedHistory { MasterKeyModel selectedHistory; String remark; - bool? isChecked; - bool? isLocal; + bool isChecked; + bool isLocal; MySelectedHistory( {this.selectedHistory, this.remark, this.isChecked, this.isLocal = true}); diff --git a/lib/models/admisson_orders/admission_orders_model.dart b/lib/models/admisson_orders/admission_orders_model.dart index 01539342..a0891a02 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 4b6296e5..897bb8f8 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 79ba027e..89797fab 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 5719b06b..0e03e899 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 = []; + summaryoptions = new List(); json['summaryoptions'].forEach((v) { - summaryoptions!.add(new Summaryoptions.fromJson(v)); + summaryoptions.add(new Summaryoptions.fromJson(v)); }); } } @@ -21,20 +21,21 @@ 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, 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 c732fa71..ec19abb0 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 a69f812f..287f40f1 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 cc643e3f..2d2c14ad 100644 --- a/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart +++ b/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart @@ -1,14 +1,11 @@ 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 214acc97..10ddab00 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 690837fe..e5eb8eee 100644 --- a/lib/models/doctor/clinic_model.dart +++ b/lib/models/doctor/clinic_model.dart @@ -6,14 +6,20 @@ *@desc: Clinic Model */ class ClinicModel { - dynamic setupID; - int? projectID; - int? doctorID; - int? clinicID; - bool? isActive; - String? clinicName; + Null 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 f0221c34..c2f5b0dd 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; - dynamic doctorNameN; - int? clinicID; - String? clinicDescription; - dynamic clinicDescriptionN; - dynamic licenseExpiry; - int? employmentType; + int doctorID; + String doctorName; + Null doctorNameN; + int clinicID; + String clinicDescription; + Null clinicDescriptionN; + Null licenseExpiry; + int employmentType; dynamic setupID; - 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; + 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; 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['IsDoctorAppoint?mentDisplayed']; + isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed']; 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['IsAppoint?mentAllowed']; + isAppointmentAllowed = json['IsAppointmentAllowed']; 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['IsDoctorAppoint?mentDisplayed'] = this.isDoctorAppointmentDisplayed; + data['IsDoctorAppointmentDisplayed'] = 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['IsAppoint?mentAllowed'] = this.isAppointmentAllowed; + data['IsAppointmentAllowed'] = 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 fa6f53a6..4712d285 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -1,11 +1,12 @@ 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, @@ -34,7 +35,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 0e630c5f..656a43dd 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -1,75 +1,74 @@ 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']; @@ -105,8 +104,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 147809ea..115f389d 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -6,19 +6,19 @@ *@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, @@ -29,7 +29,7 @@ class ProfileReqModel { this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress = '11.11.11.11', - // this.versionID = 5.5, + // this.versionID=5.5, this.channel = 9, this.sessionID = 'E2bsEeYEJo', this.tokenID, diff --git a/lib/models/doctor/replay/request_create_doctor_response.dart b/lib/models/doctor/replay/request_create_doctor_response.dart index 0544ef05..49e421d9 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 8283801a..82384586 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, @@ -34,7 +34,7 @@ class RequestDoctorReply { this.infoStatus, this.pageSize}); - RequestDoctorReply.fromJson(Map json) { + RequestDoctorReply.fromJson(Map json) { projectID = json['ProjectID']; doctorID = json['DoctorID']; transactionNo = json['TransactionNo']; @@ -68,7 +68,8 @@ class RequestDoctorReply { data['PatientOutSA'] = this.patientOutSA; data['PageIndex'] = this.pageIndex; data['PageSize'] = this.pageSize; - if (this.infoStatus != null) data['InfoStatus'] = this.infoStatus; + if(this.infoStatus != null) + data['InfoStatus'] = this.infoStatus; return data; } } diff --git a/lib/models/doctor/request_add_referred_doctor_remarks.dart b/lib/models/doctor/request_add_referred_doctor_remarks.dart index e4d3ecdb..b396c47f 100644 --- a/lib/models/doctor/request_add_referred_doctor_remarks.dart +++ b/lib/models/doctor/request_add_referred_doctor_remarks.dart @@ -1,40 +1,41 @@ 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, - 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.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}); RequestAddReferredDoctorRemarks.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/doctor/request_schedule.dart b/lib/models/doctor/request_schedule.dart index decd97e6..ae7b80aa 100644 --- a/lib/models/doctor/request_schedule.dart +++ b/lib/models/doctor/request_schedule.dart @@ -1,18 +1,20 @@ + + 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 8b810fe0..08fa03f3 100644 --- a/lib/models/doctor/statstics_for_certain_doctor_request.dart +++ b/lib/models/doctor/statstics_for_certain_doctor_request.dart @@ -1,13 +1,18 @@ 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 66768c8a..95035f8d 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 97c00390..b9bfce0a 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,15 +65,18 @@ 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 e3cc2722..7a1ae8eb 100644 --- a/lib/models/livecare/end_call_req.dart +++ b/lib/models/livecare/end_call_req.dart @@ -1,11 +1,12 @@ 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 2ed2638a..719b9134 100644 --- a/lib/models/livecare/get_panding_req_list.dart +++ b/lib/models/livecare/get_panding_req_list.dart @@ -1,11 +1,16 @@ 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']); @@ -18,7 +23,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; @@ -28,9 +33,9 @@ class LiveCarePendingListRequest { } class PatientData { - bool? isOutKSA; + bool isOutKSA; - PatientData({required this.isOutKSA}); + PatientData({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 85d62d35..b45c53b9 100644 --- a/lib/models/livecare/get_pending_res_list.dart +++ b/lib/models/livecare/get_pending_res_list.dart @@ -1,43 +1,43 @@ 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, @@ -80,11 +80,11 @@ class LiveCarePendingListResponse { this.vCID, this.voipToken}); - LiveCarePendingListResponse.fromJson(Map json) { + LiveCarePendingListResponse.fromJson(Map json) { acceptedBy = json['AcceptedBy']; acceptedOn = json['AcceptedOn']; age = json['Age']; - appointmentNo = json['Appoint?mentNo']; + appointmentNo = json['AppointmentNo']; 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['Appoint?mentNo'] = this.appointmentNo; + data['AppointmentNo'] = 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 18d5ae6b..7e7a3e43 100644 --- a/lib/models/livecare/session_status_model.dart +++ b/lib/models/livecare/session_status_model.dart @@ -1,10 +1,14 @@ 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 cdc8c924..b3ceabb5 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 c4b0d224..44921d5f 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 291528b9..841f5e7d 100644 --- a/lib/models/livecare/transfer_to_admin.dart +++ b/lib/models/livecare/transfer_to_admin.dart @@ -1,12 +1,18 @@ 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 cecbce0b..f6d72b1b 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,54 +1,54 @@ 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, - this.patientID, - this.reservationNo, - this.admissionNo, - this.preOpDiagmosis, - this.postOpDiagmosis, - this.surgeon, - this.assistant, - this.anasthetist, - this.operation, - this.inasion, - this.finding, - this.surgeryProcedure, - this.postOpInstruction, - this.createdBy, - this.editedBy, - this.complicationDetails, - this.bloodLossDetail, - this.histopathSpecimen, - this.microbiologySpecimen, - this.otherSpecimen, - this.scrubNurse, - this.circulatingNurse, - this.bloodTransfusedDetail}); + this.patientID, + this.reservationNo, + this.admissionNo, + this.preOpDiagmosis, + this.postOpDiagmosis, + this.surgeon, + this.assistant, + this.anasthetist, + this.operation, + this.inasion, + this.finding, + this.surgeryProcedure, + this.postOpInstruction, + this.createdBy, + this.editedBy, + this.complicationDetails, + this.bloodLossDetail, + this.histopathSpecimen, + this.microbiologySpecimen, + this.otherSpecimen, + this.scrubNurse, + this.circulatingNurse, + this.bloodTransfusedDetail}); CreateUpdateOperationReportRequestModel.fromJson(Map json) { setupID = json['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 fd7be8a4..7e23b503 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 b57acc4a..04540ea6 100644 --- a/lib/models/operation_report/get_operation_details_response_modle.dart +++ b/lib/models/operation_report/get_operation_details_response_modle.dart @@ -1,74 +1,74 @@ 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; GetOperationDetailsResponseModel( {this.setupID, - this.projectID, - this.reservationNo, - this.patientID, - this.admissionID, - this.surgeryDate, - this.preOpDiagnosis, - this.postOpDiagnosis, - this.surgeon, - this.assistant, - this.anasthetist, - this.operation, - this.inasion, - this.finding, - this.surgeryProcedure, - this.postOpInstruction, - this.isActive, - this.createdBy, - this.createdName, - this.createdNameN, - this.createdOn, - this.editedBy, - this.editedByName, - this.editedByNameN, - this.editedOn, - this.oRBookStatus, - this.complicationDetail, - this.bloodLossDetail, - this.histopathSpecimen, - this.microbiologySpecimen, - this.otherSpecimen, - this.scrubNurse, - this.circulatingNurse, - this.bloodTransfusedDetail}); + this.projectID, + this.reservationNo, + this.patientID, + this.admissionID, + this.surgeryDate, + this.preOpDiagnosis, + this.postOpDiagnosis, + this.surgeon, + this.assistant, + this.anasthetist, + this.operation, + this.inasion, + this.finding, + this.surgeryProcedure, + this.postOpInstruction, + this.isActive, + this.createdBy, + this.createdName, + this.createdNameN, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedByNameN, + this.editedOn, + this.oRBookStatus, + this.complicationDetail, + this.bloodLossDetail, + this.histopathSpecimen, + this.microbiologySpecimen, + this.otherSpecimen, + this.scrubNurse, + this.circulatingNurse, + this.bloodTransfusedDetail}); GetOperationDetailsResponseModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/operation_report/get_reservations_request_model.dart b/lib/models/operation_report/get_reservations_request_model.dart index 8de0bbf3..06425254 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 b6191353..3bebdc8b 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 aa0d1279..f00e84a0 100644 --- a/lib/models/patient/MedicalReport/MedicalReportTemplate.dart +++ b/lib/models/patient/MedicalReport/MedicalReportTemplate.dart @@ -1,32 +1,32 @@ 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) { + MedicalReportTemplate.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; templateID = json['TemplateID']; @@ -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 6cfe81ca..74ee53a5 100644 --- a/lib/models/patient/MedicalReport/MeidcalReportModel.dart +++ b/lib/models/patient/MedicalReport/MeidcalReportModel.dart @@ -1,60 +1,60 @@ 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, - this.setupID, - this.projectID, - this.projectName, - this.projectNameN, - this.patientID, - this.invoiceNo, - this.status, - this.verifiedOn, - this.verifiedBy, - this.editedOn, - this.editedBy, - this.lineItemNo, - this.createdOn, - this.templateID, - this.doctorID, - this.doctorGender, - this.doctorGenderDescription, - this.doctorGenderDescriptionN, - this.doctorImageURL, - this.doctorName, - this.doctorNameN, - this.clinicID, - this.clinicName, - this.clinicNameN, - this.reportDataHtml}); + this.setupID, + this.projectID, + this.projectName, + this.projectNameN, + this.patientID, + this.invoiceNo, + this.status, + this.verifiedOn, + this.verifiedBy, + this.editedOn, + this.editedBy, + this.lineItemNo, + this.createdOn, + this.templateID, + this.doctorID, + this.doctorGender, + this.doctorGenderDescription, + this.doctorGenderDescriptionN, + this.doctorImageURL, + this.doctorName, + this.doctorNameN, + this.clinicID, + this.clinicName, + this.clinicNameN, + this.reportDataHtml}); - MedicalReportModel.fromJson(Map json) { + MedicalReportModel.fromJson(Map json) { reportData = json['ReportData']; setupID = json['SetupID']; projectID = json['ProjectID']; @@ -83,8 +83,8 @@ class MedicalReportModel { reportDataHtml = json['ReportDataHtml']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ReportData'] = this.reportData; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; diff --git a/lib/models/patient/PatientArrivalEntity.dart b/lib/models/patient/PatientArrivalEntity.dart index 710cd70f..54622cd7 100644 --- a/lib/models/patient/PatientArrivalEntity.dart +++ b/lib/models/patient/PatientArrivalEntity.dart @@ -1,44 +1,44 @@ 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, - this.appointmentDate, - this.appointmentNo, - this.appointmentType, - this.arrivedOn, - this.companyName, - this.endTime, - this.episodeNo, - this.fallRiskScore, - this.gender, - this.medicationOrders, - this.mobileNumber, - this.nationality, - this.patientMRN, - this.patientName, - this.rowCount, - this.startTime, - this.visitType}); + this.appointmentDate, + this.appointmentNo, + this.appointmentType, + this.arrivedOn, + this.companyName, + this.endTime, + this.episodeNo, + this.fallRiskScore, + this.gender, + this.medicationOrders, + this.mobileNumber, + this.nationality, + this.patientMRN, + this.patientName, + this.rowCount, + this.startTime, + this.visitType}); - PatientArrivalEntity.fromJson(Map json) { + PatientArrivalEntity.fromJson(Map json) { age = json['age']; appointmentDate = json['appointmentDate']; appointmentNo = json['appointmentNo']; @@ -59,8 +59,8 @@ class PatientArrivalEntity { visitType = json['visitType']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['age'] = this.age; data['appointmentDate'] = this.appointmentDate; data['appointmentNo'] = this.appointmentNo; @@ -81,4 +81,4 @@ class PatientArrivalEntity { data['visitType'] = this.visitType; return data; } -} +} \ No newline at end of file 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 c3ba279d..09198dc0 100644 --- a/lib/models/patient/get_clinic_by_project_id_request.dart +++ b/lib/models/patient/get_clinic_by_project_id_request.dart @@ -1,5 +1,6 @@ class ClinicByProjectIdRequest { - /* + + /* *@author: Ibrahim Albitar *@Date:03/06/2020 *@param: @@ -7,17 +8,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, @@ -47,7 +48,7 @@ class ClinicByProjectIdRequest { this.patientOutSA = false, this.patientTypeID = 1}); - ClinicByProjectIdRequest.fromJson(Map json) { + ClinicByProjectIdRequest.fromJson(Map json) { projectID = json['ProjectID']; languageID = json['LanguageID']; stamp = json['stamp']; 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 351f19f7..9504fc35 100644 --- a/lib/models/patient/get_doctor_by_clinic_id_request.dart +++ b/lib/models/patient/get_doctor_by_clinic_id_request.dart @@ -1,31 +1,35 @@ 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; - DoctorsByClinicIdRequest({ - this.clinicID, - this.projectID, - this.continueDentalPlan = false, - this.isSearchAppointmnetByClinicID = true, - this.patientID, - this.gender, - this.isGetNearAppointment = false, - this.isVoiceCommand = true, - this.latitude = 0, - this.longitude = 0, - this.license = true, - this.isDentalAllowedBackend = false, - }); + 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( + { + this.clinicID, + this.projectID, + this.continueDentalPlan = false, + this.isSearchAppointmnetByClinicID = true, + this.patientID, + this.gender, + this.isGetNearAppointment = false, + this.isVoiceCommand = true, + this.latitude = 0, + this.longitude = 0, + this.license = true, + this.isDentalAllowedBackend = false, + }); + DoctorsByClinicIdRequest.fromJson(Map json) { clinicID = json['ClinicID']; @@ -57,5 +61,6 @@ class DoctorsByClinicIdRequest { data['License'] = this.license; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; return data; + } } 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 1f5b97a0..edae9f18 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -1,5 +1,6 @@ class STPReferralFrequencyRequest { -/* + +/* *@author: Ibrahim Albitar *@Date:03/06/2020 *@param: @@ -7,16 +8,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, @@ -43,7 +44,7 @@ class STPReferralFrequencyRequest { this.patientOutSA = false, this.patientTypeID = 1}); - STPReferralFrequencyRequest.fromJson(Map json) { + STPReferralFrequencyRequest.fromJson(Map json) { languageID = json['LanguageID']; stamp = json['stamp']; iPAdress = json['IPAdress']; diff --git a/lib/models/patient/get_pending_patient_er_model.dart b/lib/models/patient/get_pending_patient_er_model.dart index e16024ac..e1b50a81 100644 --- a/lib/models/patient/get_pending_patient_er_model.dart +++ b/lib/models/patient/get_pending_patient_er_model.dart @@ -7,10 +7,9 @@ */ 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({ @@ -57,128 +56,127 @@ 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( - acceptedBy: json["AcceptedBy"], - acceptedOn: json["AcceptedOn"], - age: json["Age"], - appointmentNo: json["AppointmentNo"], - arrivalTime: json["ArrivalTime"], - arrivalTimeD: json["ArrivalTimeD"], - callStatus: json["CallStatus"], - clientRequestId: json["ClientRequestID"], - clinicName: json["ClinicName"], - consoltationEnd: json["ConsoltationEnd"], - consultationNotes: json["ConsultationNotes"], - createdOn: json["CreatedOn"], - dateOfBirth: DateTime.parse(json["DateOfBirth"]), - deviceToken: json["DeviceToken"], - deviceType: json["DeviceType"], - doctorName: json["DoctorName"], - editOn: json["EditOn"], - gender: json["Gender"], - isFollowUp: json["IsFollowUP"], - isFromVida: json["IsFromVida"], - isLoginB: json["IsLoginB"], - isOutKsa: json["IsOutKSA"], - isRejected: json["IsRejected"], - language: json["Language"], - latitude: json["Latitude"].toDouble(), - longitude: json["Longitude"].toDouble(), - mobileNumber: json["MobileNumber"], - openSession: json["OpenSession"], - openTokenId: json["OpenTokenID"], - patientId: json["PatientID"], - patientName: json["PatientName"], - patientStatus: json["PatientStatus"], - preferredLanguage: json["PreferredLanguage"], - projectId: json["ProjectID"], - scoring: json["Scoring"], - serviceId: json["ServiceID"], - tokenId: json["TokenID"], - vcId: json["VC_ID"], - voipToken: json["VoipToken"], - ); + factory ListPendingPatientListModel.fromJson(Map json) => ListPendingPatientListModel( + acceptedBy: json["AcceptedBy"], + acceptedOn: json["AcceptedOn"], + age: json["Age"], + appointmentNo: json["AppointmentNo"], + arrivalTime: json["ArrivalTime"], + arrivalTimeD: json["ArrivalTimeD"], + callStatus: json["CallStatus"], + clientRequestId: json["ClientRequestID"], + clinicName: json["ClinicName"], + consoltationEnd: json["ConsoltationEnd"], + consultationNotes: json["ConsultationNotes"], + createdOn: json["CreatedOn"], + dateOfBirth: DateTime.parse(json["DateOfBirth"]), + deviceToken: json["DeviceToken"], + deviceType: json["DeviceType"], + doctorName: json["DoctorName"], + editOn: json["EditOn"], + gender: json["Gender"], + isFollowUp: json["IsFollowUP"], + isFromVida: json["IsFromVida"], + isLoginB: json["IsLoginB"], + isOutKsa: json["IsOutKSA"], + isRejected: json["IsRejected"], + language: json["Language"], + latitude: json["Latitude"].toDouble(), + longitude: json["Longitude"].toDouble(), + mobileNumber: json["MobileNumber"], + openSession: json["OpenSession"], + openTokenId: json["OpenTokenID"], + patientId: json["PatientID"], + patientName: json["PatientName"], + patientStatus: json["PatientStatus"], + preferredLanguage: json["PreferredLanguage"], + projectId: json["ProjectID"], + scoring: json["Scoring"], + serviceId: json["ServiceID"], + tokenId: json["TokenID"], + vcId: json["VC_ID"], + voipToken: json["VoipToken"], + ); - Map toJson() => { - "AcceptedBy": acceptedBy, - "AcceptedOn": acceptedOn, - "Age": age, - "AppointmentNo": appointmentNo, - "ArrivalTime": arrivalTime, - "ArrivalTimeD": arrivalTimeD, - "CallStatus": callStatus, - "ClientRequestID": clientRequestId, - "ClinicName": clinicName, - "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')}", - "DeviceToken": deviceToken, - "DeviceType": deviceType, - "DoctorName": doctorName, - "EditOn": editOn, - "Gender": gender, - "IsFollowUP": isFollowUp, - "IsFromVida": isFromVida, - "IsLoginB": isLoginB, - "IsOutKSA": isOutKsa, - "IsRejected": isRejected, - "Language": language, - "Latitude": latitude, - "Longitude": longitude, - "MobileNumber": mobileNumber, - "OpenSession": openSession, - "OpenTokenID": openTokenId, - "PatientID": patientId, - "PatientName": patientName, - "PatientStatus": patientStatus, - "PreferredLanguage": preferredLanguage, - "ProjectID": projectId, - "Scoring": scoring, - "ServiceID": serviceId, - "TokenID": tokenId, - "VC_ID": vcId, - "VoipToken": voipToken, - }; + Map toJson() => { + "AcceptedBy": acceptedBy, + "AcceptedOn": acceptedOn, + "Age": age, + "AppointmentNo": appointmentNo, + "ArrivalTime": arrivalTime, + "ArrivalTimeD": arrivalTimeD, + "CallStatus": callStatus, + "ClientRequestID": clientRequestId, + "ClinicName": clinicName, + "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')}", + "DeviceToken": deviceToken, + "DeviceType": deviceType, + "DoctorName": doctorName, + "EditOn": editOn, + "Gender": gender, + "IsFollowUP": isFollowUp, + "IsFromVida": isFromVida, + "IsLoginB": isLoginB, + "IsOutKSA": isOutKsa, + "IsRejected": isRejected, + "Language": language, + "Latitude": latitude, + "Longitude": longitude, + "MobileNumber": mobileNumber, + "OpenSession": openSession, + "OpenTokenID": openTokenId, + "PatientID": patientId, + "PatientName": patientName, + "PatientStatus": patientStatus, + "PreferredLanguage": preferredLanguage, + "ProjectID": projectId, + "Scoring": scoring, + "ServiceID": serviceId, + "TokenID": tokenId, + "VC_ID": vcId, + "VoipToken": voipToken, + }; } // To parse this JSON data, do // diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart index eb505c34..2d3ac663 100644 --- a/lib/models/patient/insurance_aprovals_request.dart +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -21,22 +21,23 @@ *@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( - {this.exuldAppNO, + { + this.exuldAppNO, this.patientID, this.channel = 9, this.projectID = 12, @@ -45,12 +46,12 @@ class InsuranceAprovalsRequest { this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', this.versionID = 5.8, - this.tokenID, + this.tokenID , this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, this.patientOutSA = false}); - InsuranceAprovalsRequest.fromJson(Map json) { + InsuranceAprovalsRequest.fromJson(Map json) { exuldAppNO = json['EXuldAPPNO']; patientID = json['PatientID']; channel = json['Channel']; @@ -66,8 +67,8 @@ class InsuranceAprovalsRequest { patientOutSA = json['PatientOutSA']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['EXuldAPPNO'] = this.exuldAppNO; data['PatientID'] = this.patientID; data['Channel'] = this.channel; 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 15efb56e..a97f4093 100644 --- a/lib/models/patient/lab_orders/lab_orders_req_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_req_model.dart @@ -1,23 +1,24 @@ -/* - *@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, @@ -26,12 +27,12 @@ class LabOrdersReqModel { this.languageID, this.tokenID, 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.isLoginForDoctorApp = true, - this.patientOutSA = false}); + this.iPAdress='11.11.11.11', + this.versionID=5.5, + this.channel=9, + this.sessionID='E2bsEeYEJo', + this.isLoginForDoctorApp =true, + this.patientOutSA=false}); LabOrdersReqModel.fromJson(Map json) { patientID = json['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 3aa46535..7f463933 100644 --- a/lib/models/patient/lab_orders/lab_orders_res_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_res_model.dart @@ -1,27 +1,29 @@ + + 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; - dynamic createdByN; - DateTime? createdOn; - String? editedBy; - dynamic 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; + Null createdByN; + DateTime createdOn; + String editedBy; + Null editedByN; + String editedOn; + String clinicName; + String doctorImageURL; + String doctorName; + String projectName; LabOrdersResModel( {this.setupID, @@ -46,7 +48,7 @@ class LabOrdersResModel { this.doctorName, this.projectName}); - LabOrdersResModel.fromJson(Map json) { + LabOrdersResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -70,8 +72,8 @@ class LabOrdersResModel { projectName = json['ProjectName']; } - 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; diff --git a/lib/models/patient/lab_result/lab_result.dart b/lib/models/patient/lab_result/lab_result.dart index 6e740e16..ca753f2d 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; - 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; + 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; Null patientID; - int? gender; - dynamic maleinterpretativeData; - dynamic femaleinterpretativeData; - String? testCode; - String? statusDescription; + int gender; + Null maleInterpretativeData; + Null 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['Maleint?erpretativeData']; - femaleinterpretativeData = json['Femaleint?erpretativeData']; + maleInterpretativeData = json['MaleInterpretativeData']; + femaleInterpretativeData = json['FemaleInterpretativeData']; 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['Maleint?erpretativeData'] = this.maleinterpretativeData; - data['Femaleint?erpretativeData'] = this.femaleinterpretativeData; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['FemaleInterpretativeData'] = 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 91510d38..5e58a4a5 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 58f12baf..6d3f0b83 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, @@ -68,7 +68,9 @@ class PendingReferral { }); PendingReferral.fromJson(Map json) { - patientDetails = json['patientDetails'] != null ? PatiantInformtion.fromJson(json['patientDetails']) : null; + patientDetails = json['patientDetails'] != null + ? PatiantInformtion.fromJson(json['patientDetails']) + : null; doctorImageUrl = json['DoctorImageURL']; nationalityFlagUrl = json['NationalityFlagURL']; responded = json['Responded']; @@ -77,7 +79,7 @@ class PendingReferral { data = json['data']; isSameBranch = json['isSameBranch']; editedOn = json['editedOn']; - int? erBranchReferral = json['int?erBranchReferral']; + interBranchReferral = json['interBranchReferral']; patientID = json['patientID']; patientName = json['patientName']; patientType = json['patientType']; @@ -89,19 +91,19 @@ class PendingReferral { referredType = json['referredType']; remarksFromSource = json['remarksFromSource']; respondedOn = json['respondedOn']; - sourceAppointmentNo = json['sourceAppoint?mentNo']; + sourceAppointmentNo = json['sourceAppointmentNo']; sourceProjectId = json['sourceProjectId']; sourceSetupID = json['sourceSetupID']; startDate = json['startDate']; - targetAppointmentNo = json['targetAppoint?mentNo']; + targetAppointmentNo = json['targetAppointmentNo']; targetClinicID = json['targetClinicID']; targetDoctorID = json['targetDoctorID']; targetProjectId = json['targetProjectId']; targetSetupID = json['targetSetupID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorImageURL'] = this.doctorImageUrl; data['NationalityFlagURL'] = this.nationalityFlagUrl; data['Responded'] = this.responded; @@ -110,7 +112,7 @@ class PendingReferral { data['data'] = this.data; data['isSameBranch'] = this.isSameBranch; data['editedOn'] = this.editedOn; - data['int?erBranchReferral'] = this.interBranchReferral; + data['interBranchReferral'] = this.interBranchReferral; data['patientID'] = this.patientID; data['patientName'] = this.patientName; data['patientType'] = this.patientType; @@ -122,11 +124,11 @@ class PendingReferral { data['referredType'] = this.referredType; data['remarksFromSource'] = this.remarksFromSource; data['respondedOn'] = this.respondedOn; - data['sourceAppoint?mentNo'] = this.sourceAppointmentNo; + data['sourceAppointmentNo'] = this.sourceAppointmentNo; data['sourceProjectId'] = this.sourceProjectId; data['sourceSetupID'] = this.sourceSetupID; data['startDate'] = this.startDate; - data['targetAppoint?mentNo'] = this.targetAppointmentNo; + data['targetAppointmentNo'] = this.targetAppointmentNo; data['targetClinicID'] = this.targetClinicID; data['targetDoctorID'] = this.targetDoctorID; data['targetProjectId'] = this.targetProjectId; diff --git a/lib/models/patient/my_referral/clinic-doctor.dart b/lib/models/patient/my_referral/clinic-doctor.dart index a8c541cf..843f636c 100644 --- a/lib/models/patient/my_referral/clinic-doctor.dart +++ b/lib/models/patient/my_referral/clinic-doctor.dart @@ -1,86 +1,86 @@ 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, - this.clinicName, - this.doctorTitle, - this.iD, - this.name, - this.projectID, - this.projectName, - this.actualDoctorRate, - this.clinicRoomNo, - this.date, - this.dayName, - this.doctorID, - this.doctorImageURL, - this.doctorProfile, - this.doctorProfileInfo, - this.doctorRate, - this.gender, - this.genderDescription, - this.isAppointmentAllowed, - this.isDoctorAllowVedioCall, - this.isDoctorDummy, - this.isLiveCare, - this.latitude, - this.longitude, - this.nationalityFlagURL, - this.nationalityID, - this.nationalityName, - this.nearestFreeSlot, - this.noOfPatientsRate, - this.originalClinicID, - this.personRate, - this.projectDistanceInKiloMeters, - this.qR, - this.qRString, - this.rateNumber, - this.serviceID, - this.setupID, - this.speciality, - this.workingHours}); + this.clinicName, + this.doctorTitle, + this.iD, + this.name, + this.projectID, + this.projectName, + this.actualDoctorRate, + this.clinicRoomNo, + this.date, + this.dayName, + this.doctorID, + this.doctorImageURL, + this.doctorProfile, + this.doctorProfileInfo, + this.doctorRate, + this.gender, + this.genderDescription, + this.isAppointmentAllowed, + this.isDoctorAllowVedioCall, + this.isDoctorDummy, + this.isLiveCare, + this.latitude, + this.longitude, + this.nationalityFlagURL, + this.nationalityID, + this.nationalityName, + this.nearestFreeSlot, + this.noOfPatientsRate, + this.originalClinicID, + this.personRate, + this.projectDistanceInKiloMeters, + this.qR, + this.qRString, + this.rateNumber, + this.serviceID, + this.setupID, + this.speciality, + this.workingHours}); - ClinicDoctor.fromJson(Map json) { + ClinicDoctor.fromJson(Map json) { clinicID = json['ClinicID']; clinicName = json['ClinicName']; doctorTitle = json['DoctorTitle']; @@ -99,7 +99,7 @@ class ClinicDoctor { doctorRate = json['DoctorRate']; gender = json['Gender']; genderDescription = json['GenderDescription']; - isAppointmentAllowed = json['IsAppoint?mentAllowed']; + isAppointmentAllowed = json['IsAppointmentAllowed']; isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; isDoctorDummy = json['IsDoctorDummy']; isLiveCare = json['IsLiveCare']; @@ -114,16 +114,16 @@ class ClinicDoctor { personRate = json['PersonRate']; projectDistanceInKiloMeters = json['ProjectDistanceInKiloMeters']; qR = json['QR']; - qRString = json['QRString?']; + qRString = json['QRString']; rateNumber = json['RateNumber']; serviceID = json['ServiceID']; setupID = json['SetupID']; - speciality = json['Speciality'].cast(); + speciality = json['Speciality'].cast(); workingHours = json['WorkingHours']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ClinicID'] = this.clinicID; data['ClinicName'] = this.clinicName; data['DoctorTitle'] = this.doctorTitle; @@ -142,7 +142,7 @@ class ClinicDoctor { data['DoctorRate'] = this.doctorRate; data['Gender'] = this.gender; data['GenderDescription'] = this.genderDescription; - data['IsAppoint?mentAllowed'] = this.isAppointmentAllowed; + data['IsAppointmentAllowed'] = this.isAppointmentAllowed; data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; data['IsDoctorDummy'] = this.isDoctorDummy; data['IsLiveCare'] = this.isLiveCare; @@ -157,7 +157,7 @@ class ClinicDoctor { data['PersonRate'] = this.personRate; data['ProjectDistanceInKiloMeters'] = this.projectDistanceInKiloMeters; data['QR'] = this.qR; - data['QRString?'] = this.qRString; + data['QRString'] = this.qRString; data['RateNumber'] = this.rateNumber; data['ServiceID'] = this.serviceID; data['SetupID'] = this.setupID; @@ -165,4 +165,5 @@ class ClinicDoctor { data['WorkingHours'] = this.workingHours; return data; } -} + +} \ No newline at end of file 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 f79a57c3..f1506f8e 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 dbb3a90b..b353e587 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -1,134 +1,136 @@ + + 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, - 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.isReferralDoctorSameBranch, - this.referralDoctorName, - this.referralClinicDescription, - this.referralStatusDesc}); + MyReferredPatientModel({ + 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.isReferralDoctorSameBranch, + this.referralDoctorName, + this.referralClinicDescription,this.referralStatusDesc + }); MyReferredPatientModel.fromJson(Map json) { rowID = json['RowID']; diff --git a/lib/models/patient/orders_request.dart b/lib/models/patient/orders_request.dart index 8fb336aa..1372cfd6 100644 --- a/lib/models/patient/orders_request.dart +++ b/lib/models/patient/orders_request.dart @@ -1,3 +1,4 @@ + /* *@author: Ibrahim Albitar *@Date:15/5/2020 @@ -22,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']; @@ -67,8 +68,8 @@ class OrdersRequest { versionID = json['VersionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VisitType'] = this.visitType; data['AdmissionNo'] = this.admissionNo; data['ProjectID'] = this.projectID; @@ -84,4 +85,4 @@ class OrdersRequest { data['VersionID'] = this.versionID; return data; } -} +} \ No newline at end of file diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 2ab6ba90..df966f03 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,9 +158,7 @@ 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"]; @@ -188,8 +186,7 @@ class PatiantInformtion { nationalityId = json["NationalityID"] ?? json["nationalityID"]; mobileNumber = json["MobileNumber"] ?? json["mobileNumber"]; emailAddress = json["EmailAddress"] ?? json["emailAddress"]; - patientIdentificationNo = - json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; + patientIdentificationNo = json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; //TODO make 7 dynamic when the backend retrun it in patient arrival patientType = json["PatientType"] ?? json["patientType"] ?? 1; admissionNo = json["AdmissionNo"] ?? json["admissionNo"]; @@ -199,16 +196,10 @@ 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"]; @@ -216,8 +207,7 @@ 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']; @@ -239,12 +229,9 @@ 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']; @@ -267,9 +254,8 @@ 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; } } @@ -317,8 +303,7 @@ 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 c37cd72b..1d0da9c5 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, @@ -40,6 +40,7 @@ class GetPatientArrivalListRequestModel { data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; + return data; } } diff --git a/lib/models/patient/patient_model.dart b/lib/models/patient/patient_model.dart index 27da32f1..7368c538 100644 --- a/lib/models/patient/patient_model.dart +++ b/lib/models/patient/patient_model.dart @@ -7,108 +7,110 @@ *@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, @@ -135,12 +137,12 @@ class PatientModel { this.IdentificationNo, this.MobileNo}); - factory PatientModel.fromJson(Map json) => PatientModel( + factory PatientModel.fromJson(Map json) => PatientModel( FirstName: json["FirstName"], LastName: json["LasttName"], ); - Map toJson() { - final Map data = new Map(); + 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 10119e75..05d28bdc 100644 --- a/lib/models/patient/prescription/prescription_report.dart +++ b/lib/models/patient/prescription/prescription_report.dart @@ -1,70 +1,70 @@ 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, - this.appointmentNo, - this.clinic, - this.companyName, - this.days, - this.doctorName, - this.doseDailyQuantity, - this.frequency, - this.frequencyNumber, - this.imageExtension, - this.imageSRCUrl, - this.imageString, - this.imageThumbUrl, - this.isCovered, - this.itemDescription, - this.itemID, - this.orderDate, - this.patientID, - this.patientName, - this.phoneOffice1, - this.prescriptionQR, - this.prescriptionTimes, - this.productImage, - this.productImageBase64, - this.productImageString, - this.projectID, - this.projectName, - this.remarks, - this.route, - this.sKU, - this.scaleOffset, - this.startDate}); + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); PrescriptionReport.fromJson(Map json) { address = json['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 f6285885..21cb13b1 100644 --- a/lib/models/patient/prescription/prescription_report_for_in_patient.dart +++ b/lib/models/patient/prescription/prescription_report_for_in_patient.dart @@ -1,104 +1,104 @@ 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( {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}); - 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 new file mode 100644 index 00000000..9141c282 --- /dev/null +++ b/lib/models/patient/prescription/prescription_req_model.dart @@ -0,0 +1,71 @@ +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: + *@return:PrescriptionReqModel + *@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; + + PrescriptionReqModel( + {this.patientID, + this.setupID, + this.projectID, + 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.patientOutSA = false, + this.patientTypeID}); + + PrescriptionReqModel.fromJson(Map json) { + patientID = json['PatientID']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/models/patient/prescription/prescription_res_model.dart b/lib/models/patient/prescription/prescription_res_model.dart index cc7fc44d..9c7e296d 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, @@ -75,7 +75,7 @@ class PrescriptionResModel { this.qR, this.speciality}); - PrescriptionResModel.fromJson(Map json) { + PrescriptionResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -111,8 +111,8 @@ class PrescriptionResModel { speciality = json['Speciality']; } - 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; diff --git a/lib/models/patient/prescription/request_prescription_report.dart b/lib/models/patient/prescription/request_prescription_report.dart index 078fd874..0581692e 100644 --- a/lib/models/patient/prescription/request_prescription_report.dart +++ b/lib/models/patient/prescription/request_prescription_report.dart @@ -1,34 +1,34 @@ 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, - this.appointmentNo, - this.episodeID, - this.setupID, - this.patientTypeID, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.appointmentNo, + this.episodeID, + this.setupID, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); RequestPrescriptionReport.fromJson(Map json) { projectID = json['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 deleted file mode 100644 index 97862aaa..00000000 --- a/lib/models/patient/profile/patient_profile_app_bar_model.dart +++ /dev/null @@ -1,91 +0,0 @@ -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 aed886cb..13e1b571 100644 --- a/lib/models/patient/progress_note_request.dart +++ b/lib/models/patient/progress_note_request.dart @@ -1,4 +1,5 @@ -/* + +/* *@author: Ibrahim Albitar *@Date:15/5/2020 @@ -22,35 +23,33 @@ */ 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; - 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; ProgressNoteRequest( - {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.patientOutSA = false}); - ProgressNoteRequest.fromJson(Map json) { + ProgressNoteRequest.fromJson(Map json) { visitType = json['VisitType']; admissionNo = json['AdmissionNo']; projectID = json['ProjectID']; @@ -65,8 +64,8 @@ class ProgressNoteRequest { patientTypeID = json['PatientTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VisitType'] = this.visitType; data['AdmissionNo'] = this.admissionNo; data['ProjectID'] = this.projectID; @@ -81,4 +80,4 @@ class ProgressNoteRequest { data['PatientTypeID'] = this.patientTypeID; return data; } -} +} \ No newline at end of file diff --git a/lib/models/patient/radiology/radiology_req_model.dart b/lib/models/patient/radiology/radiology_req_model.dart index 3b510019..47154d8b 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, @@ -33,7 +33,7 @@ class RadiologyReqModel { this.patientOutSA = false, this.patientTypeID}); - RadiologyReqModel.fromJson(Map json) { + RadiologyReqModel.fromJson(Map json) { patientID = json['PatientID']; projectID = json['ProjectID']; languageID = json['LanguageID']; @@ -48,8 +48,8 @@ class RadiologyReqModel { patientTypeID = json['PatientTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['PatientID'] = this.patientID; data['ProjectID'] = this.projectID; data['LanguageID'] = this.languageID; diff --git a/lib/models/patient/radiology/radiology_res_model.dart b/lib/models/patient/radiology/radiology_res_model.dart index cf618dd7..6c6509a9 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; - dynamic 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; + Null 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']; @@ -57,8 +57,8 @@ class RadiologyResModel { 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['PatientID'] = this.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 fe8bc3f1..857705c4 100644 --- a/lib/models/patient/reauest_prescription_report_for_in_patient.dart +++ b/lib/models/patient/reauest_prescription_report_for_in_patient.dart @@ -1,34 +1,34 @@ 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, - this.projectID, - this.admissionNo, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA, - this.patientTypeID}); + this.projectID, + this.admissionNo, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.patientTypeID}); - RequestPrescriptionReportForInPatient.fromJson(Map json) { + RequestPrescriptionReportForInPatient.fromJson(Map json) { patientID = json['PatientID']; projectID = json['ProjectID']; admissionNo = json['AdmissionNo']; @@ -44,8 +44,8 @@ class RequestPrescriptionReportForInPatient { patientTypeID = json['PatientTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['PatientID'] = this.patientID; data['ProjectID'] = this.projectID; data['AdmissionNo'] = this.admissionNo; diff --git a/lib/models/patient/refer_to_doctor_request.dart b/lib/models/patient/refer_to_doctor_request.dart index fc1fd80d..83db54f4 100644 --- a/lib/models/patient/refer_to_doctor_request.dart +++ b/lib/models/patient/refer_to_doctor_request.dart @@ -1,38 +1,40 @@ import 'package:flutter/cupertino.dart'; class ReferToDoctorRequest { -/* - *@author: Ibrahim Albitar - *@Date:03/06/2020 - *@param: + +/* + *@author: Ibrahim Albitar + *@Date:03/06/2020 + *@param: *@return: *@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; + /* { @@ -66,17 +68,17 @@ class ReferToDoctorRequest { ReferToDoctorRequest( {@required this.projectID, @required this.admissionNo, - @required this.roomID, + @required this.roomID , @required this.referralClinic, - @required this.referralDoctor, + @required this.referralDoctor , @required this.createdBy, - @required this.editedBy, + @required this.editedBy , @required this.patientID, @required this.patientTypeID, @required this.referringClinic, @required this.referringDoctor, @required this.referringDoctorRemarks, - @required this.priority, + @required this.priority , @required this.frequency, @required this.extension, this.languageID = 2, @@ -89,7 +91,7 @@ class ReferToDoctorRequest { this.isLoginForDoctorApp = true, this.patientOutSA = false}); - ReferToDoctorRequest.fromJson(Map json) { + ReferToDoctorRequest.fromJson(Map json) { projectID = json['ProjectID']; admissionNo = json['AdmissionNo']; roomID = json['RoomID']; diff --git a/lib/models/patient/request_my_referral_patient_model.dart b/lib/models/patient/request_my_referral_patient_model.dart index 21e725d2..219b7b2a 100644 --- a/lib/models/patient/request_my_referral_patient_model.dart +++ b/lib/models/patient/request_my_referral_patient_model.dart @@ -1,24 +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, @@ -32,17 +34,17 @@ class RequestMyReferralPatientModel { this.patientID = 0, this.from = "0", this.to = "0", - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, + this.languageID , + this.stamp , + this.iPAdress , + this.versionID , + this.channel , this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.sessionID , + this.isLoginForDoctorApp , + this.patientOutSA }); - RequestMyReferralPatientModel.fromJson(Map json) { + RequestMyReferralPatientModel.fromJson(Map json) { projectID = json['ProjectID']; clinicID = json['ClinicID']; doctorID = json['DoctorID']; diff --git a/lib/models/patient/topten_users_res_model.dart b/lib/models/patient/topten_users_res_model.dart index b1144d9a..3454568f 100644 --- a/lib/models/patient/topten_users_res_model.dart +++ b/lib/models/patient/topten_users_res_model.dart @@ -1,3 +1,4 @@ + /* *@author: Amjad Amireh *@Date:27/4/2020 @@ -7,23 +8,25 @@ *@desc: */ 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 = []; - + + + List list = new List(); + list = parsedJson.map((i) => PatiantInformtion.fromJson(i)).toList(); return new ModelResponse(list: list); } } -class PatiantInformtionl {} +class PatiantInformtionl { +} \ No newline at end of file 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 c02c2464..57133a08 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-data.dart @@ -1,68 +1,68 @@ 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; VitalSignData( {this.appointmentNo, - this.bloodPressureCuffLocation, - this.bloodPressureCuffSize, - this.bloodPressureHigher, - this.bloodPressureLower, - this.bloodPressurePatientPosition, - this.bodyMassIndex, - this.fio2, - this.headCircumCm, - this.heightCm, - this.idealBodyWeightLbs, - this.isPainManagementDone, - this.isVitalsRequired, - this.leanBodyWeightLbs, - this.painCharacter, - this.painDuration, - this.painFrequency, - this.painLocation, - this.painScore, - this.patientMRN, - this.patientType, - this.pulseBeatPerMinute, - this.pulseRhythm, - this.respirationBeatPerMinute, - this.respirationPattern, - this.sao2, - this.status, - this.temperatureCelcius, - this.temperatureCelciusMethod, - this.waistSizeInch, - this.weightKg}); + this.bloodPressureCuffLocation, + this.bloodPressureCuffSize, + this.bloodPressureHigher, + this.bloodPressureLower, + this.bloodPressurePatientPosition, + this.bodyMassIndex, + this.fio2, + this.headCircumCm, + this.heightCm, + this.idealBodyWeightLbs, + this.isPainManagementDone, + this.isVitalsRequired, + this.leanBodyWeightLbs, + this.painCharacter, + this.painDuration, + this.painFrequency, + this.painLocation, + this.painScore, + this.patientMRN, + this.patientType, + this.pulseBeatPerMinute, + this.pulseRhythm, + this.respirationBeatPerMinute, + this.respirationPattern, + this.sao2, + this.status, + this.temperatureCelcius, + this.temperatureCelciusMethod, + this.waistSizeInch, + this.weightKg}); VitalSignData.fromJson(Map json) { appointmentNo = json['appointmentNo']; @@ -133,4 +133,5 @@ 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 9b125216..ed39a86e 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; @@ -242,7 +242,8 @@ class VitalSignHistory { data['BloodPressure'] = this.bloodPressure; data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc; data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc; - data['BloodPressurePatientPositionDesc'] = this.bloodPressurePatientPositionDesc; + data['BloodPressurePatientPositionDesc'] = + this.bloodPressurePatientPositionDesc; data['ClinicName'] = this.clinicName; data['DoctorImageURL'] = this.doctorImageURL; data['DoctorName'] = this.doctorName; 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 c52cf838..8f5be6ba 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_req_model.dart @@ -1,25 +1,26 @@ -/* - *@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, @@ -29,13 +30,12 @@ class VitalSignReqModel { this.languageID, this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress = '11.11.11.11', - - this.channel = 9, - this.sessionID = 'E2bsEeYEJo', - this.isLoginForDoctorApp = true, + this.iPAdress='11.11.11.11', + this.channel=9, + this.sessionID='E2bsEeYEJo', + this.isLoginForDoctorApp=true, this.patientTypeID, - this.patientOutSA = false}); + this.patientOutSA=false}); VitalSignReqModel.fromJson(Map json) { projectID = json['ProjectID']; @@ -72,4 +72,5 @@ class VitalSignReqModel { data['PatientTypeID'] = this.patientTypeID; return data; } + } 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 e5af8aef..78af108d 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; @@ -61,9 +61,9 @@ class VitalSignResModel { var bloodPressureCuffLocationDesc; var bloodPressureCuffSizeDesc; var bloodPressurePatientPositionDesc; - var clinicName; - var doctorImageURL; - var doctorName; + var clinicName; + var doctorImageURL; + var doctorName; var painScoreDesc; var pulseRhythmDesc; var respirationPatternDesc; @@ -170,8 +170,7 @@ class VitalSignResModel { triageCategory = json['TriageCategory']; gCScore = json['GCScore']; lineItemNo = json['LineItemNo']; - vitalSignDate = - json['VitalSignDate'] != null ? AppDateUtils.convertStringToDate(json['VitalSignDate']) : new DateTime.now(); + vitalSignDate = json['VitalSignDate'] !=null? AppDateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now(); actualTimeTaken = json['ActualTimeTaken']; sugarLevel = json['SugarLevel']; fBS = json['FBS']; @@ -252,7 +251,8 @@ class VitalSignResModel { data['BloodPressure'] = this.bloodPressure; data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc; data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc; - data['BloodPressurePatientPositionDesc'] = this.bloodPressurePatientPositionDesc; + data['BloodPressurePatientPositionDesc'] = + this.bloodPressurePatientPositionDesc; data['ClinicName'] = this.clinicName; data['DoctorImageURL'] = this.doctorImageURL; data['DoctorName'] = this.doctorName; diff --git a/lib/models/pending_orders/pending_order_request_model.dart b/lib/models/pending_orders/pending_order_request_model.dart index 47577b16..c69cf780 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 65f93f89..89525369 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 48ef6c9c..a00e217a 100644 --- a/lib/models/pharmacies/pharmacies_List_request_model.dart +++ b/lib/models/pharmacies/pharmacies_List_request_model.dart @@ -1,3 +1,4 @@ + /* *@author: Ibrahim Albitar *@Date:27/4/2020 @@ -7,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, @@ -60,4 +61,4 @@ class PharmaciesListRequestModel { data['Channel'] = this.channel; return data; } -} +} \ No newline at end of file diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/models/pharmacies/pharmacies_items_request_model.dart index a8cd82c3..e81ce9b3 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 05d839f1..d398153b 100644 --- a/lib/models/sickleave/add_sickleave_request.dart +++ b/lib/models/sickleave/add_sickleave_request.dart @@ -1,11 +1,16 @@ 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 e25c2eb8..8b61eb90 100644 --- a/lib/models/sickleave/extend_sick_leave_request.dart +++ b/lib/models/sickleave/extend_sick_leave_request.dart @@ -1,10 +1,11 @@ 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}); + ExtendSickLeaveRequest( + {this.patientMRN, this.previousRequestNo, this.noOfDays, this.remarks}); ExtendSickLeaveRequest.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/sickleave/get_all_sickleave_response.dart b/lib/models/sickleave/get_all_sickleave_response.dart index 7cfb292b..de831213 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 179664a6..f679807c 100644 --- a/lib/models/sickleave/sick_leave_statisitics_model.dart +++ b/lib/models/sickleave/sick_leave_statisitics_model.dart @@ -1,12 +1,12 @@ class SickLeaveStatisticsModel { - String? recommendedSickLeaveDays; - int? totalLeavesByAllClinics; - int? totalLeavesByDoctor; + String recommendedSickLeaveDays; + int totalLeavesByAllClinics; + int totalLeavesByDoctor; SickLeaveStatisticsModel( {this.recommendedSickLeaveDays, - this.totalLeavesByAllClinics, - this.totalLeavesByDoctor}); + this.totalLeavesByAllClinics, + this.totalLeavesByDoctor}); SickLeaveStatisticsModel.fromJson(Map json) { recommendedSickLeaveDays = json['recommendedSickLeaveDays']; diff --git a/lib/root_page.dart b/lib/root_page.dart index f7955eff..35a3fa44 100644 --- a/lib/root_page.dart +++ b/lib/root_page.dart @@ -1,6 +1,8 @@ +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -11,11 +13,8 @@ import 'landing_page.dart'; class RootPage extends StatelessWidget { @override Widget build(BuildContext context) { - - AuthenticationViewModel authenticationViewModel = Provider.of(context); Widget buildRoot() { - switch (authenticationViewModel.status) { case APP_STATUS.LOADING: return Scaffold( @@ -23,9 +22,7 @@ class RootPage extends StatelessWidget { ); break; case APP_STATUS.UNVERIFIED: - return VerificationMethodsScreen( - password: null, - ); + return VerificationMethodsScreen(password: null,); break; case APP_STATUS.UNAUTHENTICATED: return LoginScreen(); @@ -33,11 +30,6 @@ class RootPage extends StatelessWidget { case APP_STATUS.AUTHENTICATED: return LandingPage(); break; - default: - return Scaffold( - body: AppLoaderWidget(), - ); - break; } } diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index ba6215f2..9563b29c 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -2,26 +2,31 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.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/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; + class LoginScreen extends StatefulWidget { @override _LoginScreenState createState() => _LoginScreenState(); } class _LoginScreenState extends State { - late String platformImei; + String platformImei; bool allowCallApi = true; + //TODO change AppTextFormField to AppTextFormFieldCustom final loginFormKey = GlobalKey(); var projectIdController = TextEditingController(); var userIdController = TextEditingController(); @@ -29,171 +34,224 @@ class _LoginScreenState extends State { List projectsList = []; FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); - late AuthenticationViewModel authenticationViewModel; + AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); - double textFieldHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?10:SizeConfig.isHeightShort?8:6); return AppScaffold( isShowAppBar: false, backgroundColor: HexColor('#F8F8F8'), - body: SingleChildScrollView( - child: SafeArea( - child: Container( + body: SafeArea( + child: ListView(children: [ + Container( margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), alignment: Alignment.topLeft, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - //TODO Use App Text rather than text - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Text( - TranslationBase.of(context).welcomeTo??"", - style: TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins'), - ), - Text( - TranslationBase.of(context).drSulaimanAlHabib!, - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 6, - fontFamily: 'Poppins'), - ), - Text( - "Doctor App", - style: TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - fontWeight: FontWeight.w600, - color: Color(0xFFD02127)), - ), - ])), - SizedBox( - height: 40, - ), - Form( - key: loginFormKey, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - buildSizedBox(), - AppTextFieldCustom( - height: textFieldHeight, - hintText: TranslationBase.of(context).enterId, - hasBorder: true, - controller: userIdController, - onChanged: (value) { - if (value != null) - setState(() { - authenticationViewModel.userInfo.userID = - value.trim(); - }); - }, - ), - buildSizedBox(), - AppTextFieldCustom( - height: textFieldHeight, - hintText: TranslationBase.of(context).enterPassword, - hasBorder: true, - isSecure: true, - controller: passwordController, - onChanged: (value) { - if (value != null) - setState(() { - authenticationViewModel.userInfo.password = - value.trim(); - }); - this.getProjects( - authenticationViewModel.userInfo.userID); - }, - onClick: () {}, - ), - buildSizedBox(), - AppTextFieldCustom( - height: textFieldHeight, - hintText: - TranslationBase.of(context).selectYourProject, - hasBorder: true, - controller: projectIdController, - isTextFieldHasSuffix: true, - enabled: false, - onClick: projectsList.isEmpty== null ? null:() { - Helpers.showCupertinoPicker( - context, - projectsList, - 'facilityName', - onSelectProject, - authenticationViewModel); - }, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + //TODO Use App Text rather than text + Container( + + child: Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + SizedBox( + height: 30, + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment + .start, children: [ + SizedBox( + height: 10, + ), + Text( + TranslationBase + .of(context) + .welcomeTo, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight + .w600, + fontFamily: 'Poppins'), + ), + Text( + TranslationBase + .of(context) + .drSulaimanAlHabib, + style: TextStyle( + color:Color(0xFF2B353E), + fontWeight: FontWeight + .bold, + fontSize: SizeConfig + .isMobile + ? 24 + : SizeConfig + .realScreenWidth * + 0.029, + fontFamily: 'Poppins'), + ), + + Text( + "Doctor App", + style: TextStyle( + fontSize: + SizeConfig.isMobile + ? 16 + : SizeConfig + .realScreenWidth * + 0.030, + fontWeight: FontWeight + .w600, + color: Color(0xFFD02127)), + ), + ]), + ], + )), + SizedBox( + height: 40, + ), + Form( + key: loginFormKey, + child: Column( + mainAxisAlignment: MainAxisAlignment + .spaceBetween, + children: [ + Container( + width: SizeConfig + .realScreenWidth * 0.90, + height: SizeConfig + .realScreenHeight * 0.65, + child: + Column( + crossAxisAlignment: CrossAxisAlignment + .start, children: [ + + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).enterId, + hasBorder: true, + controller: userIdController, + onChanged: (value){ + if (value != null) + setState(() { + authenticationViewModel.userInfo + .userID = + value + .trim(); + }); + }, + ), + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).enterPassword, + hasBorder: true, + isSecure: true, + controller: passwordController, + onChanged: (value){ + if (value != null) + setState(() { + authenticationViewModel.userInfo + .password = + value + .trim(); + }); + // if(allowCallApi) { + this.getProjects( + authenticationViewModel.userInfo + .userID); + // setState(() { + // allowCallApi = false; + // }); + // } + }, + onClick: (){ + + }, + ), + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).selectYourProject, + hasBorder: true, + controller: projectIdController, + isTextFieldHasSuffix: true, + enabled: false, + onClick: (){ + Helpers + .showCupertinoPicker( + context, + projectsList, + 'facilityName', + onSelectProject, + authenticationViewModel); + }, + + + ), + buildSizedBox() + ]), + ), + ], ), - buildSizedBox(), - ]), - ), - SizedBox( - height: 40, - ), - ], - )), - ), + ) + ], + ) + ])) + ]), ), bottomSheet: Container( -// color: Colors.green, - height: SizeConfig.heightMultiplier * 10, + + height: 90, width: double.infinity, child: Center( child: FractionallySizedBox( widthFactor: 0.9, child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.end, children: [ AppButton( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - hPadding: 1, - title: TranslationBase.of(context).login, + title: TranslationBase + .of(context) + .login, color: Color(0xFFD02127), fontWeight: FontWeight.w700, - disabled: authenticationViewModel.userInfo.userID == null || - authenticationViewModel.userInfo.password == null, + disabled: authenticationViewModel.userInfo + .userID == null || + authenticationViewModel.userInfo + .password == + null, onPressed: () { login(context); }, ), + SizedBox(height: 25,) ], ), ), - ), - ), + ),), ); } SizedBox buildSizedBox() { return SizedBox( - height: SizeConfig.heightMultiplier * 2, + height: 20, ); } - login( - context, - ) async { - if (loginFormKey.currentState!.validate()) { - loginFormKey.currentState!.save(); + login(context,) async { + if (loginFormKey.currentState.validate()) { + loginFormKey.currentState.save(); GifLoaderDialogUtils.showMyDialog(context); await authenticationViewModel.login(authenticationViewModel.userInfo); if (authenticationViewModel.state == ViewState.ErrorLocal) { @@ -201,33 +259,39 @@ class _LoginScreenState extends State { Helpers.showErrorToast(authenticationViewModel.error); } else { GifLoaderDialogUtils.hideDialog(context); - authenticationViewModel.setUnverified(true, isFromLogin: true); + authenticationViewModel.setUnverified(true,isFromLogin: true); + // Navigator.of(context).pushReplacement( + // MaterialPageRoute( + // builder: (BuildContext context) => + // VerificationMethodsScreen( + // password: authenticationViewModel.userInfo.password, + // isFromLogin: true, + // ), + // ), + // ); } } } onSelectProject(index) { setState(() { - authenticationViewModel.userInfo.projectID = - projectsList[index].facilityId; - projectIdController.text = projectsList[index].facilityName!; + authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; + projectIdController.text = projectsList[index].facilityName; }); - primaryFocus!.unfocus(); + primaryFocus.unfocus(); } - - String memberID = ""; - getProjects(memberID) async { + String memberID =""; + getProjects(memberID)async { if (memberID != null && memberID != '') { - if (this.memberID != memberID) { + if (this.memberID !=memberID) { this.memberID = memberID; await authenticationViewModel.getHospitalsList(memberID); - if (authenticationViewModel.state == ViewState.Idle) { + if(authenticationViewModel.state == ViewState.Idle) { projectsList = authenticationViewModel.hospitals; setState(() { - authenticationViewModel.userInfo.projectID = - projectsList[0].facilityId; - projectIdController.text = projectsList[0].facilityName!; + authenticationViewModel.userInfo.projectID = projectsList[0].facilityId; + projectIdController.text = projectsList[0].facilityName; }); } } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 17aa4fdc..fc85db8f 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -1,5 +1,6 @@ import 'dart:io' show Platform; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/auth_method_types.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; @@ -14,99 +15,117 @@ 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/buttons/secondary_button.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../config/size_config.dart'; +import '../../landing_page.dart'; +import '../../root_page.dart'; +import '../../routes.dart'; import '../../util/dr_app_shared_pref.dart'; import '../../util/helpers.dart'; import '../../widgets/auth/verification_methods_list.dart'; +import 'login_screen.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); -///TODO Elham* check if this still in user or not class VerificationMethodsScreen extends StatefulWidget { + + final password; - VerificationMethodsScreen({ - this.password, - }); + + VerificationMethodsScreen({this.password, }); @override _VerificationMethodsScreenState createState() => _VerificationMethodsScreenState(); } class _VerificationMethodsScreenState extends State { - late ProjectViewModel projectsProvider; + + ProjectViewModel projectsProvider; bool isMoreOption = false; bool onlySMSBox = false; - AuthMethodTypes? fingerPrintBefore; - late AuthMethodTypes selectedOption; - late AuthenticationViewModel authenticationViewModel; + AuthMethodTypes fingerPrintBefore; + AuthMethodTypes selectedOption; + AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); authenticationViewModel = Provider.of(context); + + return AppScaffold( isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor, + // baseViewModel: model, body: SingleChildScrollView( child: Center( child: FractionallySizedBox( - widthFactor: 0.9, - child: SingleChildScrollView( - child:Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4), - ), - if (authenticationViewModel.isFromLogin) - InkWell( - onTap: () { - authenticationViewModel.setUnverified(false, isFromLogin: false); - authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); - }, - child: Icon( - Icons.arrow_back_ios, - color: Color(0xFF2B353E), - )), - Column( + child: Container( + margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + height: SizeConfig.realScreenHeight * .95, + width: SizeConfig.realScreenWidth, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4), + height: 80, ), - authenticationViewModel.user != null && isMoreOption == false - ? Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + if(authenticationViewModel.isFromLogin) + InkWell( + onTap: (){ + authenticationViewModel.setUnverified(false,isFromLogin: false); + authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); + }, + child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) + + ), + Container( + + child: Column( + children: [ + SizedBox( + height: 20, + ), + authenticationViewModel.user != null && isMoreOption == false + ? Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppText( TranslationBase.of(context).welcomeBack, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + fontSize:12, fontWeight: FontWeight.w700, color: Color(0xFF2B353E), ), AppText( - Helpers.capitalize(authenticationViewModel.user!.doctorName), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6, + Helpers.capitalize(authenticationViewModel.user.doctorName), + fontSize: 24, color: Color(0xFF2B353E), fontWeight: FontWeight.bold, ), SizedBox( - height: SizeConfig.heightMultiplier * 4, + height: 20, ), AppText( - TranslationBase.of(context).accountInfo, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, + TranslationBase.of(context).accountInfo , + fontSize: 16, color: Color(0xFF2E303A), fontWeight: FontWeight.w600, ), - SizedBox(height: SizeConfig.heightMultiplier * 4), + SizedBox( + height: 20, + ), Container( padding: EdgeInsets.all(15), decoration: BoxDecoration( @@ -114,216 +133,261 @@ class _VerificationMethodsScreenState extends State { borderRadius: BorderRadius.all( Radius.circular(10), ), - border: Border.all(color: HexColor('#707070'), width: 0.1), + border: Border.all( + color: HexColor('#707070'), + width: 0.1), ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: SizeConfig.realScreenWidth * .5, - padding: EdgeInsets.all(0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, + Column( + children: [ + + Text( + TranslationBase.of(context) + .lastLoginAt, + overflow: + TextOverflow.ellipsis, + style: TextStyle( + fontFamily: 'Poppins', + fontSize: 16, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700,), + + ), + Row( children: [ - Text( - TranslationBase.of(context).lastLoginAt!, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontFamily: 'Poppins', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - ), + AppText( + TranslationBase + .of(context) + .verifyWith, + fontSize: 14, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, ), - Container( - width: MediaQuery.of(context).size.width * 0.55, - child: RichText( - text: TextSpan( - text: TranslationBase.of(context).verifyWith, - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.w600, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, - fontFamily: 'Poppins', - ), - children: [ - TextSpan( - text: authenticationViewModel.getType( - authenticationViewModel.user!.logInTypeID, context), - style: TextStyle( - color: Color(0xFF2B353E), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - ), - ) - ]), - ), + AppText( + authenticationViewModel.getType( + authenticationViewModel.user + .logInTypeID, + context), + fontSize: 14, + color: Color(0xFF2B353E), + + fontWeight: FontWeight.w700, ), ], - crossAxisAlignment: CrossAxisAlignment.start, + ) + ], + crossAxisAlignment: CrossAxisAlignment.start,), + Column(children: [ + AppText( + authenticationViewModel.user.editedOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + authenticationViewModel.user + .editedOn)) + : authenticationViewModel.user.createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate(authenticationViewModel.user + .createdOn)) + : '--', + textAlign: + TextAlign.right, + fontSize: 13, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - authenticationViewModel.user!.editedOn != null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - authenticationViewModel.user!.editedOn!)) - : authenticationViewModel.user!.createdOn! != null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - authenticationViewModel.user!.createdOn!)) - : '--', - textAlign: TextAlign.right, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - ), - AppText( - authenticationViewModel.user!.editedOn != null - ? AppDateUtils.getHour(AppDateUtils.convertStringToDate( - authenticationViewModel.user!.editedOn!)) - : authenticationViewModel.user!.createdOn != null - ? AppDateUtils.getHour(AppDateUtils.convertStringToDate( - authenticationViewModel.user!.createdOn!)) - : '--', - textAlign: TextAlign.right, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ) - ], + AppText( + authenticationViewModel.user.editedOn != + null + ? AppDateUtils.getHour( + AppDateUtils.convertStringToDate( + authenticationViewModel.user + .editedOn)) + : authenticationViewModel.user.createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils.convertStringToDate(authenticationViewModel.user + .createdOn)) + : '--', + textAlign: + TextAlign.right, + fontSize: 14, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ) + ], crossAxisAlignment: CrossAxisAlignment.start, + ) - ], - ), + ], ), - SizedBox( - height: SizeConfig.heightMultiplier * 3, + ), + SizedBox( + height: 20, ), Row( children: [ - //todo add translation AppText( - "Please Verify", - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, + "Please Verify", + fontSize: 16, color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, ), ], - ), - SizedBox( - height: SizeConfig.heightMultiplier * 2, - ), + ) ], ) - : Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + : Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ this.onlySMSBox == false ? Container( - margin: EdgeInsets.only(bottom: 20, top: 30), - child: AppText( - TranslationBase.of(context).verifyLoginWith, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, - color: Color(0xFF2E303A), - fontWeight: FontWeight.bold, - textAlign: TextAlign.left, - ), - ) + margin: EdgeInsets.only(bottom: 20, top: 30), + child: AppText( + TranslationBase.of(context) + .verifyLoginWith, + fontSize: 18, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + textAlign: TextAlign.left, + ), + ) : AppText( - TranslationBase.of(context).verifyFingerprint2, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, - textAlign: TextAlign.start, - ), + TranslationBase.of(context) + .verifyFingerprint2, + fontSize: + SizeConfig.textMultiplier * 2.5, + textAlign: TextAlign.start, + ), ]), - authenticationViewModel.user != null && isMoreOption == false - ? Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row(mainAxisAlignment: MainAxisAlignment.center, children: [ - Expanded( - child: InkWell( - onTap: () => { - // TODO check this logic it seem it will create bug to us - authenticateUser(AuthMethodTypes.Fingerprint, true) + authenticationViewModel.user != null && isMoreOption == false + ? Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () => + { + // TODO check this logic it seem it will create bug to us + authenticateUser( + AuthMethodTypes + .Fingerprint, true) }, - child: VerificationMethodsList( - authenticationViewModel: authenticationViewModel, - authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user!.logInTypeID!), - authenticateUser: (AuthMethodTypes authMethodType, isActive) => - authenticateUser(authMethodType, isActive), - )), - ), - Expanded( - child: VerificationMethodsList( - authenticationViewModel: authenticationViewModel, - authMethodType: AuthMethodTypes.MoreOptions, - onShowMore: () { - setState(() { - isMoreOption = true; - }); - }, - )) - ]), + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: SelectedAuthMethodTypesService + .getMethodsTypeService( + authenticationViewModel.user + .logInTypeID), + authenticateUser: + (AuthMethodTypes + authMethodType, + isActive) => + authenticateUser( + authMethodType, + isActive), + )), + ), + Expanded( + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: + AuthMethodTypes.MoreOptions, + onShowMore: () { + setState(() { + isMoreOption = true; + }); + }, + )) + ]), ]) - : Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + : Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ onlySMSBox == false ? Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: VerificationMethodsList( - authenticationViewModel: authenticationViewModel, - authMethodType: AuthMethodTypes.Fingerprint, - authenticateUser: (AuthMethodTypes authMethodType, isActive) => - authenticateUser(authMethodType, isActive), - )), - Expanded( - child: VerificationMethodsList( - authenticationViewModel: authenticationViewModel, - authMethodType: AuthMethodTypes.FaceID, - authenticateUser: (AuthMethodTypes authMethodType, isActive) => - authenticateUser(authMethodType, isActive), - )) - ], - ) + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: + AuthMethodTypes.Fingerprint, + authenticateUser: + (AuthMethodTypes + authMethodType, + isActive) => + authenticateUser( + authMethodType, + isActive), + )), + Expanded( + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: + AuthMethodTypes.FaceID, + authenticateUser: + (AuthMethodTypes + authMethodType, + isActive) => + authenticateUser( + authMethodType, + isActive), + )) + ], + ) : SizedBox(), Row( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, children: [ Expanded( child: VerificationMethodsList( - authenticationViewModel: authenticationViewModel, - authMethodType: AuthMethodTypes.SMS, - authenticateUser: (AuthMethodTypes authMethodType, isActive) => - authenticateUser(authMethodType, isActive), - )), + authenticationViewModel:authenticationViewModel, + authMethodType: AuthMethodTypes + .SMS, + authenticateUser: + ( + AuthMethodTypes authMethodType, + isActive) => + authenticateUser( + authMethodType, isActive), + )), Expanded( child: VerificationMethodsList( - authenticationViewModel: authenticationViewModel, - authMethodType: AuthMethodTypes.WhatsApp, - authenticateUser: (AuthMethodTypes authMethodType, isActive) => - authenticateUser(authMethodType, isActive), - )) + authenticationViewModel:authenticationViewModel, + authMethodType: + AuthMethodTypes.WhatsApp, + authenticateUser: + ( + AuthMethodTypes authMethodType, + isActive) => + authenticateUser( + authMethodType, isActive), + )) ], ), ]), - // ) + // ) + ], + ), + ), ], ), - ], ), ), ), @@ -341,7 +405,7 @@ class _VerificationMethodsScreenState extends State { SecondaryButton( label: TranslationBase .of(context) - .useAnotherAccount??'', + .useAnotherAccount, color: Color(0xFFD02127), //fontWeight: FontWeight.w700, onTap: () { @@ -358,12 +422,14 @@ 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!); + + await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType:authMethodType, password: authenticationViewModel.userInfo.password ); if (authenticationViewModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(authenticationViewModel.error); GifLoaderDialogUtils.hideDialog(context); @@ -382,15 +448,17 @@ class _VerificationMethodsScreenState extends State { sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel.sendActivationCodeVerificationScreen(authMethodType); + await authenticationViewModel + .sendActivationCodeVerificationScreen(authMethodType); if (authenticationViewModel.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(authenticationViewModel.error); } else { await sharedPref.setString(TOKEN, - authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!); - if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { + authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); + if (authMethodType == AuthMethodTypes.SMS || + authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType,isSilentLogin: true); } else { @@ -400,10 +468,12 @@ class _VerificationMethodsScreenState extends State { } authenticateUser(AuthMethodTypes authMethodType, isActive) { - if (authMethodType == AuthMethodTypes.Fingerprint || authMethodType == AuthMethodTypes.FaceID) { + if (authMethodType == AuthMethodTypes.Fingerprint || + authMethodType == AuthMethodTypes.FaceID) { fingerPrintBefore = authMethodType; } - this.selectedOption = (fingerPrintBefore != null ? fingerPrintBefore : authMethodType)!; + this.selectedOption = + fingerPrintBefore != null ? fingerPrintBefore : authMethodType; switch (authMethodType) { case AuthMethodTypes.SMS: @@ -413,7 +483,8 @@ class _VerificationMethodsScreenState extends State { sendActivationCode(authMethodType); break; case AuthMethodTypes.Fingerprint: - this.loginWithFingerPrintOrFaceID(AuthMethodTypes.Fingerprint, isActive); + this.loginWithFingerPrintOrFaceID( + AuthMethodTypes.Fingerprint, isActive); break; case AuthMethodTypes.FaceID: this.loginWithFingerPrintOrFaceID(AuthMethodTypes.FaceID, isActive); @@ -436,9 +507,7 @@ class _VerificationMethodsScreenState extends State { new SMSOTP( context, type, - authenticationViewModel.loggedUser != null - ? authenticationViewModel.loggedUser!.mobileNumber - : authenticationViewModel.user!.mobile, + authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile, (value) { showDialog( context: context, @@ -448,21 +517,23 @@ class _VerificationMethodsScreenState extends State { this.checkActivationCode(value: value,isSilentLogin: isSilentLogin); }, - () => { + () => + { print('Faild..'), }, ).displayDialog(context); } - - loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, isActive) async { + loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, + isActive) async { if (isActive) { await authenticationViewModel.showIOSAuthMessages(); if (!mounted) return; if (authenticationViewModel.user != null && - (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == - AuthMethodTypes.Fingerprint || - SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == - AuthMethodTypes.FaceID)) { + (SelectedAuthMethodTypesService.getMethodsTypeService( + authenticationViewModel.user.logInTypeID) == + AuthMethodTypes.Fingerprint || + SelectedAuthMethodTypesService.getMethodsTypeService( + authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) { this.sendActivationCode(authMethodTypes); } else { setState(() { @@ -472,8 +543,8 @@ 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); diff --git a/lib/screens/base/base_view.dart b/lib/screens/base/base_view.dart index 0cf174c7..7a5c93e6 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({ - required this.builder, + 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 7088902b..5166d2b1 100644 --- a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart @@ -12,8 +12,9 @@ import 'package:flutter/material.dart'; import 'doctor_repaly_chat.dart'; class AllDoctorQuestions extends StatefulWidget { + final Function changeCurrentTab; - const AllDoctorQuestions({Key? key}) : super(key: key); + const AllDoctorQuestions({Key key, this.changeCurrentTab}) : super(key: key); @override _AllDoctorQuestionsState createState() => _AllDoctorQuestionsState(); @@ -30,9 +31,10 @@ class _AllDoctorQuestionsState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, + 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( @@ -80,7 +82,7 @@ class _AllDoctorQuestionsState extends State { }); model.getDoctorReply(pageIndex: pageIndex); } - return false; + return; }, ), ), diff --git a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart index 39528c9c..52331e8e 100644 --- a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart @@ -7,11 +7,11 @@ import 'package:doctor_app_flutter/util/date-utils.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/shared/TextFields.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -24,7 +24,7 @@ class DoctorReplayChat extends StatefulWidget { final DoctorReplayViewModel previousModel; bool showMsgBox = false; DoctorReplayChat( - {Key? key, required this.reply, required this.previousModel, + {Key key, this.reply, this.previousModel, }); @override @@ -37,8 +37,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; @@ -172,7 +172,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, @@ -194,7 +194,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, @@ -236,7 +236,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( @@ -269,7 +269,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, @@ -280,7 +280,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 9bdfe49d..8b51319c 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -28,7 +28,7 @@ import 'not_replaied_Doctor_Questions.dart'; class DoctorReplyScreen extends StatefulWidget { final Function changeCurrentTab; - const DoctorReplyScreen({Key? key, required this.changeCurrentTab}) : super(key: key); + const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key); @override _DoctorReplyScreenState createState() => _DoctorReplyScreenState(); @@ -36,7 +36,7 @@ class DoctorReplyScreen extends StatefulWidget { class _DoctorReplyScreenState extends State with SingleTickerProviderStateMixin { - late TabController _tabController; + TabController _tabController; int _activeTab = 0; int pageIndex = 1; @@ -69,7 +69,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, @@ -109,7 +109,7 @@ class _DoctorReplyScreenState extends State tabWidget( screenSize, _activeTab == 1, - TranslationBase.of(context).all!, + TranslationBase.of(context).all, ), ], ), diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index c48dbf08..69bb9ab2 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, required this.reply}); + DoctorReplyWidget({Key key, this.reply}); @override _DoctorReplyWidgetState createState() => _DoctorReplyWidgetState(); @@ -31,9 +31,10 @@ class _DoctorReplyWidgetState extends State { return Container( child: CardWithBgWidget( - bgColor:widget.reply.infoStatus == 99 + bgColor: widget.reply.infoStatus == 99 ? Color(0xFF2B353E) - : widget.reply.infoStatus == 4 ? IN_PROGRESS_COLOR + : widget.reply.infoStatus == 4 + ? IN_PROGRESS_COLOR : widget.reply.infoStatus == 3 ? Color(0xFFD02127) : Colors.green[600], @@ -49,13 +50,14 @@ class _DoctorReplyWidgetState extends State { children: [ RichText( text: new TextSpan( - style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), children: [ new TextSpan( text: widget.reply.infoStatus == 99 - ? TranslationBase.of(context).notReplied - : widget.reply.infoStatus == 1 - ? TranslationBase.of(context).replayCallStatus + ? TranslationBase.of(context).notReplied:widget.reply.infoStatus == 1 + ? TranslationBase.of(context).replayCallStatus : widget.reply.infoStatus == 2 ? TranslationBase.of(context).patientArrived : widget.reply.infoStatus == 3 @@ -69,7 +71,8 @@ class _DoctorReplyWidgetState extends State { .textResponse : '', style: TextStyle( - color: widget.reply.infoStatus == 99 ? Color(0xFF2B353E) + color: widget.reply.infoStatus == 99 + ? Color(0xFF2B353E) : widget.reply.infoStatus == 4 ? IN_PROGRESS_COLOR : widget.reply.infoStatus == 3 @@ -85,21 +88,35 @@ 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, ) @@ -122,7 +139,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, @@ -188,10 +205,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, @@ -213,7 +230,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 1416e70a..5b21809f 100644 --- a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart @@ -14,7 +14,7 @@ import 'doctor_repaly_chat.dart'; class NotRepliedDoctorQuestions extends StatefulWidget { final Function changeCurrentTab; - const NotRepliedDoctorQuestions({Key? key, required this.changeCurrentTab}) + const NotRepliedDoctorQuestions({Key key, this.changeCurrentTab}) : super(key: key); @override @@ -33,10 +33,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( @@ -91,7 +91,7 @@ class _NotRepliedDoctorQuestionsState extends State { }); model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); } - return false; + return; }, ), ), diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 23117bb8..5ef8b617 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -14,8 +14,9 @@ class PatientArrivalScreen extends StatefulWidget { _PatientArrivalScreen createState() => _PatientArrivalScreen(); } -class _PatientArrivalScreen extends State with SingleTickerProviderStateMixin { - late TabController _tabController; +class _PatientArrivalScreen extends State + with SingleTickerProviderStateMixin { + TabController _tabController; var _patientSearchFormValues = PatientModel( FirstName: "0", MiddleName: "0", @@ -23,8 +24,10 @@ class _PatientArrivalScreen extends State with SingleTicke PatientMobileNumber: "0", PatientIdentificationID: "0", PatientID: 0, - From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd').toString(), - To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd').toString(), + From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", @@ -51,7 +54,7 @@ class _PatientArrivalScreen extends State with SingleTicke Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).arrivalpatient ?? "", + appBarTitle: TranslationBase.of(context).arrivalpatient, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -63,7 +66,9 @@ class _PatientArrivalScreen extends State with SingleTicke width: MediaQuery.of(context).size.width * 0.92, // 0.9, decoration: BoxDecoration( border: Border( - bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.9), //width: 0.7 + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), //width: 0.7 ), color: Colors.white), child: Center( @@ -73,19 +78,22 @@ class _PatientArrivalScreen extends State with SingleTicke indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + labelPadding: + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: AppText(TranslationBase.of(context).arrivalpatient), + child: AppText( + TranslationBase.of(context).arrivalpatient), ), ), Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: AppText(TranslationBase.of(context).rescheduleLeaves), + child: AppText( + TranslationBase.of(context).rescheduleLeaves), ), ), ], diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart deleted file mode 100644 index fd5ab744..00000000 --- a/lib/screens/home/dashboard_referral_patient.dart +++ /dev/null @@ -1,158 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; -import 'package:flutter/material.dart'; - -import 'label.dart'; - -class DashboardReferralPatient extends StatelessWidget { - final List? dashboardItemList; - final double? height; - final DashboardViewModel? model; - - const DashboardReferralPatient({Key? key, this.dashboardItemList, this.height, this.model}) : super(key: key); - @override - Widget build(BuildContext context) { - return RoundedContainer( - raduis: 16, - showBorder: false, - borderColor: Colors.white, - shadowWidth: 0.2, - shadowSpreadRadius: 3, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - flex: 1, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(8), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * - (SizeConfig.isHeightVeryShort - ? 3 - : SizeConfig.isHeightShort - ? 2 - : 2)), - Label( - firstLine: TranslationBase.of(context).patients, - secondLine: TranslationBase.of(context).referral, - color: Color(0xFF2B353E), - secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) * - (SizeConfig.isHeightVeryShort - ? 5 - : SizeConfig.isHeightShort - ? 7 - : 12), - ), - SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * - (SizeConfig.isHeightVeryShort - ? 5 - : SizeConfig.isHeightShort - ? 10 - : 5)) - ], - ), - ), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RowCounts( - dashboardItemList![2].summaryoptions![0].kPIParameter, - dashboardItemList![2].summaryoptions![0].value!, - Colors.black, - height: height!, - ), - RowCounts( - dashboardItemList![2].summaryoptions![1].kPIParameter, - dashboardItemList![2].summaryoptions![1].value!, - Colors.grey, - height: height!, - ), - RowCounts( - dashboardItemList![2].summaryoptions![2].kPIParameter, - dashboardItemList![2].summaryoptions![2].value!, - Colors.red, - height: height!, - ), - ], - ), - ) - ], - )), - ), - Expanded( - flex: 3, - child: Stack(children: [ - Container(padding: EdgeInsets.all(0), child: GaugeChart(_createReferralData(dashboardItemList!))), - Positioned( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - AppText( - model!.getPatientCount(dashboardItemList![2]).toString(), - fontSize: SizeConfig.textMultiplier * 3.0, - fontWeight: FontWeight.bold, - ) - ], - ), - top: height! * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), - left: 0, - right: 0) - ]), - ), - ], - )), - ])); - } - - static List> _createReferralData(List dashboardItemList) { - final data = [ - new GaugeSegment(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), charts.MaterialPalette.gray.shadeDefault), - new GaugeSegment(dashboardItemList[2].summaryoptions![2].kPIParameter!, - getValue(dashboardItemList[1].summaryoptions![2].value), charts.MaterialPalette.red.shadeDefault), - ]; - - return [ - new charts.Series( - id: 'Segments', - domainFn: (GaugeSegment segment, _) => segment.segment, - measureFn: (GaugeSegment segment, _) => segment.size, - data: data, - colorFn: (GaugeSegment segment, _) => segment.color, - ) - ]; - } - - static int getValue(value) { - return value == 0 ? 1 : value; - } -} diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 3c633430..4b7c4f46 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -1,11 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/activity_card.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -import 'label.dart'; - class DashboardSliderItemWidget extends StatelessWidget { final DashboardModel item; @@ -18,25 +16,20 @@ class DashboardSliderItemWidget extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Label( - firstLine: Helpers.getLabelFromKPI(item.kPIName!), - secondLine: Helpers.getNameFromKPI(item.kPIName!), + AppText( + item.kPIName, + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.bold, ), ], ), new Container( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort - ? 16 - : SizeConfig.isHeightShort - ? 14 - : SizeConfig.isHeightLarge - ? 15 - : 13), + height: 110, 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 GetActivityButton(item.summaryoptions[index]); }))) ], ); diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 8f51d553..66261292 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -1,13 +1,16 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; import 'package:doctor_app_flutter/widgets/dashboard/out_patient_stack.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; - -import 'dashboard_referral_patient.dart'; +import 'package:charts_flutter/flutter.dart' as charts; class DashboardSwipeWidget extends StatefulWidget { final List dashboardItemList; @@ -25,10 +28,8 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { - double height = SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 40 : SizeConfig.isHeightLarge?33:31); return Container( - height: height, + height: MediaQuery.of(context).size.height * 0.35, // height: 230, child: Swiper( onIndexChanged: (index) { @@ -40,11 +41,12 @@ class _DashboardSwipeWidgetState extends State { } }, itemBuilder: (BuildContext context, int index) { - return getSwipeWidget(widget.dashboardItemList, index, height); + return getSwipeWidget(widget.dashboardItemList, index); }, itemCount: 3, - - pagination: new SwiperCustomPagination(builder: (BuildContext context, SwiperPluginConfig config) { + // itemHeight: 300, + pagination: new SwiperCustomPagination( + builder: (BuildContext context, SwiperPluginConfig config) { return new Stack( alignment: Alignment.bottomCenter, children: [ @@ -57,9 +59,15 @@ class _DashboardSwipeWidgetState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - config.activeIndex == 0 ? SwiperRoundedPagination(true) : SwiperRoundedPagination(false), - config.activeIndex == 1 ? SwiperRoundedPagination(true) : SwiperRoundedPagination(false), - config.activeIndex == 2 ? SwiperRoundedPagination(true) : SwiperRoundedPagination(false), + config.activeIndex == 0 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + config.activeIndex == 1 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + config.activeIndex == 2 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), ], ), ), @@ -76,20 +84,19 @@ class _DashboardSwipeWidgetState extends State { ); } - Widget getSwipeWidget(List dashboardItemList, int index, double height) { + Widget getSwipeWidget(List dashboardItemList, int index) { if (index == 1) return RoundedContainer( - raduis: 16, - showBorder: false, + raduis: 16, + showBorder: false, borderColor: Colors.white, shadowWidth: 0.1, shadowSpreadRadius: 2, shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding(padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[1], - ), - ), - ); + child: Padding( + padding: const EdgeInsets.all(5.0), + child: GetOutPatientStack(dashboardItemList[1]))); if (index == 0) return RoundedContainer( raduis: 16, @@ -99,14 +106,156 @@ class _DashboardSwipeWidgetState extends State { shadowSpreadRadius: 2, shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding(padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[0]))); + child: Padding( + padding: const EdgeInsets.all(5.0), + child: GetOutPatientStack(dashboardItemList[0]))); if (index == 2) - return DashboardReferralPatient(dashboardItemList: widget.dashboardItemList,height: height,model: widget.model,); + return RoundedContainer( + raduis: 16, + showBorder: false, + borderColor: Colors.white, + shadowWidth: 0.1, + shadowSpreadRadius: 2, + shadowDy: 1, + margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Expanded( + flex: 1, + child: Row( + children: [ + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(8), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .patients, + fontSize: 12, + fontWeight: FontWeight.bold, + fontHeight: 0.5, + ), + AppText( + TranslationBase.of(context) + .referral, + fontSize: 22, + fontWeight: FontWeight.bold, + ), + ], + )), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: RowCounts( + dashboardItemList[2] + .summaryoptions[0] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[0] + .value, + Colors.black), + ), + Expanded( + child: RowCounts( + dashboardItemList[2] + .summaryoptions[1] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[1] + .value, + Colors.grey), + ), + Expanded( + child: RowCounts( + dashboardItemList[2] + .summaryoptions[2] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[2] + .value, + Colors.red), + ), + ], + ), + ) + ], + )), + ), + Expanded( + flex: 3, + child: Stack(children: [ + Container( + child: GaugeChart( + _createReferralData(widget.dashboardItemList))), + Positioned( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + AppText( + widget.model + .getPatientCount(dashboardItemList[2]) + .toString(), + fontSize: SizeConfig.textMultiplier * 3.0, + fontWeight: FontWeight.bold, + ) + ], + ), + top: MediaQuery.of(context).size.height * 0.13, + left: 0, + right: 0) + ]), + ), + ], + )), + ])); return Container(); } + static List> _createReferralData( + List dashboardItemList) { + final data = [ + new GaugeSegment( + 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), + charts.MaterialPalette.gray.shadeDefault), + new GaugeSegment( + dashboardItemList[2].summaryoptions[2].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[2].value), + charts.MaterialPalette.red.shadeDefault), + ]; + return [ + new charts.Series( + id: 'Segments', + domainFn: (GaugeSegment segment, _) => segment.segment, + measureFn: (GaugeSegment segment, _) => segment.size, + data: data, + colorFn: (GaugeSegment segment, _) => segment.color, + ) + ]; + } + static int getValue(value) { + return value == 0 ? 1 : value; + } } - - diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 75d1b713..503bbe60 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -5,29 +5,31 @@ class HomePageCard extends StatelessWidget { const HomePageCard( {this.hasBorder = false, this.imageName, - required this.child, - required this.onTap, - Key? key, - required this.color, + @required this.child, + this.onTap, + Key key, + this.color, this.opacity = 0.4, - required this.margin, this.width}) + this.margin}) : super(key: key); final bool hasBorder; - final String? imageName; + final String imageName; final Widget child; - final GestureTapCallback onTap; + final Function onTap; final Color color; final double opacity; - final double? width; final EdgeInsets margin; @override Widget build(BuildContext context) { return InkWell( onTap: onTap, child: Container( - width: width, + width: 120, + height: MediaQuery.of(context).orientation == Orientation.portrait + ? 100 + : 200, margin: this.margin, - decoration: BoxDecoration( + decoration: BoxDecoration( color: !hasBorder ? color != null ? color @@ -41,7 +43,8 @@ class HomePageCard extends StatelessWidget { ? DecorationImage( image: AssetImage('assets/images/dashboard/$imageName'), fit: BoxFit.cover, - colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn), + colorFilter: new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn), ) : null, ), diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index a1a5f8f8..a0d0bce7 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -6,32 +6,29 @@ import 'package:flutter/material.dart'; class HomePatientCard extends StatelessWidget { final Color backgroundColor; final IconData cardIcon; - final String? cardIconImage; + final String cardIconImage; final Color backgroundIconColor; final String text; final Color textColor; - final GestureTapCallback onTap; + final Function onTap; final double iconSize; HomePatientCard({ - required this.backgroundColor, - required this.backgroundIconColor, - required this.cardIcon, - this.cardIconImage, - required this.text, - required this.textColor, - required this.onTap, - this.iconSize = 30, + @required this.backgroundColor, + @required this.backgroundIconColor, + this.cardIcon, + this.cardIconImage, + @required this.text, + @required this.textColor, + @required this.onTap, + this.iconSize = 30, }); @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* - (SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightLarge?15:13); return HomePageCard( color: backgroundColor, - width: width, - margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), + margin: EdgeInsets.all(4), child: Container( padding: EdgeInsets.all(8), child: Column( @@ -70,12 +67,11 @@ class HomePatientCard extends StatelessWidget { cardIcon != null ? Icon( cardIcon, - size: - SizeConfig.getWidthMultiplier(width: width) * 22, + size: iconSize, color: textColor, ) : Image.asset( - cardIconImage!, + cardIconImage, height: iconSize, width: iconSize, ), @@ -94,9 +90,7 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth(width: width) * - (SizeConfig.isHeightVeryShort ? 11 : 10), + fontSize: SizeConfig.textMultiplier * 1.6, ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 2d469daf..62988caa 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; @@ -33,13 +32,12 @@ import 'package:provider/provider.dart'; import 'package:sticky_headers/sticky_headers/widget.dart'; import '../../routes.dart'; -import 'home_screen_header.dart'; -import 'label.dart'; +import '../../widgets/shared/app_texts_widget.dart'; class HomeScreen extends StatefulWidget { - HomeScreen({Key? key, this.title}) : super(key: key); + HomeScreen({Key key, this.title}) : super(key: key); - final String? title; + final String title; final String iconURL = 'assets/images/dashboard_icon/'; @override @@ -48,15 +46,15 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { bool isLoading = false; - ProjectViewModel? projectsProvider; - DoctorProfileModel? profile; + ProjectViewModel projectsProvider; + var _isInit = true; + DoctorProfileModel profile; bool isExpanded = false; bool isInpatient = false; int sliderActiveIndex = 0; - var clinicId; - late AuthenticationViewModel authenticationViewModel; + var clinicId; + AuthenticationViewModel authenticationViewModel; int colorIndex = 0; - final GlobalKey scaffoldKey = new GlobalKey(); @override Widget build(BuildContext context) { @@ -70,17 +68,12 @@ class _HomeScreenState extends State { return BaseView( onModelReady: (model) async { - model.startHomeScreenServices(projectsProvider, authenticationViewModel); + model.startHomeScreenServices( + projectsProvider, authenticationViewModel); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBar: HomeScreenHeader( - model: model, - onOpenDrawer: () { - Scaffold.of(context).openDrawer(); - }, - ), + isShowAppBar: false, body: ListView(children: [ Column(children: [ StickyHeader( @@ -330,21 +323,21 @@ class _HomeScreenState extends State { DashboardViewModel model, projectsProvider) { colorIndex = 0; - List backgroundColors = []; - backgroundColors.add(Color(0xffD02127)); - backgroundColors.add(Colors.grey[300]!); - backgroundColors.add(Color(0xff2B353E)); + List backgroundColors = List(3); + backgroundColors[0] = Color(0xffD02127); + backgroundColors[1] = Colors.grey[300]; + backgroundColors[2] = Color(0xff2B353E); + 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] = Colors.black; + textColors[2] = Colors.white; - List backgroundIconColors = []; - backgroundIconColors.add(Colors.white12); - backgroundIconColors.add(Colors.white38); - backgroundIconColors.add(Colors.white10); + List patientCards = List(); - List textColors = []; - textColors.add(Colors.white); - textColors.add(Colors.black); - textColors.add(Colors.white); - List patientCards = []; if (model.hasVirtualClinic) { patientCards.add(HomePatientCard( backgroundColor: backgroundColors[colorIndex], @@ -352,7 +345,8 @@ class _HomeScreenState extends State { cardIcon: DoctorApp.livecare, textColor: textColors[colorIndex], iconSize: 21, - text: "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", + text: + "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", onTap: () { // TODO MOSA TEST // PatiantInformtion patient = PatiantInformtion( @@ -387,13 +381,14 @@ 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, FadePage( page: InPatientScreen( - specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!)!, + specialClinic: model.getSpecialClinic( + clinicId ?? projectsProvider.doctorClinicsList[0].clinicID), ), ), ); @@ -407,7 +402,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, @@ -424,17 +419,21 @@ 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(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); Navigator.push( context, MaterialPageRoute( builder: (context) => OutPatientsScreen( - patientSearchRequestModel: PatientSearchRequestModel( - from: date, to: date, doctorID: authenticationViewModel.doctorProfile!.doctorID), + patientSearchRequestModel: PatientSearchRequestModel( + from: date, + to: date, + doctorID: authenticationViewModel.doctorProfile.doctorID), ), settings: RouteSettings(name: 'OutPatientsScreen'), )); @@ -447,7 +446,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, @@ -465,7 +464,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, @@ -482,7 +481,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, @@ -494,7 +493,10 @@ class _HomeScreenState extends State { )); changeColorIndex(); - return [...List.generate(patientCards.length, (index) => patientCards[index]).toList()]; + return [ + ...List.generate(patientCards.length, (index) => patientCards[index]) + .toList() + ]; } changeColorIndex() { diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart deleted file mode 100644 index 9b1aa63c..00000000 --- a/lib/screens/home/home_screen_header.dart +++ /dev/null @@ -1,219 +0,0 @@ -// ignore: must_be_immutable -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:provider/provider.dart'; - -// ignore: must_be_immutable -class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { - - final DashboardViewModel model; - final Function onOpenDrawer; - - double height = SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10 : 6); - - HomeScreenHeader({Key? key, required this.model, required this.onOpenDrawer}) : super(key: key); - - @override - _HomeScreenHeaderState createState() => _HomeScreenHeaderState(); - - @override - Size get preferredSize => Size(double.maxFinite,height); -} - -class _HomeScreenHeaderState extends State { - ProjectViewModel? projectsProvider; - int? clinicId; - - - AuthenticationViewModel? authenticationViewModel; - - - @override - Widget build(BuildContext context) { - ProjectViewModel projectsProvider = Provider.of(context); - authenticationViewModel = Provider.of(context); - - return widget.model.state == ViewState.Busy - ? Container(color: Colors.grey.withOpacity(0.65)) - : Container( - color: Colors.grey[100], - child: Stack(children: [ - IconButton( - icon: Icon(FontAwesomeIcons.ellipsisH), - iconSize: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?4: 3), - color: Colors.black, - onPressed: () { - widget.onOpenDrawer(); - }, - ), - Column( - children: [ - ProfileWelcomeWidget( - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - width: MediaQuery - .of(context) - .size - .width * .6, - child: projectsProvider.doctorClinicsList.length > - 0 - ? Stack( - children: [ - DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[0].clinicID - : clinicId, - iconSize: SizeConfig.widthMultiplier * 7, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - padding: - EdgeInsets.all(2), - margin: - EdgeInsets.all(2), - decoration: - new BoxDecoration( - color: - Colors.red[800], - borderRadius: - BorderRadius - .circular( - 20), - ), - constraints: - BoxConstraints( - minWidth: SizeConfig - .getHeightMultiplier( - height: widget.height) * - 35, - minHeight: SizeConfig - .getHeightMultiplier( - height: widget.height) * - 30, - ), - child: Center( - child: AppText( - projectsProvider - .doctorClinicsList - .length - .toString(), - color: - Colors.white, - fontSize: - projectsProvider - .isArabic - ? SizeConfig - .getHeightMultiplier( - height: widget.height) - : SizeConfig - .getHeightMultiplier( - height: widget - .height) * 20, - textAlign: - TextAlign - .center, - ), - )), - ], - ), - AppText(item.clinicName, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth( - width: MediaQuery - .of(context) - .size - .width * .6) * (SizeConfig.isWidthLarge?4:5), - color: Color(0xFF2B353E), - maxLines: 1, - maxLength: 2, - letterSpacing: -0.96, - textOverflow: TextOverflow - .ellipsis, - fontWeight: - FontWeight.bold, - textAlign: TextAlign.end), - ], - ); - }).toList(); - }, - onChanged: (int? newValue) async { - setState(() { - clinicId = newValue; - }); - - GifLoaderDialogUtils.showMyDialog( - context); - await widget.model.changeClinic(newValue!, - authenticationViewModel!); - GifLoaderDialogUtils.hideDialog( - context); - if (widget.model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - widget.model.error); - } - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: AppText( - item.clinicName, - textAlign: TextAlign.left, - ), - value: item.clinicID, - ); - }).toList(), - )), - ], - ) - : AppText( - TranslationBase - .of(context) - .noClinic), - ), - ], - ), - isClinic: true, - height: widget.height, - ), - ]) - ])); - } - - -} \ No newline at end of file diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart deleted file mode 100644 index 59c396ac..00000000 --- a/lib/screens/home/label.dart +++ /dev/null @@ -1,45 +0,0 @@ -// ignore: must_be_immutable - -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, - }) : super(key: key); - final String? firstLine; - final String? secondLine; - Color color; - final double? secondLineFontSize; - final double? firstLineFontSize; - - @override - Widget build(BuildContext context) { - - return Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - firstLine, - fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , - // fontWeight: FontWeight.bold, - color: color, - fontHeight: .5, - letterSpacing: -0.72, - fontWeight: FontWeight.w600, - ), - AppText( - secondLine, - color: color, - fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), - fontWeight: FontWeight.bold, - letterSpacing: -1.44, - - ), - ], - ); - } -} \ No newline at end of file diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index a9ab2d9f..62b97f2d 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart' import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/livecare/session_status_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/live_care/live-care_transfer_to_admin.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; @@ -24,9 +23,9 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:hexcolor/hexcolor.dart'; class EndCallScreen extends StatefulWidget { - final PatiantInformtion? patient; + final PatiantInformtion patient; - const EndCallScreen({Key? key, this.patient,}) : super(key: key); + const EndCallScreen({Key key, this.patient,}) : super(key: key); @override _EndCallScreenState createState() => _EndCallScreenState(); @@ -34,15 +33,15 @@ class EndCallScreen extends StatefulWidget { class _EndCallScreenState extends State { bool isInpatient = false; - PatiantInformtion ?patient; + PatiantInformtion patient; bool isDischargedPatient = false; bool isSearchAndOut = false; - late String patientType; - late String arrivalType; - late String from; - late String to; + String patientType; + String arrivalType; + String from; + String to; - late LiveCarePatientViewModel liveCareModel; + LiveCarePatientViewModel liveCareModel; @override void initState() { super.initState(); @@ -53,7 +52,7 @@ class _EndCallScreenState extends State { @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; if(routeArgs.containsKey('patient')) patient = routeArgs['patient']; } @@ -61,13 +60,15 @@ class _EndCallScreenState extends State { @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel( - TranslationBase.of(context).resume!, TranslationBase.of(context).theCall!, '', 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).resume, + TranslationBase.of(context).theCall, '', 'patient/vital_signs.png', isInPatient: isInpatient, - color: Colors.green[800]!, + color: Colors.green[800], onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.startCall(isReCall: false, vCID: patient!.vcId!).then((value) async { + await liveCareModel + .startCall(isReCall: false, vCID: patient.vcId) + .then((value) async { await liveCareModel.getDoctorProfile(); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { @@ -77,12 +78,12 @@ class _EndCallScreenState extends State { kToken: liveCareModel.startCallRes.openTokenID, kSessionId: liveCareModel.startCallRes.openSessionID, kApiKey: '46209962', - vcId: patient!.vcId, + vcId: patient.vcId, isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes.isRecording: false, - patientName: patient!.fullName ?? (patient!.firstName != null ? "${patient!.firstName} ${patient!.lastName}" : "-"), + patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await liveCareModel.getToken(), generalId: GENERAL_ID, - doctorId: liveCareModel.doctorProfile!.doctorID, + doctorId: liveCareModel.doctorProfile.doctorID, onFailure: (String error) { DrAppToastMsg.showErrorToast(error); }, @@ -90,19 +91,20 @@ class _EndCallScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCall( - patient!.vcId!, + patient.vcId, false, - - );GifLoaderDialogUtils.hideDialog(context); + ); + GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); } }, - onCallNotRespond: (SessionStatusModel sessionStatusModel) async { + onCallNotRespond: + (SessionStatusModel sessionStatusModel) async { GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCall( - patient!.vcId!, + patient.vcId, sessionStatusModel.sessionStatus == 3, ); GifLoaderDialogUtils.hideDialog(context); @@ -117,23 +119,26 @@ class _EndCallScreenState extends State { } }, isDartIcon: true, dartIcon: DoctorApp.call), PatientProfileCardModel( - TranslationBase.of(context).endLC!, TranslationBase.of(context).consultation!, '', 'patient/vital_signs.png', + TranslationBase.of(context).endLC, + TranslationBase.of(context).consultation, + '', + 'patient/vital_signs.png', isInPatient: isInpatient, - color: Colors.red[800]!, + color: Colors.red[800], onTap: () { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.getAlternativeServices(patient!.vcId!); + await liveCareModel.getAlternativeServices(patient.vcId); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); } else { showAlternativesDialog(context, liveCareModel, (bool isConfirmed) async { GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.endCallWithCharge(patient!.vcId!, isConfirmed); + await liveCareModel.endCallWithCharge(patient.vcId, isConfirmed); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -146,7 +151,10 @@ class _EndCallScreenState extends State { } }); }, isDartIcon: true, dartIcon: DoctorApp.end_consultaion), - PatientProfileCardModel(TranslationBase.of(context).sendLC!, TranslationBase.of(context).instruction!, "", + PatientProfileCardModel( + TranslationBase.of(context).sendLC, + TranslationBase.of(context).instruction, + "", 'patient/health_summary.png', onTap: () { Helpers.showConfirmationDialog(context, @@ -154,7 +162,7 @@ class _EndCallScreenState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.sendSMSInstruction(patient!.vcId!); + await liveCareModel.sendSMSInstruction(patient.vcId); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -168,12 +176,20 @@ class _EndCallScreenState extends State { // isDisable: true, dartIcon: DoctorApp.send_instruction), PatientProfileCardModel( - TranslationBase.of(context).transferTo!, TranslationBase.of(context).admin!, '', 'patient/health_summary.png', - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient!), + TranslationBase.of(context).transferTo, + TranslationBase.of(context).admin, + '', + 'patient/health_summary.png', onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + LivaCareTransferToAdmin(patient: patient), settings: RouteSettings(name: 'LivaCareTransferToAdmin'),),); - }, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin), + }, + isInPatient: isInpatient, + isDartIcon: true, + dartIcon: DoctorApp.transfer_to_admin), ]; return BaseView( @@ -182,12 +198,8 @@ class _EndCallScreenState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase - .of(context) - .patientProfile!, - backgroundColor: Theme - .of(context) - .scaffoldBackgroundColor, + appBarTitle: TranslationBase.of(context).patientProfile, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, isShowAppBar: true, appBar: PatientProfileAppBar( patient, @@ -196,8 +208,8 @@ class _EndCallScreenState extends State { }, isInpatient: isInpatient, - height: (patient!.patientStatusType != null && - patient!.patientStatusType == 43) + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) ? 210 : isDischargedPatient ? 240 @@ -212,7 +224,8 @@ class _EndCallScreenState extends State { child: ListView( children: [ Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + padding: + const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -237,8 +250,9 @@ class _EndCallScreenState extends State { crossAxisCount: 3, itemCount: cardsList.length, staggeredTileBuilder: (int index) => StaggeredTile.fit(1), - itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: patient!, + itemBuilder: (BuildContext context, int index) => + PatientProfileButton( + patient: patient, patientType: patientType, arrivalType: arrivalType, from: from, @@ -248,13 +262,14 @@ class _EndCallScreenState extends State { route: cardsList[index].route, icon: cardsList[index].icon, isInPatient: cardsList[index].isInPatient, - isDischargedPatient: cardsList[index].isDischargedPatient, + isDischargedPatient: + cardsList[index].isDischargedPatient, isDisable: cardsList[index].isDisable, onTap: cardsList[index].onTap, isLoading: cardsList[index].isLoading, isDartIcon: cardsList[index].isDartIcon, dartIcon: cardsList[index].dartIcon, - color: cardsList[index].color, + color: cardsList[index].color, ), ), ], @@ -354,10 +369,10 @@ class _EndCallScreenState extends State { } class CheckBoxListWidget extends StatefulWidget { - final LiveCarePatientViewModel? model; + final LiveCarePatientViewModel model; const CheckBoxListWidget({ - Key? key, + Key key, this.model, }) : super(key: key); @@ -371,7 +386,7 @@ class _CheckBoxListState extends State { return SingleChildScrollView( child: Column( children: [ - ...widget.model!.alternativeServicesList + ...widget.model.alternativeServicesList .map( (element) => Container( child: CheckboxListTile( @@ -383,7 +398,7 @@ class _CheckBoxListState extends State { value: element.isSelected, onChanged: (newValue) { setState(() { - widget.model! + widget.model .setSelectedCheckboxValues(element, newValue); }); }, 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 00cb9579..233f59d8 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -23,20 +23,21 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class LivaCareTransferToAdmin extends StatefulWidget { final PatiantInformtion patient; - const LivaCareTransferToAdmin({Key? key, required this.patient}) : super(key: key); + const LivaCareTransferToAdmin({Key key, this.patient}) : super(key: key); @override - _LivaCareTransferToAdminState createState() => _LivaCareTransferToAdminState(); + _LivaCareTransferToAdminState createState() => + _LivaCareTransferToAdminState(); } class _LivaCareTransferToAdminState extends State { stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; TextEditingController noteController = TextEditingController(); - late String noteError; + String noteError; void initState() { requestPermissions(); @@ -58,7 +59,8 @@ class _LivaCareTransferToAdminState extends State { onModelReady: (model) {}, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", + appBarTitle: + "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", backgroundColor: Theme.of(context).scaffoldBackgroundColor, isShowAppBar: true, body: Container( @@ -82,13 +84,17 @@ class _LivaCareTransferToAdminState extends State { ), Positioned( top: -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, + 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()}); }, ), ], @@ -99,31 +105,32 @@ class _LivaCareTransferToAdminState extends State { ), ), ButtonBottomSheet( - title: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", + title: + "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", 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(); + } + }); } }); }, @@ -138,7 +145,8 @@ class _LivaCareTransferToAdminState 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, @@ -182,7 +190,8 @@ class _LivaCareTransferToAdminState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index 0e13c867..a9c7b38f 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -30,8 +30,8 @@ class LiveCarePatientScreen extends StatefulWidget { class _LiveCarePatientScreenState extends State { final _controller = TextEditingController(); - late Timer timer; - late LiveCarePatientViewModel _liveCareViewModel; + Timer timer; + LiveCarePatientViewModel _liveCareViewModel; @override void initState() { super.initState(); @@ -45,8 +45,8 @@ class _LiveCarePatientScreenState extends State { @override void dispose() { _liveCareViewModel.isLogin(0); - // _liveCareViewModel = null!; - timer.cancel(); + _liveCareViewModel = null; + timer?.cancel(); super.dispose(); } @@ -99,13 +99,11 @@ class _LiveCarePatientScreenState extends State { }, marginTop: 5, suffixIcon: IconButton( - onPressed: () {}, - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, ), ), model.state == ViewState.Idle @@ -115,7 +113,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 a503ae74..f081479c 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; - late LiveCareViewModel _liveCareProvider; + 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, @@ -61,11 +61,13 @@ class _LiveCarePandingListState extends State { ? Center( child: Text( _liveCareProvider.errorMsg, - style: TextStyle(color: Theme.of(context).errorColor), + style: TextStyle( + color: Theme.of(context).errorColor), ), ) : Column( - children: _liveCareProvider.liveCarePendingList.map((item) { + children: _liveCareProvider.liveCarePendingList + .map((item) { return Container( decoration: myBoxDecoration(), child: InkWell( @@ -84,28 +86,47 @@ class _LiveCarePandingListState extends State { Column( children: [ Container( - decoration: BoxDecoration( + decoration: + BoxDecoration( gradient: LinearGradient( - begin: Alignment(-1, -1), - end: Alignment(1, 1), + begin: Alignment( + -1, + -1), + end: Alignment( + 1, 1), colors: [ - Colors.grey[100]!, - Colors.grey[200]!, + Colors.grey[ + 100], + Colors.grey[ + 200], ]), boxShadow: [ BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) + color: Color.fromRGBO( + 0, + 0, + 0, + 0.08), + offset: Offset( + 0.0, + 5.0), + blurRadius: + 16.0) ], - borderRadius: BorderRadius.all(Radius.circular(50.0)), + borderRadius: + BorderRadius.all( + Radius.circular( + 50.0)), ), width: 80, height: 80, child: Icon( - item.gender == "1" - ? DoctorApp.male - : DoctorApp.female_icon, + item.gender == + "1" + ? DoctorApp + .male + : DoctorApp + .female_icon, size: 80, )), ], @@ -114,28 +135,48 @@ class _LiveCarePandingListState extends State { width: 20, ), Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment + .start, children: [ AppText( item.patientName, - fontSize: 2.0 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + fontSize: 2.0 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight + .bold, ), SizedBox( height: 8, ), AppText( - TranslationBase.of(context).fileNo! + - item.patientID.toString(), - fontSize: 2.0 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + TranslationBase.of( + context) + .fileNo + + item.patientID + .toString(), + fontSize: 2.0 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight + .bold, ), AppText( - TranslationBase.of(context).age! + + TranslationBase.of( + context) + .age + ' ' + - item.age.toString(), - fontSize: 2.0 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + item.age + .toString(), + fontSize: 2.0 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight + .bold, ), SizedBox( height: 8, @@ -152,7 +193,8 @@ class _LiveCarePandingListState extends State { Icons.video_call, size: 40, ), - color: Colors.green, //Colors.black, + color: Colors + .green, //Colors.black, onPressed: () => { _isInit = true, // sharedPref.setObj( @@ -213,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 f62e3e11..e024624a 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -18,8 +18,7 @@ class VideoCallPage extends StatefulWidget { final PatiantInformtion patientData; final listContext; final LiveCarePatientViewModel model; - VideoCallPage( - {required this.patientData, this.listContext, required this.model}); + VideoCallPage({this.patientData, this.listContext, this.model}); @override _VideoCallPageState createState() => _VideoCallPageState(); @@ -28,10 +27,10 @@ class VideoCallPage extends StatefulWidget { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class _VideoCallPageState extends State { - late Timer _timmerInstance; + Timer _timmerInstance; int _start = 0; String _timmer = ''; - late LiveCareViewModel _liveCareProvider; + LiveCareViewModel _liveCareProvider; bool _isInit = true; var _tokenData; bool isTransfer = false; @@ -67,12 +66,8 @@ class _VideoCallPageState extends State { //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', kApiKey: '46209962', vcId: widget.patientData.vcId, - isRecording: tokenData != null ? tokenData.isRecording! : false, - patientName: widget.patientData.fullName != null - ? widget.patientData.fullName! - : widget.patientData.firstName != null - ? "${widget.patientData.firstName} ${widget.patientData.lastName}" - : "-", + isRecording: tokenData != null ? tokenData.isRecording: false, + patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", tokenID: token, //"hfkjshdf347r8743", generalId: "Cs2020@2016\$2958", doctorId: doctorprofile['DoctorID'], @@ -82,13 +77,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); }); }); @@ -141,7 +136,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, @@ -237,7 +232,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, )), @@ -246,7 +241,7 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {resumeCall()}, child: - Text(TranslationBase.of(context).resumecall!), + Text(TranslationBase.of(context).resumecall), color: Colors.green[900], textColor: Colors.white, ), @@ -256,7 +251,7 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {endCallWithCharge()}, child: Text(TranslationBase.of(context) - .endcallwithcharge!), + .endcallwithcharge), textColor: Colors.white, ), ), @@ -267,7 +262,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 9b8450e3..b1ee901b 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 { - late PatiantInformtion patient; + 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( - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, + builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( + appBar: PatientProfileAppBar( + patient, isInpatient: isInpatient, ), isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport!.toUpperCase(), + appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -79,64 +79,62 @@ class _HealthSummaryPageState extends State { physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList![0].timelines!.length, + 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 != + 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()), + ); + 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 ?? "", + 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 ?? "", + model.medicalFileList[0].entityList[0].timelines[index].date, ), isPrescriptions: true, - isShowEye: model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0].consulations!.length != + isShowEye: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0] + .consulations.length != 0 ? true : false), diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 7fab2bd8..b53284a9 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,24 +21,24 @@ 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( - {required this.age, - required this.firstName, - required this.lastName, - required this.gender, - required this.encounterNumber, - required this.pp, - required this.patient, + {this.age, + this.firstName, + this.lastName, + this.gender, + this.encounterNumber, + this.pp, + this.patient, this.doctorName, - required this.vistDate, + this.vistDate, this.clinicName, - required this.episode, + this.episode, this.doctorImage}); @override @@ -50,11 +50,11 @@ class MedicalFileDetails extends StatefulWidget { encounterNumber: encounterNumber, pp: pp, patient: patient, - clinicName: clinicName!, - doctorName: doctorName!, + clinicName: clinicName, + doctorName: doctorName, episode: episode, vistDate: vistDate, - doctorImage: doctorImage!, + doctorImage: doctorImage, ); } @@ -73,64 +73,51 @@ class _MedicalFileDetailsState extends State { String doctorImage; _MedicalFileDetailsState( - {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}); + {this.age, + this.firstName, + this.lastName, + this.gender, + this.encounterNumber, + this.pp, + this.patient, + this.doctorName, + this.vistDate, + this.clinicName, + this.episode, + this.doctorImage}); bool isPhysicalExam = true; bool isProcedureExpand = true; bool isHistoryExpand = true; bool isAssessmentExpand = true; - PatientProfileAppBarModel? patientProfileAppBarModel; - ProjectViewModel? projectViewModel; - - @override - 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) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { if (model.medicalFileList.length == 0) { model.getMedicalFile(mrn: pp); } }, - builder: (BuildContext? context, MedicalFileViewModel? model, Widget? child) => AppScaffold( - patientProfileAppBarModel: patientProfileAppBarModel!, + 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, + ), isShowAppBar: true, - appBarTitle: TranslationBase.of(context!).medicalReport!.toUpperCase(), + appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -138,9 +125,14 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - model!.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber].timeLineEvents![0] - .consulations!.length != + model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != 0 ? Padding( padding: EdgeInsets.all(10.0), @@ -149,81 +141,109 @@ class _MedicalFileDetailsState extends State { children: [ SizedBox(height: 25.0), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] - .timeLineEvents![0].consulations!.length != + 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), + 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), + 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, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( children: [ AppText( - TranslationBase.of(context) - .historyOfPresentIllness! + TranslationBase.of( + context) + .historyOfPresentIllness .toUpperCase(), - variant: isHistoryExpand ? "bodyText" : '', - bold: isHistoryExpand ? true : true, + variant: isHistoryExpand + ? "bodyText" + : '', + bold: isHistoryExpand + ? true + : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isHistoryExpand = !isHistoryExpand; + isHistoryExpand = + !isHistoryExpand; }); }, - child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + child: Icon(isHistoryExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstCheifComplaint! + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstCheifComplaint .length, - itemBuilder: (BuildContext ctxt, int index) { + itemBuilder: (BuildContext ctxt, + int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment + .center, children: [ Row( children: [ Expanded( child: AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstCheifComplaint![index] - .hOPI! + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstCheifComplaint[ + index] + .hOPI .trim(), ), ), - SizedBox(width: 35.0), + SizedBox( + width: 35.0), ], ), ], @@ -243,62 +263,86 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] - .timeLineEvents![0].consulations!.length != + 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), + 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), + 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, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText(TranslationBase.of(context).assessment!.toUpperCase(), - variant: isAssessmentExpand ? "bodyText" : '', - bold: isAssessmentExpand ? true : true, + AppText( + TranslationBase.of( + context) + .assessment + .toUpperCase(), + variant: + isAssessmentExpand + ? "bodyText" + : '', + bold: isAssessmentExpand + ? true + : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isAssessmentExpand = !isAssessmentExpand; + isAssessmentExpand = + !isAssessmentExpand; }); }, - child: - Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + child: Icon(isAssessmentExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstAssessments! + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments .length, - itemBuilder: (BuildContext ctxt, int index) { + itemBuilder: (BuildContext ctxt, + int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment + .center, children: [ Row( children: [ @@ -308,39 +352,58 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstAssessments![index] - .iCD10! + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .iCD10 .trim(), fontSize: 13.5, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), - SizedBox(width: 15.0), + SizedBox( + width: 15.0), ], ), Row( children: [ AppText( - TranslationBase.of(context).condition! + ": ", + TranslationBase.of( + context) + .condition + + ": ", fontSize: 12.5, ), Expanded( child: AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstAssessments![index] - .condition! + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .condition .trim(), fontSize: 13.0, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), ), ], @@ -350,14 +413,22 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstAssessments![index] + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] .description, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, fontSize: 15.0, ), ) @@ -366,21 +437,32 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).type! + ": ", + TranslationBase.of( + context) + .type + + ": ", fontSize: 15.5, ), Expanded( child: AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstAssessments![index] + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] .type, fontSize: 16.0, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), ), ], @@ -390,13 +472,16 @@ class _MedicalFileDetailsState extends State { ), 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] + .remarks .trim(), ), Divider( @@ -421,62 +506,85 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] - .timeLineEvents![0].consulations!.length != + 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), + 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), + 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, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText(TranslationBase.of(context).test!.toUpperCase(), - variant: isProcedureExpand ? "bodyText" : '', - bold: isProcedureExpand ? true : true, + AppText( + TranslationBase.of( + context) + .test + .toUpperCase(), + variant: isProcedureExpand + ? "bodyText" + : '', + bold: isProcedureExpand + ? true + : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isProcedureExpand = !isProcedureExpand; + isProcedureExpand = + !isProcedureExpand; }); }, - child: - Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + child: Icon(isProcedureExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstProcedure! + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure .length, - itemBuilder: (BuildContext ctxt, int index) { + itemBuilder: (BuildContext ctxt, + int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment + .center, children: [ Row( children: [ @@ -487,39 +595,63 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstProcedure![index] - .procedureId! + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .procedureId .trim(), - fontSize: 13.5, - fontWeight: FontWeight.w700, + fontSize: + 13.5, + fontWeight: + FontWeight + .w700, ), ], ), - SizedBox(width: 35.0), + SizedBox( + width: 35.0), Column( children: [ AppText( - TranslationBase.of(context).orderDate! + ": ", + TranslationBase.of( + context) + .orderDate + + ": ", ), AppText( - AppDateUtils.getDateFormatted(DateTime.parse( + AppDateUtils.getDateFormatted( + DateTime + .parse( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstProcedure![index] - .orderDate! + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .orderDate .trim(), )), - fontSize: 13.5, - fontWeight: FontWeight.w700, + fontSize: + 13.5, + fontWeight: + FontWeight + .w700, ), ], ), @@ -533,14 +665,22 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstProcedure![index] + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] .procName, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), ) ], @@ -552,15 +692,22 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstProcedure![index] + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] .patientID .toString(), - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), ], ), @@ -589,59 +736,78 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] - .timeLineEvents![0].consulations!.length != + 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), + 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), + 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, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( children: [ AppText( - TranslationBase.of(context) - .physicalSystemExamination! + TranslationBase.of( + context) + .physicalSystemExamination .toUpperCase(), - variant: isPhysicalExam ? "bodyText" : '', - bold: isPhysicalExam ? true : true, + variant: isPhysicalExam + ? "bodyText" + : '', + bold: isPhysicalExam + ? true + : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isPhysicalExam = !isPhysicalExam; + isPhysicalExam = + !isPhysicalExam; }); }, - child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + child: Icon(isPhysicalExam + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstPhysicalExam! + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam .length, - itemBuilder: (BuildContext ctxt, int index) { + itemBuilder: (BuildContext ctxt, + int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( @@ -649,17 +815,27 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - AppText(TranslationBase.of(context).examType! + ": "), + AppText(TranslationBase.of( + context) + .examType + + ": "), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstPhysicalExam![index] + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] .examDesc, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), ], ), @@ -667,30 +843,47 @@ class _MedicalFileDetailsState extends State { children: [ AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstPhysicalExam![index] + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] .examDesc, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ) ], ), Row( children: [ - AppText(TranslationBase.of(context).abnormal! + ": "), + AppText(TranslationBase.of( + context) + .abnormal + + ": "), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstPhysicalExam![index] + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] .abnormal, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), ], ), @@ -699,12 +892,15 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstPhysicalExam![index] + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[ + index] .remarks, ), Divider( diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index ec58385a..6ebb2fc8 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -32,7 +32,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg { MedicineSearchScreen({this.changeLoadingState}); - final Function? changeLoadingState; + final Function changeLoadingState; @override _MedicineSearchState createState() => _MedicineSearchState(); @@ -47,16 +47,17 @@ class _MedicineSearchState extends State { bool _isInit = true; final SpeechToText speech = SpeechToText(); String lastStatus = ''; - late GetMedicationResponseModel _selectedMedication; - GlobalKey key = new GlobalKey>(); + GetMedicationResponseModel _selectedMedication; + GlobalKey key = + new GlobalKey>(); // String lastWords; List _localeNames = []; - late String lastError; + String lastError; double level = 0.0; double minSoundLevel = 50000; double maxSoundLevel = -50000; - late String reconizedWord; + String reconizedWord; @override void didChangeDependencies() { @@ -70,13 +71,15 @@ class _MedicineSearchState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); // if (hasSpeech) { // _localeNames = await speech.locales(); // var systemLocale = await speech.systemLocale(); - _currentLocaleId = - TranslationBase.of(context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId; + _currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' + ? 'en-GB' + : 'ar-SA'; // systemLocale.localeId; // } if (!mounted) return; @@ -86,7 +89,9 @@ 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), @@ -119,7 +124,7 @@ class _MedicineSearchState extends State { return AppScaffold( // baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).searchMedicine!, + appBarTitle: TranslationBase.of(context).searchMedicine, body: SingleChildScrollView( child: FractionallySizedBox( widthFactor: 0.97, @@ -135,8 +140,9 @@ class _MedicineSearchState extends State { FractionallySizedBox( widthFactor: 0.9, child: AppTextFieldCustomSearch( - hintText: TranslationBase.of(context).searchMedicineNameHere, - searchController: myController, + hintText: + TranslationBase.of(context).searchMedicineNameHere, + searchController: myController, onFieldSubmitted: (value) { searchMedicine(context, model); }, @@ -164,15 +170,18 @@ class _MedicineSearchState extends State { ), ), Container( - margin: EdgeInsets.only(left: SizeConfig.heightMultiplier * 2), + margin: + EdgeInsets.only(left: SizeConfig.heightMultiplier * 2), child: Row( 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, ), ], @@ -189,20 +198,26 @@ class _MedicineSearchState extends State { scrollDirection: Axis.vertical, // shrinkWrap: true, - itemCount: model.pharmacyItemsList == null ? 0 : model.pharmacyItemsList.length, + itemCount: model.pharmacyItemsList == null + ? 0 + : model.pharmacyItemsList.length, itemBuilder: (BuildContext context, int index) { return InkWell( child: MedicineItemWidget( - label: model.pharmacyItemsList[index]["ItemDescription"], - url: model.pharmacyItemsList[index]["ImageSRCUrl"], + label: model.pharmacyItemsList[index] + ["ItemDescription"], + url: model.pharmacyItemsList[index] + ["ImageSRCUrl"], ), onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => PharmaciesListScreen( - itemID: model.pharmacyItemsList[index]["ItemID"], - url: model.pharmacyItemsList[index]["ImageSRCUrl"]), + itemID: model.pharmacyItemsList[index] + ["ItemID"], + url: model.pharmacyItemsList[index] + ["ImageSRCUrl"]), settings: RouteSettings( name: 'PharmaciesListScreen'), ), diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 764a19f6..49c39c53 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -23,7 +23,8 @@ class PharmaciesListScreen extends StatefulWidget { final String url; - PharmaciesListScreen({Key? key, required this.itemID, required this.url}) : super(key: key); + PharmaciesListScreen({Key key, @required this.itemID, this.url}) + : super(key: key); @override _PharmaciesListState createState() => _PharmaciesListState(); @@ -31,7 +32,8 @@ class PharmaciesListScreen extends StatefulWidget { class _PharmaciesListState extends State { Helpers helpers = new Helpers(); - late ProjectViewModel projectsProvider; + ProjectViewModel projectsProvider; + @override Widget build(BuildContext context) { @@ -40,7 +42,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( @@ -50,64 +52,71 @@ class _PharmaciesListState extends State { children: [ model.pharmaciesList.length > 0 ? RoundedContainer( - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(7)), - child: widget.url != null - ? Image.network( - widget.url, - height: SizeConfig.imageSizeMultiplier * 21, - width: SizeConfig.imageSizeMultiplier * 20, - fit: BoxFit.cover, - ) - : Container(), - ), + child: Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(7)), + child: widget.url != null + ? Image.network( + widget.url, + height: + SizeConfig.imageSizeMultiplier * + 21, + width: + SizeConfig.imageSizeMultiplier * + 20, + fit: BoxFit.cover, + ): Container(), ), - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - AppText( - TranslationBase.of(context).description, - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - model.pharmaciesList[0]["ItemDescription"], - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - AppText( - TranslationBase.of(context).price, - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - model.pharmaciesList[0]["SellingPrice"].toString(), - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - ], - ), - ) - ], - )) - : Container(), + ), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + AppText( + TranslationBase.of(context) + .description, + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + model.pharmaciesList[0]["ItemDescription"], + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + AppText( + TranslationBase.of(context).price, + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + model.pharmaciesList[0]["SellingPrice"] + .toString(), + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + ], + ), + ) + ], + )): Container(), Container( margin: EdgeInsets.only( top: SizeConfig.widthMultiplier * 2, @@ -122,15 +131,18 @@ class _PharmaciesListState extends State { fontWeight: FontWeight.bold, ), ), - alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, + alignment: projectsProvider.isArabic + ? Alignment.topRight + : Alignment.topLeft, ), Container( width: SizeConfig.screenWidth * 0.99, - margin: EdgeInsets.only(left: 10, right: 10), + margin: EdgeInsets.only(left: 10,right: 10), child: ListView.builder( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemCount: model.pharmaciesList == null ? 0 : model.pharmaciesList.length, + itemCount: model.pharmaciesList == null ? 0 : model + .pharmaciesList.length, itemBuilder: (BuildContext context, int index) { return RoundedContainer( margin: EdgeInsets.only(top: 5), @@ -139,11 +151,15 @@ class _PharmaciesListState extends State { Expanded( flex: 1, child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(7)), + borderRadius: + BorderRadius.all(Radius.circular(7)), child: Image.network( - model.pharmaciesList[index]["ProjectImageURL"], - height: SizeConfig.imageSizeMultiplier * 15, - width: SizeConfig.imageSizeMultiplier * 15, + model + .pharmaciesList[index]["ProjectImageURL"], + height: + SizeConfig.imageSizeMultiplier * 15, + width: + SizeConfig.imageSizeMultiplier * 15, fit: BoxFit.cover, ), ), @@ -151,7 +167,8 @@ class _PharmaciesListState extends State { Expanded( flex: 4, child: AppText( - model.pharmaciesList[index]["LocationDescription"], + model + .pharmaciesList[index]["LocationDescription"], margin: 10, ), ), @@ -169,7 +186,10 @@ class _PharmaciesListState extends State { Icons.call, color: Colors.red, ), - onTap: () => launch("tel://" + model.pharmaciesList[index]["PhoneNumber"]), + onTap: () => + launch("tel://" + + model + .pharmaciesList[index]["PhoneNumber"]), ), ), Padding( @@ -181,9 +201,14 @@ class _PharmaciesListState extends State { ), onTap: () { MapsLauncher.launchCoordinates( - double.parse(model.pharmaciesList[index]["Latitude"]), - double.parse(model.pharmaciesList[index]["Longitude"]), - model.pharmaciesList[index]["LocationDescription"]); + double.parse( + model + .pharmaciesList[index]["Latitude"]), + double.parse( + model + .pharmaciesList[index]["Longitude"]), + model.pharmaciesList[index] + ["LocationDescription"]); }, ), ), @@ -196,18 +221,18 @@ class _PharmaciesListState extends State { }), ) ]), - ), - ), - ); + ),),); } + Image imageFromBase64String(String base64String) { return Image.memory(base64Decode(base64String)); } //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/add_patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart index 9f42bbca..8c9f0f1d 100644 --- a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart @@ -38,7 +38,7 @@ class AddPatientSickLeaveScreen extends StatefulWidget { AddPatientSickLeaveScreen( {this.appointmentNo, this.patientMRN, - required this.patient, required this.previousModel}); + this.patient, this.previousModel}); @override _AddPatientSickLeaveScreenState createState() => @@ -52,7 +52,7 @@ class _AddPatientSickLeaveScreenState extends State { TextEditingController _clinicController = new TextEditingController(); TextEditingController _doctorController = new TextEditingController(); TextEditingController _remarkController = new TextEditingController(); - late DateTime currentDate; + DateTime currentDate; AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); bool isFormSubmitted = false; @@ -85,8 +85,8 @@ class _AddPatientSickLeaveScreenState extends State { return BaseView( onModelReady: (model) async { await model.getDoctorProfile(); - _clinicController.text = model.doctorProfile!.clinicDescription!; - _doctorController.text = model.doctorProfile!.doctorName!; + _clinicController.text = model.doctorProfile.clinicDescription; + _doctorController.text = model.doctorProfile.doctorName; await model.preSickLeaveStatistics( widget.appointmentNo, widget.patientMRN); }, @@ -97,7 +97,7 @@ class _AddPatientSickLeaveScreenState extends State { child: AppScaffold( baseViewModel: model, appBar: BottomSheetTitle( - title: TranslationBase.of(context).addSickLeave!, + title: TranslationBase.of(context).addSickLeave, ), isShowAppBar: true, body: Center( @@ -112,9 +112,9 @@ class _AddPatientSickLeaveScreenState extends State { ), AppTextFieldCustom( height: Helpers.getTextFieldHeight(), - hintText: TranslationBase.of(context).sickLeave! + + hintText: TranslationBase.of(context).sickLeave + ' ' + - TranslationBase.of(context).days!, + TranslationBase.of(context).days, maxLines: 1, minLines: 1, dropDownColor: Colors.white, @@ -154,7 +154,7 @@ class _AddPatientSickLeaveScreenState extends State { minLines: 1, isTextFieldHasSuffix: true, suffixIcon: IconButton( - icon: Icon(Icons.calendar_today), onPressed: () { },), + icon: Icon(Icons.calendar_today)), inputFormatters: [ FilteringTextInputFormatter.allow( RegExp(ONLY_NUMBERS)) 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 a1817985..51c5b35b 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -23,13 +23,13 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PatientSickLeaveScreen extends StatelessWidget { - late PatiantInformtion patient; + 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( @@ -84,7 +84,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" @@ -193,7 +193,7 @@ class PatientSickLeaveScreen extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .startDate! + + .startDate + ' ' ?? "", labelSize: SizeConfig @@ -217,7 +217,7 @@ class PatientSickLeaveScreen extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .endDate! + + .endDate + ' ' ?? "", labelSize: SizeConfig @@ -269,7 +269,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 83e8376a..6791785a 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -59,6 +59,7 @@ class _DischargedPatientState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ + SizedBox( height: 12, ), @@ -69,7 +70,6 @@ class _DischargedPatientState extends State { }, marginTop: 0, suffixIcon: IconButton( - onPressed: () {}, icon: Icon( DoctorApp.filter_1, color: Colors.black, @@ -170,14 +170,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 +203,7 @@ class _DischargedPatientState extends State { .network( model.filterData[index].nationalityFlagURL != null - ? model.filterData[index].nationalityFlagURL! + ? model.filterData[index].nationalityFlagURL : '', height: 25, @@ -320,7 +320,7 @@ class _DischargedPatientState extends State { text: model.filterData[index].admissionDate == null ? "" - : TranslationBase.of(context).admissionDate! + + : TranslationBase.of(context).admissionDate + " : ", style: TextStyle( fontSize: @@ -385,7 +385,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 138559d4..ba4c108c 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -3,10 +3,10 @@ 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'; +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:flutter/cupertino.dart'; @@ -17,20 +17,21 @@ 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), - patientProfileAppBarModel: PatientProfileAppBarModel( - patient:patient), + appBar: PatientProfileAppBar(patient), body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8.0), @@ -38,105 +39,84 @@ class ECGPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), - SizedBox( - height: 12, - ), - AppText( - 'Service', - style: "caption2", - color: Colors.black, - ), - AppText( - 'ECG', - bold: true, - fontSize: 22, - ), - SizedBox( - height: 12, - ), - ...List.generate( - model.patientMuseResultsModelList.length, - (index) => InkWell( - onTap: () async { - await launch(model.patientMuseResultsModelList[index].imageURL ?? ""); - }, - child: Container( - width: double.infinity, - height: 120, - margin: EdgeInsets.only(top: 5, bottom: 5), - padding: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all(color: Colors.white, width: 2), - color: Colors.white, - borderRadius: BorderRadius.circular(8)), - child: Column( - children: [ - Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'ECG Report', - fontWeight: FontWeight.w700, - fontSize: 17, - ), - SizedBox(height: 3), - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).orderNo, - style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), - new TextSpan( - text: - '${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}', - style: TextStyle( - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - fontSize: 14)), - ], - ), - ) - ], - ), + SizedBox(height: 12,), + AppText('Service',style: "caption2",color: Colors.black,), + AppText('ECG',bold: true,fontSize: 22,), + SizedBox(height: 12,), + ...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell( + onTap: () async { + await launch( + model.patientMuseResultsModelList[index].imageURL); + }, + child: Container( + width: double.infinity, + height: 120, + margin: EdgeInsets.only(top: 5,bottom: 5), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all(color: Colors.white,width: 2), + color: Colors.white, + borderRadius: BorderRadius.circular(8) + ), + child: Column( + children: [ + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,), + SizedBox(height:3), + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of(context).orderNo, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: '${/*model.patientMuseResultsModelList[index].orderNo?? */'3455'}', + style: TextStyle( + fontWeight: FontWeight.w600, + fontFamily: + 'Poppins', + fontSize: 14)), + ], ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime ?? DateTime.now(), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 14, - ), - AppText( - '${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime ?? DateTime.now())}', - fontWeight: FontWeight.w600, - color: Colors.grey[700], - fontSize: 14, - ), - ], - ), - ), - ], - ), - SizedBox( - height: 15, - ), - Align( - alignment: Alignment.topRight, - child: Icon(DoctorApp.external_link), - ) - ], + ) + ], + ), + ), + Expanded( + 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,), + ], + ), ), - ), - )), + ], + ), + SizedBox(height: 15,), + Align( + alignment: Alignment.topRight, + child: Icon(DoctorApp.external_link), + ) + ], + ), + ), + )), + ], ), ), diff --git a/lib/screens/patients/In_patient/InPatientHeader.dart b/lib/screens/patients/In_patient/InPatientHeader.dart index 3ee29b28..f2d0f74e 100644 --- a/lib/screens/patients/In_patient/InPatientHeader.dart +++ b/lib/screens/patients/In_patient/InPatientHeader.dart @@ -10,8 +10,8 @@ import 'package:provider/provider.dart'; class InPatientHeader extends StatelessWidget with PreferredSizeWidget { InPatientHeader( - {required this.model, - required this.specialClinic, + {this.model, + this.specialClinic, this.activeTab, this.selectedMapId, this.onChangeFunc}) diff --git a/lib/screens/patients/In_patient/NoData.dart b/lib/screens/patients/In_patient/NoData.dart index 89f7c65e..0c48cd2a 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 edbdd113..6e9ad14f 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( - {required this.isMyInPatient, - required this.patientSearchViewModel, - required this.selectedClinicName, - required this.onChangeValue, - required this.isAllClinic, - required this.showBottomSheet}); + {this.isMyInPatient, + this.patientSearchViewModel, + this.selectedClinicName, + this.onChangeValue, + this.isAllClinic, + this.showBottomSheet}); @override _InPatientListPageState createState() => _InPatientListPageState(); @@ -279,7 +279,7 @@ class _InPatientListPageState extends State { .patientSearchViewModel .InpatientClinicList[index]); widget.patientSearchViewModel - .filterByClinic(clinicName: value.toString()); + .filterByClinic(clinicName: value); }); }, 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 940cc9e8..ef9f8b03 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -24,8 +24,8 @@ class InPatientScreen extends StatefulWidget { bool isAllClinic = true; bool showBottomSheet = false; - late String selectedClinicName; - InPatientScreen({Key? key, required this.specialClinic}); + String selectedClinicName; + InPatientScreen({Key key, this.specialClinic}); @override _InPatientScreenState createState() => _InPatientScreenState(); @@ -33,9 +33,9 @@ class InPatientScreen extends StatefulWidget { class _InPatientScreenState extends State with SingleTickerProviderStateMixin { - late TabController _tabController; + TabController _tabController; int _activeTab = 0; - late int selectedMapId; + int selectedMapId; @override void initState() { @@ -79,7 +79,7 @@ class _InPatientScreenState extends State builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: InPatientHeader( + appBar: InPatientHeader( model: model, selectedMapId: selectedMapId, specialClinic: widget.specialClinic, @@ -136,13 +136,13 @@ class _InPatientScreenState extends State unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, - TranslationBase.of(context).inPatientAll!, + TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length), tabWidget(screenSize, _activeTab == 1, - TranslationBase.of(context).myInPatientTitle!, + TranslationBase.of(context).myInPatientTitle, counter: model.myIinPatientList.length), tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged!), + TranslationBase.of(context).discharged), ], ), ), 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 b29aafa2..06634819 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, - required this.patientSearchViewModel, + Key key, + @required this.isAllClinic, + @required this.hasQuery, + 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 false; + return; }, ), ), 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 79b7c0df..f5f7c070 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, - required this.patientSearchViewModel, + Key key, + @required this.isAllClinic, + @required this.hasQuery, + this.patientSearchViewModel, }) : super(key: key); final bool isAllClinic; @@ -56,6 +56,9 @@ class ListOfMyInpatient extends StatelessWidget { }, ); }), + onNotification: (t) { + return; + }, ), ), ); diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index 68d8c319..f78752ec 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -49,7 +49,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - (Helpers.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")), + (Helpers.capitalize( + "${referredPatient.firstName} ${referredPatient.lastName}")), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -66,15 +67,20 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = model.getPatientFromDischargeReferralPatient(referredPatient); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = + model.getPatientFromDischargeReferralPatient( + referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", "isDischargedPatient": true, - "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -105,10 +111,11 @@ class ReferralDischargedPatientDetails extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ AppText( - "${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}", + "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, @@ -120,7 +127,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), AppText( AppDateUtils.getDayMonthYearDateFormatted( - referredPatient.referralDate!, + referredPatient.referralDate, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -143,10 +150,12 @@ 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: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -166,10 +175,12 @@ 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: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -188,10 +199,11 @@ 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: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -213,30 +225,36 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.referringDoctorName, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).fileNumber, + TranslationBase.of(context) + .fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: + 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( "${referredPatient.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -244,48 +262,60 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( - referredPatient.referringClinicDescription, + referredPatient + .referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).frequency! + ": ", + TranslationBase.of(context) + .frequency + + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.frequencyDescription, + referredPatient + .frequencyDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -301,7 +331,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority! + ": ", + TranslationBase.of(context).priority + + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -312,7 +343,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.priorityDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -331,10 +363,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - referredPatient.referringClinicDescription, + referredPatient + .referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -356,7 +390,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.frequency.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -378,7 +413,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.frequency.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -389,7 +425,9 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).maxResponseTime! + ": ", + TranslationBase.of(context) + .maxResponseTime + + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -398,10 +436,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime ?? "", "dd MMM,yyyy"), + referredPatient.mAXResponseTime, + "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -411,7 +451,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 10, right: 0), + margin: + EdgeInsets.only(left: 10, right: 0), child: Image.asset( 'assets/images/patient/ic_ref_arrow_left.png', height: 50, @@ -455,22 +496,30 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0), + margin: EdgeInsets.only( + left: 10, + top: 30, + right: 10, + bottom: 0), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: 1.5 * + SizeConfig.textMultiplier, color: Colors.black, ), AppText( - referredPatient.referringClinicDescription, + referredPatient + .referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * SizeConfig.textMultiplier, + fontSize: 1.3 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart index 1e001799..92f92f87 100644 --- a/lib/screens/patients/ReferralDischargedPatientPage.dart +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -17,88 +17,81 @@ class ReferralDischargedPatientPage extends StatefulWidget { } class _ReferralDischargedPatientPageState extends State { + @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.gtMyDischargeReferralPatient(), builder: (_, model, w) => AppScaffold( appBarTitle: 'Referral Discharged ', - backgroundColor: Colors.grey[200]!, + backgroundColor: Colors.grey[200], isShowAppBar: false, baseViewModel: model, - body: model.myDischargeReferralPatient.isEmpty - ? 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 Discharged Patient', - color: Theme.of(context).errorColor, - ), - ) - ], - ), - ) - : Padding( + body: model.myDischargeReferralPatient.isEmpty?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: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 5, - ), - Expanded( - child: ListView.builder( - itemCount: model.myDischargeReferralPatient.length, - itemBuilder: (context, index) => InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: ReferralDischargedPatientDetails(model.myDischargeReferralPatient[index]), - ), - ); - }, - child: PatientReferralItemWidget( - referralStatus: model.getReferralStatusNameByCode( - model.myDischargeReferralPatient[index].referralStatus!, context), - referralStatusCode: model.myDischargeReferralPatient[index].referralStatus, - patientName: model.myDischargeReferralPatient[index].firstName! + - " " + - model.myDischargeReferralPatient[index].lastName!, - patientGender: model.myDischargeReferralPatient[index].gender, - referredDate: AppDateUtils.getDayMonthYearDateFormatted( - model.myDischargeReferralPatient[index].referralDate!), - referredTime: - AppDateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate!), - patientID: "${model.myDischargeReferralPatient[index].patientID}", - isSameBranch: false, - isReferral: true, - isReferralClinic: true, - referralClinic: - "${model.myDischargeReferralPatient[index].referringClinicDescription}", - remark: model.myDischargeReferralPatient[index].referringDoctorRemarks, - nationality: model.myDischargeReferralPatient[index].nationalityName, - nationalityFlag: - '', //model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend - doctorAvatar: - '', //model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend - referralDoctorName: model.myDischargeReferralPatient[index].referringDoctorName, - clinicDescription: model.myDischargeReferralPatient[index].referringClinicDescription, - infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), - ), - )), - ), - ], + child: AppText( + 'No Discharged Patient', + color: Theme.of(context).errorColor, ), + ) + ], + ), + ):Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 5,), + Expanded( + child: ListView.builder( + itemCount: model.myDischargeReferralPatient.length, + itemBuilder: (context,index)=>InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferralDischargedPatientDetails(model.myDischargeReferralPatient[index]), + ), + ); + }, + child: PatientReferralItemWidget( + referralStatus: model.getReferralStatusNameByCode(model.myDischargeReferralPatient[index].referralStatus,context), + referralStatusCode: model.myDischargeReferralPatient[index].referralStatus, + patientName: model.myDischargeReferralPatient[index].firstName+" "+model.myDischargeReferralPatient[index].lastName, + patientGender: model.myDischargeReferralPatient[index].gender, + referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myDischargeReferralPatient[index].referralDate), + referredTime: AppDateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate), + patientID: "${model.myDischargeReferralPatient[index].patientID}", + isSameBranch: false, + isReferral: true, + isReferralClinic: true, + referralClinic:"${model.myDischargeReferralPatient[index].referringClinicDescription}", + remark: model.myDischargeReferralPatient[index].referringDoctorRemarks, + nationality: model.myDischargeReferralPatient[index].nationalityName, + nationalityFlag: '',//model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend + doctorAvatar: '',//model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend + referralDoctorName: model.myDischargeReferralPatient[index].referringDoctorName, + clinicDescription: model.myDischargeReferralPatient[index].referringClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), + ), + )), ), + + ], + ), + ), ), ); } + + } diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index bd7e3efb..2c89425e 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -4,9 +4,9 @@ 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/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/patients/insurance_approvals_details.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_insurance.dart'; @@ -17,7 +17,7 @@ import 'package:provider/provider.dart'; import '../base/base_view.dart'; class InsuranceApprovalScreenNew extends StatefulWidget { - final int? appointmentNo; + final int appointmentNo; InsuranceApprovalScreenNew({this.appointmentNo}); @@ -29,7 +29,7 @@ class _InsuranceApprovalScreenNewState extends State @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']; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; @@ -39,16 +39,16 @@ class _InsuranceApprovalScreenNewState extends State ? (model) => 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( - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, + builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( + appBar: PatientProfileAppBar( + patient, isInpatient: isInpatient, ), isShowAppBar: true, baseViewModel: model, - appBarTitle: TranslationBase.of(context).approvals ?? "", + appBarTitle: TranslationBase.of(context).approvals, body: patient.admissionNo != null ? SingleChildScrollView( child: Container( diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index a506b113..0945df37 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -2,10 +2,10 @@ 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'; +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:flutter/cupertino.dart'; @@ -17,10 +17,14 @@ class InsuranceApprovalsDetails extends StatefulWidget { int indexInsurance; String patientType; - InsuranceApprovalsDetails({required this.patient, required this.indexInsurance, required this.patientType}); + InsuranceApprovalsDetails( + {this.patient, this.indexInsurance, this.patientType}); @override _InsuranceApprovalsDetailsState createState() => - _InsuranceApprovalsDetailsState(patient: patient, indexInsurance: indexInsurance, patientType: patientType); + _InsuranceApprovalsDetailsState( + patient: patient, + indexInsurance: indexInsurance, + patientType: patientType); } class _InsuranceApprovalsDetailsState extends State { @@ -28,12 +32,13 @@ class _InsuranceApprovalsDetailsState extends State { int indexInsurance; String patientType; - _InsuranceApprovalsDetailsState({required this.patient, required this.indexInsurance, required this.patientType}); + _InsuranceApprovalsDetailsState( + {this.patient, this.indexInsurance, 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 @@ -41,602 +46,776 @@ 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, - 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( + builder: (BuildContext context, InsuranceViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBar: PatientProfileAppBar( + patient), + body: patient.admissionNo != null + ? SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( children: [ - AppText( - TranslationBase.of(context!).insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', + Row( + children: [ + AppText( + TranslationBase.of(context).insurance22, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + TranslationBase.of(context).approvals22, + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], ), ], ), - ], - ), - ), - 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( + ), + 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: [ - 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] + .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: Colors.black, - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - children: [ - Column( + 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: [ - 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, + Column( + children: [ + 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, ), ), - backgroundColor: Colors.transparent, - ), + ], ), - ], - ), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox( - height: 25.0, - ), - Row( + Expanded( + child: Padding( + padding: + const EdgeInsets.symmetric( + horizontal: 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - TranslationBase.of(context).clinic! + ": ", - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: AppText( - model.insuranceApprovalInPatient[indexInsurance].clinicName, - fontSize: 14, - ), - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvalNo! + ": ", - color: Colors.grey[500], - fontSize: 14, + SizedBox( + height: 25.0, ), - AppText( - model.insuranceApprovalInPatient[indexInsurance].approvalNo - .toString(), - fontSize: 14, - ) - ], - ), - Row( - children: [ - AppText( - 'Unused Count:', - color: Colors.grey[500], - fontSize: 14, + Row( + children: [ + AppText( + TranslationBase.of( + context) + .clinic + + ": ", + color: Colors.grey[500], + fontSize: 14, + ), + Expanded( + child: AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .clinicName, + fontSize: 14, + ), + ) + ], ), - AppText( - model.insuranceApprovalInPatient[indexInsurance].unUsedCount - .toString(), - fontSize: 14, - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).companyName! + ": ", - color: Colors.grey[500], + Row( + children: [ + AppText( + TranslationBase.of( + context) + .approvalNo + + ": ", + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .approvalNo + .toString(), + fontSize: 14, + ) + ], ), - AppText('Sample') - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).receiptOn! + ": ", - color: Colors.grey[500], + Row( + children: [ + AppText( + 'Unused Count:', + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .unUsedCount + .toString(), + fontSize: 14, + ) + ], ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn!), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - ), + Row( + children: [ + AppText( + TranslationBase.of( + context) + .companyName + + ": ", + color: Colors.grey[500], + ), + AppText('Sample') + ], ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).expiryDate! + ": ", - color: Colors.grey[500], + Row( + children: [ + AppText( + TranslationBase.of( + context) + .receiptOn + + ": ", + color: Colors.grey[500], + ), + Expanded( + child: AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), + ), + ], ), - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, + Row( + children: [ + AppText( + TranslationBase.of( + context) + .expiryDate + + ": ", + color: Colors.grey[500], + ), + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), + ], ), ], ), - ], + ), ), - ), + ], ), - ], - ), - ), - SizedBox( - height: 20.0, - ), - Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - children: [ - Expanded( - child: AppText( - TranslationBase.of(context).procedure, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context).status, - fontWeight: FontWeight.w700, - ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Row( + children: [ + Expanded( + child: AppText( + TranslationBase.of(context) + .procedure, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context) + .status, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context) + .usageStatus, + fontWeight: FontWeight.w700, + ), + ) + ], ), - Expanded( - child: AppText( - TranslationBase.of(context).usageStatus, - fontWeight: FontWeight.w700, - ), - ) - ], - ), - ), - Divider( - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model - .insuranceApprovalInPatient[indexInsurance].apporvalDetails!.length, - itemBuilder: (BuildContext context, int index) { - return Container( - child: Column( - children: [ - Row( + ), + Divider( + color: Colors.black, + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model + .insuranceApprovalInPatient[ + indexInsurance] + .apporvalDetails + .length, + itemBuilder: + (BuildContext context, + int index) { + return Container( + child: Column( children: [ - Expanded( - child: Container( - child: AppText( - model.insuranceApprovalInPatient[indexInsurance] - .apporvalDetails![index].procedureName ?? - "", - textAlign: TextAlign.start, + Row( + children: [ + Expanded( + child: Container( + child: AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.procedureName ?? + "", + textAlign: + TextAlign + .start, + ), + ), ), - ), - ), - Expanded( - child: Container( - child: AppText( - model.insuranceApprovalInPatient[indexInsurance] - .apporvalDetails![index].status ?? - "", - textAlign: TextAlign.center, + Expanded( + child: Container( + child: AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.status ?? + "", + textAlign: + TextAlign + .center, + ), + ), ), - ), - ), - Expanded( - child: Container( - child: AppText( - model.insuranceApprovalInPatient[indexInsurance] - .apporvalDetails![index].isInvoicedDesc ?? - "", - textAlign: TextAlign.center, + Expanded( + child: Container( + child: AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.isInvoicedDesc ?? + "", + textAlign: + TextAlign + .center, + ), + ), ), - ), + ], + ), + SizedBox( + width: 5, + ), + Divider( + color: Colors.black38, ), ], ), - SizedBox( - width: 5, - ), - Divider( - color: Colors.black38, - ), - ], - ), - ); - }), + ); + }), + ), + ], ), - ], - ), + ), + ], ), - ], + ), ), - ), + ], ), - ], - ), - ), - ) - : SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( + ), + ) + : SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( children: [ - AppText( - TranslationBase.of(context!).insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', + Row( + children: [ + AppText( + TranslationBase.of(context).insurance22, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + TranslationBase.of(context).approvals22, + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], ), ], ), - ], - ), - ), - 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( + ), + 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: [ - AppText( - model!.insuranceApproval[indexInsurance].approvalStatusDescption != null - ? model.insuranceApproval[indexInsurance].approvalStatusDescption ?? "" - : "", - color: model.insuranceApproval[indexInsurance].approvalStatusDescption != null - ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == - "Approved" - ? Color(0xff359846) - : Color(0xffD02127) - : Color(0xffD02127), + Row( + children: [ + AppText( + model + .insuranceApproval[ + indexInsurance] + .approvalStatusDescption != + null + ? model + .insuranceApproval[ + indexInsurance] + .approvalStatusDescption ?? + "" + : "", + color: model + .insuranceApproval[ + indexInsurance] + .approvalStatusDescption != + null + ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == + "Approved" + ? Color(0xff359846) + : Color(0xffD02127) + : Color(0xffD02127), + ), + ], ), - ], - ), - Row( - children: [ - AppText( - model.insuranceApproval[indexInsurance].doctorName!.toUpperCase(), - color: Colors.black, - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - children: [ - Column( + Row( + children: [ + AppText( + model + .insuranceApproval[indexInsurance] + .doctorName + .toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Row( children: [ - 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.insuranceApproval[indexInsurance].doctorImage!, - fit: BoxFit.fill, - width: 700, + Column( + children: [ + 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 + .insuranceApproval[ + indexInsurance] + .doctorImage, + fit: BoxFit.fill, + width: 700, + ), + ), + backgroundColor: + Colors.transparent, ), ), - backgroundColor: Colors.transparent, - ), + ], ), - ], - ), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox( - height: 25.0, - ), - Row( + Expanded( + child: Padding( + padding: + const EdgeInsets.symmetric( + horizontal: 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - TranslationBase.of(context).clinic! + ": ", - color: Colors.grey[500], - fontSize: 14, + SizedBox( + height: 25.0, ), - Expanded( - child: AppText( - model.insuranceApproval[indexInsurance].clinicName, - fontSize: 14, - ), - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvalNo! + ": ", - color: Colors.grey[500], - fontSize: 14, + Row( + children: [ + AppText( + TranslationBase.of( + context) + .clinic + + ": ", + color: Colors.grey[500], + fontSize: 14, + ), + Expanded( + child: AppText( + model + .insuranceApproval[ + indexInsurance] + .clinicName, + fontSize: 14, + ), + ) + ], ), - AppText( - model.insuranceApproval[indexInsurance].approvalNo.toString(), - fontSize: 14, - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).unusedCount! + ": ", - color: Colors.grey[500], - fontSize: 14, + Row( + children: [ + AppText( + TranslationBase.of( + context) + .approvalNo + + ": ", + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + model + .insuranceApproval[ + indexInsurance] + .approvalNo + .toString(), + fontSize: 14, + ) + ], ), - AppText( - model.insuranceApproval[indexInsurance].unUsedCount.toString(), - fontSize: 14, - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).companyName! + ": ", - color: Colors.grey[500], + Row( + children: [ + AppText( + TranslationBase.of( + context) + .unusedCount + + ": ", + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + model + .insuranceApproval[ + indexInsurance] + .unUsedCount + .toString(), + fontSize: 14, + ) + ], ), - AppText('Sample') - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).receiptOn! + ": ", - color: Colors.grey[500], + Row( + children: [ + AppText( + TranslationBase.of( + context) + .companyName + + ": ", + color: Colors.grey[500], + ), + AppText('Sample') + ], ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn!), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - ), + Row( + children: [ + AppText( + TranslationBase.of( + context) + .receiptOn + + ": ", + color: Colors.grey[500], + ), + Expanded( + child: AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), + ), + ], ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).expiryDate! + ": ", - color: Colors.grey[500], + Row( + children: [ + AppText( + TranslationBase.of( + context) + .expiryDate + + ": ", + color: Colors.grey[500], + ), + if (model + .insuranceApproval[ + indexInsurance] + .expiryDate != + null) + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), + ], ), - if (model.insuranceApproval[indexInsurance].expiryDate != null) - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - ), ], ), - ], + ), ), - ), + ], ), - ], - ), - ), - SizedBox( - height: 20.0, - ), - Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - children: [ - Expanded( - child: AppText( - TranslationBase.of(context).procedure, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context).status, - fontWeight: FontWeight.w700, - ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Row( + children: [ + Expanded( + child: AppText( + TranslationBase.of(context) + .procedure, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context) + .status, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context) + .usageStatus, + fontWeight: FontWeight.w700, + ), + ) + ], ), - Expanded( - child: AppText( - TranslationBase.of(context).usageStatus, - fontWeight: FontWeight.w700, - ), - ) - ], - ), - ), - Divider( - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model.insuranceApproval[indexInsurance].apporvalDetails!.length, - itemBuilder: (BuildContext context, int index) { - return Container( - child: Column( - children: [ - Row( + ), + Divider( + color: Colors.black, + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model + .insuranceApproval[ + indexInsurance] + .apporvalDetails + .length, + itemBuilder: + (BuildContext context, + int index) { + return Container( + child: Column( children: [ - Expanded( - child: Container( - child: AppText( - model.insuranceApproval[indexInsurance] - .apporvalDetails![index].procedureName ?? - "", - textAlign: TextAlign.start, + Row( + children: [ + Expanded( + child: Container( + child: AppText( + model + .insuranceApproval[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.procedureName ?? + "", + textAlign: + TextAlign + .start, + ), + ), ), - ), - ), - Expanded( - child: Container( - child: AppText( - model.insuranceApproval[indexInsurance] - .apporvalDetails![index].status ?? - "", - textAlign: TextAlign.center, + Expanded( + child: Container( + child: AppText( + model + .insuranceApproval[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.status ?? + "", + textAlign: + TextAlign + .center, + ), + ), ), - ), - ), - Expanded( - child: Container( - child: AppText( - model.insuranceApproval[indexInsurance] - .apporvalDetails![index].isInvoicedDesc ?? - "", - textAlign: TextAlign.center, + Expanded( + child: Container( + child: AppText( + model + .insuranceApproval[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.isInvoicedDesc ?? + "", + textAlign: + TextAlign + .center, + ), + ), ), - ), + ], + ), + SizedBox( + width: 5, + ), + Divider( + color: Colors.black38, ), ], ), - SizedBox( - width: 5, - ), - Divider( - color: Colors.black38, - ), - ], - ), - ); - }), + ); + }), + ), + ], ), - ], - ), + ), + ], ), - ], + ), ), - ), + ], ), - ], - ), - ), - )), + ), + )), ); } } diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 3636e698..14ae707b 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -16,7 +16,8 @@ class FilterDatePage extends StatefulWidget { final OutPatientFilterType outPatientFilterType; final PatientSearchViewModel patientSearchViewModel; - const FilterDatePage({Key? key, required this.outPatientFilterType, required this.patientSearchViewModel}) + const FilterDatePage( + {Key key, this.outPatientFilterType, this.patientSearchViewModel}) : super(key: key); @override @@ -45,7 +46,8 @@ class _FilterDatePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ BottomSheetTitle( - title: (OutPatientFilterType.Previous == widget.outPatientFilterType) + title: (OutPatientFilterType.Previous == + widget.outPatientFilterType) ? " Filter Previous Out Patient" : "Filter Nextweek Out Patient", ), @@ -61,12 +63,16 @@ 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, @@ -86,12 +92,16 @@ 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, @@ -136,30 +146,41 @@ class _FilterDatePageState extends State { padding: 10, color: Color(0xFF359846), onPressed: () async { - if (widget.patientSearchViewModel.selectedFromDate == null || - widget.patientSearchViewModel.selectedToDate == null) { - Helpers.showErrorToast("Please Select All The date Fields "); + if (widget.patientSearchViewModel.selectedFromDate == + null || + widget.patientSearchViewModel.selectedToDate == + null) { + Helpers.showErrorToast( + "Please Select All The date Fields "); } else { - Duration difference = widget.patientSearchViewModel.selectedToDate! - .difference(widget.patientSearchViewModel.selectedFromDate!); + Duration difference = widget + .patientSearchViewModel.selectedToDate + .difference(widget + .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!, 'yyyy-MM-dd'); + widget.patientSearchViewModel.selectedToDate, + 'yyyy-MM-dd'); String dateFrom = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedFromDate!, 'yyyy-MM-dd'); + widget.patientSearchViewModel.selectedFromDate, + 'yyyy-MM-dd'); - PatientSearchRequestModel currentModel = PatientSearchRequestModel(); + PatientSearchRequestModel currentModel = + PatientSearchRequestModel(); currentModel.to = dateTo; currentModel.from = dateFrom; GifLoaderDialogUtils.showMyDialog(context); - await widget.patientSearchViewModel.getOutPatient(currentModel, isLocalBusy: true); + await widget.patientSearchViewModel + .getOutPatient(currentModel, isLocalBusy: true); GifLoaderDialogUtils.hideDialog(context); - if (widget.patientSearchViewModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientSearchViewModel.error); + if (widget.patientSearchViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.patientSearchViewModel.error); } else { Navigator.of(context).pop(); } @@ -178,15 +199,16 @@ 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, ); @@ -210,22 +232,27 @@ class _FilterDatePageState extends State { getFirstDate(OutPatientFilterType outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { - return DateTime(DateTime.now().year - 20, DateTime.now().month, DateTime.now().day); + return DateTime( + DateTime.now().year - 20, DateTime.now().month, DateTime.now().day); } else { - return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); + return DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); } } getLastDate(OutPatientFilterType outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { - return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); + return DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); } else { - return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 7); + return DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day + 7); } } - 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 3a7cce7e..e0e4fb4a 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -34,13 +34,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, @@ -61,21 +61,21 @@ class OutPatientsScreen extends StatefulWidget { } class _OutPatientsScreenState extends State { - late int clinicId; - late AuthenticationViewModel authenticationViewModel; + int clinicId; + AuthenticationViewModel authenticationViewModel; List _times = []; int _activeLocation = 1; - String? patientType; - late String patientTypeTitle; + String patientType; + String patientTypeTitle; var selectedFilter = 1; - late String arrivalType; - late ProjectViewModel projectsProvider; + String arrivalType; + ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - late PatientModel patient; + PatientModel patient; OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; bool isSortDes = true; @@ -84,15 +84,15 @@ class _OutPatientsScreenState extends State { Widget build(BuildContext context) { authenticationViewModel = 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", @@ -106,13 +106,15 @@ class _OutPatientsScreenState extends State { Container( // color: Colors.red, height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), borderRadius: 4, borderWidth: 0), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: _times.map((item) { - bool _isActive = _times[_activeLocation] == item ? true : false; + bool _isActive = + _times[_activeLocation] == item ? true : false; return Expanded( child: InkWell( @@ -132,7 +134,8 @@ class _OutPatientsScreenState extends State { await model.getPatientBasedOnDate( item: item, selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: widget.patientSearchRequestModel, + patientSearchRequestModel: + widget.patientSearchRequestModel, isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); GifLoaderDialogUtils.hideDialog(context); @@ -140,11 +143,16 @@ class _OutPatientsScreenState extends State { child: Center( child: Container( height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - _isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), - _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), + decoration: + TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive + ? Color(0xFFD02127) + : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -152,16 +160,22 @@ class _OutPatientsScreenState extends State { AppText( item, fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), + color: _isActive + ? Colors.white + : Color(0xFF2B353E), fontWeight: FontWeight.w700, ), - _isActive && _activeLocation != 0 && model.state == ViewState.Idle + _isActive && + _activeLocation != 0 && + model.state == ViewState.Idle ? Container( padding: EdgeInsets.all(2), - margin: EdgeInsets.symmetric(horizontal: 5), + margin: EdgeInsets.symmetric( + horizontal: 5), decoration: new BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(50), + borderRadius: + BorderRadius.circular(50), ), constraints: BoxConstraints( minWidth: 20, @@ -169,7 +183,9 @@ class _OutPatientsScreenState extends State { ), child: new Text( model.filterData.length.toString(), - style: new TextStyle(color: Colors.red, fontSize: 10), + style: new TextStyle( + color: Colors.red, + fontSize: 10), textAlign: TextAlign.center, ), ) @@ -192,21 +208,23 @@ class _OutPatientsScreenState extends State { }, marginTop: 5, suffixIcon: IconButton( - icon: Icon( - _activeLocation != 0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH, - color: Colors.black, - ), - iconSize: 20, - - onPressed: _activeLocation != 0 - ? null - : () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => FilterDatePage( - outPatientFilterType: outPatientFilterType, - patientSearchViewModel: model, + icon: Icon( + _activeLocation != 0 + ? DoctorApp.filter_1 + : FontAwesomeIcons.slidersH, + color: Colors.black, + ), + iconSize: 20, + onPressed: _activeLocation != 0 + ? null + : () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + FilterDatePage( + outPatientFilterType: outPatientFilterType, + patientSearchViewModel: model, ), settings: RouteSettings( name: 'FilterOutPatentDateScreen'), @@ -217,16 +235,16 @@ class _OutPatientsScreenState extends State { icon: Icon( isSortDes ? FontAwesomeIcons.sortAmountDown - : FontAwesomeIcons.sortAmountUp, + : FontAwesomeIcons.sortAmountUp, color: Colors.black, - ), - iconSize: 20, - onPressed: () { - model.sortOutPatient(isDes: isSortDes); + ), + iconSize: 20, + onPressed: () { + model.sortOutPatient(isDes: isSortDes); isSortDes = !isSortDes; }, - ), - ), + ), + ), SizedBox( height: 10.0, ), @@ -235,7 +253,8 @@ class _OutPatientsScreenState extends State { child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context).youDontHaveAnyPatient ?? "", + error: TranslationBase.of(context) + .youDontHaveAnyPatient, ), ) : ListView.builder( @@ -244,28 +263,35 @@ class _OutPatientsScreenState extends State { itemCount: model.filterData.length, itemBuilder: (BuildContext ctxt, int index) { if (_activeLocation != 0 || - (model.filterData[index].patientStatusType != null && - model.filterData[index].patientStatusType == 43)) + (model.filterData[index].patientStatusType != + null && + model.filterData[index] + .patientStatusType == + 43)) return Padding( padding: EdgeInsets.all(8.0), child: PatientCard( patientInfo: model.filterData[index], - patientType: "1", - arrivalType: "1", + patientType: patientType, + arrivalType: arrivalType, isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filterData[index], - "patientType": "1", - "from": widget.patientSearchRequestModel!.from, - "to": widget.patientSearchRequestModel!.from, - "isSearch": false, - "isInpatient": false, - "arrivalType": "7", - "isSearchAndOut": false, - }); + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget + .patientSearchRequestModel.from, + "to": widget + .patientSearchRequestModel.from, + "isSearch": false, + "isInpatient": false, + "arrivalType": "7", + "isSearchAndOut": false, + }); }, // isFromSearch: widget.isSearch, ), diff --git a/lib/screens/patients/out_patient_prescription_details_screen.dart b/lib/screens/patients/out_patient_prescription_details_screen.dart index cee49c6c..c7056ce3 100644 --- a/lib/screens/patients/out_patient_prescription_details_screen.dart +++ b/lib/screens/patients/out_patient_prescription_details_screen.dart @@ -12,38 +12,42 @@ import 'package:flutter/material.dart'; class OutPatientPrescriptionDetailsScreen extends StatefulWidget { final PrescriptionResModel prescriptionResModel; - OutPatientPrescriptionDetailsScreen({Key? key, required this.prescriptionResModel}); + OutPatientPrescriptionDetailsScreen({Key key, this.prescriptionResModel}); @override - _OutPatientPrescriptionDetailsScreenState createState() => _OutPatientPrescriptionDetailsScreenState(); + _OutPatientPrescriptionDetailsScreenState createState() => + _OutPatientPrescriptionDetailsScreenState(); } -class _OutPatientPrescriptionDetailsScreenState extends State { - getPrescriptionReport(BuildContext context, PatientViewModel model) { - RequestPrescriptionReport prescriptionReqModel = RequestPrescriptionReport( +class _OutPatientPrescriptionDetailsScreenState + extends State { + + + getPrescriptionReport(BuildContext context,PatientViewModel model ){ + RequestPrescriptionReport prescriptionReqModel = + RequestPrescriptionReport( appointmentNo: widget.prescriptionResModel.appointmentNo, episodeID: widget.prescriptionResModel.episodeID, setupID: widget.prescriptionResModel.setupID, patientTypeID: widget.prescriptionResModel.patientID); model.getPrescriptionReport(prescriptionReqModel.toJson()); } - @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => getPrescriptionReport(context, model), builder: (_, model, w) => AppScaffold( - appBarTitle: TranslationBase.of(context).prescriptionDetails ?? "", - body: CardWithBgWidgetNew( - widget: ListView.builder( - itemCount: model.prescriptionReport.length, - itemBuilder: (BuildContext context, int index) { - return OutPatientPrescriptionDetailsItem( - prescriptionReport: model.prescriptionReport[index], - ); - }), - ), - ), - ); + appBarTitle: TranslationBase.of(context).prescriptionDetails, + body: CardWithBgWidgetNew( + widget: ListView.builder( + itemCount: model.prescriptionReport.length, + itemBuilder: (BuildContext context, int index) { + return OutPatientPrescriptionDetailsItem( + prescriptionReport: + model.prescriptionReport[index], + ); + }), + ), + ),); } } diff --git a/lib/screens/patients/patient_search/patient_search_header.dart b/lib/screens/patients/patient_search/patient_search_header.dart index 587550e3..7df6905f 100644 --- a/lib/screens/patients/patient_search/patient_search_header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -5,11 +5,11 @@ import 'package:flutter/material.dart'; class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { final String title; - const PatientSearchHeader({Key? key, required this.title}) : super(key: key); + const PatientSearchHeader({Key key, this.title}) : super(key: key); @override Widget build(BuildContext context) { - return Container( + return Container( padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, @@ -38,5 +38,5 @@ class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { } @override - Size get preferredSize => Size(double.maxFinite, 65); + Size get preferredSize => Size(double.maxFinite,65); } 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 de135ff1..b0ec2943 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -31,41 +31,45 @@ class PatientsSearchResultScreen extends StatefulWidget { final String searchKey; PatientsSearchResultScreen( - {required this.selectedPatientType, - required this.patientSearchRequestModel, + {this.selectedPatientType, + this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, this.isInpatient = false, - required this.searchKey, + this.searchKey, this.isSearchAndOut = false}); @override - _PatientsSearchResultScreenState createState() => _PatientsSearchResultScreenState(); + _PatientsSearchResultScreenState createState() => + _PatientsSearchResultScreenState(); } -class _PatientsSearchResultScreenState extends State { - late int clinicId; - late AuthenticationViewModel authenticationViewModel; +class _PatientsSearchResultScreenState + extends State { + int clinicId; + AuthenticationViewModel authenticationViewModel; - String? patientType; - String? patientTypeTitle; + String patientType; + String patientTypeTitle; var selectedFilter = 1; - String? arrivalType; - late ProjectViewModel projectsProvider; + String arrivalType; + ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - late PatientModel patient; + PatientModel patient; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { - if (!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { + if (!widget.isSearchWithKeyInfo && + widget.selectedPatientType == PatientType.OutPatient) { await model.getOutPatient(widget.patientSearchRequestModel); } else { - await model.getPatientFileInformation(widget.patientSearchRequestModel); + await model + .getPatientFileInformation(widget.patientSearchRequestModel); } }, builder: (_, model, w) => AppScaffold( @@ -85,15 +89,14 @@ class _PatientsSearchResultScreenState extends State }, marginTop: 5, suffixIcon: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - // padding: EdgeInsets.only(bottom: 30), - onPressed: () {}, - ), - ), + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + // padding: EdgeInsets.only(bottom: 30), + ), + ), SizedBox( height: 10.0, ), @@ -102,7 +105,8 @@ class _PatientsSearchResultScreenState extends State child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context).youDontHaveAnyPatient ?? "", + error: TranslationBase.of(context) + .youDontHaveAnyPatient, ), ) : ListView.builder( @@ -114,22 +118,27 @@ class _PatientsSearchResultScreenState extends State 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: () { // TODO change the parameter to daynamic - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filterData[index], - "patientType": "1", - "from": widget.patientSearchRequestModel.from, - "to": widget.patientSearchRequestModel.from, - "isSearch": widget.isSearch, - "isInpatient": widget.isInpatient, - "arrivalType": "7", - "isSearchAndOut": widget.isSearchAndOut, - }); + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget + .patientSearchRequestModel.from, + "to": widget + .patientSearchRequestModel.from, + "isSearch": widget.isSearch, + "isInpatient": widget.isInpatient, + "arrivalType": "7", + "isSearchAndOut": + widget.isSearchAndOut, + }); }, // isFromSearch: widget.isSearch, ), diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index b61de12a..e1fdd033 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; - late AuthenticationViewModel authenticationViewModel; + AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -45,7 +45,8 @@ 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( @@ -137,29 +138,41 @@ class _PatientSearchScreenState extends State { isFormSubmitted = true; }); PatientSearchRequestModel patientSearchRequestModel = - PatientSearchRequestModel(doctorID: authenticationViewModel.doctorProfile!.doctorID); + PatientSearchRequestModel( + doctorID: authenticationViewModel.doctorProfile.doctorID); if (showOther) { patientSearchRequestModel.firstName = - firstNameInfoController.text.trim().isEmpty ? "0" : firstNameInfoController.text.trim(); + firstNameInfoController.text.trim().isEmpty + ? "0" + : firstNameInfoController.text.trim(); patientSearchRequestModel.middleName = - middleNameInfoController.text.trim().isEmpty ? "0" : middleNameInfoController.text.trim(); + middleNameInfoController.text.trim().isEmpty + ? "0" + : middleNameInfoController.text.trim(); patientSearchRequestModel.lastName = - lastNameFileInfoController.text.isEmpty ? "0" : lastNameFileInfoController.text.trim(); + lastNameFileInfoController.text.isEmpty + ? "0" + : lastNameFileInfoController.text.trim(); } if (patientFileInfoController.text.isNotEmpty) { if (patientFileInfoController.text.length == 10 && - (patientFileInfoController.text[0] == '2' || patientFileInfoController.text[0] == '1')) { - patientSearchRequestModel.identificationNo = patientFileInfoController.text; + (patientFileInfoController.text[0] == '2' || + patientFileInfoController.text[0] == '1')) { + patientSearchRequestModel.identificationNo = + patientFileInfoController.text; patientSearchRequestModel.searchType = 2; patientSearchRequestModel.patientID = 0; - } else if ((patientFileInfoController.text.length == 10 || patientFileInfoController.text.length == 9) && - ((patientFileInfoController.text[0] == '0' && patientFileInfoController.text[1] == '5') || + } else if ((patientFileInfoController.text.length == 10 || + patientFileInfoController.text.length == 9) && + ((patientFileInfoController.text[0] == '0' && + patientFileInfoController.text[1] == '5') || patientFileInfoController.text[0] == '5')) { patientSearchRequestModel.mobileNo = patientFileInfoController.text; patientSearchRequestModel.searchType = 0; } else { - patientSearchRequestModel.patientID = int.parse(patientFileInfoController.text); + patientSearchRequestModel.patientID = + int.parse(patientFileInfoController.text); patientSearchRequestModel.searchType = 1; } } @@ -179,7 +192,8 @@ class _PatientSearchScreenState extends State { builder: (BuildContext context) => PatientsSearchResultScreen( selectedPatientType: selectedPatientType, patientSearchRequestModel: patientSearchRequestModel, - isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, + isSearchWithKeyInfo: + patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, isSearchAndOut: true, searchKey: patientFileInfoController.text, diff --git a/lib/screens/patients/patient_search/time_bar.dart b/lib/screens/patients/patient_search/time_bar.dart new file mode 100644 index 00000000..a1ee2cab --- /dev/null +++ b/lib/screens/patients/patient_search/time_bar.dart @@ -0,0 +1,110 @@ +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 e50c6ae1..9268b031 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -7,7 +7,6 @@ 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'; @@ -86,14 +85,17 @@ class _UcafDetailScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + margin: EdgeInsets.symmetric( + vertical: 16, horizontal: 16), child: Column( children: [ - treatmentStepsBar(context, model, screenSize, patient), + treatmentStepsBar( + context, model, screenSize, patient), SizedBox( height: 16, ), - ...getSelectedTreatmentStepItem(context, model), + ...getSelectedTreatmentStepItem( + context, model), ], ), ), @@ -102,20 +104,23 @@ class _UcafDetailScreenState extends State { ), ), ), + ], ), )); } - Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, Size screenSize, PatiantInformtion patient) { + 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, - decoration: Helpers.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), + decoration: Helpers.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC)), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -127,13 +132,16 @@ class _UcafDetailScreenState extends State { child: Container( height: screenSize.height * 0.070, decoration: Helpers.containerBorderDecoration( - _isActive ? HexColor("#B8382B") : Colors.white, _isActive ? HexColor("#B8382B") : Colors.white), + _isActive ? HexColor("#B8382B") : Colors.white, + _isActive ? HexColor("#B8382B") : Colors.white), child: Center( child: Text( item, style: TextStyle( fontSize: 12, - color: _isActive ? Colors.white : Colors.black, //Colors.black, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, fontWeight: FontWeight.bold, ), ), @@ -166,17 +174,20 @@ class _UcafDetailScreenState extends State { ); } - List getSelectedTreatmentStepItem(BuildContext _context, UcafViewModel model) { + List getSelectedTreatmentStepItem( + BuildContext _context, UcafViewModel model) { switch (_activeTap) { case 0: if (model.patientAssessmentList != null) { return [ - ListView.builder(itemCount: model.patientAssessmentList.length, + ListView.builder( + itemCount: model.patientAssessmentList.length, scrollDirection: Axis.vertical, physics: ScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { - return DiagnosisWidget(model, model.patientAssessmentList[index]); + return DiagnosisWidget( + model, model.patientAssessmentList[index]); }) ]; } else { @@ -187,12 +198,16 @@ class _UcafDetailScreenState extends State { break; case 1: return [ - ListView.builder(itemCount:model.prescriptionList != null ? model.prescriptionList!.entityList!.length : 0, + ListView.builder( + itemCount: model.prescriptionList != null + ? model.prescriptionList.entityList.length + : 0, scrollDirection: Axis.vertical, physics: ScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { - return MedicationWidget(model, model.prescriptionList!.entityList![index]); + return MedicationWidget( + model, model.prescriptionList.entityList[index]); }) ]; break; @@ -200,7 +215,8 @@ class _UcafDetailScreenState extends State { if (model.orderProcedures != null) { return [ ListView.builder( - itemCount:model.orderProcedures.length, scrollDirection: Axis.vertical, + itemCount: model.orderProcedures.length, + scrollDirection: Axis.vertical, physics: ScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { @@ -230,10 +246,12 @@ class DiagnosisWidget extends StatelessWidget { @override Widget build(BuildContext context) { - MasterKeyModel? diagnosisType = - model.findMasterDataById(masterKeys: MasterKeysService.DiagnosisType, id: diagnosis.diagnosisTypeID); - MasterKeyModel? diagnosisCondition = - model.findMasterDataById(masterKeys: MasterKeysService.DiagnosisCondition, id: diagnosis.conditionID); + MasterKeyModel diagnosisType = model.findMasterDataById( + masterKeys: MasterKeysService.DiagnosisType, + id: diagnosis.diagnosisTypeID); + MasterKeyModel diagnosisCondition = model.findMasterDataById( + masterKeys: MasterKeysService.DiagnosisCondition, + id: diagnosis.conditionID); return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -504,7 +522,7 @@ class ProceduresWidget extends StatelessWidget { AppText( "${procedure.isCovered}", fontWeight: FontWeight.normal, - color: procedure.isCovered! ? Colors.green : 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 1d1d549b..93bae074 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -1,12 +1,13 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-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/screens/patients/profile/UCAF/page-stepper-widget.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/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/buttons/app_buttons_widget.dart'; @@ -83,7 +84,8 @@ class _UCAFInputScreenState extends State { children: [ // PatientHeaderWidgetNoAvatar(patient), Container( - margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), + margin: EdgeInsets.symmetric( + vertical: 0, horizontal: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -137,7 +139,8 @@ class _UCAFInputScreenState extends State { height: 16, ),*/ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( children: [ @@ -151,7 +154,8 @@ class _UCAFInputScreenState extends State { ), AppText( "BP (H/L)", - fontSize: SizeConfig.textMultiplier * 1.8, + fontSize: + SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), @@ -160,7 +164,8 @@ class _UCAFInputScreenState extends State { ), AppText( "${model.bloodPressure}", - fontSize: SizeConfig.textMultiplier * 2, + fontSize: + SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.w700, ), @@ -174,7 +179,8 @@ class _UCAFInputScreenState extends State { children: [ AppText( "${TranslationBase.of(context).temperature}", - fontSize: SizeConfig.textMultiplier * 1.8, + fontSize: + SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), @@ -184,7 +190,8 @@ class _UCAFInputScreenState extends State { Expanded( child: AppText( "${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)", - fontSize: SizeConfig.textMultiplier * 2, + fontSize: + SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.w700, ), @@ -198,13 +205,15 @@ class _UCAFInputScreenState extends State { height: 2, ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( children: [ AppText( "${TranslationBase.of(context).pulseBeats}:", - fontSize: SizeConfig.textMultiplier * 1.8, + fontSize: + SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), @@ -213,7 +222,8 @@ class _UCAFInputScreenState extends State { ), AppText( "${model.hartRat}", - fontSize: SizeConfig.textMultiplier * 2, + fontSize: + SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.w700, ), @@ -225,7 +235,8 @@ class _UCAFInputScreenState extends State { height: 16, ), AppText( - TranslationBase.of(context).chiefComplaintsAndSymptoms, + TranslationBase.of(context) + .chiefComplaintsAndSymptoms, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.w700, @@ -246,9 +257,11 @@ class _UCAFInputScreenState extends State { height: 8, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).instruction, - dropDownText: - Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint ?? ""), + hintText: + TranslationBase.of(context).instruction, + dropDownText: Helpers.parseHtmlString(model + .patientChiefComplaintList[0] + .chiefComplaint), controller: _additionalComplaintsController, inputType: TextInputType.multiline, enabled: false, @@ -370,29 +383,31 @@ class _UCAFInputScreenState extends State { ) : model.patientChiefComplaintList != null || model.patientVitalSignsHistory != null - ?Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, + ? 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( + model.patientVitalSignsHistory == null || model.patientVitalSignsHistory.length == 0 + ? TranslationBase.of(context).vitalSignEmptyMsg + : TranslationBase.of(context) + .chiefComplaintEmptyMsg, + fontWeight: FontWeight.normal, + textAlign: TextAlign.center, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ) + ], ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - model.patientVitalSignsHistory == null ||model.patientVitalSignsHistory.length == 0 - ? TranslationBase.of(context).vitalSignEmptyMsg - : TranslationBase.of(context).chiefComplaintEmptyMsg, - fontWeight: FontWeight.normal, - textAlign: TextAlign.center, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], - ), - ): Container(), + ) + : Container(), ), ); } diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index 78f7f6db..6d9838f4 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -18,7 +18,7 @@ class PageStepperWidget extends StatelessWidget { final Size screenSize; final List stepsTitles; - PageStepperWidget({required this.stepsCount, required this.currentStepIndex, required this.screenSize, this.stepsTitles}); + PageStepperWidget({this.stepsCount, this.currentStepIndex, this.screenSize, this.stepsTitles}); @override Widget build(BuildContext context) { @@ -33,9 +33,11 @@ class PageStepperWidget extends StatelessWidget { children: [ for (int i = 1; i <= stepsCount; i++) if (i == currentStepIndex) - StepWidget(i, true, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles,) + StepWidget(i, true, i == stepsCount, i < currentStepIndex, + dividerWidth, stepsTitles: stepsTitles,) else - StepWidget(i, false, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles,) + StepWidget(i, false, i == stepsCount, i < currentStepIndex, + dividerWidth, stepsTitles: stepsTitles,) ], ) ], @@ -45,6 +47,7 @@ class PageStepperWidget extends StatelessWidget { } class StepWidget extends StatelessWidget { + final int index; final bool isInProgress; final bool isFinalStep; @@ -52,7 +55,8 @@ class StepWidget extends StatelessWidget { final double dividerWidth; final List stepsTitles; - StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth, {this.stepsTitles}); + StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, + this.dividerWidth, {this.stepsTitles}); @override Widget build(BuildContext context) { @@ -60,9 +64,9 @@ class StepWidget extends StatelessWidget { if (isInProgress) { status = StepStatus.InProgress; } else { - if (isStepFinish) { + if(isStepFinish){ status = StepStatus.Completed; - } else { + }else { status = StepStatus.Locked; } } @@ -78,18 +82,10 @@ 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( @@ -130,13 +126,11 @@ class StepWidget extends StatelessWidget { 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 @@ -151,8 +145,8 @@ class StepWidget extends StatelessWidget { color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked - ? Color(0xFF969696) - : Color(0xFF359846), + ? Color(0xFF969696) + : Color(0xFF359846), ), ) ], @@ -164,4 +158,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 2be71d19..8c38ece7 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -15,7 +15,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(); @@ -53,7 +53,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 0ec237da..f83117e2 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -14,7 +14,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(); @@ -23,22 +23,22 @@ class AdmissionOrdersScreen extends StatefulWidget { class _AdmissionOrdersScreenState extends State { bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; + AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + 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: 2014005178, patientId: patient!.patientMRN!), + admissionNo: 2014005178, patientId: patient.patientMRN), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -50,7 +50,7 @@ class _AdmissionOrdersScreenState extends State { body: model.admissionOrderList == null || model.admissionOrderList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).noDataAvailable!) + error: TranslationBase.of(context).noDataAvailable) : Container( color: Colors.grey[200], child: Column( @@ -257,6 +257,21 @@ class _AdmissionOrdersScreenState extends State { SizedBox( height: 8, ), + // Row( + // mainAxisAlignment: + // MainAxisAlignment.start, + // children: [ + // Expanded( + // child: AppText( + // model + // .admissionOrderList[ + // index] + // .notes, + // fontSize: 10, + // isCopyable: true, + // ), + // ), + // ]) ], ), SizedBox( 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 c17c36e3..9fa78cef 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,10 +6,10 @@ 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'; +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/buttons/app_buttons_widget.dart'; @@ -41,16 +41,16 @@ class _AdmissionRequestThirdScreenState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), - appBarTitle: TranslationBase.of(context).admissionRequest!, + appBar: PatientProfileAppBar(patient), + appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -217,7 +217,7 @@ class _AdmissionRequestThirdScreenState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), - - appBarTitle: TranslationBase.of(context).admissionRequest!, + appBar: PatientProfileAppBar(patient), + appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -155,7 +154,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 a92912dc..0258d26f 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,11 +8,11 @@ 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'; 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/buttons/app_buttons_widget.dart'; @@ -40,28 +40,28 @@ class _AdmissionRequestSecondScreenState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), - appBarTitle: TranslationBase.of(context).admissionRequest!, + appBar: PatientProfileAppBar(patient), + appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -187,16 +187,15 @@ class _AdmissionRequestSecondScreenState extends State { DiabeticType(nameAr: "Urine Glucose", nameEn: "Urine Glucose", value: 1), DiabeticType(nameAr: "Urine Acet", nameEn: "Urine Acet", value: 2), DiabeticType(nameAr: "Blood Glucose", nameEn: "Blood Glucose", value: 3), - DiabeticType( - nameAr: "Blood Glucose(Glucometer)", - nameEn: "Blood Glucose(Glucometer)", - value: 4) + DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4) ]; - late DiabeticType selectedDiabeticType; + 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( @@ -74,69 +70,84 @@ class _DiabeticChartState extends State { child: Column( children: [ Container( - width: MediaQuery.of(context).size.width * 0.7, + width: MediaQuery.of(context).size.width * 0.7, child: DropdownButtonHideUnderline( child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: selectedDiabeticType.value, - iconSize: 25, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return diabeticType.map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - padding: EdgeInsets.all(2), - margin: EdgeInsets.all(2), - decoration: new BoxDecoration( - color: Colors.red[800], - borderRadius: BorderRadius.circular(20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: Center( - child: AppText( - diabeticType.length.toString(), - color: Colors.white, - fontSize: - projectsProvider.isArabic ? 10 : 11, - textAlign: TextAlign.center, - ), - )), + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: selectedDiabeticType.value, + iconSize: 25, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return diabeticType + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + + padding: EdgeInsets.all(2), + margin: EdgeInsets.all(2), + decoration: new BoxDecoration( + color: Colors.red[800], + borderRadius: + BorderRadius.circular( + 20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: Center( + child: AppText( + diabeticType + .length + .toString(), + color: Colors.white, + fontSize: projectsProvider + .isArabic + ? 10 + : 11, + textAlign: + TextAlign.center, + ), + )), + ], + ), + AppText( + selectedDiabeticType.nameEn, + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.bold, + textAlign: TextAlign.end), ], + ); + }).toList(); + }, + onChanged: (newValue) async { + await onChangeFunc(newValue, model, patient); + setState(() { + + }); + }, + items: diabeticType + .map((item) { + return DropdownMenuItem( + child: AppText( + item.nameEn, + textAlign: TextAlign.left, ), - AppText(selectedDiabeticType.nameEn, - fontSize: 12, - color: Colors.black, - fontWeight: FontWeight.bold, - textAlign: TextAlign.end), - ], - ); - }).toList(); - }, - onChanged: (newValue) async { - await onChangeFunc(newValue, model, patient); - setState(() {}); - }, - items: diabeticType.map((item) { - return DropdownMenuItem( - child: AppText( - item.nameEn, - textAlign: TextAlign.left, - ), - value: item.value, - ); - }).toList(), - )), + value: item.value, + ); + }).toList(), + )), ), timeSeriesData1.length != 0 || timeSeriesData2.length != 0 ? Padding( @@ -144,13 +155,14 @@ class _DiabeticChartState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Container( margin: EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12)), child: LineChartForDiabetic( - title: selectedDiabeticType.nameEn!, + title: selectedDiabeticType.nameEn, isOX: false, timeSeries1: timeSeriesData1, // timeSeries2: timeSeriesData2, @@ -187,7 +199,7 @@ class _DiabeticChartState extends State { ], ), ) - : ErrorMessage(error: TranslationBase.of(context).noItem!), + : ErrorMessage(error: TranslationBase.of(context).noItem), ], ), )), @@ -199,21 +211,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(), ), ); }, @@ -224,17 +236,20 @@ class _DiabeticChartState extends State { onChangeFunc(newValue, PatientViewModel model, patient) async { GifLoaderDialogUtils.showMyDialog(context); setState(() { - selectedDiabeticType = diabeticType[newValue - 1]; + selectedDiabeticType = diabeticType[newValue-1]; timeSeriesData1.clear(); 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); GifLoaderDialogUtils.hideDialog(context); + + + + } } 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 f1600b10..b3b1b581 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,10 +12,8 @@ import 'package:provider/provider.dart'; class DiabeticDetails extends StatefulWidget { final List diabeticDetailsList; - DiabeticDetails({ - Key? key, - required this.diabeticDetailsList, - }); + DiabeticDetails( + {Key key, this.diabeticDetailsList,}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -42,6 +40,7 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', ), // height: 60, @@ -53,7 +52,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(8), child: Container( child: AppText( - "Result", + "Result", fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -71,8 +70,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), ), @@ -87,7 +85,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/diabetic_chart/line_chart_for_diabetic.dart b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart index 6f4005f1..671230c2 100644 --- a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart +++ b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart @@ -12,10 +12,10 @@ class LineChartForDiabetic extends StatelessWidget { final bool isOX; LineChartForDiabetic( - {required this.title, required this.timeSeries1, required this.indexes, this.isOX= false}); + {this.title, this.timeSeries1, this.indexes, this.isOX= false}); - List xAxixs = []; - List yAxixs = []; + List xAxixs = List(); + List yAxixs = List(); @override Widget build(BuildContext context) { @@ -93,7 +93,7 @@ class LineChartForDiabetic extends StatelessWidget { titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, - getTextStyles: (value) => TextStyle( + getTextStyles: (value) => const TextStyle( color: Colors.black, fontSize: 10, ), @@ -188,12 +188,12 @@ class LineChartForDiabetic extends StatelessWidget { } List getData(context) { - List spots = []; + List spots = List(); for (int index = 0; index < timeSeries1.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); } - List spots2 = []; + List spots2 = List(); // for (int index = 0; index < timeSeries2.length; index++) { // spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); // } @@ -225,7 +225,7 @@ class LineChartForDiabetic extends StatelessWidget { ), ); - List lineChartData = []; + List lineChartData = List(); if(spots.isNotEmpty){ lineChartData.add(lineChartBarData1); } diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 640e3061..65e483b5 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -31,7 +31,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(); @@ -39,22 +39,21 @@ class DiagnosisScreen extends StatefulWidget { class _ProgressNoteState extends State { bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + AuthenticationViewModel authenticationViewModel; + 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!, - patientID: patient.patientId, - setupID: "010266"); + GetDiagnosisForInPatientRequestModel( + admissionNo: int.parse(patient.admissionNo), + patientTypeID: patient.patientType, + patientID: patient.patientId, setupID: "010266"); model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); } @@ -62,7 +61,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']; @@ -77,7 +76,8 @@ class _ProgressNoteState extends State { ), body: model.diagnosisForInPatientList == null || model.diagnosisForInPatientList.length == 0 - ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) + ? DrAppEmbeddedError( + error: TranslationBase.of(context).noItem) : Container( color: Colors.grey[200], child: Column( @@ -85,7 +85,8 @@ class _ProgressNoteState extends State { Expanded( child: Container( child: ListView.builder( - itemCount: model.diagnosisForInPatientList.length, + itemCount: + model.diagnosisForInPatientList.length, itemBuilder: (BuildContext ctxt, int index) { return FractionallySizedBox( widthFactor: 0.95, @@ -159,7 +160,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .diagnosisForInPatientList[ index] - .createdOn!), + .createdOn), isArabic: projectViewModel .isArabic, @@ -185,7 +186,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .diagnosisForInPatientList[ index] - .createdOn!)) + .createdOn)) : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight.w600, @@ -206,9 +207,9 @@ class _ProgressNoteState extends State { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .icd! + - " : ", + TranslationBase.of( + context) + .icd + " : ", fontSize: 12, ), Expanded( @@ -227,17 +228,16 @@ class _ProgressNoteState extends State { ), Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ - AppText( - "Ascii Desc : ", + AppText("Ascii Desc : ", fontSize: 12, ), Expanded( child: AppText( model .diagnosisForInPatientList[ - index] + index] .asciiDesc, fontSize: 12, isCopyable: true, 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 50e1cd4d..f29315ae 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -10,9 +10,10 @@ import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; class AllDischargeSummary extends StatefulWidget { + final Function changeCurrentTab; final PatiantInformtion patient; - const AllDischargeSummary({ required this.patient}); + const AllDischargeSummary({this.changeCurrentTab, this.patient}); @override _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); @@ -26,7 +27,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( @@ -35,7 +36,7 @@ class _AllDischargeSummaryState extends State { body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) model.allDisChargeSummaryList.isEmpty ? ErrorMessage( - error: TranslationBase.of(context).noDataAvailable!) + error: TranslationBase.of(context).noDataAvailable) : Column( children: [ Padding( 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 33572f93..c1e72f96 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -17,7 +17,7 @@ class DischargeSummaryWidget extends StatefulWidget { final GetDischargeSummaryResModel dischargeSummary; bool isShowMore = false; - DischargeSummaryWidget({Key? key, required this.dischargeSummary}); + DischargeSummaryWidget({Key key, this.dischargeSummary}); @override _DischargeSummaryWidgetState createState() => _DischargeSummaryWidgetState(); @@ -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,26 +52,26 @@ 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, ), CustomRow( - label: TranslationBase.of(context).clinicName! + ": ", + label: TranslationBase.of(context).clinicName + ": ", value: widget.dischargeSummary.clinicName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( - label: TranslationBase.of(context).dischargeDate! + ": ", + label: TranslationBase.of(context).dischargeDate + ": ", value: AppDateUtils.getDateTimeFromServerFormat( widget.dischargeSummary.createdOn) .day diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index b5ab77a7..31935fcf 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -12,8 +12,9 @@ import 'all_discharge_summary.dart'; import 'pending_discharge_summary.dart'; class DischargeSummaryPage extends StatefulWidget { + final Function changeCurrentTab; - const DischargeSummaryPage({Key? key, }) + const DischargeSummaryPage({Key key, this.changeCurrentTab}) : super(key: key); @override @@ -22,7 +23,7 @@ class DischargeSummaryPage extends StatefulWidget { class _DoctorReplyScreenState extends State with SingleTickerProviderStateMixin { - late TabController _tabController; + TabController _tabController; int _activeTab = 0; int pageIndex = 1; @@ -48,15 +49,16 @@ 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, // appBarTitle: TranslationBase.of(context).progressNote, appBar: PatientProfileAppBar( @@ -101,7 +103,7 @@ class _DoctorReplyScreenState extends State 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 a99ce464..4984999f 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -9,9 +9,10 @@ import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; class PendingDischargeSummary extends StatefulWidget { + final Function changeCurrentTab; final PatiantInformtion patient; - const PendingDischargeSummary({Key? key, required this.patient}) + const PendingDischargeSummary({Key key, this.changeCurrentTab, this.patient}) : super(key: key); @override @@ -28,7 +29,7 @@ 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( @@ -37,7 +38,7 @@ class _PendingDischargeSummaryState extends State { body: model.pendingDischargeSummaryList.isEmpty ? ErrorMessage( error: TranslationBase.of(context) - .noDataAvailable!) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) + .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 f0ee0404..be863b87 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( - {required this.patientLabOrder, required this.filterName, required this.patient, required this.isInpatient}); + {this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); @override Widget build(BuildContext context) { @@ -39,37 +39,37 @@ class FlowChartPage extends StatelessWidget { baseViewModel: model, body: model.labOrdersResultHistoryList.isNotEmpty ? SingleChildScrollView( - child: Container( - child: LabResultHistoryChartAndDetails( - name: filterName, - labResultHistory: model.labOrdersResultHistoryList, - ), - // child: LabResultChartAndDetails( - // name: filterName, - // labResult: model.labOrdersResultsList, - // ), - ), - ) + child: Container( + child: LabResultHistoryChartAndDetails( + name: filterName, + labResultHistory: model.labOrdersResultHistoryList, + ), + // child: LabResultChartAndDetails( + // name: filterName, + // labResult: model.labOrdersResultsList, + // ), + ), + ) : Container( - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noDataAvailable, - fontWeight: FontWeight.normal, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).noDataAvailable, + fontWeight: FontWeight.normal, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ) + ], ), - ) - ], - ), - ), - ), + ), + ), ), ); } diff --git a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart index 4a23710f..118bc476 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({required this.patientLabOrder, required this.filterName, required this.patient}); + LabResultHistoryPage({this.patientLabOrder, this.filterName, 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 df0eef1f..6ca92a4a 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, - required this.filterName, - required this.patientLabResultList, - required this.patientLabOrder, - required this.patient, - required this.isInpatient}) + {Key key, + this.filterName, + this.patientLabResultList, + this.patientLabOrder, + this.patient, + this.isInpatient}) : super(key: key); - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -47,33 +47,34 @@ class LabResultWidget extends StatelessWidget { children: [ AppText( filterName, - fontSize: SizeConfig.textMultiplier * 2.0, + fontSize: SizeConfig.textMultiplier * 2.0, fontWeight: FontWeight.w700, ), ], ), - //InkWell( - // onTap: () { - // Navigator.push( - // context, - // FadePage( - // page: FlowChartPage( - // filterName: filterName, - // patientLabOrder: patientLabOrder, - // patient: patient, - // isInpatient: isInpatient, - // ), - // ), - // ); - // }, - // // child: AppText( - // // TranslationBase.of(context).showMoreBtn, - // // textDecoration: TextDecoration.underline, - // // color: Colors.blue, - // // ), - //), + // InkWell( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: FlowChartPage( + // filterName: filterName, + // patientLabOrder: patientLabOrder, + // patient: patient, + // isInpatient: isInpatient, + // ), + // ), + // ); + // }, + // // child: AppText( + // // TranslationBase.of(context).showMoreBtn, + // // textDecoration: TextDecoration.underline, + // // color: Colors.blue, + // // ), + // ), ], - ),SizedBox( + ), + SizedBox( height: 8, ), Row( @@ -150,7 +151,7 @@ class LabResultWidget extends StatelessWidget { child: Center( child: AppText( /*'${patientLabResultList[index].testCode}\n' +*/ - patientLabResultList[index].description!, + patientLabResultList[index].description, textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.8, isCopyable: true, @@ -185,8 +186,9 @@ class LabResultWidget extends StatelessWidget { child: Center( child: AppText( patientLabResultList[index].resultValue ?? - - "" + " " + "${patientLabResultList[index].uOM ?? ""}", + "" + + " " + + "${patientLabResultList[index].uOM ?? ""}", textAlign: TextAlign.center, isCopyable: true, fontSize: SizeConfig.textMultiplier * 1.8, @@ -220,7 +222,7 @@ class LabResultWidget extends StatelessWidget { FadePage( page: FlowChartPage( filterName: - patientLabResultList[index].description!, + patientLabResultList[index].description, patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient, @@ -329,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 c08d1514..697d16d2 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({ - required this.labResult, + this.labResult, }); @override @@ -24,7 +24,7 @@ class _VitalSignDetailsWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - /* decoration: BoxDecoration( + /* decoration: BoxDecoration( color: Colors.transparent, borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), @@ -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,16 +87,17 @@ 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( padding: EdgeInsets.all(8), color: Colors.white, child: AppText( - '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', + '${projectViewModel.isArabic? AppDateUtils.getWeekDayArabic(date.weekday): AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), ), @@ -109,6 +110,7 @@ class _VitalSignDetailsWidgetState extends State { '${vital.resultValue}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), ), 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 ba49e356..490d0ec4 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,15 +12,14 @@ class LabResultHistoryDetailsWidget extends StatefulWidget { final List labResultHistory; LabResultHistoryDetailsWidget({ - required this.labResultHistory, + this.labResultHistory, }); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); } -class _VitalSignDetailsWidgetState - extends State { +class _VitalSignDetailsWidgetState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -73,7 +72,7 @@ class _VitalSignDetailsWidgetState ), 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), ), @@ -86,7 +85,7 @@ class _VitalSignDetailsWidgetState 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( @@ -114,4 +113,4 @@ class _VitalSignDetailsWidgetState }); return tableRow; } -} +} \ No newline at end of file diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index 4c27861e..89860f44 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -10,15 +10,15 @@ class LineChartCurved extends StatefulWidget { final String title; final List labResult; - LineChartCurved({required this.title, required this.labResult}); + LineChartCurved({this.title, this.labResult}); @override State createState() => LineChartCurvedState(); } class LineChartCurvedState extends State { - bool? isShowingMainData; - List xAxixs = []; + bool isShowingMainData; + List xAxixs = List(); int indexes = 0; @override @@ -59,6 +59,7 @@ class LineChartCurvedState extends State { widget.title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', textAlign: TextAlign.center, ), @@ -91,7 +92,8 @@ class LineChartCurvedState extends State { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -100,23 +102,27 @@ class LineChartCurvedState extends State { fontSize: 11, ), margin: 28, - rotateAngle: -65, + rotateAngle:-65, getTitles: (value) { print(value); - DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime!); + DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); if (widget.labResult.length < 8) { if (widget.labResult.length > value.toInt()) { return '${date.day}/ ${date.year}'; } else return ''; } else { - if (value.toInt() == 0) return '${date.day}/ ${date.year}'; - if (value.toInt() == widget.labResult.length - 1) return '${date.day}/ ${date.year}'; + if (value.toInt() == 0) + return '${date.day}/ ${date.year}'; + if (value.toInt() == widget.labResult.length - 1) + return '${date.day}/ ${date.year}'; if (xAxixs.contains(value.toInt())) { return '${date.day}/ ${date.year}'; } } + + return ''; }, ), @@ -154,7 +160,7 @@ class LineChartCurvedState extends State { ), minX: 0, maxX: (widget.labResult.length - 1).toDouble(), - maxY: getMaxY() + 2, + maxY: getMaxY()+2, minY: getMinY(), lineBarsData: getData(), ); @@ -163,10 +169,10 @@ class LineChartCurvedState extends State { double getMaxY() { double max = 0; widget.labResult.forEach((element) { - try { - double resultValueDouble = double.parse(element.resultValue!); - if (resultValueDouble > max) max = resultValueDouble; - } catch (e) { + try{ + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble > max) max = resultValueDouble;} + catch(e){ print(e); } }); @@ -176,14 +182,13 @@ class LineChartCurvedState extends State { double getMinY() { double min = 0; - try { - min = double.parse(widget.labResult[0].resultValue ?? ""); - - widget.labResult.forEach((element) { - double resultValueDouble = double.parse(element.resultValue ?? ""); - if (resultValueDouble < min) min = resultValueDouble; - }); - } catch (e) { + try{ + min = double.parse(widget.labResult[0].resultValue); + + widget.labResult.forEach((element) { + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble < min) min = resultValueDouble; + });}catch(e){ print(e); } int value = min.toInt(); @@ -192,14 +197,15 @@ class LineChartCurvedState extends State { } List getData() { - List spots = []; + List spots = List(); for (int index = 0; index < widget.labResult.length; index++) { - try { - var resultValueDouble = double.parse(widget.labResult[index].resultValue ?? ""); - spots.add(FlSpot(index.toDouble(), resultValueDouble)); - } catch (e) { + try{ + var resultValueDouble = double.parse(widget.labResult[index].resultValue); + spots.add(FlSpot(index.toDouble(), resultValueDouble)); + }catch(e){ print(e); spots.add(FlSpot(index.toDouble(), 0.0)); + } } diff --git a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart index 606c75a2..ea9300d0 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart @@ -9,15 +9,15 @@ class LineChartCurvedLabHistory extends StatefulWidget { final String title; final List labResultHistory; - LineChartCurvedLabHistory({required this.title, required this.labResultHistory}); + LineChartCurvedLabHistory({this.title, this.labResultHistory}); @override State createState() => LineChartCurvedLabHistoryState(); } class LineChartCurvedLabHistoryState extends State { - late bool isShowingMainData; - List xAxixs = []; + bool isShowingMainData; + List xAxixs = List(); int indexes = 0; @override @@ -197,7 +197,7 @@ class LineChartCurvedLabHistoryState extends State { } List getData() { - List spots = []; + List spots = List(); for (int index = 0; index < widget.labResultHistory.length; index++) { try { var resultValueDouble = 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 6efac930..545b4378 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 @@ -14,24 +14,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 { - late String patientType; + String patientType; - late String arrivalType; - late PatiantInformtion patient; - late bool isInpatient; - late bool isFromLiveCare; + String arrivalType; + PatiantInformtion patient; + bool isInpatient; + 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']; @@ -46,7 +46,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], @@ -71,9 +71,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, @@ -110,10 +110,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( @@ -135,17 +135,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), ), @@ -159,21 +159,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 371cabec..49fee0f4 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 @@ -1,3 +1,4 @@ + import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -7,16 +8,18 @@ import 'package:flutter/material.dart'; import 'LineChartCurved.dart'; 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; final String name; + @override Widget build(BuildContext context) { return Padding( @@ -26,16 +29,19 @@ class LabResultChartAndDetails extends StatelessWidget { children: [ Container( margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), - child: LineChartCurved( - title: name, - labResult: labResult, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) ), + child: LineChartCurved(title: name,labResult:labResult,), ), Container( margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) + ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -45,9 +51,7 @@ class LabResultChartAndDetails extends StatelessWidget { fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), - SizedBox( - height: 8, - ), + SizedBox(height: 8,), LabResultDetailsWidget( labResult: labResult.reversed.toList(), ), @@ -58,4 +62,5 @@ class LabResultChartAndDetails extends StatelessWidget { ), ); } + } 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 fdf95b2c..322eb817 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 a8b98be9..dd8ace01 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, required this.labOrders}); + LabResult({Key key, this.labOrders}); @override _LabResultState createState() => _LabResultState(); @@ -27,11 +27,13 @@ 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), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, + 0, SizeConfig.realScreenWidth * 0.05, 0), child: ListView( children: [ CardWithBgWidgetNew( @@ -67,6 +69,7 @@ class _LabResultState extends State { ), ], ), + ], ), ), 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 ee220b06..4ccd4379 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -1,8 +1,8 @@ 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'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -17,12 +17,12 @@ class LaboratoryResultPage extends StatefulWidget { final bool isInpatient; LaboratoryResultPage( - {Key? key, - required this.patientLabOrders, - required this.patient, - required this.patientType, - required this.arrivalType, - required this.isInpatient}); + {Key key, + this.patientLabOrders, + this.patient, + this.patientType, + this.arrivalType, + this.isInpatient}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -33,25 +33,29 @@ 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, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: widget.patient, - isInpatient: widget.isInpatient, - isFromLabResult: true, - appointmentDate: widget.patientLabOrders.orderDate!, + appBar: PatientProfileAppBar( + widget.patient, + isInpatient:widget.isInpatient, + isFromLabResult: true, + appointmentDate: widget.patientLabOrders.orderDate, ), + baseViewModel: model, body: AppScaffold( isShowAppBar: false, 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 e84552ba..9bf81081 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, - required this.onTap, - required this.billNo, - required this.details, - required this.orderNo, - required this.patientLabOrder, - required this.patient, - required this.isInpatient}) + {Key key, + this.onTap, + this.billNo, + this.details, + this.orderNo, + this.patientLabOrder, + this.patient, + this.isInpatient}) : super(key: key); @override @@ -42,7 +42,7 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMoreGeneral = true; bool _isShowMore = true; - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -90,9 +90,11 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only(left: 0, right: 0), + margin: EdgeInsets.only( + left: 0, right: 0), child: AppText( - TranslationBase.of(context).generalResult, + TranslationBase.of(context) + .generalResult, fontSize: SizeConfig.textMultiplier * 2.3, bold: false, ))), @@ -100,7 +102,9 @@ class _LaboratoryResultWidgetState extends State { width: 25, height: 25, child: Icon( - _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, + _isShowMoreGeneral + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, color: Colors.grey[800], size: 22, ), @@ -134,12 +138,15 @@ class _LaboratoryResultWidgetState extends State { shrinkWrap: true, itemBuilder: (context, index) { return LabResultWidget( - patientLabOrder: widget.patientLabOrder, - filterName: model.labResultLists[index].filterName, - patientLabResultList: model.labResultLists[index].patientLabResultList, - patient: widget.patient, - isInpatient: widget.isInpatient, - ); + patientLabOrder: widget.patientLabOrder, + filterName: model + .labResultLists[index].filterName, + patientLabResultList: model + .labResultLists[index] + .patientLabResultList, + patient: widget.patient, + isInpatient: widget.isInpatient, + ); }), ], ), @@ -151,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( @@ -179,9 +186,11 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only(left: 0, right: 0), + margin: EdgeInsets.only( + left: 0, right: 0), child: AppText( - TranslationBase.of(context).specialResult, + TranslationBase.of(context) + .specialResult, fontSize: SizeConfig.textMultiplier * 2.3, bold: false, ))), @@ -189,7 +198,9 @@ class _LaboratoryResultWidgetState extends State { width: 25, height: 25, child: Icon( - _isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, + _isShowMore + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, color: Colors.grey[800], size: 22, ), @@ -212,12 +223,16 @@ 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).noDataAvailable, + widget.details ?? + TranslationBase.of(context) + .noDataAvailable, ) : Html( - data: widget.details ?? TranslationBase.of(context).noDataAvailable, + data: widget.details ?? + TranslationBase.of(context) + .noDataAvailable, ), ), ), 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 d600f7c2..2c6dbb0c 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -1,13 +1,13 @@ 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'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.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/card_with_bg_widget.dart'; @@ -23,16 +23,17 @@ class LabsHomePage extends StatefulWidget { } class _LabsHomePageState extends State { - late String patientType; + 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']; @@ -49,10 +50,12 @@ class _LabsHomePageState extends State { onModelReady: (model) => model.getLabs(patient, isInpatient: false), builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, - backgroundColor: Colors.grey[100]!, + backgroundColor: Colors.grey[100], isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, isInpatient:isInpatient,), + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -119,7 +122,7 @@ class _LabsHomePageState extends State { ), ); }, - label: TranslationBase.of(context).applyForNewLabOrder ?? "", + label: TranslationBase.of(context).applyForNewLabOrder, ), ...List.generate( model.patientLabOrdersList.length, @@ -142,28 +145,27 @@ class _LabsHomePageState extends State { left: 1, child: Container( width: 20, - - decoration: BoxDecoration( - color: model.patientLabOrdersList[index].isLiveCareAppointment! - ? Colors.red[900] - : !model.patientLabOrdersList[index].isInOutPatient! - ? Colors.black - : Color(0xffa9a089), - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), - bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), - ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - model.patientLabOrdersList[index].isLiveCareAppointment! - ? TranslationBase.of(context).liveCare!.toUpperCase() - : !model.patientLabOrdersList[index].isInOutPatient! - ? TranslationBase.of(context).inPatientLabel!.toUpperCase() - : TranslationBase.of(context).outpatient!.toUpperCase(), + decoration: BoxDecoration( + color: model.patientLabOrdersList[index].isLiveCareAppointment + ? Colors.red[900] + : !model.patientLabOrdersList[index].isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), + bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.patientLabOrdersList[index].isLiveCareAppointment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.patientLabOrdersList[index].isInOutPatient + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -187,12 +189,12 @@ class _LabsHomePageState extends State { ), ), ), - doctorName: model.patientLabOrdersList[index].doctorName ?? "", + doctorName: model.patientLabOrdersList[index].doctorName, invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', - profileUrl: model.patientLabOrdersList[index].doctorImageURL ?? "", - branch: model.patientLabOrdersList[index].projectName ?? "", - clinic: model.patientLabOrdersList[index].clinicDescription ?? "", - appointmentDate: model.patientLabOrdersList[index].orderDate!.add(Duration(days: 1)), + profileUrl: model.patientLabOrdersList[index].doctorImageURL, + branch: model.patientLabOrdersList[index].projectName, + clinic: model.patientLabOrdersList[index].clinicDescription, + appointmentDate: 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 e338635a..db86dd72 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, required this.resultData, required this.patient}) : super(key: key); + const SpecialLabResultDetailsPage({Key key, this.resultData, 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 5035806d..72ee1311 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,7 +38,6 @@ class AddVerifyMedicalReport extends StatefulWidget { } class _AddVerifyMedicalReportState extends State { - HtmlEditorController _controller = HtmlEditorController(); @override Widget build(BuildContext context) { String txtOfMedicalReport; @@ -51,8 +50,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: [ @@ -69,26 +68,13 @@ 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, - controller: _controller, + height: MediaQuery.of(context).size.height * 0.75, ), ], ), @@ -114,35 +100,27 @@ class _AddVerifyMedicalReportState extends State { // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = await _controller.getText(); + txtOfMedicalReport = await HtmlEditor.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); widget.medicalReport != null - ? await widget.model!.updateMedicalReport( - widget.patient!, + ?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); + widget.medicalReport != null ? widget.medicalReport.lineItemNo : null, + widget.medicalReport != null ? widget.medicalReport.invoiceNo : null) + : await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); //model.getMedicalReportList(patient); Navigator.pop(context); GifLoaderDialogUtils.hideDialog(context); - if (widget.model!.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - widget.model!.error); + if (widget.model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(widget.model.error); } } else { - DrAppToastMsg.showErrorToast( - "Please enter medical note"); + DrAppToastMsg.showErrorToast("Please enter medical note"); } }, ), @@ -159,22 +137,17 @@ class _AddVerifyMedicalReportState extends State { color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = - await _controller.getText(); + txtOfMedicalReport = await HtmlEditor.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - await widget.model!.verifyMedicalReport( - widget.patient!, widget.medicalReport!); + 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); + if (widget.model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(widget.model.error); } } else { - DrAppToastMsg.showErrorToast( - "Please enter medical note"); + DrAppToastMsg.showErrorToast("Please enter medical note"); } }, ), diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index ceac8526..ab24f8e0 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -1,13 +1,16 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.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/models/patient/MedicalReport/MeidcalReportModel.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.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/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; @@ -17,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']; @@ -28,8 +31,9 @@ class MedicalReportDetailPage extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient:patient), + appBar: PatientProfileAppBar( + patient, + ), body: Container( child: SingleChildScrollView( child: Column( @@ -55,29 +59,27 @@ class MedicalReportDetailPage extends StatelessWidget { ], ), ), - medicalReport.reportDataHtml != null - ? Container( - width: double.infinity, - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(8)), - border: Border.fromBorderSide( - BorderSide( - color: Colors.white, - width: 1.0, - ), - ), - ), - child: Html(data: medicalReport.reportDataHtml ?? ""), - ) - : Container( - child: ErrorMessage( - error: "No Data", - ), + medicalReport.reportDataHtml != null ? Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide( + BorderSide( + color: Colors.white, + width: 1.0, ), + ), + ), + child: Html( + data: medicalReport.reportDataHtml ?? "" + ), + ) : Container( + child: ErrorMessage(error: "No Data",), + ), ], ), ), diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index e0155547..a25d03b4 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -6,7 +6,6 @@ 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'; @@ -14,6 +13,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.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/card_with_bg_widget.dart'; @@ -33,7 +33,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']; @@ -48,8 +48,9 @@ class _MedicalReportPageState extends State { baseViewModel: model, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient:patient), + appBar: PatientProfileAppBar( + patient, + ), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( @@ -83,21 +84,22 @@ 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( @@ -109,21 +111,22 @@ class _MedicalReportPageState extends State { context, MaterialPageRoute( builder: (context) => AddVerifyMedicalReport( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - medicalReport: model.medicalReportList[index], - model: model, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + medicalReport: model.medicalReportList[index], + model: model, medicalNote: model.medicalReportList[index].reportDataHtml, ), - settings: RouteSettings(name: 'AddVerifyMedicalReport')),); - } else { - Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'type': MedicalReportStatus.ADD, - 'medicalReport': model.medicalReportList[index], + settings: RouteSettings(name: 'AddVerifyMedicalReport')), + ); + } else { + Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'type': MedicalReportStatus.ADD, + 'medicalReport': model.medicalReportList[index], 'model': model, }); } @@ -132,111 +135,110 @@ class _MedicalReportPageState extends State { margin: EdgeInsets.symmetric(horizontal: 8), child: CardWithBgWidget( hasBorder: false, - bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) : Colors.green[700]!, - widget: Column( - children: [ - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - model.medicalReportList[index].status == 1 - ? TranslationBase.of(context).onHold - : TranslationBase.of(context).verified, - color: model.medicalReportList[index].status == 1 - ? Color(0xFFCC9B14) - : Colors.green[700], - fontSize: 1.4 * SizeConfig.textMultiplier, - bold: true, - ), - AppText( - projectViewModel.isArabic - ? model.medicalReportList[index].doctorNameN?? "" - : model.medicalReportList[index].doctorName?? "", - fontSize: 1.9 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w700, - color: Color(0xFF2E303A), - ), - ], - )), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - '${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")}', - color: Color(0xFF2E303A), - fontWeight: FontWeight.w600, - fontSize: 1.5 * SizeConfig.textMultiplier, - ), - ], - ), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.only(left: 0, top: 4, right: 8, bottom: 0), - child: LargeAvatar( - name: projectViewModel.isArabic + bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) : Colors.green[700], + widget: Column( + children: [ + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + model.medicalReportList[index].status == 1 + ? TranslationBase.of(context).onHold + : TranslationBase.of(context).verified, + color: model.medicalReportList[index].status == 1 + ? Color(0xFFCC9B14) + : Colors.green[700], + fontSize: 1.4 * SizeConfig.textMultiplier, + bold: true, + ), + AppText( + projectViewModel.isArabic ? model.medicalReportList[index].doctorNameN ?? "" : model.medicalReportList[index].doctorName ?? "", - url: model.medicalReportList[index].doctorImageURL, + fontSize: 1.9 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), - width: 50, - height: 50, - ), - Expanded( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - projectViewModel.isArabic - ? model.medicalReportList[index].projectNameN - : model.medicalReportList[index].projectName, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0xFF2E303A), - ), - AppText( - projectViewModel.isArabic - ? model.medicalReportList[index].clinicNameN - : model.medicalReportList[index].clinicName, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0xFF2E303A), - ), - ], - ), + ], + )), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + '${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")}', + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.5 * SizeConfig.textMultiplier, ), + ], + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(left: 0, top: 4, right: 8, bottom: 0), + child: LargeAvatar( + name: projectViewModel.isArabic + ? model.medicalReportList[index].doctorNameN + : model.medicalReportList[index].doctorName, + url: model.medicalReportList[index].doctorImageURL, ), - Container( - height: 50, + width: 50, + height: 50, + ), + Expanded( + child: Container( child: Column( - mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - model.medicalReportList[index].status == 1 ? DoctorApp.edit_1 - :EvaIcons.eye , + AppText( + projectViewModel.isArabic + ? model.medicalReportList[index].projectNameN + : model.medicalReportList[index].projectName, + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Color(0xFF2E303A), + ), + AppText( + projectViewModel.isArabic + ? model.medicalReportList[index].clinicNameN + : model.medicalReportList[index].clinicName, + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Color(0xFF2E303A), ), ], ), - ) - ], - ), - ], - ), + ), + ), + Container( + height: 50, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Icon( + model.medicalReportList[index].status == 1 ? DoctorApp.edit_1 : EvaIcons.eye, + ), + ], + ), + ) + ], + ), + ], ), ), ), ), + ), SizedBox( height: 15, ) 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 f17688f5..52a1b0e0 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -33,21 +33,22 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class ProgressNoteScreen extends StatefulWidget { final int visitType; - const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key); + const ProgressNoteScreen({Key key, this.visitType}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - late List notesList; + List notesList; var filteredNotesList; bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + AuthenticationViewModel authenticationViewModel; + 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); @@ -56,12 +57,15 @@ 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; }); } @@ -70,10 +74,11 @@ 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( @@ -87,7 +92,7 @@ class _ProgressNoteState extends State { body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote!) + error: TranslationBase.of(context).errorNoProgressNote) : Container( color: Colors.grey[200], child: Column( @@ -113,8 +118,8 @@ class _ProgressNoteState extends State { ); }, label: widget.visitType == 3 - ? TranslationBase.of(context).addNewOrderSheet! - : TranslationBase.of(context).addProgressNote!, + ? TranslationBase.of(context).addNewOrderSheet + : TranslationBase.of(context).addProgressNote, ), Expanded( child: Container( @@ -129,7 +134,7 @@ class _ProgressNoteState extends State { .status == 1 && authenticationViewModel - .doctorProfile!.doctorID != + .doctorProfile.doctorID != model .patientProgressNoteList[ index] @@ -156,7 +161,7 @@ class _ProgressNoteState extends State { .status == 1 && authenticationViewModel - .doctorProfile!.doctorID != + .doctorProfile.doctorID != model .patientProgressNoteList[ index] @@ -201,7 +206,7 @@ class _ProgressNoteState extends State { .status != 4 && authenticationViewModel - .doctorProfile!.doctorID == + .doctorProfile.doctorID == model .patientProgressNoteList[ index] @@ -239,222 +244,327 @@ class _ProgressNoteState extends State { ), // 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: 2, + ), + AppText( + TranslationBase.of( + context) + .update, + fontSize: 10, + color: Colors.white, + ), + ], ), + padding: EdgeInsets.all(6), ), - 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: Colors.green[600], - borderRadius: BorderRadius.circular(10), - ), - // color:Colors.red[600], + ), + 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: Colors.green[600], + 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), + 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: 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], + ), + 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), + child: Row( + children: [ + Icon( + FontAwesomeIcons + .trash, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Cancel', + fontSize: 10, + color: Colors.white, + ), + ], ), - ), - SizedBox( - width: 10, - ) - ], - ), - 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,), - ), - ], - ), - ], + padding: EdgeInsets.all(6), ), ), - 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( + width: 10, ) ], ), - SizedBox( - height: 8, - ), - Row(mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - child: AppText( - model.patientProgressNoteList[index].notes, - fontSize: 10,isCopyable:true, + 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, + ), + ), + ], + ), + ], ), ), - ]) - ], - ), - SizedBox( - height: 20, - ), - ], - ), + 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, + ), + ], ), - ); - }), - ), + ), + ); + }), ), + ), ], ), ), @@ -462,7 +572,7 @@ class _ProgressNoteState extends State { ); } - showMyDialog({required BuildContext context, required Function confirmFun, required String actionName}) { + showMyDialog({BuildContext context, Function confirmFun, String actionName}) { showDialog( context: context, builder: (ctx) => Center( diff --git a/lib/screens/patients/profile/notes/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart index b2873fde..3fde4262 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, - required this.patientModel, - required this.patient, - required this.visitType, - required this.isUpdate}) + this.patientModel, + this.patient, + this.visitType, + 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,13 +119,17 @@ 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, @@ -133,19 +137,26 @@ class _UpdateNoteOrderState extends State { hasBorder: true, // isTextFieldHasSuffix: true, - validationError: progressNoteController.text.isEmpty && isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, + validationError: + progressNoteController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : 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( - 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()}); }, ), ], @@ -162,34 +173,34 @@ class _UpdateNoteOrderState extends State { ), ), bottomSheet: Container( - height: progressNoteController.text.isNotEmpty ? 130 : 70, + height: progressNoteController.text.isNotEmpty? 130:70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( children: [ - if (progressNoteController.text.isNotEmpty) - Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: TranslationBase.of(context).clearText, - onPressed: () { - setState(() { - progressNoteController.text = ''; - }); - }, - ), - ), + if(progressNoteController.text.isNotEmpty) + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + progressNoteController.text = ''; + }); + }, + ), + ), Container( margin: EdgeInsets.all(5), child: AppButton( 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, @@ -201,23 +212,26 @@ class _UpdateNoteOrderState extends State { GifLoaderDialogUtils.showMyDialog(context); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = + DoctorProfileModel.fromJson(profile); 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, patientOutSA: false, ); - await widget.patientModel.updatePatientProgressNote(reqModel); + await widget.patientModel + .updatePatientProgressNote(reqModel); } else { CreateNoteModel reqModel = CreateNoteModel( - admissionNo: int.parse(widget.patient.admissionNo!), + admissionNo: + int.parse(widget.patient.admissionNo), createdBy: doctorProfile.doctorID, visitType: widget.visitType, patientID: widget.patient.patientId, @@ -226,23 +240,28 @@ class _UpdateNoteOrderState extends State { patientOutSA: false, notes: progressNoteController.text); - await widget.patientModel.createPatientProgressNote(reqModel); + await widget.patientModel + .createPatientProgressNote(reqModel); } if (widget.patientModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.patientModel.error); } else { - ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( - visitType: widget.visitType, - // if equal 5 then this will return progress note - admissionNo: int.parse(widget.patient.admissionNo!), - projectID: widget.patient.projectId, - patientTypeID: widget.patient.patientType, - languageID: 2); - await widget.patientModel.getPatientProgressNote(progressNoteRequest.toJson()); + ProgressNoteRequest progressNoteRequest = + ProgressNoteRequest( + visitType: widget.visitType, + // if equal 5 then this will return progress note + admissionNo: + int.parse(widget.patient.admissionNo), + projectID: widget.patient.projectId, + patientTypeID: widget.patient.patientType, + languageID: 2); + await widget.patientModel.getPatientProgressNote( + progressNoteRequest.toJson()); } GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast("Your Order added Successfully"); + DrAppToastMsg.showSuccesToast( + "Your Order added Successfully"); Navigator.of(context).pop(); } else { Helpers.showErrorToast("You cant add only spaces"); @@ -257,7 +276,8 @@ class _UpdateNoteOrderState 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, @@ -301,7 +321,8 @@ class _UpdateNoteOrderState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } 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 472f3f85..0fbac8bf 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 @@ -30,32 +30,31 @@ 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 { - late List notesList; + List notesList; var filteredNotesList; bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + AuthenticationViewModel authenticationViewModel; + 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!, - patientID: patient.patientId, - setupID: "010266"); + admissionNo: int.parse(patient.admissionNo), + patientTypeID: patient.patientType, + patientID: patient.patientId, setupID: "010266"); model.getNursingProgressNote(getNursingProgressNoteRequestModel); } @@ -63,7 +62,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']; @@ -80,7 +79,7 @@ class _ProgressNoteState extends State { body: model.patientNursingProgressNoteList == null || model.patientNursingProgressNoteList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote!) + error: TranslationBase.of(context).errorNoProgressNote) : Container( color: Colors.grey[200], child: Column( @@ -163,7 +162,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .patientNursingProgressNoteList[ index] - .createdOn!), + .createdOn), isArabic: projectViewModel .isArabic, @@ -189,7 +188,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .patientNursingProgressNoteList[ index] - .createdOn!)) + .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 376f8dbb..c2751424 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -31,31 +31,31 @@ import '../../../../widgets/shared/app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class OperationReportScreen extends StatefulWidget { - final int? visitType; + final int visitType; - const OperationReportScreen({Key? key, this.visitType}) : super(key: key); + const OperationReportScreen({Key key, this.visitType}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - late List notesList; + List notesList; var filteredNotesList; bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + AuthenticationViewModel authenticationViewModel; + 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, @@ -71,7 +71,7 @@ class _ProgressNoteState extends State { model.reservationList == null || model.reservationList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote!) + error: TranslationBase.of(context).errorNoProgressNote) : Expanded( child: Container( child: ListView.builder( 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 6ff2b7de..d042ff2f 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -36,16 +36,16 @@ class UpdateOperationReport extends StatefulWidget { final GetReservationsResponseModel reservation; // final OperationReportViewModel operationReportViewModel; final PatiantInformtion patient; - final int? visitType; + final int visitType; final bool isUpdate; const UpdateOperationReport( - {Key? key, + {Key key, // this.operationReportViewModel, - required this.patient, + this.patient, this.visitType, - required this.isUpdate, - required this.reservation}) + this.isUpdate, + this.reservation}) : super(key: key); @override @@ -53,12 +53,12 @@ class UpdateOperationReport extends StatefulWidget { } class _UpdateOperationReportState extends State { - late int selectedType; + int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; TextEditingController preOpDiagmosisController = TextEditingController(); TextEditingController postOpDiagmosisNoteController = TextEditingController(); @@ -135,7 +135,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( @@ -540,8 +540,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, @@ -590,9 +590,9 @@ class _UpdateOperationReportState extends State { bloodLossDetailController.text, patientID: widget.patient.patientId, admissionNo: - int.parse(widget.patient.admissionNo!), + int.parse(widget.patient.admissionNo), createdBy: model - .doctorProfile!.doctorID!, + .doctorProfile.doctorID, setupID: "010266"); await model .updateOperationReport( 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 c69f3868..e9e4f8b2 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -24,73 +24,73 @@ class PendingOrdersScreen extends StatelessWidget { admissionNo: int.parse(patient.admissionNo)), builder: (BuildContext context, PendingOrdersViewModel model, Widget child) => - AppScaffold( - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), - isShowAppBar: true, - baseViewModel: model, - appBarTitle: "Pending Orders", - body: model.pendingOrdersList == null || + AppScaffold( + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + isShowAppBar: true, + baseViewModel: model, + appBarTitle: "Pending Orders", + body: model.pendingOrdersList == null || model.pendingOrdersList.length == 0 - ? DrAppEmbeddedError( + ? DrAppEmbeddedError( error: TranslationBase.of(context).noDataAvailable) - : Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).pending, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).orders, - fontSize: 25.0, - fontWeight: FontWeight.w700, - ), - ], - ), - ], + : Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).pending, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).orders, + fontSize: 25.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), ), - ), - Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.pendingOrdersList.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.pendingOrdersList.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Color(0xFF707070), width: 0.30), + ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: AppText( + model.pendingOrdersList[index].notes), ), - border: Border.all( - color: Color(0xFF707070), width: 0.30), - ), - child: Padding( - padding: EdgeInsets.all(8.0), - child: AppText( - model.pendingOrdersList[index].notes), ), - ), - ); - })), - ], - ), - ), + ); + })), + ], + ), + ), ); } } 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 51d9fae0..ca8be2c0 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 @@ -10,15 +10,17 @@ import 'package:flutter/material.dart'; class InpatientPrescriptionDetailsScreen extends StatefulWidget { @override - _InpatientPrescriptionDetailsScreenState createState() => _InpatientPrescriptionDetailsScreenState(); + _InpatientPrescriptionDetailsScreenState createState() => + _InpatientPrescriptionDetailsScreenState(); } -class _InpatientPrescriptionDetailsScreenState extends State { +class _InpatientPrescriptionDetailsScreenState + extends State { bool _showDetails = false; - String? error; - TextEditingController? answerController; + String error; + TextEditingController answerController; bool _isInit = true; - late PrescriptionReportForInPatient prescription; + PrescriptionReportForInPatient prescription; @override void initState() { @@ -29,7 +31,7 @@ class _InpatientPrescriptionDetailsScreenState extends State diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart index 9808bb97..e4351d91 100644 --- a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -8,23 +8,26 @@ class PatientProfileCardModel { final bool isInPatient; final bool isDisable; final bool isLoading; - final GestureTapCallback? onTap; + final Function 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, this.nameLine2, this.route, this.icon, - {this.isInPatient = false, - this.isDisable = false, - this.isLoading = false, - this.onTap, - this.isDischargedPatient = false, - this.isSelectInpatient = false, - this.isDartIcon = false, - this.dartIcon, + PatientProfileCardModel( + this.nameLine1, + this.nameLine2, + this.route, + this.icon, { + this.isInPatient = false, + this.isDisable = false, + this.isLoading = false, + this.onTap, + this.isDischargedPatient = false, + this.isSelectInpatient = false, + this.isDartIcon = false, + this.dartIcon, this.color, }); } diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 2aa9e669..0c66b493 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -8,7 +8,6 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.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/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; @@ -18,7 +17,6 @@ import 'package:doctor_app_flutter/util/NotificationPermissionUtils.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/patients/profile/patient-profile-header-new-design-app-bar.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -34,8 +32,9 @@ class PatientProfileScreen extends StatefulWidget { _PatientProfileScreenState createState() => _PatientProfileScreenState(); } -class _PatientProfileScreenState extends State with SingleTickerProviderStateMixin { - late PatiantInformtion patient; +class _PatientProfileScreenState extends State + with SingleTickerProviderStateMixin { + PatiantInformtion patient; LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel(); bool isFromSearch = false; @@ -47,16 +46,17 @@ class _PatientProfileScreenState extends State with Single bool isDischargedPatient = false; bool isSearchAndOut = false; bool isCallStarted = false; - late String patientType; - late String arrivalType; - late String from; - late String to; - late TabController _tabController; + String patientType; + String arrivalType; + String from; + String to; + TabController _tabController; int index = 0; int _activeTab = 0; - late StreamController videoCallDurationStreamController; - late Stream videoCallDurationStream; //= (() async*{})(); TODO Elham* + StreamController videoCallDurationStreamController; + Stream videoCallDurationStream = (() async* {})(); + @override void initState() { _tabController = TabController(length: 2, vsync: this); @@ -77,7 +77,7 @@ class _PatientProfileScreenState extends State with Single @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']; @@ -110,7 +110,7 @@ class _PatientProfileScreenState extends State with Single _activeTab = 1; } - late StreamSubscription callTimer; + StreamSubscription callTimer; callConnected() { callTimer = @@ -126,7 +126,7 @@ class _PatientProfileScreenState extends State with Single callDisconnected() { callTimer.cancel(); - videoCallDurationStreamController.sink.add(''); + videoCallDurationStreamController.sink.add(null); setState(() { isCallStarted = false; @@ -140,9 +140,11 @@ class _PatientProfileScreenState extends State with Single onModelReady: (model) async { if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId); - },builder: (_, model, w) => AppScaffold( - baseViewModel: model,isLoading: true, - appBarTitle: TranslationBase.of(context).patientProfile ?? "", + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isLoading: true, + appBarTitle: TranslationBase.of(context).patientProfile, isShowAppBar: false, body: Column( children: [ @@ -150,20 +152,18 @@ class _PatientProfileScreenState extends State with Single children: [ Column( children: [ - PatientProfileAppBar( - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, - videoCallDurationStream: videoCallDurationStream, - isInpatient: isInpatient, - isFromLiveCare: isFromLiveCare, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : isDischargedPatient - ? 240 - : 0, - isDischargedPatient: isDischargedPatient), - ), + PatientProfileHeaderNewDesignAppBar( + patient, arrivalType ?? '0', patientType, + videoCallDurationStream: videoCallDurationStream, + isInpatient: isInpatient, + isFromLiveCare: isFromLiveCare, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, + isDischargedPatient: isDischargedPatient), Container( height: !isSearchAndOut ? isDischargedPatient @@ -190,7 +190,8 @@ class _PatientProfileScreenState extends State with Single isInpatient: isInpatient, from: from, to: to, - isDischargedPatient: isDischargedPatient, + isDischargedPatient: + isDischargedPatient, isFromSearch: isFromSearch, ) : ProfileGridForOther( @@ -213,9 +214,10 @@ class _PatientProfileScreenState extends State with Single ), if ((isInpatient && !isDischargedPatient) ? true - :isFromLiveCare - ? patient.episodeNo != null - : patient.patientStatusType != null && patient.patientStatusType == 43) + : isFromLiveCare + ? patient.episodeNo != null + : patient.patientStatusType != null && + patient.patientStatusType == 43) BaseView( onModelReady: (model) async { model.getDoctorProfile(); @@ -457,7 +459,12 @@ class AvatarWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( decoration: BoxDecoration( - boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)], + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], borderRadius: BorderRadius.all(Radius.circular(35.0)), color: Color(0xffCCCCCC), ), 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 e9451e54..ca304986 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 @@ -12,7 +12,7 @@ class ProfileGridForInPatient extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - final double? height; + final double height; final bool isInpatient; final bool isDischargedPatient; final bool isFromSearch; @@ -20,26 +20,32 @@ class ProfileGridForInPatient extends StatelessWidget { String to; ProfileGridForInPatient( - {Key? key, - required this.patient, - required this.patientType, - required this.arrivalType, + {Key key, + this.patient, + this.patientType, + this.arrivalType, this.height, - required this.isInpatient, - required this.from, - required this.to, - required this.isDischargedPatient, - required this.isFromSearch}) + this.isInpatient, + this.from, + this.to, + this.isDischargedPatient, + this.isFromSearch}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).vital ?? "", TranslationBase.of(context).signs ?? "", - VITAL_SIGN_DETAILS, 'patient/vital_signs.png', + PatientProfileCardModel( + TranslationBase.of(context).vital, + TranslationBase.of(context).signs, + VITAL_SIGN_DETAILS, + 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).lab ?? "", TranslationBase.of(context).result ?? "", - LAB_RESULT, 'patient/lab_results.png', + PatientProfileCardModel( + TranslationBase.of(context).lab, + TranslationBase.of(context).result, + LAB_RESULT, + 'patient/lab_results.png', isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).lab, @@ -47,45 +53,75 @@ class ProfileGridForInPatient extends StatelessWidget { ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).result!, - RADIOLOGY_PATIENT, 'patient/health_summary.png', + PatientProfileCardModel( + TranslationBase.of(context).radiology, + TranslationBase.of(context).result, + RADIOLOGY_PATIENT, + 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).prescription!, - ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', + PatientProfileCardModel( + TranslationBase.of(context).patient, + TranslationBase.of(context).prescription, + ORDER_PRESCRIPTION_NEW, + 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).progress!, TranslationBase.of(context).note!, PROGRESS_NOTE, + PatientProfileCardModel( + TranslationBase.of(context).progress, + TranslationBase.of(context).note, + PROGRESS_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), - PatientProfileCardModel(TranslationBase.of(context).order!, TranslationBase.of(context).sheet!, ORDER_NOTE, + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient), + PatientProfileCardModel( + TranslationBase.of(context).order, + TranslationBase.of(context).sheet, + ORDER_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), - PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, - ORDER_PROCEDURE, 'patient/Order_Procedures.png', + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).procedures, + ORDER_PROCEDURE, + 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, + PatientProfileCardModel( + TranslationBase.of(context).health, + TranslationBase.of(context).summary, + HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).medical!, TranslationBase.of(context).report!, - PATIENT_MEDICAL_REPORT, 'patient/health_summary.png', - isInPatient: isInpatient, isDisable: false), PatientProfileCardModel( - TranslationBase.of(context).referral!, - TranslationBase.of(context).patient!, + TranslationBase.of(context).medical, + TranslationBase.of(context).report, + PATIENT_MEDICAL_REPORT, + 'patient/health_summary.png', + isInPatient: isInpatient, + isDisable: false), + PatientProfileCardModel( + TranslationBase.of(context).referral, + TranslationBase.of(context).patient, REFER_IN_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', isInPatient: isInpatient, isDisable: isDischargedPatient || isFromSearch, ), - PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).approvals!, - PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', + PatientProfileCardModel( + TranslationBase.of(context).insurance, + TranslationBase.of(context).approvals, + PATIENT_INSURANCE_APPROVALS_NEW, + 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).discharge!, TranslationBase.of(context).report!, DISCHARGE_SUMMARY, + PatientProfileCardModel( + TranslationBase.of(context).discharge, + TranslationBase.of(context).report, + DISCHARGE_SUMMARY, 'patient/patient_sick_leave.png', - isInPatient: isInpatient, ) + isInPatient: isInpatient,) , PatientProfileCardModel( - TranslationBase.of(context).patientSick!, - TranslationBase.of(context).leave!, + TranslationBase.of(context).patientSick, + TranslationBase.of(context).leave, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', 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 7045f6c7..a374898c 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 @@ -12,31 +12,32 @@ class ProfileGridForOther extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - final double? height; + final double height; final bool isInpatient; final bool isFromLiveCare; String from; String to; ProfileGridForOther( - {Key? key, - required this.patient, - required this.patientType, - required this.arrivalType, + {Key key, + this.patient, + this.patientType, + this.arrivalType, this.height, - required this.isInpatient, - required this.from, - required this.to, - required this.isFromLiveCare}) + this.isInpatient, + this.from, + this.to, + this.isFromLiveCare}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, + 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png', + TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', @@ -47,21 +48,22 @@ class ProfileGridForOther extends StatelessWidget { PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, + PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!, + PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, + 'patient/patient_sick_leave.png', isInPatient: isInpatient), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!, + PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'patient/ucaf.png', isInPatient: isInpatient, isDisable: isFromLiveCare @@ -69,8 +71,8 @@ class ProfileGridForOther extends StatelessWidget { : patient.patientStatusType != 43 || patient.appointmentNo == null), 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, 'patient/refer_patient.png', isInPatient: isInpatient, @@ -79,7 +81,7 @@ class ProfileGridForOther extends StatelessWidget { : patient.patientStatusType != 43 || patient.appointmentNo == null, ), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!, + PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', isInPatient: isInpatient, isDisable: isFromLiveCare 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 47097c43..5bcc398d 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 @@ -11,29 +11,23 @@ class ProfileGridForSearch extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - final double? height; + final double height; final bool isInpatient; String from; String to; ProfileGridForSearch( - {Key? key, - required this.patient, - required this.patientType, - required this.arrivalType, - this.height, - required this.isInpatient, - required this.from, - required this.to}) + {Key key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient, this.from, this.to}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, + 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png', + TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', @@ -44,29 +38,30 @@ class ProfileGridForSearch extends StatelessWidget { PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, + PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!, + PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, + 'patient/patient_sick_leave.png', isInPatient: isInpatient), if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!, + PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'patient/ucaf.png', isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel(TranslationBase.of(context).referral!, TranslationBase.of(context).patient!, + PatientProfileCardModel(TranslationBase.of(context).referral, TranslationBase.of(context).patient, REFER_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!, + PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), ]; diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 779776a4..1e742de9 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -2,9 +2,9 @@ import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_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/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/buttons/secondary_button.dart'; @@ -17,13 +17,12 @@ 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, required this.finalRadiology, required this.patient, this.patientType, this.arrivalType, - this.isInpatient = false}); + {Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false}); @override Widget build(BuildContext context) { @@ -34,9 +33,9 @@ class RadiologyDetailsPage extends StatelessWidget { lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, - appointmentDate: finalRadiology.orderDate!, + appBar: PatientProfileAppBar( + patient, + appointmentDate: finalRadiology.orderDate, doctorName: finalRadiology.doctorName, clinic: finalRadiology.clinicDescription, branch: finalRadiology.projectName, @@ -107,7 +106,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 6714460f..958301fd 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -1,13 +1,13 @@ 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'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.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'; @@ -23,16 +23,16 @@ class RadiologyHomePage extends StatefulWidget { } class _RadiologyHomePageState extends State { - String? patientType; - late PatiantInformtion patient; - late String arrivalType; - late bool isInpatient; - late bool isFromLiveCare; + String patientType; + PatiantInformtion patient; + String arrivalType; + bool isInpatient; + 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,8 +50,10 @@ class _RadiologyHomePageState extends State { isShowAppBar: true, backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, isInpatient:isInpatient,), + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -116,7 +118,7 @@ class _RadiologyHomePageState extends State { settingRoute: 'AddProcedureTabPage'), ); }, - label: TranslationBase.of(context).applyForRadiologyOrder ?? "", + label: TranslationBase.of(context).applyForRadiologyOrder, ), ...List.generate( model.radiologyList.length, @@ -138,9 +140,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( @@ -153,11 +155,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), ), )), @@ -171,7 +173,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 bf883517..e7714074 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, required this.reportData, required this.url}); + RadiologyReportScreen({Key key, this.reportData, this.url}); @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).radiologyReport ?? "", + appBarTitle: TranslationBase.of(context).radiologyReport, body: SingleChildScrollView( child: Column( children: [ @@ -38,9 +38,7 @@ class RadiologyReportScreen extends StatelessWidget { fontSize: 2.5 * SizeConfig.textMultiplier, ), ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.13, - ) + SizedBox(height:MediaQuery.of(context).size.height * 0.13 ,) ], ), ), diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 2ab83a88..251a91fa 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -26,11 +26,13 @@ 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, required this.patientReferralViewModel, required this.myReferralInPatientModel, + {Key key, + this.patientReferralViewModel, + this.myReferralInPatientModel, this.isEdited, this.myReferralInPatientRequestModel}) : super(key: key); @@ -80,39 +82,40 @@ class _AddReplayOnReferralPatientState extends State children: [ AppTextFieldCustom( hintText: 'Reply your responses here', - controller: replayOnReferralController, - maxLines: 35, - minLines: 25, - hasBorder: true, - validationError: replayOnReferralController.text.isEmpty && isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - Positioned( - top: 0, //MediaQuery.of(context).size.height * 0, - right: 15, - child: IconButton( - icon: Icon( - DoctorApp.speechtotext, - color: Colors.black, - size: 35, - ), - onPressed: () { - onVoiceText(); - }, + controller: replayOnReferralController, + maxLines: 35, + minLines: 25, + hasBorder: true, + validationError: replayOnReferralController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, ), - ) - ], - ), - ], + Positioned( + top: 0, + //MediaQuery.of(context).size.height * 0, + right: 15, + child: IconButton( + icon: Icon( + DoctorApp.speechtotext, + color: Colors.black, + size: 35, + ), + onPressed: () { + onVoiceText(); + }, + ), + ) + ], + ), + ], + ), ), ), - ), - ], + ], + ), ), ), - ), - Container( + Container( // height: replayOnReferralController.text.isNotEmpty ? 130 : 70, // margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( diff --git a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart index 5a4eab5f..2a48e079 100644 --- a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart @@ -21,10 +21,12 @@ class ReplySummeryOnReferralPatient extends StatefulWidget { ReplySummeryOnReferralPatient(this.referredPatient, this.doctorReply); @override - _ReplySummeryOnReferralPatientState createState() => _ReplySummeryOnReferralPatientState(this.referredPatient); + _ReplySummeryOnReferralPatientState createState() => + _ReplySummeryOnReferralPatientState(this.referredPatient); } -class _ReplySummeryOnReferralPatientState extends State { +class _ReplySummeryOnReferralPatientState + extends State { final MyReferralPatientModel referredPatient; _ReplySummeryOnReferralPatientState(this.referredPatient); @@ -35,16 +37,19 @@ class _ReplySummeryOnReferralPatientState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).summeryReply!, + appBarTitle: TranslationBase.of(context).summeryReply, body: Container( child: Column( children: [ + Expanded( child: SingleChildScrollView( child: Container( width: double.infinity, - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + margin: + EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric( + horizontal: 16, vertical: 16), decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, @@ -65,7 +70,7 @@ class _ReplySummeryOnReferralPatientState extends State( 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 c818639a..29697dc1 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( @@ -77,15 +77,15 @@ class _MyReferralInPatientScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ListView.builder( - itemCount:model.myReferralPatients.length, - scrollDirection: Axis.vertical, + ListView.builder( + itemCount: model.myReferralPatients.length, + scrollDirection: Axis.vertical, physics: ScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { return InkWell( - onTap: () { - if (patientType == + onTap: () { + if (patientType == PatientType.OUT_PATIENT) { Navigator.push( context, @@ -95,43 +95,74 @@ class _MyReferralInPatientScreenState extends State { .myReferralPatients[index]), ), ); - } else {Navigator.push( - context, - FadePage( - page: ReferralPatientDetailScreen(model.myReferralPatients[index], model), - ), - ); - } - },child: PatientReferralItemWidget( - referralStatus: model.getReferralStatusNameByCode( - model.myReferralPatients[index].referralStatus!, context), - referralStatusCode: model.myReferralPatients[index].referralStatus, - patientName: model.myReferralPatients[index].patientName, - patientGender: model.myReferralPatients[index].gender, - referredDate: AppDateUtils.getDayMonthYearDateFormatted( - model.myReferralPatients[index].referralDate!), + } else { + Navigator.push( + context, + FadePage( + page: ReferralPatientDetailScreen( + model.myReferralPatients[index], + model), + ), + ); + } + }, + child: PatientReferralItemWidget( + referralStatus: + model.getReferralStatusNameByCode( + model.myReferralPatients[index] + .referralStatus, + context), + referralStatusCode: model + .myReferralPatients[index] + .referralStatus, + patientName: model + .myReferralPatients[index] + .patientName, + patientGender: model + .myReferralPatients[index].gender, + referredDate: AppDateUtils + .getDayMonthYearDateFormatted(model + .myReferralPatients[index] + .referralDate), referredTime: AppDateUtils.getTimeHHMMA( model.myReferralPatients[index] - .referralDate!), - patientID: "${model.myReferralPatients[index].patientID}", - isSameBranch: false, - isReferral: true, - isReferralClinic: true, - referralClinic: "${model.myReferralPatients[index].referringClinicDescription}", - remark: model.myReferralPatients[index].referringDoctorRemarks, - nationality: model.myReferralPatients[index].nationalityName, - nationalityFlag: model.myReferralPatients[index].nationalityFlagURL, - doctorAvatar: model.myReferralPatients[index].doctorImageURL, - referralDoctorName: model.myReferralPatients[index].referringDoctorName, - clinicDescription: model.myReferralPatients[index].referringClinicDescription, - infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), - ), - ); - }) - ], + .referralDate), + patientID: + "${model.myReferralPatients[index].patientID}", + isSameBranch: false, + isReferral: true, + isReferralClinic: true, + referralClinic: + "${model.myReferralPatients[index].referringClinicDescription}", + remark: model.myReferralPatients[index] + .referringDoctorRemarks, + nationality: model + .myReferralPatients[index] + .nationalityName, + nationalityFlag: model + .myReferralPatients[index] + .nationalityFlagURL, + doctorAvatar: model + .myReferralPatients[index] + .doctorImageURL, + referralDoctorName: model + .myReferralPatients[index] + .referringDoctorName, + clinicDescription: model + .myReferralPatients[index] + .referringClinicDescription, + infoIcon: Icon( + FontAwesomeIcons.arrowRight, + size: 25, + color: Colors.black), + ), + ); + }) + ], + ), + ), + ), ), - ), - ),), ], ), ), 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 03488886..fe6fd2db 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -12,12 +12,13 @@ import '../../../../routes.dart'; class MyReferralPatientScreen extends StatelessWidget { @override Widget build(BuildContext context) { + return BaseView( onModelReady: (model) => model.getPendingReferralPatients(), 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,30 +51,49 @@ 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 d87fdc39..de1d5958 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -18,8 +18,9 @@ class PatientReferralScreen extends StatefulWidget { } class _PatientReferralScreen extends State with SingleTickerProviderStateMixin { - late TabController _tabController; - int index = 0; + + TabController _tabController; + int index=0; @override void initState() { @@ -40,11 +41,12 @@ class _PatientReferralScreen extends State with SingleTic _tabController.dispose(); } + @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).patientsreferral!, + appBarTitle: TranslationBase.of(context).patientsreferral, body: Scaffold( extendBodyBehindAppBar: true, // backgroundColor: Colors.white, @@ -55,7 +57,9 @@ class _PatientReferralScreen extends State with SingleTic height: MediaQuery.of(context).size.height * 0.070, decoration: BoxDecoration( border: Border( - bottom: BorderSide(color: Theme.of(context).dividerColor, width: 1), //width: 0.7 + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 1), //width: 0.7 ), color: Colors.white), child: Center( @@ -65,20 +69,24 @@ class _PatientReferralScreen extends State with SingleTic indicatorColor: Colors.transparent, indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), + labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.33, height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), borderRadius: 4, borderWidth: 0), child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + index == 0 + ? Color(0xFFD02127 ) + : Color(0xFFEAEAEA), index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -95,14 +103,17 @@ class _PatientReferralScreen extends State with SingleTic ), Container( width: MediaQuery.of(context).size.width * 0.34, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + index == 1 + ? Color(0xFFD02127 ) + : Color(0xFFEAEAEA), index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -120,13 +131,16 @@ class _PatientReferralScreen extends State with SingleTic Container( width: MediaQuery.of(context).size.width * 0.33, height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + index == 2 + ? Color(0xFFD02127 ) + : Color(0xFFEAEAEA), index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -141,6 +155,7 @@ class _PatientReferralScreen extends State with SingleTic ), ), ), + ], ), ), 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 41514739..41686ead 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,10 +5,10 @@ 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'; +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/buttons/app_buttons_widget.dart'; @@ -31,8 +31,8 @@ class PatientMakeInPatientReferralScreen extends StatefulWidget { class _PatientMakeInPatientReferralScreenState extends State { - late PatiantInformtion patient; - late List referToList; + PatiantInformtion patient; + List referToList; dynamic _referTo; dynamic _selectedBranch; dynamic _selectedClinic; @@ -41,13 +41,13 @@ class _PatientMakeInPatientReferralScreenState final _remarksController = TextEditingController(); final _extController = TextEditingController(); int _activePriority = 1; - late String appointmentDate; + 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 +121,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 = []; + referToList = List(); dynamic sameBranch = { "id": 1, "name": TranslationBase.of(context).sameBranch @@ -144,10 +144,12 @@ class _PatientMakeInPatientReferralScreenState onModelReady: (model) => model.getReferralFrequencyList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient!, + appBarTitle: TranslationBase.of(context).referPatient, isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, isInpatient:isInpatient,), + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), body: SingleChildScrollView( child: Container( child: Column( @@ -183,7 +185,7 @@ class _PatientMakeInPatientReferralScreenState children: [ AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).branch ?? "ssss", + hintText: TranslationBase.of(context).branch, dropDownText: _referTo != null ? _referTo['name'] : null, enabled: false, @@ -520,31 +522,31 @@ class _PatientMakeInPatientReferralScreenState setState(() { if (_referTo == null) { branchError = - TranslationBase.of(context).fieldRequired!; + TranslationBase.of(context).fieldRequired; } else { branchError = null; } if (_selectedBranch == null) { hospitalError = - TranslationBase.of(context).fieldRequired!; + TranslationBase.of(context).fieldRequired; } else { hospitalError = null; } if (_selectedClinic == null) { clinicError = - TranslationBase.of(context).fieldRequired!; + TranslationBase.of(context).fieldRequired; } else { clinicError = null; } if (_selectedDoctor == null) { doctorError = - TranslationBase.of(context).fieldRequired!; + TranslationBase.of(context).fieldRequired; } else { doctorError = null; } if (_selectedFrequency == null) { frequencyError = - TranslationBase.of(context).fieldRequired!; + TranslationBase.of(context).fieldRequired; } else { frequencyError = null; } @@ -591,9 +593,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 014fc8c7..6010a422 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -4,12 +4,12 @@ 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'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.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/buttons/app_buttons_widget.dart'; @@ -27,19 +27,19 @@ class PatientMakeReferralScreen extends StatefulWidget { } class _PatientMakeReferralScreenState extends State { - late PatiantInformtion patient; - late List referToList; + PatiantInformtion patient; + List referToList; dynamic _referTo; dynamic _selectedBranch; dynamic _selectedClinic; dynamic _selectedDoctor; - late DateTime appointmentDate; + 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() { @@ -50,12 +50,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 = []; + referToList = List(); dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch}; dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch}; referToList.add(sameBranch); @@ -67,9 +67,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, - patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), + appBar: PatientProfileAppBar(patient), body: SingleChildScrollView( child: Container( child: Column( @@ -106,18 +106,18 @@ class _PatientMakeReferralScreenState extends State { 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, + model.patientReferral[model.patientReferral.length - 1].patientDetails.gender, referredDate: - model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[0], + model.patientReferral[model.patientReferral.length - 1].referredOn.split(" ")[0], referredTime: - model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[1], + 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, + 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: @@ -140,22 +140,22 @@ class _PatientMakeReferralScreenState extends State { eventAction: "Submit Refer", ); 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; } @@ -374,11 +374,10 @@ 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); }, @@ -401,7 +400,7 @@ 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)), 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 c9c037e2..cfc26eee 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 @@ -21,6 +21,7 @@ import 'AddReplayOnReferralPatient.dart'; class ReferralPatientDetailScreen extends StatelessWidget { final MyReferralPatientModel referredPatient; final PatientReferralViewModel patientReferralViewModel; + ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel); @override @@ -138,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, @@ -150,7 +151,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.getDayMonthYearDateFormatted( - referredPatient.referralDate!, + referredPatient.referralDate, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -183,7 +184,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.getTimeHHMMA( - referredPatient.referralDate!, + referredPatient.referralDate, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -221,28 +222,29 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), ], ), - 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?? '', + if (referredPatient.frequency != null) + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).frequency + ": ", fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + 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), + ), + ), + ], + ), ], ), ), @@ -260,11 +262,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'); }, )) @@ -279,46 +281,49 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority! + ": ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.5 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - referredPatient.priorityDescription?? '', + TranslationBase.of(context).priority + ": ", fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.5 * SizeConfig.textMultiplier, + color: Color(0XFF575757), ), - ), - ], - ),if (referredPatient.mAXResponseTime != null) - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).maxResponseTime! + ": ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.5 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText(referredPatient.mAXResponseTime != null - ? AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime!, "dd MMM,yyyy"): '', + Expanded( + child: AppText( + referredPatient.priorityDescription ?? '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + if (referredPatient.mAXResponseTime != null) + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).maxResponseTime + ": ", fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.5 * SizeConfig.textMultiplier, + color: Color(0XFF575757), ), - ), - ], - ), + Expanded( + child: AppText( + referredPatient.mAXResponseTime != null + ? AppDateUtils.convertDateFromServerFormat( + referredPatient.mAXResponseTime, "dd MMM,yyyy") + : '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -337,11 +342,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(''); }, )) @@ -431,7 +436,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), @@ -495,7 +500,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 246ab11d..354ee04f 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( @@ -47,7 +47,8 @@ class _ReferredPatientScreenState extends State { }, ), ), - model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 + model.listMyReferredPatientModel == null || + model.listMyReferredPatientModel.length == 0 ? Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -80,38 +81,67 @@ class _ReferredPatientScreenState extends State { shrinkWrap: true, itemBuilder: (context, index) { return InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: ReferredPatientDetailScreen(model.getReferredPatientItem(index), + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferredPatientDetailScreen( + model.getReferredPatientItem(index), this.patientType), - ), - ); - }, - child: PatientReferralItemWidget( - referralStatus: model.getReferredPatientItem(index).referralStatusDesc, - referralStatusCode: model.getReferredPatientItem(index).referralStatus, - patientName: - "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", - patientGender: model.getReferredPatientItem(index).gender, - referredDate: AppDateUtils.convertDateFromServerFormat( - model.getReferredPatientItem(index).referralDate!, "dd/MM/yyyy"), - referredTime: AppDateUtils.convertDateFromServerFormat( - model.getReferredPatientItem(index).referralDate!, "hh:mm a"), - patientID: "${model.getReferredPatientItem(index).patientID}", - isSameBranch: model.getReferredPatientItem(index).isReferralDoctorSameBranch, - isReferral: false, - remark: model.getReferredPatientItem(index).referringDoctorRemarks, - nationality: model.getReferredPatientItem(index).nationalityName, - nationalityFlag: model.getReferredPatientItem(index).nationalityFlagURL, - doctorAvatar: model.getReferredPatientItem(index).doctorImageURL, - referralDoctorName: - "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", - clinicDescription: model.getReferredPatientItem(index).referralClinicDescription, - infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), - ), - ); + ), + ); + }, + child: PatientReferralItemWidget( + referralStatus: model + .getReferredPatientItem(index) + .referralStatusDesc, + referralStatusCode: model + .getReferredPatientItem(index) + .referralStatus, + patientName: + "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", + patientGender: model + .getReferredPatientItem(index) + .gender, + referredDate: AppDateUtils + .convertDateFromServerFormat( + model + .getReferredPatientItem(index) + .referralDate, + "dd/MM/yyyy"), + referredTime: AppDateUtils + .convertDateFromServerFormat( + model + .getReferredPatientItem(index) + .referralDate, + "hh:mm a"), + patientID: + "${model.getReferredPatientItem(index).patientID}", + isSameBranch: model + .getReferredPatientItem(index) + .isReferralDoctorSameBranch, + isReferral: false, + remark: model + .getReferredPatientItem(index) + .referringDoctorRemarks, + nationality: model + .getReferredPatientItem(index) + .nationalityName, + nationalityFlag: model + .getReferredPatientItem(index) + .nationalityFlagURL, + doctorAvatar: model + .getReferredPatientItem(index) + .doctorImageURL, + referralDoctorName: + "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", + clinicDescription: model + .getReferredPatientItem(index) + .referralClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), + ), + ); }, ), ], @@ -132,7 +162,8 @@ class PatientTypeRadioWidget extends StatefulWidget { PatientTypeRadioWidget(this.radioOnChange); @override - _PatientTypeRadioWidgetState createState() => _PatientTypeRadioWidgetState(this.radioOnChange); + _PatientTypeRadioWidgetState createState() => + _PatientTypeRadioWidgetState(this.radioOnChange); } class _PatientTypeRadioWidgetState extends State { @@ -151,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); }); }, @@ -164,9 +195,9 @@ 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!; + 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 c292497f..f6d3b8d7 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 @@ -52,7 +52,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - (Helpers.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")), + (Helpers.capitalize( + "${referredPatient.firstName} ${referredPatient.lastName}")), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -69,15 +70,19 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = model.getPatientFromReferral(referredPatient); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = + model.getPatientFromReferral(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": patientType == PatientType.IN_PATIENT, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -92,15 +97,19 @@ class ReferredPatientDetailScreen extends StatelessWidget { children: [ InkWell( onTap: () { - PatiantInformtion patient = model.getPatientFromReferral(referredPatient); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = + model.getPatientFromReferral(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": patientType == PatientType.IN_PATIENT, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), }); }, child: Column( @@ -137,7 +146,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ AppText( referredPatient.referralStatusDesc, @@ -152,7 +162,8 @@ 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, @@ -161,16 +172,20 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).fileNumber, + TranslationBase.of(context) + .fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: + 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( @@ -184,7 +199,8 @@ 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, @@ -193,25 +209,29 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.referralClinicDescription, + referredPatient + .referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 13, @@ -220,52 +240,66 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ], ), - if(referredPatient - .frequencyDescription != null) - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).frequency ?? "" + ": ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - referredPatient.frequencyDescription, + if (referredPatient + .frequencyDescription != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .frequency + + ": ", fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 14, - color: Color(0XFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.7 * + SizeConfig.textMultiplier, + color: Color(0XFF575757), ), - ), - ], - ), + Expanded( + child: AppText( + referredPatient + .frequencyDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 14, + color: Color(0XFF2E303A), + ), + ), + ], + ), ], ), ), Row( children: [ AppText( - referredPatient.nationalityName != null + referredPatient.nationalityName != + null ? referredPatient.nationalityName : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: 1.4 * SizeConfig.textMultiplier, + fontSize: + 1.4 * SizeConfig.textMultiplier, ), - referredPatient.nationalityFlagURL != null + referredPatient.nationalityFlagURL != + null ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), + borderRadius: + BorderRadius.circular(20.0), child: Image.network( - referredPatient.nationalityFlagURL ?? "", + referredPatient + .nationalityFlagURL, height: 25, width: 30, - errorBuilder: - (BuildContext context, Object exception, StackTrace? stackTrace) { + errorBuilder: (BuildContext + context, + Object exception, + StackTrace stackTrace) { return Text('No Image'); }, )) @@ -281,50 +315,64 @@ class ReferredPatientDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority ?? "" + ": ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - AppText( - referredPatient.priorityDescription, - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 14, - color: Color(0XFF2E303A), - ), - ], - ), - if(referredPatient.mAXResponseTime != null) - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).maxResponseTime ?? "" + ": ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - referredPatient.mAXResponseTime != null?AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime ?? "", "dd MMM,yyyy"):'', + TranslationBase.of(context).priority + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: + 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + referredPatient.priorityDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 14, color: Color(0XFF2E303A), ), - ), - ], - ), + ], + ), + if (referredPatient.mAXResponseTime != null) + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .maxResponseTime + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: + 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.mAXResponseTime != + null + ? AppDateUtils + .convertDateFromServerFormat( + referredPatient + .mAXResponseTime, + "dd MMM,yyyy") + : '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 10, right: 0), + margin: + EdgeInsets.only(left: 10, right: 0), child: Image.asset( 'assets/images/patient/ic_ref_arrow_left.png', height: 50, @@ -332,17 +380,26 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), - padding: EdgeInsets.only(left: 4.0, right: 4.0), - child: referredPatient.doctorImageURL != null + margin: EdgeInsets.only( + left: 0, + top: 25, + right: 0, + bottom: 0), + padding: EdgeInsets.only( + left: 4.0, right: 4.0), + child: referredPatient.doctorImageURL != + null ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), + 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'); }, )) @@ -358,22 +415,30 @@ class ReferredPatientDetailScreen extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0), + margin: EdgeInsets.only( + left: 10, + top: 30, + right: 10, + bottom: 0), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: 1.5 * + SizeConfig.textMultiplier, color: Colors.black, ), AppText( - referredPatient.referralClinicDescription, + referredPatient + .referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * SizeConfig.textMultiplier, + fontSize: 1.3 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -430,16 +495,19 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 0, top: 0, right: 4, bottom: 0), + margin: EdgeInsets.only( + left: 0, top: 0, right: 4, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: referredPatient.doctorImageURL != null ? 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'); }, )) @@ -464,8 +532,11 @@ class ReferredPatientDetailScreen extends StatelessWidget { color: Color(0XFF2E303A), ), AppText( - referredPatient - .referredDoctorRemarks == null ?'':referredPatient.referredDoctorRemarks!.isNotEmpty + referredPatient.referredDoctorRemarks == + null + ? '' + : referredPatient.referredDoctorRemarks + .isNotEmpty ? referredPatient .referredDoctorRemarks : TranslationBase.of(context) @@ -485,28 +556,34 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ), ), - if (patientType == PatientType.IN_PATIENT)Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: AppButton( - title: TranslationBase.of(context).acknowledged, - color: Colors.red[700], - fontColor: Colors.white, - fontWeight: FontWeight.w700, - fontSize: 1.8, - hPadding: 8, - vPadding: 12, - disabled: referredPatient.referredDoctorRemarks == null? true: referredPatient.referredDoctorRemarks!.isNotEmpty ? false : true, - onPressed: () async { - await model.verifyReferralDoctorRemarks(referredPatient); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } else { - DrAppToastMsg.showSuccesToast("Referral is acknowledged"); - Navigator.pop(context); - } - }, + if (patientType == PatientType.IN_PATIENT) + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: AppButton( + title: TranslationBase.of(context).acknowledged, + color: Colors.red[700], + fontColor: Colors.white, + fontWeight: FontWeight.w700, + fontSize: 1.8, + hPadding: 8, + vPadding: 12, + disabled: referredPatient.referredDoctorRemarks == null + ? true + : referredPatient.referredDoctorRemarks.isNotEmpty + ? false + : true, + onPressed: () async { + await model.verifyReferralDoctorRemarks(referredPatient); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast( + "Referral is acknowledged"); + Navigator.pop(context); + } + }, + ), ), - ), ], ), ), 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 17b8740c..53447743 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 @@ -34,12 +34,12 @@ class AddAssessmentDetails extends StatefulWidget { final bool isUpdate; AddAssessmentDetails( - {Key? key, - required this.mySelectedAssessment, - required this.addSelectedAssessment, - required this.patientInfo, + {Key key, + this.mySelectedAssessment, + this.addSelectedAssessment, + this.patientInfo, this.isUpdate = false, - required this.mySelectedAssessmentList}); + this.mySelectedAssessmentList}); @override _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); @@ -60,37 +60,48 @@ 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, @@ -124,77 +135,113 @@ class _AddAssessmentDetailsState extends State { FractionallySizedBox( widthFactor: 0.9, child: Container( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 16, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - // height: 55.0, - height: Helpers.getTextFieldHeight(),hintText: TranslationBase.of(context).appointmentNumber, - isTextFieldHasSuffix: false, - enabled: false, - controller: appointmentIdController, - ), - ), - SizedBox( - height: 10, - ), - Container( - child: InkWell( - onTap: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment.selectedICD = null; - icdNameController.text = null!; - }); - } - : null, - child: widget.mySelectedAssessment.selectedICD == null - ? CustomAutoCompleteTextField( - 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( - onPressed: () {}, - icon: Icon( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + // height: 55.0, + height: Helpers.getTextFieldHeight(), + + hintText: + TranslationBase.of(context).appointmentNumber, + isTextFieldHasSuffix: false, + enabled: false, + controller: appointmentIdController, + ), + ), + SizedBox( + height: 10, + ), + Container( + child: InkWell( + onTap: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment + .selectedICD = null; + icdNameController.text = null; + }); + } + : 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(), + 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, )), - )),), + )), + ), if(widget.mySelectedAssessment .selectedICD != null) @@ -220,103 +267,132 @@ class _AddAssessmentDetailsState extends State { ), ), ], - ), - 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, - hintText: TranslationBase.of(context).condition, - maxLines: 1, - minLines: 1, - controller: conditionController, - isTextFieldHasSuffix: true, - enabled: false, - hasBorder: true, - validationError: - isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null + ), + 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, + hintText: TranslationBase.of(context).condition, + maxLines: 1, + minLines: 1, + controller: conditionController, + isTextFieldHasSuffix: true, + enabled: false, + hasBorder: true, + validationError: isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisCondition == + null ? TranslationBase.of(context).emptyMessage : null, - ), - SizedBox( - 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, - hintText: TranslationBase.of(context).dType, - maxLines: 1, - minLines: 1, - enabled: false, - isTextFieldHasSuffix: true, - controller: typeController, - hasBorder: true, - validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).remarks, - maxLines: 18, - minLines: 5, - inputType: TextInputType.multiline, - controller: remarkController, - onChanged: (value) { - widget.mySelectedAssessment.remark = remarkController.text; - }, - ), - ), - SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?20:SizeConfig.isHeightShort?15:10), + ), + SizedBox( + 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, + hintText: TranslationBase.of(context).dType, + maxLines: 1, + minLines: 1, + enabled: false, + isTextFieldHasSuffix: true, + controller: typeController, + hasBorder: true, + validationError: isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisType == + null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).remarks, + maxLines: 18, + minLines: 5, + inputType: TextInputType.multiline, + controller: remarkController, + onChanged: (value) { + widget.mySelectedAssessment.remark = + remarkController.text; + }, + ), + ), + SizedBox( + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?20:SizeConfig.isHeightShort?15:10), + + ), ])), ), ], @@ -326,23 +402,31 @@ class _AddAssessmentDetailsState extends State { bottomSheet: model.state == ViewState.Busy?Container(height: 0,): BottomSheetDialogButton( - 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.selectedICD != null) { - await submitAssessment( - isUpdate: widget.isUpdate, - model: model, - mySelectedAssessment: widget.mySelectedAssessment); - } - }, - + 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.selectedICD != null) { + await submitAssessment( + isUpdate: widget.isUpdate, + model: model, + mySelectedAssessment: + widget.mySelectedAssessment); + } + }, ), ), ), @@ -350,7 +434,9 @@ class _AddAssessmentDetailsState extends State { } submitAssessment( - {required SOAPViewModel model, required MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { + {SOAPViewModel model, + MySelectedAssessment mySelectedAssessment, + bool isUpdate = false}) async { GifLoaderDialogUtils.showMyDialog(context); if (isUpdate) { PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( @@ -359,24 +445,25 @@ 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); @@ -389,7 +476,7 @@ 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); 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 f42289f9..80cdc34c 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,12 +30,13 @@ class UpdateAssessmentPage extends StatefulWidget { final PatiantInformtion patientInfo; final Function changeLoadingState; final int currentIndex; + UpdateAssessmentPage( - {Key? key, - required this.changePageViewIndex, - required this.patientInfo, - required this.changeLoadingState, - required this.currentIndex}); + {Key key, + this.changePageViewIndex, + this.patientInfo, + this.changeLoadingState, + this.currentIndex}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -44,7 +45,7 @@ class UpdateAssessmentPage extends StatefulWidget { class _UpdateAssessmentPageState extends State implements AssessmentCallBack { bool isAssessmentExpand = false; - List mySelectedAssessmentList = []; + List mySelectedAssessmentList = List(); @override Widget build(BuildContext context) { @@ -59,30 +60,33 @@ class _UpdateAssessmentPageState extends State 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); } @@ -477,9 +481,10 @@ class _UpdateAssessmentPageState extends State } openAssessmentDialog(BuildContext context, - {MySelectedAssessment? assessment, required bool isUpdate, required SOAPViewModel model}) { + {MySelectedAssessment assessment, bool isUpdate, 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, @@ -487,11 +492,12 @@ 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 3f55b8f4..42b94656 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,7 +18,9 @@ class AddExaminationPage extends StatefulWidget { final Function(MasterKeyModel) removeExamination; AddExaminationPage( - {required this.mySelectedExamination, required this.addSelectedExamination, required this.removeExamination}); + {this.mySelectedExamination, + this.addSelectedExamination, + this.removeExamination}); @override _AddExaminationPageState createState() => _AddExaminationPageState(); @@ -50,10 +52,9 @@ class _AddExaminationPageState extends State { backgroundColor: Color.fromRGBO(248, 248, 248, 1), body: Column( mainAxisAlignment: MainAxisAlignment.start, - - children: [ - Expanded( - child: SingleChildScrollView( + children: [ + Expanded( + child: SingleChildScrollView( child: Column( children: [ Container( @@ -72,8 +73,10 @@ class _AddExaminationPageState extends State { children: [ ExaminationsListSearchWidget( mySelectedExamination: - widget.mySelectedExamination,masterList: model.physicalExaminationList, - isServiceSelected: (master) => isServiceSelected(master), + widget.mySelectedExamination, + masterList: model.physicalExaminationList, + isServiceSelected: (master) => + isServiceSelected(master), removeExamination: (selectedExamination) { setState(() { mySelectedExaminationLocal.remove(selectedExamination); @@ -81,7 +84,8 @@ class _AddExaminationPageState extends State { }, addExamination: (selectedExamination) { - mySelectedExaminationLocal.insert(0, selectedExamination); + mySelectedExaminationLocal + .insert(0, selectedExamination); // setState(() {}); }, ), @@ -100,7 +104,7 @@ class _AddExaminationPageState extends State { ) : BottomSheetDialogButton( label: "${TranslationBase.of(context).addExamination}", - onTap: () { + onTap: () { widget.addSelectedExamination(mySelectedExaminationLocal); }, ), @@ -108,8 +112,10 @@ class _AddExaminationPageState extends State { } 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/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index e6df38e7..c9202e52 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -8,7 +8,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_html/shims/dart_ui.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -19,16 +18,16 @@ class AddExaminationWidget extends StatefulWidget { final Function(MySelectedExamination) addExamination; final bool Function(MasterKeyModel) isServiceSelected; bool isExpand; - final VoidCallback expandClick; + final Function expandClick; final List mySelectedExamination; AddExaminationWidget({ - required this.item, - required this.removeExamination, - required this.addExamination, - required this.isServiceSelected, - required this.isExpand, - required this.expandClick, + this.item, + this.removeExamination, + this.addExamination, + this.isServiceSelected, + this.isExpand, + this.expandClick, this.mySelectedExamination, }); @@ -98,7 +97,9 @@ class _AddExaminationWidgetState extends State { margin: EdgeInsets.symmetric(horizontal: 8), child: InkWell( onTap: widget.expandClick, - child: Icon(widget.isExpand ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), + child: Icon(widget.isExpand + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down)), ), ], ), @@ -142,7 +143,9 @@ class _AddExaminationWidgetState extends State { ), child: Container( decoration: BoxDecoration( - color: status == 1 ? HexColor("#D02127") : Colors.white, + color: status == 1 + ? HexColor("#D02127") + : Colors.white, shape: BoxShape.circle, ), ), @@ -180,7 +183,9 @@ class _AddExaminationWidgetState extends State { ), child: Container( decoration: BoxDecoration( - color: status == 2 ? HexColor("#D02127") : Colors.white, + color: status == 2 + ? HexColor("#D02127") + : Colors.white, shape: BoxShape.circle, ), ), @@ -206,23 +211,26 @@ class _AddExaminationWidgetState extends State { examination.notExamined = true; }, child: Row( - children: [Container( - padding: EdgeInsets.all(2.0), - margin: EdgeInsets.symmetric(horizontal: 6), - width: 20, - height: 20, - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.circle, - border: Border.all(color: Colors.grey, width: 1), - ), - child: Container( + children: [ + Container( + padding: EdgeInsets.all(2.0), + margin: EdgeInsets.symmetric(horizontal: 6), + width: 20, + height: 20, decoration: BoxDecoration( - color: status == 3 ? HexColor("#D02127") : Colors.white, + color: Colors.white, shape: BoxShape.circle, + border: Border.all(color: Colors.grey, width: 1), + ), + child: Container( + decoration: BoxDecoration( + color: status == 3 + ? HexColor("#D02127") + : Colors.white, + shape: BoxShape.circle, + ), ), ), - ), Expanded( child: AppText( TranslationBase.of(context).notExamined, 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 7ad9dedd..9dd00302 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 @@ -10,7 +10,7 @@ import 'package:provider/provider.dart'; class ExaminationItemCard extends StatelessWidget { final MySelectedExamination examination; - final VoidCallback removeExamination; + final Function removeExamination; ExaminationItemCard(this.examination, this.removeExamination); @@ -31,10 +31,11 @@ class ExaminationItemCard extends StatelessWidget { child: Container( child: AppText( projectViewModel.isArabic - ? examination.selectedExamination!.nameAr != null && examination.selectedExamination!.nameAr != "" - ? examination.selectedExamination!.nameAr - : examination.selectedExamination!.nameEn - : examination.selectedExamination!.nameEn, + ? examination.selectedExamination.nameAr != null && + examination.selectedExamination.nameAr != "" + ? examination.selectedExamination.nameAr + : examination.selectedExamination.nameEn + : examination.selectedExamination.nameEn, fontWeight: FontWeight.w600, fontFamily: 'Poppins', color: Color(0xFF2B353E), @@ -47,15 +48,15 @@ class ExaminationItemCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - !examination.isNormal! - ? examination.isAbnormal! + !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! + color: !examination.isNormal + ? examination.isAbnormal ? Colors.red.shade800 : Colors.grey.shade800 : Colors.green.shade800, diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index c89b30d3..c041b545 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -16,18 +16,20 @@ class ExaminationsListSearchWidget extends StatefulWidget { final List mySelectedExamination; ExaminationsListSearchWidget( - {required this.removeExamination, - required this.addExamination, - required this.isServiceSelected, - required this.masterList, this.mySelectedExamination}); + {this.removeExamination, + this.addExamination, + this.isServiceSelected, + this.masterList, this.mySelectedExamination}); @override - _ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState(); + _ExaminationsListSearchWidgetState createState() => + _ExaminationsListSearchWidgetState(); } -class _ExaminationsListSearchWidgetState extends State { +class _ExaminationsListSearchWidgetState + extends State { int expandedIndex = -1; - List items = []; + List items = List(); TextEditingController filteredSearchController = TextEditingController(); @override @@ -51,11 +53,10 @@ class _ExaminationsListSearchWidgetState extends State dummySearchList = []; + List dummySearchList = List(); dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); 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/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 99891220..9712eafd 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 @@ -31,11 +31,11 @@ class UpdateObjectivePage extends StatefulWidget { final PatiantInformtion patientInfo; UpdateObjectivePage( - {Key? key, - required this.changePageViewIndex, - required this.patientInfo, - required this.changeLoadingState, - required this.currentIndex}); + {Key key, + this.changePageViewIndex, + this.patientInfo, + this.changeLoadingState, + this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); @@ -44,9 +44,10 @@ class UpdateObjectivePage extends StatefulWidget { class _UpdateObjectivePageState extends State implements ObjectiveCallBack { bool isSysExaminationExpand = false; - List mySelectedExamination = []; + List mySelectedExamination = List(); - BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -294,7 +295,8 @@ class _UpdateObjectivePageState extends State removeExamination(MasterKeyModel masterKey) { Iterable history = mySelectedExamination.where( (element) => - masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId); + masterKey.id == element.selectedExamination.id && + masterKey.typeId == element.selectedExamination.typeId); if (history.length > 0) { setState(() { 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 f2f67f8c..37a6096e 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 @@ -31,12 +31,12 @@ class UpdatePlanPage extends StatefulWidget { final int currentIndex; UpdatePlanPage( - {Key? key, - required this.changePageViewIndex, - required this.patientInfo, - required this.changeLoadingState, - required this.currentIndex, - required this.sOAPViewModel, + {Key key, + this.changePageViewIndex, + this.patientInfo, + this.changeLoadingState, + this.currentIndex, + this.sOAPViewModel, this.changeStateFun}); @override @@ -50,9 +50,11 @@ class _UpdatePlanPageState extends State GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); - TextEditingController progressNoteController = TextEditingController(text: null); + TextEditingController progressNoteController = + TextEditingController(text: null); - BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -115,13 +117,16 @@ class _UpdatePlanPageState extends State Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - widget.sOAPViewModel.setPlanCallBack(this);GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( - appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: ''); - await widget.sOAPViewModel + widget.sOAPViewModel.setPlanCallBack(this); + GetGetProgressNoteReqModel getGetProgressNoteReqModel = + GetGetProgressNoteReqModel( + appointmentNo: + int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel .getPatientProgressNote(getGetProgressNoteReqModel); if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { @@ -356,8 +361,8 @@ class _UpdatePlanPageState extends State episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, planNote: patientProgressNote.planNote, - doctorID: '', - editedBy: ''); + doctorID: '', + editedBy: ''); if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { await widget.sOAPViewModel 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 3816dfa9..6449913c 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,48 +4,52 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class SOAPOpenItems extends StatelessWidget { - final VoidCallback onTap; + final Function onTap; final String label; - const SOAPOpenItems({Key? key, required this.onTap, required this.label}) : super(key: key); + const SOAPOpenItems({Key key, this.onTap, this.label}) : super(key: key); @override Widget build(BuildContext context) { - return InkWell( + return InkWell( onTap: onTap, child: Container( - padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8.0), + padding: EdgeInsets.symmetric( + vertical: 8, horizontal: 8.0), margin: EdgeInsets.symmetric(vertical: 8), decoration: BoxDecoration( - border: Border.all(color: Colors.grey.shade400, width: 0.5), + border: Border.all( + color: Colors.grey.shade400, width: 0.5), borderRadius: BorderRadius.all( Radius.circular(8), ), color: Colors.white, ), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "$label", - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*4.5, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "$label", + fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*4.5, fontWeight: FontWeight.w700, - color: Color(0xFF2E303A), - letterSpacing:-0.44, - ), - AppText( - "${TranslationBase.of(context).searchHere}", - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.5, + color: Color(0xFF2E303A), + letterSpacing:-0.44 , + ), + AppText( + "${TranslationBase.of(context).searchHere}", + fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*3.5, fontWeight: FontWeight.w500, - color: Color(0xFF575757), - letterSpacing:-0.56, - ), - ], - )), + color: Color(0xFF575757), + letterSpacing:-0.56 , + ), + ], + )), Icon( Icons.add_box_rounded, size: 28, @@ -57,3 +61,6 @@ class SOAPOpenItems extends StatelessWidget { ); } } + + + diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index ef92e0db..8d29150e 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -7,9 +7,8 @@ import 'package:flutter/material.dart'; class SOAPStepHeader extends StatelessWidget { const SOAPStepHeader({ - Key? key, - required this.currentIndex, - required this.changePageViewIndex, this.patientInfo, + Key key, + this.currentIndex, this.changePageViewIndex, this.patientInfo, }) : super(key: key); final int currentIndex; @@ -22,9 +21,7 @@ class SOAPStepHeader extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: SizeConfig.isHeightVeryShort?30:SizeConfig.isHeightShort?35: 15, - ), + SizedBox(height: SizeConfig.isHeightVeryShort?30:SizeConfig.isHeightShort?35: 15,), AppText( TranslationBase.of(context).createNew, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 3: 4), @@ -33,8 +30,7 @@ class SOAPStepHeader extends StatelessWidget { color: Color(0xFF2E303A), ), - AppText( - TranslationBase.of(context).episode, + AppText(TranslationBase.of(context).episode, fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 6: 8), fontWeight: FontWeight.bold, letterSpacing:-1.44, 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 c7d48e1c..835dd225 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 f9055e1a..d6c19372 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,7 @@ import 'package:flutter/material.dart'; class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { BottomSheetTitle({ - Key? key, - required this.title, + Key key, this.title, }) : super(key: key); final String title; @@ -13,42 +12,51 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { @override Widget build(BuildContext context) { return Container( - //padding: EdgeInsets.only(// left: 0, right: 5, bottom: 5, top: 5), + // padding: EdgeInsets.only( + // left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), height: headerHeight, child: Center( - child: Container( - padding: EdgeInsets.only(left: 10, right: 10), - margin: EdgeInsets.only(top: headerHeight *0.5), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - style: TextStyle(fontSize: 20, color: Colors.black), - children: [ - new TextSpan( - text: title, - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6)), - ], + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10), + margin: EdgeInsets.only(top: headerHeight *0.5), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize:20, + color: Colors.black), + children: [ + new TextSpan( + + text: title, + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6)), + ], + ), ), - ), - InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Icon(DoctorApp.close_1, size: SizeConfig.getTextMultiplierBasedOnWidth()*5, color: Color(0xFF2B353E))) - ], - ), - ],), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Icon(DoctorApp.close_1, + size:SizeConfig.getTextMultiplierBasedOnWidth()*5, + color: Color(0xFF2B353E))) + ], + ), + ], + ), ), ), ); 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 866900d9..c1b2d443 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,17 +9,12 @@ import 'package:hexcolor/hexcolor.dart'; class ExpandableSOAPWidget extends StatelessWidget { final bool isExpanded; final Widget child; - final VoidCallback onTap; + final Function onTap; final headerTitle; final bool isRequired; const ExpandableSOAPWidget( - {Key? key, - required this.isExpanded, - required this.child, - required this.onTap, - this.headerTitle, - this.isRequired = true}) + {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle, this.isRequired= true}) : super(key: key); @override @@ -31,10 +26,12 @@ class ExpandableSOAPWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: HexColor('#707070'), width: 0.30), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), ), child: HeaderBodyExpandableNotifier( - headerWidget: InkWell( + headerWidget: InkWell( onTap: onTap, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -43,20 +40,24 @@ class ExpandableSOAPWidget extends StatelessWidget { onTap: onTap, child: Row( children: [ - AppText(headerTitle, variant: isExpanded ? "bodyText" : '', fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isHeightVeryShort?4.8: SizeConfig.isWidthLarge?4: 5), + AppText(headerTitle, + variant: isExpanded ? "bodyText" : '', + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isHeightVeryShort?4.8: SizeConfig.isWidthLarge?4: 5), letterSpacing:-0.64, - fontWeight: FontWeight.w700, color: Color(0xFF2E303A),), - if (isRequired) - Icon( - FontAwesomeIcons.asterisk, - size: SizeConfig.getTextMultiplierBasedOnWidth()*2.5, - ) + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A),), + if(isRequired) + Icon( + FontAwesomeIcons.asterisk, + size: SizeConfig.getTextMultiplierBasedOnWidth()*2.5, + ) ], ), ), InkWell( onTap: onTap, - child: Icon(isExpanded ? EvaIcons.arrowIosUpwardOutline : EvaIcons.arrowIosDownwardOutline), + child: Icon( + isExpanded ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline), ) ], ), @@ -66,4 +67,4 @@ class ExpandableSOAPWidget extends StatelessWidget { ), ); } -} +} \ No newline at end of file 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 c64fe86a..1e5231c9 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 Function 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/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index 22f92f00..e1c97d75 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -16,7 +16,7 @@ class StepsWidget extends StatelessWidget { final PatiantInformtion patientInfo; StepsWidget( - {Key? key, + {Key key, this.index, this.changeCurrentTab, this.height = 0.0, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index ff5c6e6f..60c43d00 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -19,19 +19,20 @@ class AddAllergies extends StatefulWidget { final Function addAllergiesFun; final List myAllergiesList; - const AddAllergies({Key? key, required this.addAllergiesFun, required this.myAllergiesList}) : super(key: key); + const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) + : super(key: key); @override _AddAllergiesState createState() => _AddAllergiesState(); } class _AddAllergiesState extends State { - late List allergiesList; - late List allergySeverityList; + List allergiesList; + List allergySeverityList; TextEditingController remarkController = TextEditingController(); TextEditingController severityController = TextEditingController(); TextEditingController allergyController = TextEditingController(); - late List myAllergiesListLocal; + List myAllergiesListLocal; @override initState() { @@ -59,7 +60,7 @@ class _AddAllergiesState extends State { baseViewModel: model, isShowAppBar: true, appBar: BottomSheetTitle( - title: TranslationBase.of(context).addAllergies??"", + title: TranslationBase.of(context).addAllergies, ), body: Center( child: Container( @@ -131,10 +132,11 @@ class _AddAllergiesState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable allergy = myAllergiesListLocal.where((element) => - masterKey.id == element.selectedAllergy!.id && - masterKey.typeId == element.selectedAllergy!.typeId && - element.isChecked!); + Iterable allergy = myAllergiesListLocal.where( + (element) => + masterKey.id == element.selectedAllergy.id && + masterKey.typeId == element.selectedAllergy.typeId && + element.isChecked); if (allergy.length > 0) { return true; } @@ -142,14 +144,16 @@ class _AddAllergiesState extends State { } removeAllergyFromLocalList(MasterKeyModel masterKey) { - myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id); + myAllergiesListLocal + .removeWhere((element) => element.selectedAllergy.id == masterKey.id); } - MySelectedAllergy? getSelectedAllergy(MasterKeyModel masterKey) { - Iterable allergy = myAllergiesListLocal.where((element) => - masterKey.id == element.selectedAllergy!.id && - masterKey.typeId == element.selectedAllergy!.typeId && - element.isChecked!); + MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { + Iterable allergy = myAllergiesListLocal.where( + (element) => + masterKey.id == element.selectedAllergy.id && + masterKey.typeId == element.selectedAllergy.typeId && + element.isChecked); if (allergy.length > 0) { return allergy.first; } @@ -164,14 +168,17 @@ class _AddAllergiesState extends State { List allergy = // ignore: missing_return myAllergiesListLocal - .where((element) => mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id) + .where((element) => + mySelectedAllergy.selectedAllergy.id == + element.selectedAllergy.id) .toList(); if (allergy.isEmpty) { myAllergiesListLocal.add(mySelectedAllergy); } else { allergy.first.selectedAllergy = mySelectedAllergy.selectedAllergy; - allergy.first.selectedAllergySeverity = mySelectedAllergy.selectedAllergySeverity; + allergy.first.selectedAllergySeverity = + mySelectedAllergy.selectedAllergySeverity; allergy.first.remark = mySelectedAllergy.remark; allergy.first.isChecked = mySelectedAllergy.isChecked; } diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart index cceab871..130e730d 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart @@ -26,7 +26,7 @@ class AddAllergiesItem extends StatefulWidget { final MasterKeyModel item; const AddAllergiesItem( - {Key? key, + {Key key, this.model, this.removeAllergy, this.addAllergy, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart index 2c13c5b2..8819f04a 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -24,7 +24,7 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { final String hintSearchText; MasterKeyCheckboxSearchAllergiesWidget( - {Key? key, + {Key key, this.model, this.addSelectedAllergy, this.removeAllergy, @@ -43,7 +43,7 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { - List items = []; + List items = List(); TextEditingController filteredSearchController = TextEditingController(); @override @@ -122,10 +122,10 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState } void filterSearchResults(String query) { - List dummySearchList = []; + List dummySearchList = List(); dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); dummySearchList.forEach((items) { if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || items.nameEn.toLowerCase().contains(query.toLowerCase())) { 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 b0902519..c8a519c3 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, required this.myAllergiesList}); + UpdateAllergiesWidget({Key key, this.myAllergiesList}); @override _UpdateAllergiesWidgetState createState() => _UpdateAllergiesWidgetState(); @@ -38,7 +38,6 @@ class _UpdateAllergiesWidgetState extends State { onTap: () { openAllergiesList(context, changeAllState, removeAllergy); }, - ), SizedBox( height: 20, @@ -64,11 +63,14 @@ class _UpdateAllergiesWidgetState extends State { children: [ AppText( projectViewModel.isArabic - ? selectedAllergy.selectedAllergy!.nameAr - : selectedAllergy.selectedAllergy!.nameEn!.toUpperCase(), - textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough, - bold: true, - color: Color(0xFF2B353E), + ? 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, @@ -93,7 +95,7 @@ class _UpdateAllergiesWidgetState extends State { ), width: MediaQuery.of(context).size.width * 0.5, ), - if (selectedAllergy.isChecked!) + if (selectedAllergy.isChecked) RemoveButton( onTap: () => removeAllergy(selectedAllergy), ) @@ -126,9 +128,10 @@ class _UpdateAllergiesWidgetState extends State { // ignore: missing_return widget.myAllergiesList .where((element) => - mySelectedAllergy.selectedAllergySeverity!.id == element.selectedAllergySeverity!.id && - mySelectedAllergy.selectedAllergy!.id == - element.selectedAllergy!.id) + mySelectedAllergy.selectedAllergySeverity.id == + element.selectedAllergySeverity.id && + mySelectedAllergy.selectedAllergy.id == + element.selectedAllergy.id) .toList(); if (allergy.length > 0) { @@ -192,7 +195,8 @@ 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 dd64365e..0e5e6ec1 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, - required this.complaintsControllerError, - required this.illnessControllerError, - required this.medicationControllerError, + Key key, + @required this.formKey, + @required this.complaintsController, + @required this.illnessController, + @required this.medicationController, + this.complaintsControllerError, + this.illnessControllerError, + this.medicationControllerError, }) : super(key: key); final GlobalKey formKey; @@ -41,43 +41,56 @@ class UpdateChiefComplaints extends StatelessWidget { minLines: 7, hasBorder: true, inputType: TextInputType.multiline, - validationError: complaintsControllerError != '' ? complaintsControllerError : null, + validationError: complaintsControllerError != '' + ? complaintsControllerError + : null, ), - SizedBox( + SizedBox( height: 20, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).historyOfPresentIllness, + hintText: TranslationBase + .of(context) + .historyOfPresentIllness, controller: illnessController, inputType: TextInputType.multiline, + maxLines: 25, minLines: 7, hasBorder: true, - validationError: illnessControllerError != '' ? illnessControllerError : null, - ), - SizedBox( - height: 10, - ), - UpdateMedicationWidget( - medicationController: medicationController, - ), - SizedBox( - height: 10, - ), + validationError: illnessControllerError != '' + ? illnessControllerError + : null, + ), + SizedBox( + height: 10, + ), + UpdateMedicationWidget( + medicationController: medicationController, + ), + SizedBox( + height: 10, + ), AppTextFieldCustom( - hintText: TranslationBase.of(context).currentMedications, + hintText: TranslationBase + .of(context) + .currentMedications, controller: medicationController, maxLines: 25, minLines: 7, hasBorder: true, inputType: TextInputType.multiline, - validationError: medicationControllerError != '' ? medicationControllerError : null, - ), - SizedBox( - height: 10, - ), - ]), + + validationError: medicationControllerError != '' + ? medicationControllerError + : null, + + ), + SizedBox( + height: 10, + ), + ]), ); } -} +} \ No newline at end of file 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 cb0598cd..b10d831d 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, - required this.changePageViewIndex, - required this.controller, - required this.myHistoryList, - required this.addSelectedHistories, - required this.removeHistory}) + {Key key, + this.changePageViewIndex, + this.controller, + this.myHistoryList, + this.addSelectedHistories, + this.removeHistory}) : super(key: key); @override @@ -167,7 +167,7 @@ class _AddHistoryDialogState extends State { ) : BottomSheetDialogButton( label: TranslationBase.of(context).addSelectedHistories, - onTap: () { + onTap: () { widget.addSelectedHistories(); }, ), @@ -177,8 +177,9 @@ class _AddHistoryDialogState extends State { 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) { @@ -197,10 +198,11 @@ 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 94919109..305b0c65 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, required this.onTap}) : super(key: key); + const PriorityBar({Key key, this.onTap}) : super(key: key); @override _PriorityBarState createState() => _PriorityBarState(); @@ -28,7 +28,8 @@ class _PriorityBarState extends State { "طبي", ]; - BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { return BoxDecoration(); } @@ -57,11 +58,14 @@ class _PriorityBarState extends State { children: [ Container( height: screenSize.height * 0.070, - decoration: containerBorderDecoration(_isActive ? HexColor("#B8382B") : Colors.white, + decoration: containerBorderDecoration( + _isActive ? HexColor("#B8382B") : Colors.white, _isActive ? HexColor("#B8382B") : Colors.white), child: Center( child: Text( - (projectViewModel.isArabic) ? _prioritiesAr[index] : item, + (projectViewModel.isArabic) + ? _prioritiesAr[index] + : item, textAlign: TextAlign.center, style: TextStyle( fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.5, @@ -71,12 +75,8 @@ class _PriorityBarState extends State { ), ), ), - if (_isActive) - Container( - width: 120, - height: 4, - color: AppGlobal.appPrimaryColor, - ) + if(_isActive) + Container(width: 120,height: 4,color: AppGlobal.appPrimaryColor,) ], ), ), 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 f0512273..e00a83f5 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,14 +14,15 @@ import 'add_history_dialog.dart'; class UpdateHistoryWidget extends StatefulWidget { final List myHistoryList; - const UpdateHistoryWidget({Key? key, required this.myHistoryList}) : super(key: key); + const UpdateHistoryWidget({Key key, this.myHistoryList}) : super(key: key); @override _UpdateHistoryWidgetState createState() => _UpdateHistoryWidgetState(); } -class _UpdateHistoryWidgetState extends State with TickerProviderStateMixin { - late PageController _controller; +class _UpdateHistoryWidgetState extends State + with TickerProviderStateMixin { + PageController _controller; changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); @@ -60,14 +61,16 @@ class _UpdateHistoryWidgetState extends State with TickerPr Container( child: AppText( projectViewModel.isArabic - ? myHistory.selectedHistory!.nameAr - : myHistory.selectedHistory!.nameEn, - - textDecoration: myHistory.isChecked! ? null : TextDecoration.lineThrough, - color: Color(0xFF2B353E), + ? 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,10 +96,11 @@ class _UpdateHistoryWidgetState extends State with TickerPr // ignore: missing_return widget.myHistoryList .where((element) => - historyKey.id == element.selectedHistory!.id && historyKey.typeId == element.selectedHistory!.typeId) + 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/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index d2048a62..72330be3 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -26,25 +26,27 @@ class AddMedication extends StatefulWidget { final Function addMedicationFun; TextEditingController medicationController; - AddMedication({Key? key, required this.addMedicationFun, required this.medicationController}) : super(key: key); + AddMedication({Key key, this.addMedicationFun, this.medicationController}) + : super(key: key); @override _AddMedicationState createState() => _AddMedicationState(); } class _AddMedicationState extends State { - late MasterKeyModel _selectedMedicationDose; - late MasterKeyModel _selectedMedicationStrength; - late MasterKeyModel _selectedMedicationRoute; - late MasterKeyModel _selectedMedicationFrequency; + MasterKeyModel _selectedMedicationDose; + MasterKeyModel _selectedMedicationStrength; + MasterKeyModel _selectedMedicationRoute; + MasterKeyModel _selectedMedicationFrequency; TextEditingController doseController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); - GetMedicationResponseModel? _selectedMedication; + GetMedicationResponseModel _selectedMedication; - GlobalKey key = new GlobalKey>(); + GlobalKey key = + new GlobalKey>(); bool isFormSubmitted = false; @override @@ -207,161 +209,210 @@ class _AddMedicationState extends State { _selectedMedicationDose = selectedValue; - doseController.text = projectViewModel.isArabic - ? _selectedMedicationDose.nameAr! - : _selectedMedicationDose.nameEn!; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).doseTime, - maxLines: 1, - minLines: 1, - isTextFieldHasSuffix: true, - controller: doseController, - validationError: isFormSubmitted && _selectedMedicationDose == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom(height: Helpers.getTextFieldHeight(), - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationStrengthList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationStrengthList, - okText: TranslationBase.of(context).ok,selectedValue: + doseController + .text = projectViewModel + .isArabic + ? _selectedMedicationDose + .nameAr + : _selectedMedicationDose + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).doseTime, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + controller: doseController, + validationError: isFormSubmitted && + _selectedMedicationDose == null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationStrengthList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: + model.medicationStrengthList, + okText: + TranslationBase.of(context) + .ok, + selectedValue: _selectedMedicationStrength, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationStrength = selectedValue; + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrength = + selectedValue; - strengthController.text = projectViewModel.isArabic - ? _selectedMedicationStrength.nameAr! - : _selectedMedicationStrength.nameEn!; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).strength, - maxLines: 1, - minLines: 1, - controller: strengthController, - validationError: isFormSubmitted && _selectedMedicationStrength == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom(height: Helpers.getTextFieldHeight(), - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationRouteList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationRouteList, - selectedValue: - _selectedMedicationRoute,okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationRoute = selectedValue; + strengthController + .text = projectViewModel + .isArabic + ? _selectedMedicationStrength + .nameAr + : _selectedMedicationStrength + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).strength, + maxLines: 1, + minLines: 1, + controller: strengthController, + validationError: isFormSubmitted && + _selectedMedicationStrength == null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationRouteList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationRouteList, + selectedValue: + _selectedMedicationRoute, + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationRoute = + selectedValue; - routeController.text = projectViewModel.isArabic - ? _selectedMedicationRoute.nameAr! - : _selectedMedicationRoute.nameEn!; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).route, - maxLines: 1, - minLines: 1, - controller: routeController, - validationError: isFormSubmitted && _selectedMedicationRoute == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom(height: Helpers.getTextFieldHeight(), - onClick: model.medicationFrequencyList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationFrequencyList, - okText: TranslationBase.of(context).ok,selectedValue: + routeController + .text = projectViewModel + .isArabic + ? _selectedMedicationRoute + .nameAr + : _selectedMedicationRoute + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).route, + maxLines: 1, + minLines: 1, + controller: routeController, + validationError: isFormSubmitted && + _selectedMedicationRoute == null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + onClick: model.medicationFrequencyList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: + model.medicationFrequencyList, + okText: + TranslationBase.of(context) + .ok, + selectedValue: _selectedMedicationFrequency, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationFrequency = selectedValue; + okFunction: (selectedValue) { + setState(() { + _selectedMedicationFrequency = + selectedValue; - frequencyController.text = projectViewModel.isArabic - ? _selectedMedicationFrequency.nameAr! - : _selectedMedicationFrequency.nameEn!; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).frequency, - enabled: false, - maxLines: 1, - minLines: 1, - isTextFieldHasSuffix: true, - controller: frequencyController, - validationError: isFormSubmitted && _selectedMedicationFrequency == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort - ? 20 - : SizeConfig.isHeightShort - ? 15 - : 10), - ), + frequencyController + .text = projectViewModel + .isArabic + ? _selectedMedicationFrequency + .nameAr + : _selectedMedicationFrequency + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).frequency, + enabled: false, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + controller: frequencyController, + validationError: isFormSubmitted && + _selectedMedicationFrequency == null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 20 + : SizeConfig.isHeightShort + ? 15 + : 10), + ), ], ), )), 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 39bc2a21..c6427511 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, - required this.medicationController, + Key key, + this.medicationController, }); @override @@ -22,12 +22,11 @@ class _UpdateMedicationWidgetState extends State { Widget build(BuildContext context) { return Column( children: [ - SOAPOpenItems( - label: "${TranslationBase.of(context).addMedication}", - onTap: () { - openMedicationList(context); - }, - ), + + SOAPOpenItems(label: "${TranslationBase.of(context).addMedication}",onTap: () { + openMedicationList(context); + + },), SizedBox( height: 20, ) @@ -35,6 +34,7 @@ class _UpdateMedicationWidgetState extends State { ); } + openMedicationList(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, @@ -49,3 +49,6 @@ class _UpdateMedicationWidgetState extends State { }); } } + + + diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index 79417789..fd5e6b45 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, - required this.changePageViewIndex, - required this.patientInfo, - required this.changeLoadingState, - required this.currentIndex}); + {Key key, + this.changePageViewIndex, + this.patientInfo, + this.changeLoadingState, + this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); @@ -46,15 +46,16 @@ class _UpdateSubjectivePageState extends State TextEditingController medicationController = TextEditingController(); final formKey = GlobalKey(); - List myAllergiesList = []; - List myHistoryList = []; + List myAllergiesList = List(); + List myHistoryList = List(); 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, ); @@ -68,8 +69,9 @@ class _UpdateSubjectivePageState extends State 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, ); @@ -83,8 +85,9 @@ class _UpdateSubjectivePageState extends State 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, ); @@ -98,8 +101,9 @@ class _UpdateSubjectivePageState extends State 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, ); @@ -120,19 +124,22 @@ 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 = @@ -143,7 +150,9 @@ class _UpdateSubjectivePageState extends State remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity); - if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); + + if (selectedAllergy != null && selectedAllergySeverity != null) + myAllergiesList.add(mySelectedAllergy); }); } } @@ -159,11 +168,14 @@ 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); @@ -214,43 +226,47 @@ 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)], + 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, ), - 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, - ), - ], + 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, ), - isExpanded: isAllergiesExpand, - ), SizedBox( height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), @@ -294,17 +310,21 @@ if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidge } 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; } }); diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index 707770eb..a6740a2c 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -4,7 +4,6 @@ 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'; @@ -22,21 +21,22 @@ import 'plan/update_plan_page.dart'; class UpdateSoapIndex extends StatefulWidget { final bool isUpdate; - const UpdateSoapIndex({Key? key, required this.isUpdate}) : super(key: key); + const UpdateSoapIndex({Key key, 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 myHistoryList = []; + List myAllergiesList = List(); + List myHistoryList = List(); 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 with TickerProviderSt } @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( diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index ec33ccf0..564c8c2c 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -1,19 +1,19 @@ +import 'package:date_time_picker/date_time_picker.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; class LineChartCurved extends StatelessWidget { final String title; final List timeSeries; final int indexes; - LineChartCurved({required this.title, required this.timeSeries, required this.indexes}); + LineChartCurved({this.title, this.timeSeries, this.indexes}); - List xAxixs = []; - List yAxixs = []; + List xAxixs = List(); + List yAxixs = List(); // DateFormat format = DateFormat("yyyy-MM-dd"); DateFormat yearFormat = DateFormat("yyyy/MMM"); @@ -105,7 +105,8 @@ class LineChartCurved extends StatelessWidget { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -129,7 +130,9 @@ class LineChartCurved extends StatelessWidget { return ''; } } else { - if (value.toInt() == 0 || value.toInt() == timeSeries.length - 1 || xAxixs.contains(value.toInt())) { + if (value.toInt() == 0 || + value.toInt() == timeSeries.length - 1 || + xAxixs.contains(value.toInt())) { DateTime dateTime = timeSeries[value.toInt()].time; if (isDatesSameYear) { return monthFormat.format(dateTime); @@ -230,12 +233,14 @@ class LineChartCurved extends StatelessWidget { } List getData(context) { - List spots = []; + List spots = List(); isDatesSameYear = true; int previousDateYear = 0; for (int index = 0; index < timeSeries.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); - if (isDatesSameYear == false || (previousDateYear != 0 && previousDateYear != timeSeries[index].time.year)) { + if (isDatesSameYear == false || + (previousDateYear != 0 && + previousDateYear != timeSeries[index].time.year)) { isDatesSameYear = false; } previousDateYear = timeSeries[index].time.year; diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index 197e517f..1c387c9a 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -13,14 +13,10 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final bool isOX; LineChartCurvedBloodPressure( - {required this.title, - required this.timeSeries1, - required this.indexes, - required this.timeSeries2, - this.isOX = false}); + {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX= false}); - List xAxixs = []; - List yAxixs = []; + List xAxixs = List(); + List yAxixs = List(); @override Widget build(BuildContext context) { @@ -47,6 +43,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', textAlign: TextAlign.center, ), @@ -58,7 +55,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), Expanded( child: Padding( - padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + padding: + const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), swapAnimationDuration: const Duration(milliseconds: 250), @@ -77,30 +75,26 @@ class LineChartCurvedBloodPressure extends StatelessWidget { Container( width: 20, height: 20, - decoration: BoxDecoration(shape: BoxShape.rectangle, color: Theme.of(context).primaryColor), - ), - SizedBox( - width: 5, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Theme.of(context).primaryColor), ), - AppText(isOX ? "SAO2" : TranslationBase.of(context).systolicLng) + SizedBox(width: 5,), + AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng) ], ), - SizedBox( - width: 15, - ), + SizedBox(width: 15,), Row( children: [ Container( width: 20, height: 20, - decoration: BoxDecoration(shape: BoxShape.rectangle, color: Colors.red), - ), - SizedBox( - width: 5, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.red), ), - AppText( - isOX ? "FIO2" : TranslationBase.of(context).diastolicLng, - ) + SizedBox(width: 5,), + AppText(isOX? "FIO2":TranslationBase.of(context).diastolicLng,) ], ), ], @@ -129,7 +123,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -228,12 +223,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget { } List getData(context) { - List spots = []; + List spots = List(); for (int index = 0; index < timeSeries1.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); } - List spots2 = []; + List spots2 = List(); for (int index = 0; index < timeSeries2.length; index++) { spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); } @@ -265,11 +260,11 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), ); - List lineChartData = []; - if (spots.isNotEmpty) { + List lineChartData = List(); + if(spots.isNotEmpty){ lineChartData.add(lineChartBarData1); } - if (spots2.isNotEmpty) { + if(spots2.isNotEmpty){ lineChartData.add(lineChartBarData2); } return lineChartData; 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 a2a649f0..69f45d6e 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, - required this.vitalList, - required this.title1, - required this.title2, - required this.viewKey1, - required this.title3, - required this.viewKey2}); + {Key key, + this.vitalList, + this.title1, + this.title2, + this.viewKey1, + this.title3, + this.viewKey2}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -50,6 +50,7 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', ), // height: 60, @@ -64,6 +65,7 @@ class _VitalSignDetailsWidgetState extends State { widget.title2, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', ), // height: 60 @@ -78,6 +80,7 @@ class _VitalSignDetailsWidgetState extends State { widget.title3, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', ), // height: 60 @@ -93,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), ), @@ -123,7 +126,8 @@ class _VitalSignDetailsWidgetState extends State { ]));*/ widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey1]; - DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); + DateTime elementDate = + AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index fc3c6096..09694ad6 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -4,11 +4,11 @@ import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.d import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.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/vital_sign/vital_sign_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.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/errors/error_message.dart'; @@ -16,15 +16,15 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; class VitalSignDetailsScreen extends StatelessWidget { - int? appointmentNo; - int? projectID; + int appointmentNo; + int projectID; bool isNotOneAppointment; VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); @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']; @@ -40,8 +40,8 @@ class VitalSignDetailsScreen extends StatelessWidget { baseViewModel: mode, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), - appBarTitle: TranslationBase.of(context).vitalSign!, + appBar: PatientProfileAppBar(patient), + appBarTitle: TranslationBase.of(context).vitalSign, body: mode.patientVitalSignsHistory.length > 0 ? Column( children: [ @@ -56,7 +56,7 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s", + "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), @@ -283,10 +283,10 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context).height!, + des: TranslationBase.of(context).height, imagePath: "${assetBasePath}height.png", lastVal: mode.heightCm, - unit: TranslationBase.of(context).cm!, + unit: TranslationBase.of(context).cm, ), ), ), @@ -313,9 +313,9 @@ class VitalSignDetailsScreen extends StatelessWidget { ); }, child: VitalSignItem( - des: TranslationBase.of(context).weight!, + des: TranslationBase.of(context).weight, imagePath: "${assetBasePath}weight.png", - unit: TranslationBase.of(context).kg!, + unit: TranslationBase.of(context).kg, lastVal: mode.weightKg, ), ), @@ -337,10 +337,10 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context).temperature!, + des: TranslationBase.of(context).temperature, imagePath: "${assetBasePath}temperature.png", lastVal: mode.temperatureCelcius, - unit: TranslationBase.of(context).tempC!, + unit: TranslationBase.of(context).tempC, ), ), ), @@ -361,10 +361,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).heart!, + des: TranslationBase.of(context).heart, imagePath: "${assetBasePath}heart_rate.png", lastVal: mode.hartRat, - unit: TranslationBase.of(context).bpm!, + unit: TranslationBase.of(context).bpm, ), ), InkWell( @@ -384,10 +384,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).respirationRate!, + des: TranslationBase.of(context).respirationRate, imagePath: "${assetBasePath}respiration_rate.png", lastVal: mode.respirationBeatPerMinute, - unit: TranslationBase.of(context).respirationSigns!, + unit: TranslationBase.of(context).respirationSigns, ), ), InkWell( @@ -407,10 +407,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).bloodPressure!, + des: TranslationBase.of(context).bloodPressure, imagePath: "${assetBasePath}blood_pressure.png", lastVal: mode.bloodPressure, - unit: TranslationBase.of(context).sysDias!, + unit: TranslationBase.of(context).sysDias, ), ), InkWell( @@ -430,7 +430,7 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).oxygenation!, + des: TranslationBase.of(context).oxygenation, imagePath: "${assetBasePath}oxg.png", lastVal: "${mode.oxygenation}%", unit: "", @@ -453,10 +453,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).painScale!, + des: TranslationBase.of(context).painScale, imagePath: "${assetBasePath}painScale.png", lastVal: mode.painScore, - unit: TranslationBase.of(context).severe!, + unit: TranslationBase.of(context).severe, ), ), ], 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 5c83fd09..cec53580 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, required this.vitalList, required this.title1, required this.title2, required this.viewKey}); + {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -55,6 +55,7 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', ), // height: 60, @@ -76,6 +77,7 @@ class _VitalSignDetailsWidgetState extends State { widget.title2, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', ), // height: 60 @@ -91,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), ), @@ -108,7 +110,8 @@ class _VitalSignDetailsWidgetState extends State { ]));*/ widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey]; - DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); + DateTime elementDate = + AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( 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 d051f98c..20d5b439 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 eed82785..0ed9da56 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 @@ -2,32 +2,32 @@ 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/lookups/patient_lookup.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/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.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: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( - {required this.vitalList, - required this.pageKey, - required this.pageTitle, - required this.patient, - required this.patientType, - required this.arrivalType}); + {this.vitalList, + this.pageKey, + this.pageTitle, + this.patient, + this.patientType, + this.arrivalType}); final List vitalList; @@ -187,10 +187,11 @@ class VitalSignItemDetailsScreen extends StatelessWidget { default: } return AppScaffold( - appBarTitle: pageTitle ?? "", + appBarTitle: pageTitle, backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), + appBar: PatientProfileAppBar( + patient,), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -201,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, @@ -219,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, ); @@ -228,14 +229,20 @@ class VitalSignItemDetailsScreen extends StatelessWidget { return VitalSignDetailPainScale(vitalList); } - if (vitalListTemp.length != 0 && chartInfo['viewKey'] == 'BloodPressure' || - chartInfo['viewKey'] == 'O2') { + if (vitalListTemp.length != 0 && + chartInfo['viewKey'] == 'BloodPressure' || chartInfo['viewKey'] == 'O2') { return VitalSingChartBloodPressure( vitalList: vitalList, - name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'], + name: projectViewModel.isArabic + ? chartInfo['nameAr'] + : chartInfo['name'], title1: chartInfo['title1'], - title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'], - title3: projectViewModel.isArabic ? chartInfo['title3Ar'] : chartInfo['title3'], + title2: projectViewModel.isArabic + ? chartInfo['title2Ar'] + : chartInfo['title2'], + title3: projectViewModel.isArabic + ? chartInfo['title3Ar'] + : chartInfo['title3'], viewKey1: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureHigher' : 'SAO2', viewKey2: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureLower' : 'FIO2', ); @@ -244,9 +251,13 @@ class VitalSignItemDetailsScreen extends StatelessWidget { return vitalListTemp.length != 0 ? VitalSingChartAndDetials( vitalList: vitalList, - name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'], + name: projectViewModel.isArabic + ? chartInfo['nameAr'] + : chartInfo['name'], title1: chartInfo['title1'], - title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'], + title2: projectViewModel.isArabic + ? chartInfo['title2Ar'] + : chartInfo['title2'], viewKey: chartInfo['viewKey']) : Container(); }).toList(), 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 0d3803b8..ef8049ce 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; @@ -31,45 +31,50 @@ class VitalSingChartAndDetials extends StatelessWidget { generateData(); return timeSeriesData.length != 0 ? Padding( - padding: const EdgeInsets.all(10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), - child: LineChartCurved( - title: name, - timeSeries: timeSeriesData, - indexes: timeSeriesData.length ~/ 5.5, - ), + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) ), - Container( - margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), - padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).graphDetails, - fontSize: SizeConfig.textMultiplier * 2.1, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - ), - SizedBox( - height: 8, - ), - VitalSignDetailsWidget( - vitalList: vitalList, - title1: title1, - title2: title2, - viewKey: viewKey, - ), - ], - ), + child: LineChartCurved( + title: name, + timeSeries: timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, ), - /*AppExpandableNotifier( + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).graphDetails, + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.bold, + + fontFamily: 'Poppins', + ), + SizedBox(height: 8,), + VitalSignDetailsWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + viewKey: viewKey, + ), + ], + ), + ), + /*AppExpandableNotifier( // isExpand: true, headerWid: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/5.5,), bodyWid: VitalSignDetailsWidget( @@ -79,9 +84,9 @@ class VitalSingChartAndDetials extends StatelessWidget { viewKey: viewKey, ), ),*/ - ], - ), - ) + ], + ), + ) : Container( width: double.infinity, height: MediaQuery.of(context).size.height, @@ -95,11 +100,14 @@ class VitalSingChartAndDetials extends StatelessWidget { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( (element) { - DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(element.createdOn); - if (element.toJson()[viewKey] != null && element.toJson()[viewKey]?.toInt() != 0) + DateTime elementDate = + AppDateUtils.getDateTimeFromServerFormat(element.createdOn); + if (element.toJson()[viewKey] != null && + element.toJson()[viewKey]?.toInt() != 0) timeSeriesData.add( TimeSeriesSales2( - new DateTime(elementDate.year, elementDate.month, elementDate.day), + new DateTime( + elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey].toDouble(), ), ); 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 ba75ed30..d0416539 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; @@ -42,10 +42,12 @@ class VitalSingChartBloodPressure extends StatelessWidget { children: [ Container( margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), child: LineChartCurvedBloodPressure( title: name, - isOX: title2 == "SAO2", + isOX: title2=="SAO2", timeSeries1: timeSeriesData1, timeSeries2: timeSeriesData2, indexes: timeSeriesData1.length ~/ 5.5, @@ -54,7 +56,9 @@ class VitalSingChartBloodPressure extends StatelessWidget { Container( margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -111,18 +115,21 @@ class VitalSingChartBloodPressure extends StatelessWidget { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( (element) { - DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(element.createdOn); + DateTime elementDate = + AppDateUtils.getDateTimeFromServerFormat(element.createdOn); if (element.toJson()[viewKey1]?.toInt() != 0) timeSeriesData1.add( TimeSeriesSales2( - new DateTime(elementDate.year, elementDate.month, elementDate.day), + new DateTime( + elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey1].toDouble(), ), ); if (element.toJson()[viewKey2]?.toInt() != 0) timeSeriesData2.add( TimeSeriesSales2( - new DateTime(elementDate.year, elementDate.month, elementDate.day), + new DateTime( + elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey2].toDouble(), ), ); diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart index ac20d1e1..17405829 100644 --- a/lib/screens/patients/register_patient/CustomEditableText.dart +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -7,10 +7,9 @@ import 'package:flutter/material.dart'; class CustomEditableText extends StatefulWidget { CustomEditableText({ Key key, - required this.controller, + @required this.controller, this.hint, - this.isEditable = false, - this.isSubmitted, + this.isEditable = false, this.isSubmitted, }) : super(key: key); final TextEditingController controller; @@ -28,7 +27,7 @@ class _CustomEditableTextState extends State { Widget build(BuildContext context) { return Column( children: [ - if (!widget.isEditable) + if(!widget.isEditable) Container( height: 60, decoration: BoxDecoration( @@ -37,7 +36,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, ), ), @@ -63,6 +62,7 @@ class _CustomEditableTextState extends State { child: Icon( DoctorApp.edit_1, size: 20, + ), onTap: () { setState(() { @@ -74,15 +74,17 @@ class _CustomEditableTextState extends State { ), ), ), - if (widget.isEditable) + if(widget.isEditable) AppTextFieldCustom( hintText: widget.hint, //TranslationBase.of(context).addoperationReports, controller: widget.controller, - validationError: - widget.controller.text.isEmpty && widget.isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, + validationError: widget.controller + .text.isEmpty && + widget.isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, maxLines: 1, minLines: 1, hasBorder: true, @@ -90,4 +92,4 @@ class _CustomEditableTextState extends State { ], ); } -} +} \ No newline at end of file diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index 6aaacb26..c03c6f96 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -44,7 +44,7 @@ class RegisterConfirmationPatientPage extends StatefulWidget { final PatientRegistrationViewModel model; const RegisterConfirmationPatientPage( - {Key? key, this.operationReportViewModel, this.patient, this.model}) + {Key key, this.operationReportViewModel, this.patient, this.model}) : super(key: key); @override diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 9bc2d6fe..231ff3d1 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -12,7 +12,7 @@ import 'package:flutter/material.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(); diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index fd425c01..2afc593e 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -30,7 +30,7 @@ class RegisterSearchPatientPage extends StatefulWidget { final PatientRegistrationViewModel model; const RegisterSearchPatientPage( - {Key? key, this.changePageViewIndex, this.model}) + {Key key, this.changePageViewIndex, this.model}) : super(key: key); @override @@ -66,7 +66,7 @@ class _RegisterSearchPatientPageState extends State { @override void initState() { _phoneCode.text = ""; - countryList = []; + countryList = List(); dynamic ksaCountry = {"id": 967, "name": "Saudi Arabia"}; dynamic uaeCountry = {"id": 971, "name": "United Arab Emirates"}; diff --git a/lib/screens/patients/register_patient/VerifyActivationCodePage.dart b/lib/screens/patients/register_patient/VerifyActivationCodePage.dart index 6f0e1a31..d58e5a3b 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 f2d0646f..8634e76e 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -501,15 +501,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 128acac6..9cd5121a 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; 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/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; @@ -21,7 +22,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'; @@ -32,6 +33,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; @@ -45,46 +47,46 @@ addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion pati } 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 prescriptionList = List(); - 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 ?? "0"), - itemId: drugId!.isEmpty ? 1 : int.parse(drugId), - doseUnitId: int.parse(doseUnit ?? "1"), - 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.Error) { + if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { model.getPrescriptions(patient); @@ -104,15 +106,14 @@ class PrescriptionFormWidget extends StatefulWidget { } class _PrescriptionFormWidgetState 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; - late int selectedType; - bool isSubmitted = false; + int selectedType; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -122,9 +123,9 @@ class _PrescriptionFormWidgetState extends State { bool visbiltySearch = true; final myController = TextEditingController(); - DateTime? selectedDate; - int? strengthChar; - GetMedicationResponseModel? _selectedMedication; + DateTime selectedDate; + int strengthChar; + GetMedicationResponseModel _selectedMedication; GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); @@ -220,6 +221,7 @@ class _PrescriptionFormWidgetState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { x = model.patientAssessmentList.map((element) { @@ -245,7 +247,7 @@ class _PrescriptionFormWidgetState extends State { builder: ( BuildContext context, MedicineViewModel model, - Widget? child, + Widget child, ) => NetworkBaseView( baseViewModel: model, @@ -343,11 +345,11 @@ class _PrescriptionFormWidgetState extends State { child: MedicineItemWidget( label: model.allMedicationList[index].description), onTap: () { - model.getItem(itemID: model.allMedicationList[index].itemId!); + model.getItem(itemID: model.allMedicationList[index].itemId); visbiltyPrescriptionForm = true; visbiltySearch = false; _selectedMedication = model.allMedicationList[index]; - uom = _selectedMedication!.uom; + uom = _selectedMedication.uom; }, ); }, @@ -380,11 +382,11 @@ class _PrescriptionFormWidgetState extends State { activeColor: Color(0xFFB9382C), value: 1, groupValue: selectedType, - onChanged: (int? value) { - setSelectedType(value!); + onChanged: (value) { + setSelectedType(value); }, ), - Text(TranslationBase.of(context).regular ?? ""), + Text(TranslationBase.of(context).regular), ], ), ), @@ -406,7 +408,7 @@ class _PrescriptionFormWidgetState extends State { setState(() { strengthChar = value.length; }); - if (strengthChar! >= 5) { + if (strengthChar >= 5) { DrAppToastMsg.showErrorToast( TranslationBase.of(context).only5DigitsAllowedForStrength, ); @@ -421,7 +423,6 @@ class _PrescriptionFormWidgetState extends State { width: 5.0, ), PrescriptionTextFiled( - isSubmitted: isSubmitted, width: MediaQuery.of(context).size.width * 0.517, element: model.itemMedicineListUnit.length == 1 ? model.itemMedicineListUnit[0] @@ -443,7 +444,6 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - isSubmitted: isSubmitted, elementList: model.itemMedicineListRoute, element: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0] @@ -457,16 +457,13 @@ class _PrescriptionFormWidgetState extends State { route['isDefault'] = true; }); }, - hintText: TranslationBase.of(context).route ?? "", + hintText: TranslationBase.of(context).route, ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - isSubmitted: isSubmitted, - hintText: TranslationBase.of(context).frequency ?? "", - elementError: frequencyError ?? "", - element: model.itemMedicineList.length == 1 - ? frequency = model.itemMedicineList[0] - : frequency, + hintText: TranslationBase.of(context).frequency, + elementError: frequencyError, + element: frequency, elementList: model.itemMedicineList, keyId: 'parameterCode', keyName: 'description', @@ -481,7 +478,7 @@ class _PrescriptionFormWidgetState extends State { model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication!.itemId!, + itemCode: _selectedMedication.itemId, strength: double.parse(strengthController.text)); return; @@ -490,9 +487,8 @@ class _PrescriptionFormWidgetState extends State { }), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - isSubmitted: isSubmitted, - hintText: TranslationBase.of(context).doseTime ?? "", - elementError: doseTimeError ?? "", + hintText: TranslationBase.of(context).doseTime, + elementError: doseTimeError, element: doseTime, elementList: model.medicationDoseTimeList, keyId: 'id', @@ -545,7 +541,7 @@ class _PrescriptionFormWidgetState extends State { 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, @@ -560,10 +556,9 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - isSubmitted: isSubmitted, element: duration, - elementError: durationError ?? "", - hintText: TranslationBase.of(context).duration ?? "", + elementError: durationError, + hintText: TranslationBase.of(context).duration, elementList: model.medicationDurationList, keyName: 'nameEn', keyId: 'id', @@ -577,7 +572,7 @@ class _PrescriptionFormWidgetState extends State { model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication!.itemId!, + itemCode: _selectedMedication.itemId, strength: double.parse(strengthController.text), ); box = model.boxQuintity; @@ -658,10 +653,10 @@ class _PrescriptionFormWidgetState extends State { frequency != null && selectedDate != null && strengthController.text != "") { - if (_selectedMedication!.isNarcotic == true) { + if (_selectedMedication.isNarcotic == true) { DrAppToastMsg.showErrorToast(TranslationBase.of(context) .narcoticMedicineCanOnlyBePrescribedFromVida); - // Navigator.pop(context); + Navigator.pop(context); return; } @@ -675,7 +670,7 @@ class _PrescriptionFormWidgetState extends State { return; } - if (formKey.currentState!.validate()) { + if (formKey.currentState.validate()) { Navigator.pop(context); openDrugToDrug(model); { @@ -763,41 +758,40 @@ class _PrescriptionFormWidgetState extends State { } } else { setState(() { - isSubmitted = true; if (duration == null) { durationError = TranslationBase.of(context).fieldRequired; } else { - durationError = ""; + durationError = null; } if (doseTime == null) { doseTimeError = TranslationBase.of(context).fieldRequired; } else { - doseTimeError = ""; + doseTimeError = null; } if (route == null) { routeError = TranslationBase.of(context).fieldRequired; } else { - routeError = ""; + routeError = null; } if (frequency == null) { frequencyError = TranslationBase.of(context).fieldRequired; } else { - frequencyError = ""; + frequencyError = null; } if (units == null) { unitError = TranslationBase.of(context).fieldRequired; } else { - unitError = ""; + unitError = null; } if (strengthController.text == "") { strengthError = TranslationBase.of(context).fieldRequired; } else { - strengthError = ""; + strengthError = null; } }); } - formKey.currentState!.save(); + formKey.currentState.save(); }, ), ], @@ -826,7 +820,7 @@ class _PrescriptionFormWidgetState 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(), @@ -840,8 +834,8 @@ class _PrescriptionFormWidgetState 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), @@ -920,7 +914,7 @@ class _PrescriptionFormWidgetState extends State { route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: _selectedMedication!.itemId.toString(), + drugId: _selectedMedication.itemId.toString(), strength: strengthController.text, indication: indicationController.text, instruction: instructionController.text, @@ -940,7 +934,7 @@ class _PrescriptionFormWidgetState extends State { getPriscriptionforDrug(List prescriptionList, MedicineViewModel model) { var prescriptionDetails = []; if (prescriptionList.length > 0) { - prescriptionList[0].entityList!.forEach((element) { + prescriptionList[0].entityList.forEach((element) { if (element.mediSpanGPICode != null) { prescriptionDetails.add({ 'DrugId': element.mediSpanGPICode, @@ -956,10 +950,10 @@ class _PrescriptionFormWidgetState extends State { } }); } - if (_selectedMedication!.mediSpanGPICode != null) { + if (_selectedMedication.mediSpanGPICode != null) { prescriptionDetails.add({ - 'DrugId': _selectedMedication!.mediSpanGPICode, - 'DrugName': _selectedMedication!.description, + 'DrugId': _selectedMedication.mediSpanGPICode, + 'DrugName': _selectedMedication.description, 'Dose': strengthController.text, 'DoseType': model.itemMedicineListUnit.length == 1 ? model.itemMedicineListUnit[0]['parameterCode'].toString() diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/drugtodrug.dart index 6b1e0df0..15abfeb6 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/drugtodrug.dart @@ -54,34 +54,45 @@ 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 4da17968..cac2f99a 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -18,7 +18,7 @@ import 'package:doctor_app_flutter/util/date-utils.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 '../../widgets/shared/text_fields/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.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/buttons/app_buttons_widget.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 prescriptionList = List(); - 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; - late int selectedType; + int selectedType; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -110,10 +110,10 @@ class _PrescriptionCheckOutScreenState extends State bool visbiltySearch = true; final myController = TextEditingController(); - late DateTime selectedDate; - late int strengthChar; - late GetMedicationResponseModel _selectedMedication; - late GlobalKey key = new GlobalKey>(); + DateTime selectedDate; + int strengthChar; + GetMedicationResponseModel _selectedMedication; + 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: (int? value) { - setSelectedType(value!); + onChanged: (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,10 +475,10 @@ 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, @@ -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,7 +617,7 @@ class _PrescriptionCheckOutScreenState extends State route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: (widget.groupProcedures!.aliasN! + drugId: (widget.groupProcedures.aliasN .replaceAll("item code ;", "")), strength: strengthController.text, indication: indicationController.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,7 +690,7 @@ 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(), @@ -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 0c364c6d..623cee90 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({required Key key, required this.prescriptionReport}); + PrescriptionDetailsPage({Key key, 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, @@ -45,9 +45,10 @@ class PrescriptionDetailsPage extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: AppText(prescriptionReport.itemDescription!.isNotEmpty - ? prescriptionReport.itemDescription - : prescriptionReport.itemDescriptionN), + child: AppText( + prescriptionReport.itemDescription.isNotEmpty + ? prescriptionReport.itemDescription + : prescriptionReport.itemDescriptionN), ), ), ) @@ -58,7 +59,9 @@ class PrescriptionDetailsPage extends StatelessWidget { color: Colors.white, margin: EdgeInsets.only(top: 10, left: 10, right: 10), child: Table( - border: TableBorder.symmetric(inside: BorderSide(width: 0.5), outside: BorderSide(width: 0.5)), + border: TableBorder.symmetric( + inside: BorderSide(width: 0.5), + outside: BorderSide(width: 0.5)), children: [ TableRow( children: [ @@ -106,22 +109,28 @@ 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 bd28146d..84f38748 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -3,10 +3,10 @@ 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'; +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:flutter/cupertino.dart'; @@ -23,14 +23,14 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { final int prescriptionIndex; PrescriptionItemsInPatientPage( - {Key? key, - required this.prescriptions, - required this.patient, - required this.patientType, - required this.arrivalType, - required this.stopOn, - required this.startOn, - required this.prescriptionIndex}); + {Key key, + this.prescriptions, + this.patient, + this.patientType, + this.arrivalType, + this.stopOn, + this.startOn, + this.prescriptionIndex}); @override Widget build(BuildContext context) { @@ -43,9 +43,9 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100]!, + backgroundColor: Colors.grey[100], baseViewModel: model, - patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), + appBar: PatientProfileAppBar(patient), body: SingleChildScrollView( child: Container( child: Column( @@ -101,7 +101,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).route, color: Colors.grey, ), - AppText(" " + prescriptions.routeDescription.toString()), + AppText(" " + prescriptions.routeDescription.toString() ?? ''), ], ), Row( @@ -160,7 +160,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).dailyDoses, color: Colors.grey, ), - AppText(" " + prescriptions.dose.toString()), + AppText(" " + prescriptions.dose.toString() ?? ''), ], ), Row( @@ -169,9 +169,7 @@ 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 2fb4131d..b97343c4 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -1,10 +1,10 @@ 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'; +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/dialogs/ShowImageDialog.dart'; @@ -17,39 +17,36 @@ class PrescriptionItemsPage extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - PrescriptionItemsPage( - {Key? key, - required this.prescriptions, - required this.patient, - required this.patientType, - required this.arrivalType}); + PrescriptionItemsPage({Key key, this.prescriptions, this.patient, this.patientType, this.arrivalType}); @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getPrescriptionReport(prescriptions: prescriptions, patient: patient), + onModelReady: (model) => + model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100]!, + backgroundColor: Colors.grey[100], baseViewModel: model, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, - clinic: prescriptions.clinicDescription!, - branch: prescriptions.name!, + appBar: PatientProfileAppBar( + 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( + (index) => Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), color: Colors.white, @@ -61,224 +58,179 @@ class PrescriptionItemsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, 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, - )), - SizedBox( - height: 12, - ), + margin: EdgeInsets.only(left: 18,right: 18), + child: AppText(model.prescriptionReportList[index].itemDescription.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)), + SizedBox(height: 12,), Row( children: [ - SizedBox( - width: 18, - ), + SizedBox(width: 18,), Container( decoration: BoxDecoration( - shape: BoxShape.circle, border: Border.all(width: 0.5, color: Colors.grey)), + shape: BoxShape.circle, + border: Border.all(width: 0.5,color: Colors.grey) + ), height: 55, width: 55, child: InkWell( - onTap: () { + 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, ), ), ), ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).route, - color: Colors.grey, - ), - Expanded( - child: AppText(" " + model.prescriptionReportList[index].routeN!)), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).frequency, - color: Colors.grey, - ), - AppText(" " + model.prescriptionReportList[index].frequencyN!), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).dailyDoses, - color: Colors.grey, - ), - AppText(" " + model.prescriptionReportList[index].doseDailyQuantity), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).duration, - color: Colors.grey, - ), - AppText(" " + model.prescriptionReportList[index].days.toString()), - ], - ), - SizedBox( - height: 12, - ), - AppText(model.prescriptionReportList[index].remarks ?? ''), - ], - ), - ) + SizedBox(width: 10,), + Expanded(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText(TranslationBase.of(context).route,color: Colors.grey,), + Expanded(child: AppText(" "+model.prescriptionReportList[index].routeN)), + ], + ), + Row( + children: [ + AppText(TranslationBase.of(context).frequency,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].frequencyN ?? ''), + ], + ), + Row( + children: [ + AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].doseDailyQuantity ?? ''), + ], + ), + Row( + children: [ + AppText(TranslationBase.of(context).duration,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), + ], + ), + SizedBox(height: 12,), + AppText(model.prescriptionReportList[index].remarks ?? ''), + ], + ),) + + ], ) ], ), ), )) + else - ...List.generate( - model.prescriptionReportEnhList.length, - (index) => Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - margin: EdgeInsets.all(12), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 18, right: 18), - child: AppText( - model.prescriptionReportEnhList[index].itemDescription, - bold: true, - ), - ), - SizedBox( - height: 12, - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 18, - ), - Container( - decoration: BoxDecoration( - shape: BoxShape.circle, border: Border.all(width: 0.5, color: Colors.grey)), - height: 55, - width: 55, - child: InkWell( - onTap: () { - showDialog( + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18,right: 18), + child: AppText(model.prescriptionReportEnhList[index].itemDescription,bold: true,),), + SizedBox(height: 12,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(width: 18,), + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(width: 0.5,color: Colors.grey) + ), + height: 55, + width: 55, + child: InkWell( + onTap: (){ + showDialog( context: context, builder: (ctx) => ShowImageDialog( - imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl!, - )); - }, - child: Stack( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl ?? "", - fit: BoxFit.cover, + imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, + ) + ); + }, + child: Stack( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.network( + model.prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + + ), ), - ), - Positioned( - top: 10, - right: 10, - child: Icon( - EvaIcons.search, - color: Colors.grey, - size: 35, - )) - ], + Positioned( + top: 10, + right: 10, + child: Icon(EvaIcons.search,color: Colors.grey,size: 35,)) + ], + ), ), ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( + SizedBox(width: 10,), + Expanded(child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ - AppText( - TranslationBase.of(context).route, - color: Colors.grey, - ), - Expanded(child: AppText(" " + model.prescriptionReportEnhList[index].route!)), + AppText(TranslationBase.of(context).route,color: Colors.grey,), + Expanded(child: AppText(" "+model.prescriptionReportEnhList[index].route??'')), ], ), Row( children: [ - AppText( - TranslationBase.of(context).frequency, - color: Colors.grey, - ), - AppText(" " + model.prescriptionReportEnhList[index].frequency!), + AppText(TranslationBase.of(context).frequency,color: Colors.grey,), + AppText(" "+model.prescriptionReportEnhList[index].frequency ?? ''), ], ), Row( children: [ - AppText( - TranslationBase.of(context).dailyDoses, - color: Colors.grey, - ), - AppText(" " + - model.prescriptionReportEnhList[index].doseDailyQuantity.toString()), + AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), + AppText(" "+model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? ''), ], ), Row( children: [ - AppText( - TranslationBase.of(context).duration, - color: Colors.grey, - ), - AppText(" " + model.prescriptionReportList[index].days.toString()), + AppText(TranslationBase.of(context).duration,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), ], ), - SizedBox( - height: 12, - ), - AppText(model.prescriptionReportEnhList[index].remarks ?? ''), + SizedBox(height: 12,), + AppText(model.prescriptionReportEnhList[index].remarks?? ''), ], - ), - ) - ], - ) - ], + ),) + + + ], + ) + ], + ), ), ), - ), - ), + ), + + + ], ), ), @@ -287,3 +239,6 @@ class PrescriptionItemsPage extends StatelessWidget { ); } } + + + diff --git a/lib/screens/prescription/prescription_text_filed.dart b/lib/screens/prescription/prescription_text_filed.dart index faf6229e..c63ccd1e 100644 --- a/lib/screens/prescription/prescription_text_filed.dart +++ b/lib/screens/prescription/prescription_text_filed.dart @@ -8,25 +8,23 @@ 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; final String hintText; - final double? width; + final double width; final Function(dynamic) okFunction; PrescriptionTextFiled( - {Key? key, - required this.element, - required this.elementError, + {Key key, + @required this.element, + @required this.elementError, this.width, - required this.elementList, - required this.keyName, - required this.keyId, - required this.hintText, - required this.okFunction, - this.isSubmitted}) + this.elementList, + this.keyName, + this.keyId, + this.hintText, + this.okFunction}) : super(key: key); @override @@ -67,9 +65,7 @@ class _PrescriptionTextFiledState extends State { ? widget.element['${widget.keyName}'] : null, isTextFieldHasSuffix: true, - validationError: widget.element == null && widget.isSubmitted == true && widget.elementList.length != 1 - ? widget.elementError - : null, + validationError: widget.elementList.length != 1 ? widget.elementError : null, enabled: false, ), ), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index c3764b22..b3cb4ec0 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -1,6 +1,5 @@ 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'; @@ -9,11 +8,12 @@ import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_pag 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/add-order/addNewOrder.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'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import '../../widgets/shared/in_patient_doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/cupertino.dart'; @@ -22,7 +22,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']; @@ -37,8 +37,10 @@ class PrescriptionsPage extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Colors.grey[100], - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, isInpatient:isInpatient,), + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), body: patient.admissionNo == null ? FractionallySizedBox( widthFactor: 1.0, @@ -107,7 +109,7 @@ class PrescriptionsPage extends StatelessWidget { ); }, label: TranslationBase.of(context) - .applyForNewPrescriptionsOrder ?? "", + .applyForNewPrescriptionsOrder, ), ...List.generate( model.prescriptionsList.length, @@ -126,17 +128,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 ?? "", + .appointmentDate, ), ))), if (model.prescriptionsList.isEmpty && @@ -196,14 +198,14 @@ class PrescriptionsPage extends StatelessWidget { model .medicationForInPatient[ index] - .startDatetime ?? "", + .startDatetime, ), stopOn: AppDateUtils .getDateTimeFromServerFormat( model .medicationForInPatient[ index] - .stopDatetime ?? "", + .stopDatetime, ), ), ), @@ -219,7 +221,7 @@ class PrescriptionsPage extends StatelessWidget { appointmentDate: AppDateUtils .getDateTimeFromServerFormat( model.medicationForInPatient[index] - .prescriptionDatetime ?? "", + .prescriptionDatetime, ), createdBy: model .medicationForInPatient[index] diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 81cae799..01ba6a91 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/util/date-utils.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 '../../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/dialogs/dailog-list-select.dart'; @@ -42,22 +42,22 @@ class UpdatePrescriptionForm extends StatefulWidget { final PrescriptionViewModel model; UpdatePrescriptionForm( - {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}); + {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}); @override _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); } @@ -66,31 +66,35 @@ class _UpdatePrescriptionFormState extends State { TextEditingController strengthController = TextEditingController(); TextEditingController remarksController = TextEditingController(); int testNum = 0; - late int strengthChar; - late PatiantInformtion patient; + int strengthChar; + PatiantInformtion patient; dynamic route; dynamic doseTime; dynamic frequencyUpdate; dynamic updatedDuration; dynamic units; - late GetMedicationResponseModel newSelectedMedication; - GlobalKey key = new GlobalKey>(); - late List indicationList; + GetMedicationResponseModel newSelectedMedication; + GlobalKey key = + new GlobalKey>(); + List indicationList; dynamic indication; - late DateTime selectedDate; + DateTime selectedDate; @override void initState() { super.initState(); strengthController.text = widget.doseStreangth; remarksController.text = widget.remarks; - indicationList = []; + indicationList = List(); 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"}; @@ -111,7 +115,8 @@ 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(); @@ -122,13 +127,20 @@ 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: () { @@ -138,13 +150,15 @@ 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: [ @@ -230,16 +244,25 @@ 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 ], @@ -247,7 +270,8 @@ class _UpdatePrescriptionFormState extends State { hintText: widget.doseStreangth, fontSize: 15.0, controller: strengthController, - keyboardType: TextInputType.numberWithOptions( + keyboardType: TextInputType + .numberWithOptions( decimal: true, ), onChanged: (String value) { @@ -255,7 +279,8 @@ 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) { @@ -273,34 +298,59 @@ 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, ), ), @@ -312,16 +362,24 @@ 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, + ListSelectDialog dialog = + ListSelectDialog( + list: model + .itemMedicineListRoute, attributeName: 'description', - attributeValueId: 'parameterCode', - okText: TranslationBase.of(context).ok, + attributeValueId: + 'parameterCode', + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { route = selectedValue; @@ -334,15 +392,21 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext 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, ), ), @@ -351,16 +415,23 @@ 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, + ListSelectDialog dialog = + ListSelectDialog( + list: model + .medicationDoseTimeList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { doseTime = selectedValue; @@ -370,15 +441,22 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext 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, ), ), @@ -387,36 +465,50 @@ 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, + ListSelectDialog dialog = + ListSelectDialog( + list: model + .medicationFrequencyList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { - frequencyUpdate = selectedValue; + frequencyUpdate = + selectedValue; }); }, ); showDialog( barrierDismissible: false, context: context, - builder: (BuildContext 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, ), ), @@ -425,36 +517,51 @@ 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, + ListSelectDialog dialog = + ListSelectDialog( + list: model + .medicationDurationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { - updatedDuration = selectedValue; + updatedDuration = + selectedValue; }); }, ); showDialog( barrierDismissible: false, context: context, - builder: (BuildContext 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, ), ), @@ -463,26 +570,46 @@ 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, + width: + MediaQuery.of(context) + .size + .width * + 0.29, child: InkWell( - onTap: indicationList != null - ? () { - Helpers.hideKeyboard(context); - } - : null, + onTap: + indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, child: TextField( decoration: textFieldSelectorDecoration( - model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID.toString() + model.patientAssessmentList + .isNotEmpty + ? model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString() : '', - indication != null ? indication['name'] : null, + indication != null + ? indication[ + 'name'] + : null, true), enabled: true, readOnly: true, @@ -490,20 +617,34 @@ class _UpdatePrescriptionFormState extends State { ), ), Container( - width: MediaQuery.of(context).size.width * 0.61, + width: + MediaQuery.of(context) + .size + .width * + 0.61, child: InkWell( - onTap: indicationList != null - ? () { - Helpers.hideKeyboard(context); - } - : null, + onTap: + indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, child: TextField( maxLines: 3, decoration: textFieldSelectorDecoration( - model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].asciiDesc.toString() + model.patientAssessmentList + .isNotEmpty + ? model + .patientAssessmentList[ + 0] + .asciiDesc + .toString() : '', - indication != null ? indication['name'] : null, + indication != null + ? indication[ + 'name'] + : null, true), enabled: true, readOnly: true, @@ -519,18 +660,22 @@ 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, ), ), @@ -544,11 +689,14 @@ class _UpdatePrescriptionFormState extends State { onTap: model.allMedicationList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = ListSelectDialog( + ListSelectDialog dialog = + ListSelectDialog( list: model.allMedicationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { // duration = selectedValue; @@ -558,15 +706,21 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext 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, ), @@ -578,11 +732,14 @@ class _UpdatePrescriptionFormState extends State { onTap: model.allMedicationList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = ListSelectDialog( + ListSelectDialog dialog = + ListSelectDialog( list: model.allMedicationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { // duration = selectedValue; @@ -592,17 +749,22 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext 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, ), @@ -613,8 +775,11 @@ 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, @@ -625,39 +790,59 @@ 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, @@ -665,18 +850,30 @@ 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); }, ), @@ -701,7 +898,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(), @@ -715,8 +912,9 @@ 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), @@ -747,29 +945,30 @@ class _UpdatePrescriptionFormState extends State { } updatePrescription( - {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, + 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 { //PrescriptionViewModel model = PrescriptionViewModel(); - PostPrescriptionReqModel updatePrescriptionReqModel = new PostPrescriptionReqModel(); - List sss = []; + PostPrescriptionReqModel updatePrescriptionReqModel = + new PostPrescriptionReqModel(); + List sss = List(); updatePrescriptionReqModel.appointmentNo = patient.appointmentNo; updatePrescriptionReqModel.clinicID = patient.clinicId; @@ -778,22 +977,31 @@ 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); @@ -805,22 +1013,22 @@ class _UpdatePrescriptionFormState extends State { void updatePrescriptionForm( {context, - 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}) { + 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}) { TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); diff --git a/lib/screens/procedures/ExpansionProcedure.dart b/lib/screens/procedures/ExpansionProcedure.dart index 740ae8e6..06e56f03 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, - required this.procedureTempleteModel, - required this.model, - required this.removeFavProcedure, - required this.addFavProcedure, + {Key key, + this.procedureTempleteModel, + this.model, + this.removeFavProcedure, + this.addFavProcedure, this.selectProcedures, this.isEntityListSelected, this.isEntityFavListSelected, this.isProcedure = true, - required this.groupProcedures}) + 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: (ProcedureTempleteDetailsModel? newValue) { - widget.selectProcedures!(newValue!); + onChanged: (newValue) { + widget.selectProcedures(newValue); })), Expanded( child: Padding( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 83896e2c..82bb649c 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 GestureTapCallback onTap; + final Function 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, - required this.onTap, - required this.entityList, - required this.categoryID, + Key key, + this.onTap, + this.entityList, + this.categoryID, this.categoryName, - required this.patient, - required this.doctorID, + this.patient, + 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'); }, ))), @@ -190,7 +190,7 @@ class ProcedureCard extends StatelessWidget { children: [ Expanded( child: AppText( - entityList.remarks.toString(), + entityList.remarks.toString() ?? '', fontSize: 12, ), ), diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart index 47fe2a4b..28a72041 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,19 +46,19 @@ 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 ""; } } - String ? getCategoryId() { + String getCategoryId() { switch (this) { case ProcedureType.PROCEDURE: return null; @@ -76,13 +76,13 @@ extension procedureType on ProcedureType { String getCategoryName() { switch (this) { case ProcedureType.PROCEDURE: - return ''; + return null; case ProcedureType.LAB_RESULT: return "Laboratory"; case ProcedureType.RADIOLOGY: return "Radiology"; default: - return ''; + return null; } } } diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 8ff817e5..7f4e49b2 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -12,23 +12,24 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.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/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/cupertino.dart'; 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, - required this.patient, - required this.procedureType, + this.patient, + @required this.procedureType, }); @override @@ -38,47 +39,47 @@ class AddFavouriteProcedure extends StatefulWidget { class _AddFavouriteProcedureState extends State { _AddFavouriteProcedureState({this.patient, this.model}); - ProcedureViewModel? model; - PatiantInformtion? patient; - List entityList = []; - ProcedureTempleteDetailsModel? groupProcedures; + ProcedureViewModel model; + PatiantInformtion patient; + List entityList = List(); + 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) - ?Expanded( - child: EntityListCheckboxSearchFavProceduresWidget( - isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), - model: model, - removeFavProcedure: (item) { - setState(() { - entityList.remove(item); - }); - }, - addFavProcedure: (history) { - setState(() { - entityList.add(history); - }); - }, - isEntityFavListSelected: (master) => isEntityListSelected(master), - groupProcedures: groupProcedures, - selectProcedures: (selectedProcedure) { - setState(() { - groupProcedures = selectedProcedure; - }); - }, - ), - ) + (model.templateList.length != 0) + ? Expanded( + child: EntityListCheckboxSearchFavProceduresWidget( + isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), + model: model, + removeFavProcedure: (item) { + setState(() { + entityList.remove(item); + }); + }, + addFavProcedure: (history) { + setState(() { + entityList.add(history); + }); + }, + isEntityFavListSelected: (master) => isEntityListSelected(master), + groupProcedures: groupProcedures, + selectProcedures: (selectedProcedure) { + setState(() { + groupProcedures = selectedProcedure; + }); + }, + ), + ) : Container( child: Padding( padding: EdgeInsets.symmetric(vertical: 50.0), @@ -87,23 +88,25 @@ class _AddFavouriteProcedureState extends State { ), ], ), - bottomSheet: Container(margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: widget.procedureType.getAddButtonTitle(context), + bottomSheet: Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: widget.procedureType.getAddButtonTitle(context) ?? + TranslationBase.of(context).addSelectedProcedures, color: Color(0xff359846), disabled: model.templateList.length == 0 ? true : false, - fontWeight: FontWeight.w700, - onPressed: () { - if (widget.procedureType == ProcedureType.PRESCRIPTION) { - if (groupProcedures == null) { - DrAppToastMsg.showErrorToast( - 'Please Select item ', - ); - return; - } + fontWeight: FontWeight.w700, + onPressed: () { + if (widget.procedureType == ProcedureType.PRESCRIPTION) { + if (groupProcedures == null) { + DrAppToastMsg.showErrorToast( + 'Please Select item ', + ); + return; + } Navigator.push( context, diff --git a/lib/screens/procedures/add-procedure-page.dart b/lib/screens/procedures/add-procedure-page.dart index 41331c08..e0b7374f 100644 --- a/lib/screens/procedures/add-procedure-page.dart +++ b/lib/screens/procedures/add-procedure-page.dart @@ -16,29 +16,31 @@ 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, required this.patient, required this.procedureType}) : super(key: key); + const AddProcedurePage( + {Key key, this.model, this.patient, @required this.procedureType}) + : super(key: key); @override - _AddProcedurePageState createState() => - _AddProcedurePageState(patient: patient, model: model, procedureType: this.procedureType); + _AddProcedurePageState createState() => _AddProcedurePageState( + patient: patient, model: model, procedureType: this.procedureType); } 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 entityListProcedure = []; + List entityList = List(); + List entityListProcedure = List(); TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -54,16 +56,17 @@ 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( @@ -79,24 +82,29 @@ class _AddProcedurePageState extends State { Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context).pleaseEnterProcedure, + TranslationBase.of(context) + .pleaseEnterProcedure, fontWeight: FontWeight.w700, fontSize: 20, ), ], ), SizedBox( - height: MediaQuery.of(context).size.height * 0.02, + height: + MediaQuery.of(context).size.height * 0.02, ), Row( children: [ Container( - width: MediaQuery.of(context).size.width * 0.79, + width: MediaQuery.of(context).size.width * + 0.79, child: AppTextFieldCustom( - hintText: TranslationBase.of(context).searchProcedureHere, + hintText: TranslationBase.of(context) + .searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, minLines: 1, @@ -105,17 +113,22 @@ class _AddProcedurePageState extends State { ), ), SizedBox( - width: MediaQuery.of(context).size.width * 0.02, + width: MediaQuery.of(context).size.width * + 0.02, ), Expanded( child: InkWell( onTap: () { - if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) - model!.getProcedureCategory( - patientId: patient!.patientId, categoryName: procedureName.text); + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) + model.getProcedureCategory( + patientId: patient.patientId, + categoryName: + procedureName.text); else DrAppToastMsg.showErrorToast( - TranslationBase.of(context).atLeastThreeCharacters, + TranslationBase.of(context) + .atLeastThreeCharacters, ); }, child: Icon( @@ -128,13 +141,16 @@ 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); @@ -149,7 +165,8 @@ class _AddProcedurePageState extends State { //TODO build your fun herr // widget.addSelectedHistories(); }, - isEntityListSelected: (master) => isEntityListSelected(master), + isEntityListSelected: (master) => + isEntityListSelected(master), )), ], ), @@ -164,18 +181,19 @@ 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 { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context).fillTheMandatoryProcedureDetails, + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, ); return; } - await this.model!.preparePostProcedure( + await this.model.preparePostProcedure( orderType: selectedType.toString(), entityList: entityList, patient: patient, @@ -193,7 +211,8 @@ class _AddProcedurePageState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList.where((element) => masterKey.procedureId == element.procedureId); + Iterable history = entityList + .where((element) => masterKey.procedureId == element.procedureId); if (history.length > 0) { return true; } diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index 10bbe773..e9ab695b 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -15,28 +15,33 @@ 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({required this.patient, required this.model, required this.procedureType}); + _BaseAddProcedureTabPageState({this.patient, this.model, this.procedureType}); - late TabController _tabController; + TabController _tabController; int _activeTab = 0; @override @@ -63,7 +68,8 @@ class _BaseAddProcedureTabPageState extends State with 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, @@ -71,7 +77,8 @@ class _BaseAddProcedureTabPageState extends State with 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( @@ -79,22 +86,24 @@ class _BaseAddProcedureTabPageState extends State with child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AppText( - procedureType.getToolbarLabel(context), - fontWeight: FontWeight.w700, - fontSize: 20, - ), - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ) - ]), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + procedureType.getToolbarLabel(context), + fontWeight: FontWeight.w700, + fontSize: 20, + ), + InkWell( + child: Icon( + Icons.close, + size: 24.0, + ), + onTap: () { + Navigator.pop(context); + }, + ) + ]), SizedBox( height: MediaQuery.of(context).size.height * 0.04, ), @@ -102,13 +111,16 @@ class _BaseAddProcedureTabPageState extends State with child: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( - preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + preferredSize: Size.fromHeight( + MediaQuery.of(context).size.height * 0.070), child: Container( - height: MediaQuery.of(context).size.height * 0.070, + height: + MediaQuery.of(context).size.height * 0.070, decoration: BoxDecoration( border: Border( - bottom: - BorderSide(color: Theme.of(context).dividerColor, width: 0.5), //width: 0.7 + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.5), //width: 0.7 ), color: Colors.white), child: Center( @@ -119,13 +131,15 @@ class _BaseAddProcedureTabPageState extends State with indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), + labelPadding: EdgeInsets.only( + top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget( screenSize, _activeTab == 0, - procedureType.getFavouriteTabName(context), + procedureType + .getFavouriteTabName(context), ), tabWidget( screenSize, @@ -145,15 +159,22 @@ class _BaseAddProcedureTabPageState extends State with controller: _tabController, children: [ AddFavouriteProcedure( + model: this.model, + prescriptionModel: + widget.prescriptionModel, patient: patient, procedureType: procedureType, ), - if (widget.procedureType == ProcedureType.PRESCRIPTION) - PrescriptionFormWidget(widget.prescriptionModel!, widget.patient!, - widget.prescriptionModel!.prescriptionList) + if (widget.procedureType == + ProcedureType.PRESCRIPTION) + PrescriptionFormWidget( + widget.prescriptionModel, + widget.patient, + widget.prescriptionModel + .prescriptionList) else AddProcedurePage( - model: this.model!, + model: this.model, patient: patient, procedureType: procedureType, ), @@ -174,13 +195,16 @@ class _BaseAddProcedureTabPageState extends State with ); } - Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) { + Widget tabWidget(Size screenSize, bool isActive, String title, + {int counter = -1}) { return Center( child: Container( height: screenSize.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, borderWidth: 0), + isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index a93d8195..725bb007 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -14,31 +14,33 @@ 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, - required this.model, - required this.addSelectedHistories, - required this.removeHistory, - required this.masterList, - required this.addHistory, - required this.isEntityListSelected, + {Key key, + this.model, + this.addSelectedHistories, + this.removeHistory, + this.masterList, + this.addHistory, + this.isEntityListSelected, this.addRemarks}) : super(key: key); @override - _EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState(); + _EntityListCheckboxSearchWidgetState createState() => + _EntityListCheckboxSearchWidgetState(); } -class _EntityListCheckboxSearchWidgetState extends State { +class _EntityListCheckboxSearchWidgetState + extends State { int selectedType = 0; - late int typeUrgent; - late int typeRegular; + int typeUrgent; + int typeRegular; setSelectedType(int val) { setState(() { @@ -46,9 +48,9 @@ class _EntityListCheckboxSearchWidgetState extends State items = []; - List remarksList = []; - List typeList = []; + List items = List(); + List remarksList = List(); + List typeList = List(); @override void initState() { @@ -69,7 +71,9 @@ class _EntityListCheckboxSearchWidgetState extends State dummySearchList = []; + List dummySearchList = List(); dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); 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 2172172b..8d4f93ed 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel. import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.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, - required this.model, + {Key key, + this.model, this.addSelectedHistories, this.removeHistory, this.masterList, this.addHistory, - required this.addFavProcedure, + this.addFavProcedure, this.selectProcedures, - required this.removeFavProcedure, + this.removeFavProcedure, this.isEntityListSelected, this.isEntityFavListSelected, this.addRemarks, @@ -55,8 +55,8 @@ class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { class _EntityListCheckboxSearchFavProceduresWidgetState extends State { int selectedType = 0; - late int typeUrgent; - late int typeRegular; + int typeUrgent; + int typeRegular; setSelectedType(int val) { setState(() { @@ -64,10 +64,10 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State items = []; - List itemsProcedure = []; - List remarksList = []; - List typeList = []; + List items = List(); + List itemsProcedure = List(); + List remarksList = List(); + List typeList = List(); @override void initState() { @@ -112,11 +112,11 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State dummySearchList = []; - dummySearchList.addAll(widget.masterList!); + List dummySearchList = List(); + dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); 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 remarksList = List(); final TextEditingController remarksController = TextEditingController(); - List typeList = []; + List typeList = List(); @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( @@ -71,7 +67,7 @@ class _ProcedureCheckOutScreenState extends State { width: 5.0, ), AppText( - widget.toolbarTitle, + widget.toolbarTitle ?? 'Add Procedure', fontWeight: FontWeight.w700, fontSize: 20, ), @@ -198,11 +194,11 @@ class _ProcedureCheckOutScreenState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: widget.addButtonTitle, + title: widget.addButtonTitle ?? TranslationBase.of(context).addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { - List entityList = []; + List entityList = List(); widget.items.forEach((element) { entityList.add( EntityList( diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index f4e3d676..79fb961c 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -4,11 +4,11 @@ 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'; 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/transitions/slide_up_page.dart'; @@ -19,7 +19,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 +29,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 +38,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, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, + appBar: PatientProfileAppBar( + patient, isInpatient: isInpatient, ), body: SingleChildScrollView( @@ -152,33 +152,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 1909fec7..24c4ea41 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -9,7 +9,7 @@ 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'; import 'package:doctor_app_flutter/util/translations_delegate_base.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'; @@ -17,15 +17,15 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; void updateProcedureForm(context, - {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}) { + {String procedureName, + int orderNo, + int limetNo, + PatiantInformtion patient, + String orderType, + String procedureId, + String remarks, + ProcedureViewModel model, + String categoreId}) { //ProcedureViewModel model2 = ProcedureViewModel(); TextEditingController remarksController = TextEditingController(); TextEditingController orderController = TextEditingController(); @@ -59,15 +59,15 @@ class UpdateProcedureWidget extends StatefulWidget { final int limetNo; UpdateProcedureWidget( - {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}); + {this.model, + this.procedureName, + this.remarks, + this.remarksController, + this.patient, + this.procedureId, + this.categoryId, + this.orderNo, + this.limetNo}); @override _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); } @@ -85,22 +85,26 @@ class _UpdateProcedureWidgetState extends State { widget.remarksController.text = widget.remarks; } - List entityList = []; + List entityList = List(); 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: [ @@ -242,8 +246,8 @@ class _UpdateProcedureWidgetState extends State { activeColor: Color(0xFFB9382C), value: 0, groupValue: selectedType, - onChanged: (int? value) { - setSelectedType(value!); + onChanged: (value) { + setSelectedType(value); }, ), Text('routine'), @@ -251,11 +255,11 @@ class _UpdateProcedureWidgetState extends State { activeColor: Color(0xFFB9382C), groupValue: selectedType, value: 1, - onChanged: (int? value) { - setSelectedType(value!); + onChanged: (value) { + setSelectedType(value); }, ), - Text(TranslationBase.of(context).urgent ?? ""), + Text(TranslationBase.of(context).urgent), ], ), ), @@ -264,12 +268,16 @@ class _UpdateProcedureWidgetState 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( fontSize: 15.0, controller: widget.remarksController, - hintText: widget.remarksController.text.isEmpty ? 'No Remarks Added' : '', + hintText: widget.remarksController.text.isEmpty + ? 'No Remarks Added' + : '', maxLines: 3, minLines: 2, onChanged: (value) {}, @@ -279,13 +287,16 @@ class _UpdateProcedureWidgetState extends State { height: 70.0, ), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + margin: + EdgeInsets.all(SizeConfig.widthMultiplier * 2), child: Column( //alignment: WrapAlignment.center, 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 == @@ -332,19 +343,20 @@ class _UpdateProcedureWidgetState extends State { } updateProcedure( - {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 = []; + {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(); ProcedureDetail controlsProcedure = new ProcedureDetail(); updateProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -373,7 +385,8 @@ class _UpdateProcedureWidgetState extends State { // else { { controls.add( - Controls(code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), + Controls( + code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), ); controls.add( Controls(code: "ordertype", controlValue: orderType), @@ -388,7 +401,9 @@ class _UpdateProcedureWidgetState extends State { // category: categorieId, procedure: procedureId, controls: controls)); updateProcedureReqModel.procedureDetail = controlsProcedure; - await model.updateProcedure(updateProcedureRequestModel: updateProcedureReqModel, mrn: patient.patientMRN); + await model.updateProcedure( + updateProcedureRequestModel: updateProcedureReqModel, + mrn: patient.patientMRN); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -400,15 +415,17 @@ class _UpdateProcedureWidgetState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList.where((element) => masterKey.procedureId == element.procedureId); + Iterable history = entityList + .where((element) => masterKey.procedureId == element.procedureId); if (history.length > 0) { return true; } 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 c0b905fe..c06a8722 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -32,7 +32,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), @@ -100,7 +100,6 @@ class _QrReaderScreenState extends State { "isInpatient": true, }); } else { - DrAppToastMsg.showErrorToast(model.error); } }).catchError((error) { diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 3337364f..f6e1b8d7 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -17,7 +17,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class AddRescheduleLeavScreen extends StatelessWidget { - late ProjectViewModel projectsProvider; + ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); @@ -26,25 +26,25 @@ 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( padding: const EdgeInsets.all(8.0), - child:AddNewOrder( - onTap: () async { + child: AddNewOrder( + onTap: () async { await locator().logEvent( eventCategory: "Add Reschedule" "Leave Screen", eventAction: "apply For Reschedule", ); - openLeave( - context, - false, - ); - }, - label: TranslationBase.of(context).applyForReschedule ?? "", - ), + openLeave( + context, + false, + ); + }, + label: TranslationBase.of(context).applyForReschedule, + ), ), Column( children: model.getReschduleLeave.map((GetRescheduleLeavesResponse item) { @@ -58,74 +58,74 @@ class AddRescheduleLeavScreen extends StatelessWidget { border: Border( left: BorderSide( color: item.status == 10 - ? Colors.red[800]! - : item.status == 2 - ? HexColor('#CC9B14') - : item.status == 9 - ? Colors.green - : Colors.red, - width: 5.0, - ))), - padding: EdgeInsets.only(left: 10, right: 10), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Wrap( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - padding: EdgeInsets.all(3), - margin: EdgeInsets.only(top: 10), - child: AppText( - item.statusDescription, - fontWeight: FontWeight.bold, - color: item.status == 10 - ? Colors.red[800] - : item.status == 2 - ? HexColor('#CC9B14') - : item.status == 9 - ? Colors.green - : Colors.red, - fontSize: 14, + ? Colors.red[800] + : item.status == 2 + ? HexColor('#CC9B14') + : item.status == 9 + ? Colors.green + : Colors.red, + width: 5.0, + ))), + padding: EdgeInsets.only(left: 10, right: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Wrap( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Container( + padding: EdgeInsets.all(3), + margin: EdgeInsets.only(top: 10), + child: AppText( + item.statusDescription, + fontWeight: FontWeight.bold, + color: item.status == 10 + ? Colors.red[800] + : item.status == 2 + ? HexColor('#CC9B14') + : item.status == 9 + ? Colors.green + : Colors.red, + fontSize: 14, + ), ), + Padding( + padding: EdgeInsets.only(top: 10), + child: AppText( + AppDateUtils.convertStringToDateFormat( + item.createdOn, 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + )) + ]), + SizedBox( + height: 5, ), - Padding( - padding: EdgeInsets.only(top: 10), + Container( child: AppText( - AppDateUtils.convertStringToDateFormat( - item.createdOn ?? "", 'yyyy-MM-dd HH:mm'), - fontWeight: FontWeight.bold, - )) - ]), - SizedBox( - height: 5, - ), - Container( - child: AppText( - item.requisitionType == 1 - ? TranslationBase.of(context).offTime - : item.requisitionType == 2 - ? TranslationBase.of(context).holiday - : item.requisitionType == 3 - ? TranslationBase.of(context).changeOfSchedule - : TranslationBase.of(context).newSchedule, - fontWeight: FontWeight.bold, - )), - SizedBox( - height: 5, - ), - Row(children: [ - AppText(TranslationBase.of(context).startDate), - AppText( - AppDateUtils.convertStringToDateFormat( - item.dateTimeFrom ?? "", 'yyyy-MM-dd HH:mm'), + item.requisitionType == 1 + ? TranslationBase.of(context).offTime + : item.requisitionType == 2 + ? TranslationBase.of(context).holiday + : item.requisitionType == 3 + ? TranslationBase.of(context).changeOfSchedule + : TranslationBase.of(context).newSchedule, fontWeight: FontWeight.bold, - ) + )), + SizedBox( + height: 5, + ), + Row(children: [ + AppText(TranslationBase.of(context).startDate), + AppText( + AppDateUtils.convertStringToDateFormat( + item.dateTimeFrom, 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + ) // overflow: // TextOverflow.ellipsis, @@ -134,63 +134,63 @@ class AddRescheduleLeavScreen extends StatelessWidget { // overflow: // TextOverflow.ellipsis, - SizedBox( - height: 5, - ), - Row( - children: [ - AppText(TranslationBase.of(context).endDate), - AppText( - AppDateUtils.convertStringToDateFormat( - item.dateTimeTo ?? "", 'yyyy-MM-dd HH:mm'), - fontWeight: FontWeight.bold, - ) - ], - ), + SizedBox( + height: 5, + ), + Row( + children: [ + AppText(TranslationBase.of(context).endDate), + AppText( + AppDateUtils.convertStringToDateFormat( + item.dateTimeTo, 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + ) + ], + ), - SizedBox( - height: 5, - ), - model.coveringDoctors.length > 0 - ? Row(children: [ - AppText( - TranslationBase.of(context).coveringDoctor, - ), - AppText( - getDoctor(model.coveringDoctors, item.coveringDoctorId), - fontWeight: FontWeight.bold, - ) - ]) - : SizedBox(), - // AppText( - // TranslationBase.of(context) - // .reasons, - // fontWeight: FontWeight.bold, - // ), - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: EdgeInsets.only(bottom: 5), - child: AppText(getReasons(model.allReasons, item.reasonId))), - (item.status == 2) - ? IconButton( - icon: Image.asset('assets/images/edit.png'), - // color: Colors.green, //Colors.black, - onPressed: () => {openLeave(context, true, extendedData: item)}, + SizedBox( + height: 5, + ), + model.coveringDoctors.length > 0 + ? Row(children: [ + AppText( + TranslationBase.of(context).coveringDoctor, + ), + AppText( + getDoctor(model.coveringDoctors, item.coveringDoctorId), + fontWeight: FontWeight.bold, ) - + ]) : SizedBox(), - ]), - ], - ), - SizedBox( - width: 10, - ), - ], + // AppText( + // TranslationBase.of(context) + // .reasons, + // fontWeight: FontWeight.bold, + // ), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Padding( + padding: EdgeInsets.only(bottom: 5), + child: AppText(getReasons(model.allReasons, item.reasonId))), + (item.status == 2) + ? IconButton( + icon: Image.asset('assets/images/edit.png'), + // color: Colors.green, //Colors.black, + onPressed: () => {openLeave(context, true, extendedData: item)}, + ) + : SizedBox(), + ]), + ], + ), + SizedBox( + width: 10, + ), + ], + ), ), - ), - ], - )), - ],), + ], + )), + ], + ), ), ); }).toList(), diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 7d90c9a8..925d0bb7 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -104,615 +104,615 @@ class _RescheduleLeaveScreen extends State { onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( onModelReady: (model2) => { - model2.getOffTime(), - model2.getReasons(offTime == '1' - ? 18 - : offTime == '2' - ? 19 - : 102), - model2.getCoveringDoctors() - }, + model2.getOffTime(), + model2.getReasons(offTime == '1' + ? 18 + : offTime == '2' + ? 19 + : 102), + model2.getCoveringDoctors() + }, builder: (_, model2, w) => GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: AppScaffold( - baseViewModel: model2, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves, - body: Center( - child: Container( - margin: EdgeInsets.only(top: 10), - child: FractionallySizedBox( - widthFactor: 0.9, - child: ListView( - children: [ - // Container( - // margin: EdgeInsets.all(8), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.all( - // Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // width: double.infinity, - // child: Padding( - // padding: EdgeInsets.only( - // top: SizeConfig.widthMultiplier * 0.9, - // bottom: - // SizeConfig.widthMultiplier * 0.9, - // right: SizeConfig.widthMultiplier * 3, - // left: SizeConfig.widthMultiplier * 3), - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Expanded( - // // add Expanded to have your dropdown button fill remaining space - // child: - // DropdownButtonHideUnderline( - // child: new IgnorePointer( - // ignoring: true, - // child: DropdownButton( - // focusColor: - // Colors.grey, - // isExpanded: true, - // dropdownColor: - // Colors.grey, - // value: getClinicName( - // model) ?? - // "", - // iconSize: 0, - // elevation: 16, - // selectedItemBuilder: - // (BuildContext - // context) { - // return model - // .getClinicNameList() - // .map((item) { - // return Row( - // mainAxisSize: - // MainAxisSize - // .max, - // children: < - // Widget>[ - // AppText( - // item, - // fontSize: - // SizeConfig.textMultiplier * - // 2.1, - // color: Colors - // .grey[ - // 500], - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: - // (newValue) => - // {}, - // items: model - // .getClinicNameList() - // .map((item) { - // return DropdownMenuItem( - // value: item - // .toString(), - // child: Text( - // item, - // textAlign: - // TextAlign - // .end, - // ), - // ); - // }).toList(), - // ))), - // ), - // ], - // ) - // ], - // ), - // )), - - // Container( - // margin: EdgeInsets.all(8), - // decoration: BoxDecoration( - // borderRadius: - // BorderRadius.all(Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // padding: EdgeInsets.all(5), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // new IgnorePointer( - // ignoring: true, - // child: AppTextFormField( - // readOnly: true, - // hintText: profile != null - // ? profile['DoctorName'] - // : "", - // borderColor: Colors.white, - // onSaved: (value) {}, - // inputFormatter: ONLY_NUMBERS)) - // ], - // ), - // ), + onTap: () { + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( + baseViewModel: model2, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).rescheduleLeaves, + body: Center( + child: Container( + margin: EdgeInsets.only(top: 10), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( + children: [ + // Container( + // margin: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all( + // Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // width: double.infinity, + // child: Padding( + // padding: EdgeInsets.only( + // top: SizeConfig.widthMultiplier * 0.9, + // bottom: + // SizeConfig.widthMultiplier * 0.9, + // right: SizeConfig.widthMultiplier * 3, + // left: SizeConfig.widthMultiplier * 3), + // child: Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Expanded( + // // add Expanded to have your dropdown button fill remaining space + // child: + // DropdownButtonHideUnderline( + // child: new IgnorePointer( + // ignoring: true, + // child: DropdownButton( + // focusColor: + // Colors.grey, + // isExpanded: true, + // dropdownColor: + // Colors.grey, + // value: getClinicName( + // model) ?? + // "", + // iconSize: 0, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext + // context) { + // return model + // .getClinicNameList() + // .map((item) { + // return Row( + // mainAxisSize: + // MainAxisSize + // .max, + // children: < + // Widget>[ + // AppText( + // item, + // fontSize: + // SizeConfig.textMultiplier * + // 2.1, + // color: Colors + // .grey[ + // 500], + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: + // (newValue) => + // {}, + // items: model + // .getClinicNameList() + // .map((item) { + // return DropdownMenuItem( + // value: item + // .toString(), + // child: Text( + // item, + // textAlign: + // TextAlign + // .end, + // ), + // ); + // }).toList(), + // ))), + // ), + // ], + // ) + // ], + // ), + // )), - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.allOffTime.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( - // focusColor: Colors.grey, - isExpanded: true, - value: offTime == null ? model2.allOffTime[0]['code'] : offTime, - iconSize: 40, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return model2.allOffTime.map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item['description'], + // Container( + // margin: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: + // BorderRadius.all(Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // padding: EdgeInsets.all(5), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // new IgnorePointer( + // ignoring: true, + // child: AppTextFormField( + // readOnly: true, + // hintText: profile != null + // ? profile['DoctorName'] + // : "", + // borderColor: Colors.white, + // onSaved: (value) {}, + // inputFormatter: ONLY_NUMBERS)) + // ], + // ), + // ), - fontSize: SizeConfig.textMultiplier * 2.1, - // color: - // Colors.grey, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) { - setState(() { - offTime = newValue; - }); - if (offTime == '1') { - model2.getReasons(18); - } else if (offTime == '2') { - model2.getReasons(19); - } else if (offTime == '3' || offTime == '5') { - model2.getReasons(102); - setState(() { - offTime = newValue; - }); - } - }, - items: model2.allOffTime.map((item) { - return DropdownMenuItem( - value: item['code'].toString(), - child: Text( - item['description'], - textAlign: TextAlign.end, - ), - ); - }).toList(), - )), - ) - : SizedBox(), - ], - ) - ], - ), - )), - offTime == '1' - ? Column( - children: [ Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context).fromDate, - borderColor: Colors.white, - prefix: IconButton(icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController, - onTap: () { - _presentDatePicker('fromDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (val) => fromDate = val, - onSaved: (val) => fromDate = val, - ) - ], - )), - Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DateTimePicker( - timeHintText: TranslationBase.of(context).fromTime, - type: DateTimePickerType.time, - controller: _controller4, - onChanged: (val) => fromTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => fromTime = val, - ) - ], - ), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.allOffTime.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: DropdownButton( + // focusColor: Colors.grey, + isExpanded: true, + value: offTime == null ? model2.allOffTime[0]['code'] : offTime, + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model2.allOffTime.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item['description'], + + fontSize: SizeConfig.textMultiplier * 2.1, + // color: + // Colors.grey, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) { + setState(() { + offTime = newValue; + }); + if (offTime == '1') { + model2.getReasons(18); + } else if (offTime == '2') { + model2.getReasons(19); + } else if (offTime == '3' || offTime == '5') { + model2.getReasons(102); + setState(() { + offTime = newValue; + }); + } + }, + items: model2.allOffTime.map((item) { + return DropdownMenuItem( + value: item['code'].toString(), + child: Text( + item['description'], + textAlign: TextAlign.end, + ), + ); + }).toList(), + )), + ) + : SizedBox(), + ], + ) + ], ), - ), - Expanded( - child: Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DateTimePicker( - timeHintText: TranslationBase.of(context).toTime, - type: DateTimePickerType.time, - controller: _controller5, - onChanged: (val) => toTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => toTime = val, - ) - ], - ), + )), + offTime == '1' + ? Column( + children: [ + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context).fromDate, + borderColor: Colors.white, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker('fromDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (val) => fromDate = val, + onSaved: (val) => fromDate = val, + ) + ], + )), + Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DateTimePicker( + timeHintText: TranslationBase.of(context).fromTime, + type: DateTimePickerType.time, + controller: _controller4, + onChanged: (val) => fromTime = val, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => fromTime = val, + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DateTimePicker( + timeHintText: TranslationBase.of(context).toTime, + type: DateTimePickerType.time, + controller: _controller5, + onChanged: (val) => toTime = val, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => toTime = val, + ) + ], + ), + ), + ) + ], + ) + ], + ) + : Column( + children: [ + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context).fromDate, + borderColor: Colors.white, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + readOnly: true, + controller: _toDateController, + onTap: () { + _presentDatePicker('fromDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + setState(() { + fromDate = value; + }); + }), + ], + )), + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context).toDate, + readOnly: true, + borderColor: Colors.white, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController2, + onTap: () { + _presentDatePicker('toDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + setState(() { + toDate = value; + }); + }), + ], + )) + ], ), - ) - ], - ) - ], - ) - : Column( - children: [ Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context).fromDate, - borderColor: Colors.white, - prefix: IconButton(icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - readOnly: true, - controller: _toDateController, - onTap: () { - _presentDatePicker('fromDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - setState(() { - fromDate = value; - }); - }), - ], + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.allReasons.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: DropdownButton( + focusColor: Colors.grey, + isExpanded: true, + value: model2.allReasons[0]['id'].toString() ?? "", + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model2.allReasons.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + projectsProvider.isArabic + ? item['nameAr'] + : item['nameEn'], + fontSize: SizeConfig.textMultiplier * 2.1, + // color: + // Colors.grey, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + reason = newValue; + }) + }, + items: model2.allReasons.map((item) { + return DropdownMenuItem( + value: item['id'].toString(), + child: Text( + projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], + textAlign: TextAlign.end, + ), + ); + }).toList(), + )), + ) + : SizedBox(), + ], + ) + ], + ), )), + Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context).toDate, - readOnly: true, - borderColor: Colors.white, - prefix: IconButton(icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController2, - onTap: () { - _presentDatePicker('toDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - setState(() { - toDate = value; - }); - }), - ], - )) - ], - ), - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.allReasons.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( - focusColor: Colors.grey, - isExpanded: true, - value: model2.allReasons[0]['id'].toString() ?? "", - iconSize: 40, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return model2.allReasons.map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - projectsProvider.isArabic - ? item['nameAr'] - : item['nameEn'], - fontSize: SizeConfig.textMultiplier * 2.1, - // color: - // Colors.grey, + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.coveringDoctors.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownSearch( + mode: Mode.BOTTOM_SHEET, + + dropdownSearchDecoration: InputDecoration( + contentPadding: EdgeInsets.all(0), border: InputBorder.none), + //maxHeight: 300, + items: model2.coveringDoctors.map((item) { + return projectsProvider.isArabic + ? item['doctorNameN'] + : item['doctorName']; + }).toList(), + // label: "Doctor List", + onChanged: (item) { + model2.coveringDoctors.forEach((newVal) => { + if (newVal['doctorName'] == item) + doctorID = newVal['DoctorID'] + }); + }, + selectedItem: getSelectedDoctor(model2), + showSearchBox: true, + searchBoxDecoration: InputDecoration( + border: OutlineInputBorder(), + contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), + labelText: "Search Doctor", + ), + popupTitle: Container( + height: 50, + decoration: BoxDecoration( + color: Theme.of(context).primaryColorDark, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + ), + child: Center( + child: Text( + '', + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - reason = newValue; - }) - }, - items: model2.allReasons.map((item) { - return DropdownMenuItem( - value: item['id'].toString(), - child: Text( - projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], - textAlign: TextAlign.end, + ), + popupShape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(24), + topRight: Radius.circular(24), + ), + ), ), - ); - }).toList(), - )), - ) - : SizedBox(), - ], - ) - ], - ), - )), - - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.coveringDoctors.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownSearch( - mode: Mode.BOTTOM_SHEET, - - dropdownSearchDecoration: InputDecoration( - contentPadding: EdgeInsets.all(0), border: InputBorder.none), - //maxHeight: 300, - items: model2.coveringDoctors.map((item) { - return projectsProvider.isArabic - ? item['doctorNameN'] - : item['doctorName']; - }).toList(), - // label: "Doctor List", - onChanged: (item) { - model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorName'] == item) - doctorID = newVal['DoctorID'] - }); - }, - selectedItem: getSelectedDoctor(model2), - showSearchBox: true, - searchBoxDecoration: InputDecoration( - border: OutlineInputBorder(), - contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), - labelText: "Search Doctor", - ), - popupTitle: Container( - height: 50, - decoration: BoxDecoration( - color: Theme.of(context).primaryColorDark, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(20), - topRight: Radius.circular(20), - ), - ), - child: Center( - child: Text( - '', - style: TextStyle( - fontSize: 24, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ), - ), - ), - popupShape: RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(24), - topRight: Radius.circular(24), - ), - ), - ), - // DropdownButtonHideUnderline( - // child: DropdownButton( - // focusColor: Colors.grey, - // isExpanded: true, - // value: doctorID == null - // ? model2 - // .coveringDoctors[0] - // ['doctorID'] - // .toString() - // : doctorID, - // iconSize: 40, - // elevation: 16, - // selectedItemBuilder: - // (BuildContext context) { - // return model2 - // .coveringDoctors - // .map((item) { - // return Row( - // mainAxisSize: - // MainAxisSize.max, - // children: [ - // AppText( - // projectsProvider - // .isArabic - // ? item[ - // 'doctorNameN'] - // : item[ - // 'doctorName'], - // fontSize: SizeConfig - // .textMultiplier * - // 2.1, - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: (newValue) => { - // setState(() { - // doctorID = newValue; - // }) - // }, - // items: model2 - // .coveringDoctors - // .map((item) { - // return DropdownMenuItem< - // String>( - // value: item['doctorID'] - // .toString(), - // child: Text( - // projectsProvider - // .isArabic - // ? item[ - // 'doctorNameN'] - // : item[ - // 'doctorName'], - // textAlign: - // TextAlign.start, - // ), - // ); - // }).toList(), - // )), + // DropdownButtonHideUnderline( + // child: DropdownButton( + // focusColor: Colors.grey, + // isExpanded: true, + // value: doctorID == null + // ? model2 + // .coveringDoctors[0] + // ['doctorID'] + // .toString() + // : doctorID, + // iconSize: 40, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext context) { + // return model2 + // .coveringDoctors + // .map((item) { + // return Row( + // mainAxisSize: + // MainAxisSize.max, + // children: [ + // AppText( + // projectsProvider + // .isArabic + // ? item[ + // 'doctorNameN'] + // : item[ + // 'doctorName'], + // fontSize: SizeConfig + // .textMultiplier * + // 2.1, + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: (newValue) => { + // setState(() { + // doctorID = newValue; + // }) + // }, + // items: model2 + // .coveringDoctors + // .map((item) { + // return DropdownMenuItem< + // String>( + // value: item['doctorID'] + // .toString(), + // child: Text( + // projectsProvider + // .isArabic + // ? item[ + // 'doctorNameN'] + // : item[ + // 'doctorName'], + // textAlign: + // TextAlign.start, + // ), + // ); + // }).toList(), + // )), + ) + : SizedBox(), + ], ) - : SizedBox(), ], - ) + ), + )), + SizedBox(height: SizeConfig.screenHeight * .3), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: widget.isUpdate == true + ? TranslationBase.of(context).updateReschedule + : TranslationBase.of(context).addReschedule, + color: HexColor('#359846'), + onPressed: () { + if (offTime == '1' || offTime == '2') { + if (widget.isUpdate == true) { + updateRecheduleLeave(model2); + } else { + addRecheduleLeave(model2); + } + } else { + DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); + } + }, + ), ], ), - )), - SizedBox(height: SizeConfig.screenHeight * .3), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: widget.isUpdate == true - ? TranslationBase.of(context).updateReschedule - : TranslationBase.of(context).addReschedule, - color: HexColor('#359846'), - onPressed: () { - if (offTime == '1' || offTime == '2') { - if (widget.isUpdate == true) { - updateRecheduleLeave(model2); - } else { - addRecheduleLeave(model2); - } - } else { - DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); - } - }, - ), - ], - ), + ), + // Column( + // children: [ + // AppText(TranslationBase.of(context) + // .previousSickLeaveIssue + + // ' ') + // ], + // ) + ], ), - // Column( - // children: [ - // AppText(TranslationBase.of(context) - // .previousSickLeaveIssue + - // ' ') - // ], - // ) - ], + ), ), ), ), - ), - ), - ))); + ))); } getProfile() async { @@ -796,8 +796,8 @@ class _RescheduleLeaveScreen extends State { context, MaterialPageRoute( builder: (context) => AddRescheduleLeavScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen') - // MyReferredPatient(), - ), + // MyReferredPatient(), + ), ); } }); @@ -867,8 +867,8 @@ class _RescheduleLeaveScreen extends State { : model2.coveringDoctors[0]['doctorName']; else { model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} - }); + if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} + }); return doctorName; } } diff --git a/lib/util/NotificationPermissionUtils.dart b/lib/util/NotificationPermissionUtils.dart index 550fedc5..8950fae3 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({required BuildContext context, required String type,required Function onTapGrant}) async { + static requestVideoCallPermission({BuildContext context, String type,Function onTapGrant}) async { var cameraPermission = Permission.camera; var microphonePermission = Permission.microphone; diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index a5e0f581..0239bf57 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -1,3 +1,4 @@ + import 'dart:convert'; import 'dart:io' show Platform; @@ -6,22 +7,12 @@ import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -class VideoChannel { +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, - required 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, String patientName, bool isRecording = false, Function() onCallEnd , + Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure, VoidCallback onCallConnected, VoidCallback onCallDisconnected}) async { onCallConnected = onCallConnected ?? (){}; onCallDisconnected = onCallDisconnected ?? (){}; @@ -29,10 +20,10 @@ class VideoChannel { try { _channel.setMethodCallHandler((call) { if(call.method == 'onCallConnected'){ - onCallConnected!(); + onCallConnected(); } if(call.method == 'onCallDisconnected'){ - onCallDisconnected!(); + onCallDisconnected(); } return true as dynamic; }); @@ -48,20 +39,24 @@ class VideoChannel { "VC_ID": vcId, "TokenID": tokenID, "generalId": generalId, - "DoctorId": doctorId, + "DoctorId": doctorId , "patientName": patientName, "isRecording": isRecording, }, ); - if (result['callResponse'] == 'CallEnd') { - onCallEnd!(); - } else { - SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson( - Platform.isIOS ? result['sessionStatus'] : json.decode(result['sessionStatus'])); - onCallNotRespond!(sessionStatusModel); + if(result['callResponse'] == 'CallEnd') { + onCallEnd(); + } + else { + SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson(Platform.isIOS ?result['sessionStatus'] :json.decode(result['sessionStatus'])); + onCallNotRespond(sessionStatusModel); } + } catch (e) { - onFailure!(e.toString()); + onFailure(e.toString()); } + } -} + + +} \ No newline at end of file diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 26df2120..a10a18e3 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 f08a6e3c..bac296bf 100644 --- a/lib/util/dr_app_shared_pref.dart +++ b/lib/util/dr_app_shared_pref.dart @@ -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; } @@ -81,10 +81,10 @@ class DrAppSharedPreferances { return prefs.getInt(key); } - getObj(String key) async { + getObj(String key) async{ final SharedPreferences prefs = await _prefs; var string = prefs.getString(key); - if (string == null) { + if (string == null ){ return null; } return json.decode(string); @@ -92,8 +92,8 @@ class DrAppSharedPreferances { clear() async { final SharedPreferences prefs = await _prefs; - var vvas = await prefs.clear(); - var asd; + var vvas= await prefs.clear(); + var asd; } remove(String key) async { diff --git a/lib/util/extenstions.dart b/lib/util/extenstions.dart index a0fd8082..da353ad0 100644 --- a/lib/util/extenstions.dart +++ b/lib/util/extenstions.dart @@ -1,5 +1,10 @@ extension Extension on Object { - bool isNullOrEmpty() => this == ''; + bool isNullOrEmpty() => this == null || this == ''; + + bool isNullEmptyOrFalse() => this == null || this == '' || !this; + + bool isNullEmptyZeroOrFalse() => + this == null || this == '' || !this || this == 0; } /// 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 d1a6d0a5..169ad81c 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -1,9 +1,12 @@ import 'package:connectivity/connectivity.dart'; 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/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -26,7 +29,8 @@ class Helpers { get currentLanguage => null; - static showConfirmationDialog(BuildContext context, String message, Function okFunction) { + static showConfirmationDialog( + BuildContext context, String message, Function okFunction) { return showDialog( context: context, barrierDismissible: false, // user must tap button! @@ -42,7 +46,7 @@ class Helpers { ), actions: [ AppButton( - onPressed: okFunction(), + onPressed: okFunction, title: TranslationBase.of(context).noteConfirm, fontColor: Colors.white, color: Colors.green[600], @@ -63,8 +67,8 @@ class Helpers { }); } - static showCupertinoPicker( - context, List items, decKey, onSelectFun, AuthenticationViewModel model) { + static showCupertinoPicker(context, List items, + decKey, onSelectFun, AuthenticationViewModel model) { showModalBottomSheet( isDismissible: false, context: context, @@ -82,14 +86,15 @@ 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: () { @@ -103,19 +108,23 @@ class Helpers { Container( height: SizeConfig.realScreenHeight * 0.3, color: Color(0xfff7f7f7), - child: buildPickerItems(context, items, decKey, onSelectFun, model)) + child: buildPickerItems( + context, items, decKey, onSelectFun, model)) ], ), ); }); } - static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor); + static TextStyle textStyle(context) => + TextStyle(color: Theme.of(context).primaryColor); - static buildPickerItems(context, List items, decKey, onSelectFun, model) { + static buildPickerItems(context, List items, + decKey, onSelectFun, model) { return CupertinoPicker( magnification: 1.5, - scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex), + scrollController: + FixedExtentScrollController(initialItem: cupertinoPickerIndex), children: items.map((item) { return Text( '${item.facilityName}', @@ -141,8 +150,10 @@ class Helpers { } static Future checkConnection() async { - ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); - if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) { + ConnectivityResult connectivityResult = + await (Connectivity().checkConnectivity()); + if ((connectivityResult == ConnectivityResult.mobile) || + (connectivityResult == ConnectivityResult.wifi)) { return true; } else { return false; @@ -154,8 +165,9 @@ class Helpers { List listOfHours = workingHours.split('a'); listOfHours.forEach((element) { - WorkingHours? workingHours = WorkingHours(); - var from = element.substring(element.indexOf('m ') + 2, element.indexOf('To') - 1); + WorkingHours workingHours = WorkingHours(); + var from = element.substring( + element.indexOf('m ') + 2, element.indexOf('To') - 1); workingHours.from = from.trim(); var to = element.substring(element.indexOf('To') + 2); workingHours.to = to.trim(); @@ -202,13 +214,14 @@ 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), @@ -238,7 +251,9 @@ class Helpers { ); } - static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, {double borderWidth = -1}) { + static BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor, + {double borderWidth = -1}) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -268,23 +283,9 @@ class Helpers { return htmlRegex.hasMatch(text); } - static getNameFromKPI(String kpi) { - if (kpi.indexOf("(") > -1) - return kpi.substring(0, kpi.indexOf("(")); - else - return kpi; - } - - static getLabelFromKPI(String kpi) { - if (kpi.indexOf("(") > -1 && kpi.indexOf(")") > -1) - return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")")); - else - return ''; - } - - static String timeFrom({Duration? duration}) { + static String timeFrom({Duration duration}) { String twoDigits(int n) => n.toString().padLeft(2, "0"); - String twoDigitMinutes = twoDigits(duration!.inMinutes.remainder(60)); + String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60)); String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); return "$twoDigitMinutes:$twoDigitSeconds"; } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 114de3d3..397f8b36 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -7,1111 +7,1112 @@ import 'package:flutter/material.dart'; class TranslationBase { TranslationBase(this.locale); - late Locale locale; + final 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 settings => localizedValues['settings'][locale.languageCode]; - String? get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo']![locale.languageCode]; + String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; - String? get language => localizedValues['language']![locale.languageCode]; + String get language => localizedValues['language'][locale.languageCode]; - String? get lanEnglish => localizedValues['lanEnglish']![locale.languageCode]; + String get lanEnglish => localizedValues['lanEnglish'][locale.languageCode]; - String? get lanArabic => localizedValues['lanArabic']![locale.languageCode]; + String get lanArabic => localizedValues['lanArabic'][locale.languageCode]; - String? get theDoctor => localizedValues['theDoctor']![locale.languageCode]; + String get theDoctor => localizedValues['theDoctor'][locale.languageCode]; - String? get reply => localizedValues['reply']![locale.languageCode]; + String get reply => localizedValues['reply'][locale.languageCode]; - String? get time => localizedValues['time']![locale.languageCode]; + String get time => localizedValues['time'][locale.languageCode]; - String? get fileNo => localizedValues['fileNo']![locale.languageCode]; + String get fileNo => localizedValues['fileNo'][locale.languageCode]; - String? get mobileNo => localizedValues['mobileNo']![locale.languageCode]; + String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; - String? get replySuccessfully => localizedValues['replySuccessfully']![locale.languageCode]; + String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; - String? get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle']![locale.languageCode]; + String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; - String? get mySchedule => localizedValues['mySchedule']![locale.languageCode]; + String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; - String? get errorNoSchedule => localizedValues['errorNoSchedule']![locale.languageCode]; + String get errorNoSchedule => localizedValues['errorNoSchedule'][locale.languageCode]; - String? get verify => localizedValues['verify']![locale.languageCode]; + String get verify => localizedValues['verify'][locale.languageCode]; - String? get referralDoctor => localizedValues['referralDoctor']![locale.languageCode]; + String get referralDoctor => localizedValues['referralDoctor'][locale.languageCode]; - String? get referringClinic => localizedValues['referringClinic']![locale.languageCode]; + String get referringClinic => localizedValues['referringClinic'][locale.languageCode]; - String? get frequency => localizedValues['frequency']![locale.languageCode]; + String get frequency => localizedValues['frequency'][locale.languageCode]; - String? get priority => localizedValues['priority']![locale.languageCode]; + String get priority => localizedValues['priority'][locale.languageCode]; - String? get maxResponseTime => localizedValues['maxResponseTime']![locale.languageCode]; + String get maxResponseTime => localizedValues['maxResponseTime'][locale.languageCode]; - String? get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks']![locale.languageCode]; + String get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks'][locale.languageCode]; - String? get answerSuggestions => localizedValues['answerSuggestions']![locale.languageCode]; + String get answerSuggestions => localizedValues['answerSuggestions'][locale.languageCode]; - String? get outPatients => localizedValues['outPatients']![locale.languageCode]; + String get outPatients => localizedValues['outPatients'][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 searchPatient => localizedValues['searchPatient'][locale.languageCode]; + String get searchPatientDashBoard => localizedValues['searchPatientDashBoard'][locale.languageCode]; + String get searchPatientName => localizedValues['searchPatient-name'][locale.languageCode]; - String? get searchAbout => localizedValues['searchAbout']![locale.languageCode]; + String get searchAbout => localizedValues['searchAbout'][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 patient => localizedValues['patient'][locale.languageCode]; + String get patients => localizedValues['patients'][locale.languageCode]; + String get labResult => localizedValues['labResult'][locale.languageCode]; - String? get todayStatistics => localizedValues['todayStatistics']![locale.languageCode]; + String get todayStatistics => localizedValues['todayStatistics'][locale.languageCode]; - String? get familyMedicine => localizedValues['familyMedicine']![locale.languageCode]; + String get familyMedicine => localizedValues['familyMedicine'][locale.languageCode]; - String? get arrived => localizedValues['arrived']![locale.languageCode]; + String get arrived => localizedValues['arrived'][locale.languageCode]; - String? get er => localizedValues['er']![locale.languageCode]; + String get er => localizedValues['er'][locale.languageCode]; - String? get walkIn => localizedValues['walkIn']![locale.languageCode]; + String get walkIn => localizedValues['walkIn'][locale.languageCode]; - String? get notArrived => localizedValues['notArrived']![locale.languageCode]; + String get notArrived => localizedValues['notArrived'][locale.languageCode]; - String? get radiology => localizedValues['radiology']![locale.languageCode]; + String get radiology => localizedValues['radiology'][locale.languageCode]; - String? get service => localizedValues['service']![locale.languageCode]; + String get service => localizedValues['service'][locale.languageCode]; - String? get referral => localizedValues['referral']![locale.languageCode]; + String get referral => localizedValues['referral'][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 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 inPatientAll => localizedValues['inPatientAll']![locale.languageCode]; + String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; - String? get operations => localizedValues['operations']![locale.languageCode]; + String get operations => localizedValues['operations'][locale.languageCode]; - String? get patientServices => localizedValues['patientServices']![locale.languageCode]; + String get patientServices => localizedValues['patientServices'][locale.languageCode]; - String? get searchMedicine => localizedValues['searchMedicine']![locale.languageCode]; - String? get searchMedicineDashboard => localizedValues['searchMedicineDashboard']![locale.languageCode]; + String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; + String get searchMedicineDashboard => localizedValues['searchMedicineDashboard'][locale.languageCode]; - String? get myReferralPatient => localizedValues['myReferralPatient']![locale.languageCode]; + String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; - String? get referPatient => localizedValues['referPatient']![locale.languageCode]; + String get referPatient => localizedValues['referPatient'][locale.languageCode]; - String? get myReferral => localizedValues['myReferral']![locale.languageCode]; + String get myReferral => localizedValues['myReferral'][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 myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; + String get referredPatient => localizedValues['referredPatient'][locale.languageCode]; + String get referredOn => localizedValues['referredOn'][locale.languageCode]; - String? get firstName => localizedValues['firstName']![locale.languageCode]; + String get firstName => localizedValues['firstName'][locale.languageCode]; - String? get middleName => localizedValues['middleName']![locale.languageCode]; + String get middleName => localizedValues['middleName'][locale.languageCode]; - String? get lastName => localizedValues['lastName']![locale.languageCode]; + String get lastName => localizedValues['lastName'][locale.languageCode]; - String? get phoneNumber => localizedValues['phoneNumber']![locale.languageCode]; + String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; - String? get patientID => localizedValues['patientID']![locale.languageCode]; + String get patientID => localizedValues['patientID'][locale.languageCode]; - String? get patientFile => localizedValues['patientFile']![locale.languageCode]; + String get patientFile => localizedValues['patientFile'][locale.languageCode]; - String? get search => localizedValues['search']![locale.languageCode]; + String get search => localizedValues['search'][locale.languageCode]; - String? get onlyArrivedPatient => localizedValues['onlyArrivedPatient']![locale.languageCode]; + String get onlyArrivedPatient => localizedValues['onlyArrivedPatient'][locale.languageCode]; - String? get searchMedicineNameHere => localizedValues['searchMedicineNameHere']![locale.languageCode]; + String get searchMedicineNameHere => localizedValues['searchMedicineNameHere'][locale.languageCode]; - String? get youCanFind => localizedValues['youCanFind']![locale.languageCode]; + String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; - String? get itemsInSearch => localizedValues['itemsInSearch']![locale.languageCode]; + String get itemsInSearch => localizedValues['itemsInSearch'][locale.languageCode]; - String? get qr => localizedValues['qr']![locale.languageCode]; + String get qr => localizedValues['qr'][locale.languageCode]; - String? get reader => localizedValues['reader']![locale.languageCode]; + String get reader => localizedValues['reader'][locale.languageCode]; - String? get startScanning => localizedValues['startScanning']![locale.languageCode]; + String get startScanning => localizedValues['startScanning'][locale.languageCode]; - String? get scanQrCode => localizedValues['scanQrCode']![locale.languageCode]; + String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; - String? get scanQr => localizedValues['scanQr']![locale.languageCode]; + String get scanQr => localizedValues['scanQr'][locale.languageCode]; - String? get profile => localizedValues['profile']![locale.languageCode]; + String get profile => localizedValues['profile'][locale.languageCode]; - String? get gender => localizedValues['gender']![locale.languageCode]; + String get gender => localizedValues['gender'][locale.languageCode]; - String? get clinic => localizedValues['clinic']![locale.languageCode]; + String get clinic => localizedValues['clinic'][locale.languageCode]; - String? get clinicSelect => localizedValues['clinicSelect']![locale.languageCode]; + String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; - String? get doctorSelect => localizedValues['doctorSelect']![locale.languageCode]; + String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; - String? get hospital => localizedValues['hospital']![locale.languageCode]; + String get hospital => localizedValues['hospital'][locale.languageCode]; - String? get speciality => localizedValues['speciality']![locale.languageCode]; + String get speciality => localizedValues['speciality'][locale.languageCode]; - String? get errorMessage => localizedValues['errorMessage']![locale.languageCode]; + String get errorMessage => localizedValues['errorMessage'][locale.languageCode]; - String? get patientProfile => localizedValues['patientProfile']![locale.languageCode]; + String get patientProfile => localizedValues['patientProfile'][locale.languageCode]; - String? get vitalSign => localizedValues['vitalSign']![locale.languageCode]; + String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; - String? get vital => localizedValues['vital']![locale.languageCode]; + String get vital => localizedValues['vital'][locale.languageCode]; - String? get signs => localizedValues['signs']![locale.languageCode]; + String get signs => localizedValues['signs'][locale.languageCode]; - String? get labOrder => localizedValues['labOrder']![locale.languageCode]; + String get labOrder => localizedValues['labOrder'][locale.languageCode]; - String? get lab => localizedValues['lab']![locale.languageCode]; + String get lab => localizedValues['lab'][locale.languageCode]; - String? get result => localizedValues['result']![locale.languageCode]; + String get result => localizedValues['result'][locale.languageCode]; - String? get medicines => localizedValues['medicines']![locale.languageCode]; + String get medicines => localizedValues['medicines'][locale.languageCode]; - String? get prescription => localizedValues['prescription']![locale.languageCode]; + String get prescription => localizedValues['prescription'][locale.languageCode]; - String? get insuranceApprovals => localizedValues['insuranceApprovals']![locale.languageCode]; + String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; - String? get insurance => localizedValues['insurance']![locale.languageCode]; + String get insurance => localizedValues['insurance'][locale.languageCode]; - String? get approvals => localizedValues['approvals']![locale.languageCode]; + String get approvals => localizedValues['approvals'][locale.languageCode]; - String? get bodyMeasurements => localizedValues['bodyMeasurements']![locale.languageCode]; + String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; - String? get temperature => localizedValues['temperature']![locale.languageCode]; + String get temperature => localizedValues['temperature'][locale.languageCode]; - String? get pulse => localizedValues['pulse']![locale.languageCode]; + String get pulse => localizedValues['pulse'][locale.languageCode]; - String? get respiration => localizedValues['respiration']![locale.languageCode]; + String get respiration => localizedValues['respiration'][locale.languageCode]; - String? get bloodPressure => localizedValues['bloodPressure']![locale.languageCode]; + String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; - String? get oxygenation => localizedValues['oxygenation']![locale.languageCode]; + String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; - String? get painScale => localizedValues['painScale']![locale.languageCode]; + String get painScale => localizedValues['painScale'][locale.languageCode]; - String? get errorNoVitalSign => localizedValues['errorNoVitalSign']![locale.languageCode]; + String get errorNoVitalSign => localizedValues['errorNoVitalSign'][locale.languageCode]; - String? get labOrders => localizedValues['labOrders']![locale.languageCode]; + String get labOrders => localizedValues['labOrders'][locale.languageCode]; - String? get errorNoLabOrders => localizedValues['errorNoLabOrders']![locale.languageCode]; + String get errorNoLabOrders => localizedValues['errorNoLabOrders'][locale.languageCode]; - String? get answerThePatient => localizedValues['answerThePatient']![locale.languageCode]; + String get answerThePatient => localizedValues['answerThePatient'][locale.languageCode]; - String? get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer']![locale.languageCode]; + String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; - String? get replay => localizedValues['replay']![locale.languageCode]; + String get replay => localizedValues['replay'][locale.languageCode]; - String? get progressNote =>localizedValues['progressNote']![locale.languageCode]; - String? get operationReports => localizedValues['operationReports']![locale.languageCode]; + String get progressNote => localizedValues['progressNote'][locale.languageCode]; + String get operationReports => localizedValues['operationReports'][locale.languageCode]; - String? get progress => localizedValues['progress']![locale.languageCode]; + String get progress => localizedValues['progress'][locale.languageCode]; - String? get note => localizedValues['note']![locale.languageCode]; + String get note => localizedValues['note'][locale.languageCode]; - String? get searchNote => localizedValues['searchNote']![locale.languageCode]; + String get searchNote => localizedValues['searchNote'][locale.languageCode]; - String? get errorNoProgressNote => localizedValues['errorNoProgressNote']![locale.languageCode]; + String get errorNoProgressNote => localizedValues['errorNoProgressNote'][locale.languageCode]; - String? get invoiceNo => localizedValues['invoiceNo:']![locale.languageCode]; - String? get orderNo => localizedValues['orderNo']![locale.languageCode]; + String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; + String get orderNo => localizedValues['orderNo'][locale.languageCode]; - String? get generalResult => localizedValues['generalResult']![locale.languageCode]; + String get generalResult => localizedValues['generalResult'][locale.languageCode]; - String? get description => localizedValues['description']![locale.languageCode]; + String get description => localizedValues['description'][locale.languageCode]; - String? get value => localizedValues['value']![locale.languageCode]; + String get value => localizedValues['value'][locale.languageCode]; - String? get range => localizedValues['range']![locale.languageCode]; + String get range => localizedValues['range'][locale.languageCode]; - String? get enterId => localizedValues['enterId']![locale.languageCode]; + String get enterId => localizedValues['enterId'][locale.languageCode]; - String? get pleaseEnterYourID => localizedValues['pleaseEnterYourID']![locale.languageCode]; + String get pleaseEnterYourID => localizedValues['pleaseEnterYourID'][locale.languageCode]; - String? get enterPassword => localizedValues['enterPassword']![locale.languageCode]; + String get enterPassword => localizedValues['enterPassword'][locale.languageCode]; - String? get pleaseEnterPassword => localizedValues['pleaseEnterPassword']![locale.languageCode]; + String get pleaseEnterPassword => localizedValues['pleaseEnterPassword'][locale.languageCode]; - String? get selectYourProject => localizedValues['selectYourProject']![locale.languageCode]; + String get selectYourProject => localizedValues['selectYourProject'][locale.languageCode]; - String? get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject']![locale.languageCode]; + String get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject'][locale.languageCode]; - String? get login => localizedValues['login']![locale.languageCode]; + String get login => localizedValues['login'][locale.languageCode]; - String? get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib']![locale.languageCode]; + String get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib'][locale.languageCode]; - String? get welcomeTo => localizedValues['welcomeTo']![locale.languageCode]; + String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; - String? get welcomeBackTo => localizedValues['welcomeBackTo']![locale.languageCode]; + String get welcomeBackTo => localizedValues['welcomeBackTo'][locale.languageCode]; - String? get home => localizedValues['home']![locale.languageCode]; + String get home => localizedValues['home'][locale.languageCode]; - String? get services => localizedValues['services']![locale.languageCode]; + String get services => localizedValues['services'][locale.languageCode]; - String? get sms => localizedValues['sms']![locale.languageCode]; + String get sms => localizedValues['sms'][locale.languageCode]; - String? get fingerprint => localizedValues['fingerprint']![locale.languageCode]; + String get fingerprint => localizedValues['fingerprint'][locale.languageCode]; - String? get faceId => localizedValues['faceId']![locale.languageCode]; + String get faceId => localizedValues['faceId'][locale.languageCode]; - String? get whatsApp => localizedValues['whatsApp']![locale.languageCode]; + String get whatsApp => localizedValues['whatsApp'][locale.languageCode]; - String? get whatsAppBy => localizedValues['whatsAppBy']![locale.languageCode]; + String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; - String? get pleaseChoose => localizedValues['pleaseChoose']![locale.languageCode]; + String get pleaseChoose => localizedValues['pleaseChoose'][locale.languageCode]; - String? get choose => localizedValues['choose']![locale.languageCode]; + String get choose => localizedValues['choose'][locale.languageCode]; - String? get verification => localizedValues['verification']![locale.languageCode]; + String get verification => localizedValues['verification'][locale.languageCode]; - String? get firstStep => localizedValues['firstStep']![locale.languageCode]; + String get firstStep => localizedValues['firstStep'][locale.languageCode]; - String? get yourAccount => localizedValues['yourAccount!']![locale.languageCode]; + String get yourAccount => localizedValues['yourAccount!'][locale.languageCode]; - String? get verify1 => localizedValues['verify1']![locale.languageCode]; + String get verify1 => localizedValues['verify1'][locale.languageCode]; - String? get youWillReceiveA => localizedValues['youWillReceiveA']![locale.languageCode]; + String get youWillReceiveA => localizedValues['youWillReceiveA'][locale.languageCode]; - String? get loginCode => localizedValues['loginCode']![locale.languageCode]; + String get loginCode => localizedValues['loginCode'][locale.languageCode]; - String? get smsBy => localizedValues['smsBy']![locale.languageCode]; + String get smsBy => localizedValues['smsBy'][locale.languageCode]; - String? get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode']![locale.languageCode]; + String get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode'][locale.languageCode]; - String? get youDontHaveAnyPatient => localizedValues['youDontHaveAnyPatient']![locale.languageCode]; + String get youDontHaveAnyPatient => localizedValues['youDontHaveAnyPatient'][locale.languageCode]; - String? get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem']![locale.languageCode]; + String get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; - String? get age => localizedValues['age']![locale.languageCode]; + String get age => localizedValues['age'][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 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 today => localizedValues['today']![locale.languageCode]; + String get today => localizedValues['today'][locale.languageCode]; - String? get tomorrow => localizedValues['tomorrow']![locale.languageCode]; + String get tomorrow => localizedValues['tomorrow'][locale.languageCode]; - String? get all => localizedValues['all']![locale.languageCode]; + String get all => localizedValues['all'][locale.languageCode]; - String? get nextWeek => localizedValues['nextWeek']![locale.languageCode]; + String get nextWeek => localizedValues['nextWeek'][locale.languageCode]; - String? get yesterday => localizedValues['yesterday']![locale.languageCode]; + String get yesterday => localizedValues['yesterday'][locale.languageCode]; - String? get errorNoInsuranceApprovals => localizedValues['errorNoInsuranceApprovals']![locale.languageCode]; + String get errorNoInsuranceApprovals => localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; - String? get searchInsuranceApprovals => localizedValues['searchInsuranceApprovals']![locale.languageCode]; + String get searchInsuranceApprovals => localizedValues['searchInsuranceApprovals'][locale.languageCode]; - String? get status => localizedValues['status']![locale.languageCode]; + String get status => localizedValues['status'][locale.languageCode]; - String? get expiryDate => localizedValues['expiryDate']![locale.languageCode]; + String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; - String? get producerName => localizedValues['producerName']![locale.languageCode]; + String get producerName => localizedValues['producerName'][locale.languageCode]; - String? get receiptOn => localizedValues['receiptOn']![locale.languageCode]; + String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; - String? get approvalNo => localizedValues['approvalNo']![locale.languageCode]; + String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; - String? get doctor => localizedValues['doctor']![locale.languageCode]; + String get doctor => localizedValues['doctor'][locale.languageCode]; - String? get ext => localizedValues['ext']![locale.languageCode]; + String get ext => localizedValues['ext'][locale.languageCode]; - String? get veryUrgent => localizedValues['veryUrgent']![locale.languageCode]; + String get veryUrgent => localizedValues['veryUrgent'][locale.languageCode]; - String? get urgent => localizedValues['urgent']![locale.languageCode]; + String get urgent => localizedValues['urgent'][locale.languageCode]; - String? get routine => localizedValues['routine']![locale.languageCode]; + String get routine => localizedValues['routine'][locale.languageCode]; - String? get send => localizedValues['send']![locale.languageCode]; + String get send => localizedValues['send'][locale.languageCode]; - String? get referralFrequency => localizedValues['referralFrequency']![locale.languageCode]; + String get referralFrequency => localizedValues['referralFrequency'][locale.languageCode]; - String? get selectReferralFrequency => localizedValues['selectReferralFrequency']![locale.languageCode]; + String get selectReferralFrequency => localizedValues['selectReferralFrequency'][locale.languageCode]; - String? get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks']![locale.languageCode]; + String get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; - String? get remarks => localizedValues['remarks']![locale.languageCode]; + String get remarks => localizedValues['remarks'][locale.languageCode]; - String? get pleaseFill => localizedValues['pleaseFill']![locale.languageCode]; + String get pleaseFill => localizedValues['pleaseFill'][locale.languageCode]; - String? get replay2 => localizedValues['replay2']![locale.languageCode]; + String get replay2 => localizedValues['replay2'][locale.languageCode]; - String? get outPatient => localizedValues['outPatients']![locale.languageCode]; + String get outPatient => localizedValues['outPatients'][locale.languageCode]; - String? get myOutPatient => localizedValues['myOutPatient']![locale.languageCode]; - String? get myOutPatient_2lines => localizedValues['myOutPatient_2lines']![locale.languageCode]; + String get myOutPatient => localizedValues['myOutPatient'][locale.languageCode]; + String get myOutPatient_2lines => localizedValues['myOutPatient_2lines'][locale.languageCode]; - String? get logout => localizedValues['logout']![locale.languageCode]; + String get logout => localizedValues['logout'][locale.languageCode]; - String? get pharmaciesList => localizedValues['pharmaciesList']![locale.languageCode]; + String get pharmaciesList => localizedValues['pharmaciesList'][locale.languageCode]; - String? get price => localizedValues['price']![locale.languageCode]; + String get price => localizedValues['price'][locale.languageCode]; - String? get youCanFindItIn => localizedValues['youCanFindItIn']![locale.languageCode]; + String get youCanFindItIn => localizedValues['youCanFindItIn'][locale.languageCode]; - String? get radiologyReport => localizedValues['radiologyReport']![locale.languageCode]; + String get radiologyReport => localizedValues['radiologyReport'][locale.languageCode]; - String? get orders => localizedValues['orders']![locale.languageCode]; + String get orders => localizedValues['orders'][locale.languageCode]; - String? get list => localizedValues['list']![locale.languageCode]; + String get list => localizedValues['list'][locale.languageCode]; - String? get searchOrders => localizedValues['searchOrders']![locale.languageCode]; + String get searchOrders => localizedValues['searchOrders'][locale.languageCode]; - String? get prescriptionDetails => localizedValues['prescriptionDetails']![locale.languageCode]; + String get prescriptionDetails => localizedValues['prescriptionDetails'][locale.languageCode]; - String? get prescriptionInfo => localizedValues['prescriptionInfo']![locale.languageCode]; + String get prescriptionInfo => localizedValues['prescriptionInfo'][locale.languageCode]; - String? get errorNoOrders => localizedValues['errorNoOrders']![locale.languageCode]; + String get errorNoOrders => localizedValues['errorNoOrders'][locale.languageCode]; - String? get livecare => localizedValues['livecare']![locale.languageCode]; + String get livecare => localizedValues['livecare'][locale.languageCode]; - String? get beingBad => localizedValues['beingBad']![locale.languageCode]; + String get beingBad => localizedValues['beingBad'][locale.languageCode]; - String? get beingGreat => localizedValues['beingGreat']![locale.languageCode]; + String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; - String? get cancel => localizedValues['cancel']![locale.languageCode]; + String get cancel => localizedValues['cancel'][locale.languageCode]; - String? get ok => localizedValues['ok']![locale.languageCode]; + String get ok => localizedValues['ok'][locale.languageCode]; - String? get done => localizedValues['done']![locale.languageCode]; + String get done => localizedValues['done'][locale.languageCode]; - String? get searchMedicineImageCaption => localizedValues['searchMedicineImageCaption']![locale.languageCode]; + String get searchMedicineImageCaption => localizedValues['searchMedicineImageCaption'][locale.languageCode]; - String? get type => localizedValues['type']![locale.languageCode]; + String get type => localizedValues['type'][locale.languageCode]; - String? get resumecall => localizedValues['resumecall']![locale.languageCode]; + String get resumecall => localizedValues['resumecall'][locale.languageCode]; - String? get endcallwithcharge => localizedValues['endcallwithcharge']![locale.languageCode]; + String get endcallwithcharge => localizedValues['endcallwithcharge'][locale.languageCode]; - String? get endcall => localizedValues['endcall']![locale.languageCode]; + String get endcall => localizedValues['endcall'][locale.languageCode]; - String? get transfertoadmin => localizedValues['transfertoadmin']![locale.languageCode]; + String get transfertoadmin => localizedValues['transfertoadmin'][locale.languageCode]; - String? get fromDate => localizedValues['fromDate']![locale.languageCode]; + String get fromDate => localizedValues['fromDate'][locale.languageCode]; - String? get toDate => localizedValues['toDate']![locale.languageCode]; + String get toDate => localizedValues['toDate'][locale.languageCode]; - String? get fromTime => localizedValues['fromTime']![locale.languageCode]; + String get fromTime => localizedValues['fromTime'][locale.languageCode]; - String? get toTime => localizedValues['toTime']![locale.languageCode]; + String get toTime => localizedValues['toTime'][locale.languageCode]; - String? get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle']![locale.languageCode]; + String get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; - String? get searchPatientImageCaptionBody => localizedValues['searchPatientImageCaptionBody']![locale.languageCode]; + String get searchPatientImageCaptionBody => localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; - String? get welcome => localizedValues['welcome']![locale.languageCode]; + String get welcome => localizedValues['welcome'][locale.languageCode]; - String? get typeMedicineName => localizedValues['typeMedicineName']![locale.languageCode]; + String get typeMedicineName => localizedValues['typeMedicineName'][locale.languageCode]; - String? get moreThan3Letter => localizedValues['moreThan3Letter']![locale.languageCode]; + String get moreThan3Letter => localizedValues['moreThan3Letter'][locale.languageCode]; - String? get gender2 => localizedValues['gender2']![locale.languageCode]; + String get gender2 => localizedValues['gender2'][locale.languageCode]; - String? get age2 => localizedValues['age2']![locale.languageCode]; + String get age2 => localizedValues['age2'][locale.languageCode]; - String? get sickleave => localizedValues['sick-leaves']![locale.languageCode]; + String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; - String? get patientSick => localizedValues['patient-sick']![locale.languageCode]; + String get patientSick => localizedValues['patient-sick'][locale.languageCode]; - String? get leave => localizedValues['leave']![locale.languageCode]; + String get leave => localizedValues['leave'][locale.languageCode]; - String? get submit => localizedValues['submit']![locale.languageCode]; + String get submit => localizedValues['submit'][locale.languageCode]; - String? get doctorName => localizedValues['doc-name']![locale.languageCode]; + String get doctorName => localizedValues['doc-name'][locale.languageCode]; - String? get clinicName => localizedValues['clinicname']![locale.languageCode]; + String get clinicName => localizedValues['clinicname'][locale.languageCode]; - String? get sickLeaveDate => localizedValues['sick-leave-date']![locale.languageCode]; + String get sickLeaveDate => localizedValues['sick-leave-date'][locale.languageCode]; - String? get sickLeaveDays => localizedValues['sick-leave-days']![locale.languageCode]; + String get sickLeaveDays => localizedValues['sick-leave-days'][locale.languageCode]; - String? get admissionDetail => localizedValues['admissionDetail']![locale.languageCode]; + String get admissionDetail => localizedValues['admissionDetail'][locale.languageCode]; - String? get dateTime => localizedValues['dateTime']![locale.languageCode]; + String get dateTime => localizedValues['dateTime'][locale.languageCode]; - String? get date => localizedValues['date']![locale.languageCode]; + String get date => localizedValues['date'][locale.languageCode]; - String? get admissionNo => localizedValues['admissionNo']![locale.languageCode]; + String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; - String? get losNo => localizedValues['losNo']![locale.languageCode]; + String get losNo => localizedValues['losNo'][locale.languageCode]; - String? get area => localizedValues['area']![locale.languageCode]; + String get area => localizedValues['area'][locale.languageCode]; - String? get room => localizedValues['room']![locale.languageCode]; + String get room => localizedValues['room'][locale.languageCode]; - String? get bed => localizedValues['bed']![locale.languageCode]; + String get bed => localizedValues['bed'][locale.languageCode]; - String? get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed']![locale.languageCode]; + String get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed'][locale.languageCode]; - String? get noSickLeaveApplied => localizedValues['no-sickleve-applied']![locale.languageCode]; + String get noSickLeaveApplied => localizedValues['no-sickleve-applied'][locale.languageCode]; - String? get applyNow => localizedValues['applynow']![locale.languageCode]; + String get applyNow => localizedValues['applynow'][locale.languageCode]; - String? get addSickLeave => localizedValues['add-sickleave']![locale.languageCode]; + String get addSickLeave => localizedValues['add-sickleave'][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 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 extended => localizedValues['extended']![locale.languageCode]; + String get extended => localizedValues['extended'][locale.languageCode]; - String? get pending => localizedValues['pending']![locale.languageCode]; + String get pending => localizedValues['pending'][locale.languageCode]; - String? get leaveStartDate => localizedValues['leave-start-date']![locale.languageCode]; + String get leaveStartDate => localizedValues['leave-start-date'][locale.languageCode]; - String? get daysSickleave => localizedValues['days-sick-leave']![locale.languageCode]; + String get daysSickleave => localizedValues['days-sick-leave'][locale.languageCode]; - String? get extend => localizedValues['extend']![locale.languageCode]; + String get extend => localizedValues['extend'][locale.languageCode]; - String? get extendSickLeave => localizedValues['extend-sickleave']![locale.languageCode]; + String get extendSickLeave => localizedValues['extend-sickleave'][locale.languageCode]; - String? get targetPatient => localizedValues['patient-target']![locale.languageCode]; + String get targetPatient => localizedValues['patient-target'][locale.languageCode]; - String? get noPrescription => localizedValues['no-priscription-listed']![locale.languageCode]; + String get noPrescription => localizedValues['no-priscription-listed'][locale.languageCode]; - String? get next => localizedValues['next']![locale.languageCode]; - String? get finish => localizedValues['finish']![locale.languageCode]; + String get next => localizedValues['next'][locale.languageCode]; + String get finish => localizedValues['finish'][locale.languageCode]; - String? get previous => localizedValues['previous']![locale.languageCode]; + String get previous => localizedValues['previous'][locale.languageCode]; - String? get emptyMessage => localizedValues['empty-message']![locale.languageCode]; + String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; - String? get healthRecordInformation => localizedValues['healthRecordInformation']![locale.languageCode]; + String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode]; - String? get chiefComplaintLength => localizedValues['chiefComplaintLength']![locale.languageCode]; + String get chiefComplaintLength => localizedValues['chiefComplaintLength'][locale.languageCode]; - String? get referTo => localizedValues['referTo']![locale.languageCode]; + String get referTo => localizedValues['referTo'][locale.languageCode]; - String? get referredFrom => localizedValues['referredFrom']![locale.languageCode]; - String? get refClinic => localizedValues['refClinic']![locale.languageCode]; + String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; + String get refClinic => localizedValues['refClinic'][locale.languageCode]; - String? get branch => localizedValues['branch']![locale.languageCode]; + String get branch => localizedValues['branch'][locale.languageCode]; - String? get chooseAppointment => localizedValues['chooseAppointment']![locale.languageCode]; + String get chooseAppointment => localizedValues['chooseAppointment'][locale.languageCode]; - String? get appointmentNo => localizedValues['appointmentNo']![locale.languageCode]; + String get appointmentNo => localizedValues['appointmentNo'][locale.languageCode]; - String? get refer => localizedValues['refer']![locale.languageCode]; + String get refer => localizedValues['refer'][locale.languageCode]; - String? get rejected => localizedValues['rejected']![locale.languageCode]; + String get rejected => localizedValues['rejected'][locale.languageCode]; - String? get sameBranch => localizedValues['sameBranch']![locale.languageCode]; + String get sameBranch => localizedValues['sameBranch'][locale.languageCode]; - String? get otherBranch => localizedValues['otherBranch']![locale.languageCode]; + String get otherBranch => localizedValues['otherBranch'][locale.languageCode]; - String? get dr => localizedValues['dr']![locale.languageCode]; + String get dr => localizedValues['dr'][locale.languageCode]; - String? get previewHealth => localizedValues['previewHealth']![locale.languageCode]; + String get previewHealth => localizedValues['previewHealth'][locale.languageCode]; - String? get summaryReport => localizedValues['summaryReport']![locale.languageCode]; + String get summaryReport => localizedValues['summaryReport'][locale.languageCode]; - String? get accept => localizedValues['accept']![locale.languageCode]; + String get accept => localizedValues['accept'][locale.languageCode]; - String? get reject => localizedValues['reject']![locale.languageCode]; + String get reject => localizedValues['reject'][locale.languageCode]; - String? get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg']![locale.languageCode]; + String get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; - String? get referralPatient => localizedValues['referralPatient']![locale.languageCode]; + String get referralPatient => localizedValues['referralPatient'][locale.languageCode]; - String? get noPrescriptionListed => localizedValues['noPrescriptionListed']![locale.languageCode]; + String get noPrescriptionListed => localizedValues['noPrescriptionListed'][locale.languageCode]; - String? get addNow => localizedValues['addNow']![locale.languageCode]; + String get addNow => localizedValues['addNow'][locale.languageCode]; - String? get orderType => localizedValues['orderType']![locale.languageCode]; + String get orderType => localizedValues['orderType'][locale.languageCode]; - String? get strength => localizedValues['strength']![locale.languageCode]; + String get strength => localizedValues['strength'][locale.languageCode]; - String? get doseTime => localizedValues['doseTime']![locale.languageCode]; + String get doseTime => localizedValues['doseTime'][locale.languageCode]; - String? get indication => localizedValues['indication']![locale.languageCode]; + String get indication => localizedValues['indication'][locale.languageCode]; - String? get duration => localizedValues['duration']![locale.languageCode]; + String get duration => localizedValues['duration'][locale.languageCode]; - String? get instruction => localizedValues['instruction']![locale.languageCode]; + String get instruction => localizedValues['instruction'][locale.languageCode]; - String? get rescheduleLeaves => localizedValues['reschedule-leave']![locale.languageCode]; + String get rescheduleLeaves => localizedValues['reschedule-leave'][locale.languageCode]; - String? get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave']![locale.languageCode]; - String? get myQRCode => localizedValues['myQRCode']![locale.languageCode]; + String get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave'][locale.languageCode]; + String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; - String? get addMedication => localizedValues['addMedication']![locale.languageCode]; + String get addMedication => localizedValues['addMedication'][locale.languageCode]; - String? get route => localizedValues['route']![locale.languageCode]; + String get route => localizedValues['route'][locale.languageCode]; - String? get noReScheduleLeave => localizedValues['no-reschedule-leave']![locale.languageCode]; + String get noReScheduleLeave => localizedValues['no-reschedule-leave'][locale.languageCode]; - String? get weight => localizedValues['weight']![locale.languageCode]; + String get weight => localizedValues['weight'][locale.languageCode]; - String? get kg => localizedValues['kg']![locale.languageCode]; + String get kg => localizedValues['kg'][locale.languageCode]; - String? get height => localizedValues['height']![locale.languageCode]; + String get height => localizedValues['height'][locale.languageCode]; - String? get cm => localizedValues['cm']![locale.languageCode]; + String get cm => localizedValues['cm'][locale.languageCode]; - String? get idealBodyWeight => localizedValues['idealBodyWeight']![locale.languageCode]; + String get idealBodyWeight => localizedValues['idealBodyWeight'][locale.languageCode]; - String? get waistSize => localizedValues['waistSize']![locale.languageCode]; + String get waistSize => localizedValues['waistSize'][locale.languageCode]; - String? get inch => localizedValues['inch']![locale.languageCode]; + String get inch => localizedValues['inch'][locale.languageCode]; - String? get headCircum => localizedValues['headCircum']![locale.languageCode]; + String get headCircum => localizedValues['headCircum'][locale.languageCode]; - String? get leanBodyWeight => localizedValues['leanBodyWeight']![locale.languageCode]; + String get leanBodyWeight => localizedValues['leanBodyWeight'][locale.languageCode]; - String? get bodyMassIndex => localizedValues['bodyMassIndex']![locale.languageCode]; + String get bodyMassIndex => localizedValues['bodyMassIndex'][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 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 method => localizedValues['method']![locale.languageCode]; + String get method => localizedValues['method'][locale.languageCode]; - String? get pulseBeats => localizedValues['pulseBeats']![locale.languageCode]; + String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode]; - String? get rhythm => localizedValues['rhythm']![locale.languageCode]; + String get rhythm => localizedValues['rhythm'][locale.languageCode]; - String? get respBeats => localizedValues['respBeats']![locale.languageCode]; + String get respBeats => localizedValues['respBeats'][locale.languageCode]; - String? get patternOfRespiration => localizedValues['patternOfRespiration']![locale.languageCode]; + String get patternOfRespiration => localizedValues['patternOfRespiration'][locale.languageCode]; - String? get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole']![locale.languageCode]; + String get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; - String? get cuffLocation => localizedValues['cuffLocation']![locale.languageCode]; + String get cuffLocation => localizedValues['cuffLocation'][locale.languageCode]; - String? get cuffSize => localizedValues['cuffSize']![locale.languageCode]; + String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; - String? get patientPosition => localizedValues['patientPosition']![locale.languageCode]; + String get patientPosition => localizedValues['patientPosition'][locale.languageCode]; - String? get fio2 => localizedValues['fio2']![locale.languageCode]; + String get fio2 => localizedValues['fio2'][locale.languageCode]; - String? get sao2 => localizedValues['sao2']![locale.languageCode]; + String get sao2 => localizedValues['sao2'][locale.languageCode]; - String? get painManagement => localizedValues['painManagement']![locale.languageCode]; + String get painManagement => localizedValues['painManagement'][locale.languageCode]; - String? get holiday => localizedValues['holiday']![locale.languageCode]; + String get holiday => localizedValues['holiday'][locale.languageCode]; - String? get to => localizedValues['to']![locale.languageCode]; + String get to => localizedValues['to'][locale.languageCode]; - String? get coveringDoctor => localizedValues['coveringDoctor']![locale.languageCode]; + String get coveringDoctor => localizedValues['coveringDoctor'][locale.languageCode]; - String? get requestLeave => localizedValues['requestLeave']![locale.languageCode]; + String get requestLeave => localizedValues['requestLeave'][locale.languageCode]; - String? get pleaseEnterDate => localizedValues['pleaseEnterDate']![locale.languageCode]; + String get pleaseEnterDate => localizedValues['pleaseEnterDate'][locale.languageCode]; - String? get pleaseEnterNoOfDays => localizedValues['pleaseEnterNoOfDays']![locale.languageCode]; + String get pleaseEnterNoOfDays => localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; - String? get pleaseEnterRemarks => localizedValues['pleaseEnterRemarks']![locale.languageCode]; + String get pleaseEnterRemarks => localizedValues['pleaseEnterRemarks'][locale.languageCode]; - String? get update => localizedValues['update']![locale.languageCode]; + String get update => localizedValues['update'][locale.languageCode]; - String? get admission => localizedValues['admission']![locale.languageCode]; + String get admission => localizedValues['admission'][locale.languageCode]; - String? get request => localizedValues['request']![locale.languageCode]; + String get request => localizedValues['request'][locale.languageCode]; - String? get admissionRequest => localizedValues['admissionRequest']![locale.languageCode]; + String get admissionRequest => localizedValues['admissionRequest'][locale.languageCode]; - String? get patientDetails => localizedValues['patientDetails']![locale.languageCode]; + String get patientDetails => localizedValues['patientDetails'][locale.languageCode]; - String? get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail']![locale.languageCode]; + String get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail'][locale.languageCode]; - String? get referringDate => localizedValues['referringDate']![locale.languageCode]; + String get referringDate => localizedValues['referringDate'][locale.languageCode]; - String? get referringDoctor => localizedValues['referringDoctor']![locale.languageCode]; + String get referringDoctor => localizedValues['referringDoctor'][locale.languageCode]; - String? get otherInformation => localizedValues['otherInformation']![locale.languageCode]; + String get otherInformation => localizedValues['otherInformation'][locale.languageCode]; - String? get expectedDays => localizedValues['expectedDays']![locale.languageCode]; + String get expectedDays => localizedValues['expectedDays'][locale.languageCode]; - String? get expectedAdmissionDate => localizedValues['expectedAdmissionDate']![locale.languageCode]; + String get expectedAdmissionDate => localizedValues['expectedAdmissionDate'][locale.languageCode]; - String? get emergencyAdmission => localizedValues['emergencyAdmission']![locale.languageCode]; - String? get isSickLeaveRequired => localizedValues['isSickLeaveRequired']![locale.languageCode]; + String get emergencyAdmission => localizedValues['emergencyAdmission'][locale.languageCode]; + String get isSickLeaveRequired => localizedValues['isSickLeaveRequired'][locale.languageCode]; - String? get patientPregnant => localizedValues['patientPregnant']![locale.languageCode]; + String get patientPregnant => localizedValues['patientPregnant'][locale.languageCode]; - String? get treatmentLine => localizedValues['treatmentLine']![locale.languageCode]; + String get treatmentLine => localizedValues['treatmentLine'][locale.languageCode]; - String? get ward => localizedValues['ward']![locale.languageCode]; + String get ward => localizedValues['ward'][locale.languageCode]; - String? get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred']![locale.languageCode]; + String get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred'][locale.languageCode]; - String? get admissionType => localizedValues['admissionType']![locale.languageCode]; + String get admissionType => localizedValues['admissionType'][locale.languageCode]; - String? get diagnosis => localizedValues['diagnosis']![locale.languageCode]; + String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; - String? get allergies => localizedValues['allergies']![locale.languageCode]; + String get allergies => localizedValues['allergies'][locale.languageCode]; - String? get preOperativeOrders => localizedValues['preOperativeOrders']![locale.languageCode]; + String get preOperativeOrders => localizedValues['preOperativeOrders'][locale.languageCode]; - String? get elementForImprovement => localizedValues['elementForImprovement']![locale.languageCode]; + String get elementForImprovement => localizedValues['elementForImprovement'][locale.languageCode]; - String? get dischargeDate => localizedValues['dischargeDate']![locale.languageCode]; + String get dischargeDate => localizedValues['dischargeDate'][locale.languageCode]; - String? get dietType => localizedValues['dietType']![locale.languageCode]; + String get dietType => localizedValues['dietType'][locale.languageCode]; - String? get dietTypeRemarks => localizedValues['dietTypeRemarks']![locale.languageCode]; + String get dietTypeRemarks => localizedValues['dietTypeRemarks'][locale.languageCode]; - String? get save => localizedValues['save']![locale.languageCode]; + String get save => localizedValues['save'][locale.languageCode]; - String? get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost']![locale.languageCode]; - String? get postPlans => localizedValues['postPlans']![locale.languageCode]; + String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; + String get postPlans => localizedValues['postPlans'][locale.languageCode]; - String? get ucaf => localizedValues['ucaf']![locale.languageCode]; + String get ucaf => localizedValues['ucaf'][locale.languageCode]; - String? get emergencyCase => localizedValues['emergencyCase']![locale.languageCode]; + String get emergencyCase => localizedValues['emergencyCase'][locale.languageCode]; - String? get durationOfIllness => localizedValues['durationOfIllness']![locale.languageCode]; + String get durationOfIllness => localizedValues['durationOfIllness'][locale.languageCode]; - String? get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms']![locale.languageCode]; + String get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; - String? get patientFeelsPainInHisBackAndCough => - localizedValues['patientFeelsPainInHisBackAndCough']![locale.languageCode]; + String get patientFeelsPainInHisBackAndCough => + localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; - String? get additionalTextComplaints => localizedValues['additionalTextComplaints']![locale.languageCode]; + String get additionalTextComplaints => localizedValues['additionalTextComplaints'][locale.languageCode]; - String? get otherConditions => localizedValues['otherConditions']![locale.languageCode]; + String get otherConditions => localizedValues['otherConditions'][locale.languageCode]; - String? get other => localizedValues['other']![locale.languageCode]; + String get other => localizedValues['other'][locale.languageCode]; - String? get how => localizedValues['how']![locale.languageCode]; + String get how => localizedValues['how'][locale.languageCode]; - String? get when => localizedValues['when']![locale.languageCode]; + String get when => localizedValues['when'][locale.languageCode]; - String? get where => localizedValues['where']![locale.languageCode]; + String get where => localizedValues['where'][locale.languageCode]; - String? get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement']![locale.languageCode]; + String get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement'][locale.languageCode]; - String? get significantSigns => localizedValues['significantSigns']![locale.languageCode]; + String get significantSigns => localizedValues['significantSigns'][locale.languageCode]; - String? get backAbdomen => localizedValues['backAbdomen']![locale.languageCode]; + String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; - String? get reasons => localizedValues['reasons']![locale.languageCode]; + String get reasons => localizedValues['reasons'][locale.languageCode]; - String? get createNew => localizedValues['createNew']![locale.languageCode]; + String get createNew => localizedValues['createNew'][locale.languageCode]; - String? get episode => localizedValues['episode']![locale.languageCode]; + String get episode => localizedValues['episode'][locale.languageCode]; - String? get medications => localizedValues['medications']![locale.languageCode]; + String get medications => localizedValues['medications'][locale.languageCode]; - String? get procedures => localizedValues['procedures']![locale.languageCode]; + String get procedures => localizedValues['procedures'][locale.languageCode]; - String? get chiefComplaints => localizedValues['chiefComplaints']![locale.languageCode]; + String get chiefComplaints => localizedValues['chiefComplaints'][locale.languageCode]; - String? get histories => localizedValues['histories']![locale.languageCode]; + String get histories => localizedValues['histories'][locale.languageCode]; - String? get allergiesSoap => localizedValues['allergiesSoap']![locale.languageCode]; + String get allergiesSoap => localizedValues['allergiesSoap'][locale.languageCode]; - String? get addChiefComplaints => localizedValues['addChiefComplaints']![locale.languageCode]; + String get addChiefComplaints => localizedValues['addChiefComplaints'][locale.languageCode]; - String? get historyOfPresentIllness => localizedValues['historyOfPresentIllness']![locale.languageCode]; + String get historyOfPresentIllness => localizedValues['historyOfPresentIllness'][locale.languageCode]; - String? get requiredMsg => localizedValues['requiredMsg']![locale.languageCode]; + String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; - String? get addHistory => localizedValues['addHistory']![locale.languageCode]; + String get addHistory => localizedValues['addHistory'][locale.languageCode]; - String? get searchHistory => localizedValues['searchHistory']![locale.languageCode]; + String get searchHistory => localizedValues['searchHistory'][locale.languageCode]; - String? get addSelectedHistories => localizedValues['addSelectedHistories']![locale.languageCode]; + String get addSelectedHistories => localizedValues['addSelectedHistories'][locale.languageCode]; - String? get addAllergies => localizedValues['addAllergies']![locale.languageCode]; + String get addAllergies => localizedValues['addAllergies'][locale.languageCode]; - String? get itemExist => localizedValues['itemExist']![locale.languageCode]; + String get itemExist => localizedValues['itemExist'][locale.languageCode]; - String? get selectAllergy => localizedValues['selectAllergy']![locale.languageCode]; + String get selectAllergy => localizedValues['selectAllergy'][locale.languageCode]; - String? get selectSeverity => localizedValues['selectSeverity']![locale.languageCode]; + String get selectSeverity => localizedValues['selectSeverity'][locale.languageCode]; - String? get leaveCreated => localizedValues['leaveCreated']![locale.languageCode]; + String get leaveCreated => localizedValues['leaveCreated'][locale.languageCode]; - String? get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg']![locale.languageCode]; + String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; - String? get referralEmptyMsg => localizedValues['referralEmptyMsg']![locale.languageCode]; + String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; - String? get referralSuccessMsg => localizedValues['referralSuccessMsg']![locale.languageCode]; + String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; - String? get diagnoseType => localizedValues['diagnoseType']![locale.languageCode]; + String get diagnoseType => localizedValues['diagnoseType'][locale.languageCode]; - String? get condition => localizedValues['condition']![locale.languageCode]; + String get condition => localizedValues['condition'][locale.languageCode]; - String? get id => localizedValues['id']![locale.languageCode]; + String get id => localizedValues['id'][locale.languageCode]; - String? get quantity => localizedValues['quantity']![locale.languageCode]; + String get quantity => localizedValues['quantity'][locale.languageCode]; - String? get durDays => localizedValues['durDays']![locale.languageCode]; + String get durDays => localizedValues['durDays'][locale.languageCode]; - String? get codeNo => localizedValues['codeNo']![locale.languageCode]; + String get codeNo => localizedValues['codeNo'][locale.languageCode]; - String? get covered => localizedValues['covered']![locale.languageCode]; + String get covered => localizedValues['covered'][locale.languageCode]; - String? get approvalRequired => localizedValues['approvalRequired']![locale.languageCode]; + String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; - String? get uncoveredByDoctor => localizedValues['uncoveredByDoctor']![locale.languageCode]; + String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; - String? get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg']![locale.languageCode]; + String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; - String? get moreVerification => localizedValues['more-verify']![locale.languageCode]; + String get moreVerification => localizedValues['more-verify'][locale.languageCode]; - String? get welcomeBack => localizedValues['welcome-back']![locale.languageCode]; + String get welcomeBack => localizedValues['welcome-back'][locale.languageCode]; - String? get accountInfo => localizedValues['account-info']![locale.languageCode]; + String get accountInfo => localizedValues['account-info'][locale.languageCode]; - String? get useAnotherAccount => localizedValues['another-acc']![locale.languageCode]; + String get useAnotherAccount => localizedValues['another-acc'][locale.languageCode]; - String? get verifyLoginWith => localizedValues['verify-login-with']![locale.languageCode]; + String get verifyLoginWith => localizedValues['verify-login-with'][locale.languageCode]; - String? get register => localizedValues['register-user']![locale.languageCode]; + String get register => localizedValues['register-user'][locale.languageCode]; - String? get verifyFingerprint => localizedValues['verify-with-fingerprint']![locale.languageCode]; + String get verifyFingerprint => localizedValues['verify-with-fingerprint'][locale.languageCode]; - String? get verifyFaceID => localizedValues['verify-with-faceid']![locale.languageCode]; + String get verifyFaceID => localizedValues['verify-with-faceid'][locale.languageCode]; - String? get verifySMS => localizedValues['verify-with-sms']![locale.languageCode]; - String? get verifyWith => localizedValues['verify-with']![locale.languageCode]; + String get verifySMS => localizedValues['verify-with-sms'][locale.languageCode]; + String get verifyWith => localizedValues['verify-with'][locale.languageCode]; - String? get verifyWhatsApp => localizedValues['verify-with-whatsapp']![locale.languageCode]; + String get verifyWhatsApp => localizedValues['verify-with-whatsapp'][locale.languageCode]; - String? get lastLoginAt => localizedValues['last-login']![locale.languageCode]; + String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; - String? get lastLoginWith => localizedValues['last-login-with']![locale.languageCode]; + String get lastLoginWith => localizedValues['last-login-with'][locale.languageCode]; - String? get verifyFingerprint2 => localizedValues['verify-fingerprint']![locale.languageCode]; + String get verifyFingerprint2 => localizedValues['verify-fingerprint'][locale.languageCode]; - String? get verificationMessage => localizedValues['verification_message']![locale.languageCode]; + String get verificationMessage => localizedValues['verification_message'][locale.languageCode]; - String? get validationMessage => localizedValues['validation_message']![locale.languageCode]; + String get validationMessage => localizedValues['validation_message'][locale.languageCode]; - String? get addAssessment => localizedValues['addAssessment']![locale.languageCode]; + String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; - String? get assessment => localizedValues['assessment']![locale.languageCode]; + String get assessment => localizedValues['assessment'][locale.languageCode]; - String? get physicalSystemExamination => localizedValues['physicalSystemExamination']![locale.languageCode]; + String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; - String? get searchExamination => localizedValues['searchExamination']![locale.languageCode]; + String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; - String? get addExamination => localizedValues['addExamination']![locale.languageCode]; + String get addExamination => localizedValues['addExamination'][locale.languageCode]; - String? get doc => localizedValues['doc']![locale.languageCode]; + String get doc => localizedValues['doc'][locale.languageCode]; - String? get allergicTO => localizedValues['allergicTO']![locale.languageCode]; + String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; - String? get normal => localizedValues['normal']![locale.languageCode]; - String? get notExamined => localizedValues['notExamined']![locale.languageCode]; + String get normal => localizedValues['normal'][locale.languageCode]; + String get notExamined => localizedValues['notExamined'][locale.languageCode]; - String? get abnormal => localizedValues['abnormal']![locale.languageCode]; + String get abnormal => localizedValues['abnormal'][locale.languageCode]; - String? get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg']![locale.languageCode]; + String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; - String? get systolicLng => localizedValues['systolic-lng']![locale.languageCode]; + String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; - String? get diastolicLng => localizedValues['diastolic-lng']![locale.languageCode]; + String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; - String? get mass => localizedValues['mass']![locale.languageCode]; + String get mass => localizedValues['mass'][locale.languageCode]; - String? get tempC => localizedValues['temp-c']![locale.languageCode]; + String get tempC => localizedValues['temp-c'][locale.languageCode]; - String? get bpm => localizedValues['bpm']![locale.languageCode]; + String get bpm => localizedValues['bpm'][locale.languageCode]; - String? get respirationSigns => localizedValues['respiration-signs']![locale.languageCode]; + String get respirationSigns => localizedValues['respiration-signs'][locale.languageCode]; - String? get sysDias => localizedValues['sys-dias']![locale.languageCode]; + String get sysDias => localizedValues['sys-dias'][locale.languageCode]; - String? get body => localizedValues['body']![locale.languageCode]; + String get body => localizedValues['body'][locale.languageCode]; - String? get respirationRate => localizedValues['respirationRate']![locale.languageCode]; + String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; - String? get heart => localizedValues['heart']![locale.languageCode]; + String get heart => localizedValues['heart'][locale.languageCode]; - String? get medicalReport => localizedValues['medicalReport']![locale.languageCode]; + String get medicalReport => localizedValues['medicalReport'][locale.languageCode]; - String? get visitDate => localizedValues['visitDate']![locale.languageCode]; + String get visitDate => localizedValues['visitDate'][locale.languageCode]; - String? get test => localizedValues['test']![locale.languageCode]; + String get test => localizedValues['test'][locale.languageCode]; - String? get addMoreProcedure => localizedValues['addMoreProcedure']![locale.languageCode]; + String get addMoreProcedure => localizedValues['addMoreProcedure'][locale.languageCode]; - String? get regular => localizedValues['regular']![locale.languageCode]; + String get regular => localizedValues['regular'][locale.languageCode]; - String? get searchProcedures => localizedValues['searchProcedures']![locale.languageCode]; + String get searchProcedures => localizedValues['searchProcedures'][locale.languageCode]; - String? get procedureCategorise => localizedValues['procedureCategorise']![locale.languageCode]; + String get procedureCategorise => localizedValues['procedureCategorise'][locale.languageCode]; - String? get selectProcedures => localizedValues['selectProcedures']![locale.languageCode]; + String get selectProcedures => localizedValues['selectProcedures'][locale.languageCode]; - String? get addSelectedProcedures => localizedValues['addSelectedProcedures']![locale.languageCode]; - String? get addProcedures => localizedValues['addProcedures']![locale.languageCode]; + String get addSelectedProcedures => localizedValues['addSelectedProcedures'][locale.languageCode]; + String get addProcedures => localizedValues['addProcedures'][locale.languageCode]; - String? get updateProcedure => localizedValues['updateProcedure']![locale.languageCode]; + String get updateProcedure => localizedValues['updateProcedure'][locale.languageCode]; - String? get orderProcedure => localizedValues['orderProcedure']![locale.languageCode]; + String get orderProcedure => localizedValues['orderProcedure'][locale.languageCode]; - String? get nameOrICD => localizedValues['nameOrICD']![locale.languageCode]; + String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; - String? get dType => localizedValues['dType']![locale.languageCode]; + String get dType => localizedValues['dType'][locale.languageCode]; - String? get addAssessmentDetails => localizedValues['addAssessmentDetails']![locale.languageCode]; + String get addAssessmentDetails => localizedValues['addAssessmentDetails'][locale.languageCode]; - String? get progressNoteSOAP => localizedValues['progressNoteSOAP']![locale.languageCode]; + String get progressNoteSOAP => localizedValues['progressNoteSOAP'][locale.languageCode]; - String? get addProgressNote => localizedValues['addProgressNote']![locale.languageCode]; + String get addProgressNote => localizedValues['addProgressNote'][locale.languageCode]; - String? get createdBy => localizedValues['createdBy']![locale.languageCode]; + String get createdBy => localizedValues['createdBy'][locale.languageCode]; - String? get editedBy => localizedValues['editedBy']![locale.languageCode]; + String get editedBy => localizedValues['editedBy'][locale.languageCode]; - String? get currentMedications => localizedValues['currentMedications']![locale.languageCode]; + String get currentMedications => localizedValues['currentMedications'][locale.languageCode]; - String? get noItem => localizedValues['noItem']![locale.languageCode]; + String get noItem => localizedValues['noItem'][locale.languageCode]; - String? get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg']![locale.languageCode]; + String get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg'][locale.languageCode]; - String? get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty']![locale.languageCode]; + String get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty'][locale.languageCode]; - String? get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday']![locale.languageCode]; + String get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday'][locale.languageCode]; - String? get active => localizedValues['active']![locale.languageCode]; + String get active => localizedValues['active'][locale.languageCode]; - String? get hold => localizedValues['hold']![locale.languageCode]; + String get hold => localizedValues['hold'][locale.languageCode]; - String? get loading => localizedValues['loading']![locale.languageCode]; + String get loading => localizedValues['loading'][locale.languageCode]; - String? get assessmentErrorMsg => localizedValues['assessmentErrorMsg']![locale.languageCode]; + String get assessmentErrorMsg => localizedValues['assessmentErrorMsg'][locale.languageCode]; - String? get examinationErrorMsg => localizedValues['examinationErrorMsg']![locale.languageCode]; + String get examinationErrorMsg => localizedValues['examinationErrorMsg'][locale.languageCode]; - String? get progressNoteErrorMsg => localizedValues['progressNoteErrorMsg']![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 chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; + String get ICDName => localizedValues['ICDName'][locale.languageCode]; - String? get referralStatus => localizedValues['referralStatus']![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 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 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 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 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]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 08c0b193..6d091756 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -1,24 +1,21 @@ -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'; import 'package:hexcolor/hexcolor.dart'; class MethodTypeCard extends StatelessWidget { const MethodTypeCard({ - Key? key, - required this.assetPath, - required this.onTap, - required this.label, - this.height = 20, + Key key, + this.assetPath, + this.onTap, + this.label, this.height = 20, }) : super(key: key); final String assetPath; - final GestureTapCallback onTap; + final Function onTap; final String label; final double height; @override Widget build(BuildContext context) { - double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 22 : SizeConfig.isHeightLarge?25:20); return InkWell( onTap: onTap, child: Container( @@ -28,28 +25,34 @@ class MethodTypeCard extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10), ), - border: Border.all(color: HexColor('#707070'), width: 0.1), + border: Border.all( + color: HexColor('#707070'), + width: 0.1), ), - height: cardHeight, - child: Center( + height: 170, + child: Padding( + padding: EdgeInsets.fromLTRB(20, 15, 20, 15), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset( - assetPath, - width: SizeConfig.widthMultiplier* (12), - height: cardHeight * 0.35, - // height: , + Row( + children: [ + Image.asset( + assetPath, + height: 60, + width: 60, + ), + ], ), SizedBox( - height: height, + height:height , ), AppText( label, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* (SizeConfig.isHeightVeryShort?3:3.7), - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, + fontSize: 14, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, ) ], ), diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 91838dbd..0c374e58 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/auth_method_types.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -8,7 +9,6 @@ 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 SMSOTP { final AuthMethodTypes type; final mobileNo; @@ -16,7 +16,7 @@ class SMSOTP { final Function onFailure; final context; - late int remainingTime = 600; + int remainingTime = 600; SMSOTP( this.context, @@ -26,7 +26,7 @@ class SMSOTP { this.onFailure, ); - late final verifyAccountForm = GlobalKey(); + final verifyAccountForm = GlobalKey(); TextEditingController digit1 = TextEditingController(text: ""); TextEditingController digit2 = TextEditingController(text: ""); @@ -43,93 +43,94 @@ class SMSOTP { final focusD2 = FocusNode(); final focusD3 = FocusNode(); final focusD4 = FocusNode(); - late String errorMsg; - late ProjectViewModel projectProvider; - late String displayTime = ''; - late bool isClosed = false; + String errorMsg; + ProjectViewModel projectProvider; + String displayTime = ''; + bool isClosed = false; displayDialog(BuildContext context) async { - double dialogWidth = MediaQuery.of(context).size.width * 0.90; - double dialogInputWidth = (dialogWidth / 4) - (SizeConfig.isWidthLarge?SizeConfig.getWidthMultiplier(width:dialogWidth )* 4.5: 20); - double dialogHeight = SizeConfig.isHeightVeryShort ?MediaQuery.of(context).size.height * 0.50:MediaQuery.of(context).size.height * 0.40; return showDialog( context: context, - - - builder: (ctx) => Center( - child: Container( - color: Colors.white, - height: dialogHeight, - width: dialogWidth, - child: Material( - color: Colors.white, - child: SingleChildScrollView( + barrierColor: Colors.black.withOpacity(0.7), + builder: (context) { + projectProvider = Provider.of(context); + return AlertDialog( + contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 0.0, 24.0), + content: StatefulBuilder(builder: (context, setState) { + if (displayTime == '') { + startTimer(setState); + } + return Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.50, + width: MediaQuery.of(context).size.width * 0.84, child: Center( - child: Container( - color: Colors.white, - child: StatefulBuilder(builder: (context, setState) { - if (displayTime == '') { - startTimer(setState); - } - - return Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 2,), - - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Icon(type == AuthMethodTypes.SMS - ? - DoctorApp.verify_sms_1 - : - DoctorApp.verify_whtsapp, - size: SizeConfig.getHeightMultiplier(height:dialogHeight) * 9, - color: Color(0xFF2B353E), - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - IconButton( - icon: Icon(Icons.close),color: Color(0xFF2B353E), - iconSize: SizeConfig.getHeightMultiplier(height:dialogHeight) * 15, - onPressed: () { - this.isClosed = true; - Navigator.pop(context); - this.onFailure(); - }, - ) - ], - ) - ]), - SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * (SizeConfig.isHeightVeryShort?10:5),), - Padding( - padding: EdgeInsets.only(top: 5, right: 5), - child: AppText( - TranslationBase.of(context).verificationMessage! + + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(13), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + type == AuthMethodTypes.SMS + ? Padding( + child: Icon( + DoctorApp.verify_sms_1, + size: 50, + ), + padding: EdgeInsets.only(bottom: 20), + ) + : Padding( + child: Icon( + DoctorApp.verify_whtsapp, + size: 50, + ), + padding: EdgeInsets.only(bottom: 20), + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, right: 10, bottom: 20), + child: IconButton( + icon: Icon(Icons.close), + iconSize: 40, + onPressed: () { + this.isClosed = true; + Navigator.pop(context); + this.onFailure(); + }, + )) + ], + ) + ])), + Padding( + padding: EdgeInsets.only(top: 5, right: 5), + child: AppText( + TranslationBase.of(context).verificationMessage + ' XXXXXX' + - mobileNo.toString().substring(mobileNo.toString().length - 3), + mobileNo + .toString() + .substring(mobileNo.toString().length - 3), textAlign: TextAlign.start, - fontWeight: FontWeight.w700, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, //14, - maxLines: 2, - )), - Form( - key: verifyAccountForm, - child: Padding( - padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier(height:dialogHeight) * 2), - child: Directionality( - textDirection: TextDirection.ltr, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: dialogInputWidth, - height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, - margin: EdgeInsets.symmetric(vertical: 2,horizontal:5), + fontWeight: FontWeight.bold, + fontSize: 14, + maxLines: 2, + )), + Form( + key: verifyAccountForm, + child: Padding( + padding: EdgeInsets.only(top: 20), + child: Directionality( + textDirection: TextDirection.ltr, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: SizeConfig.realScreenWidth * 0.16, + margin: EdgeInsets.all(5), child: TextFormField( textInputAction: TextInputAction.next, style: buildTextStyle(), @@ -142,22 +143,23 @@ class SMSOTP { onSaved: (val) {}, validator: validateCodeDigit, onFieldSubmitted: (_) { - FocusScope.of(context).requestFocus(focusD2); + FocusScope.of(context) + .requestFocus(focusD2); }, onChanged: (val) { if (val.length == 1) { - FocusScope.of(context).requestFocus(focusD2); - verifyAccountFormValue['digit1'] = val.trim(); + FocusScope.of(context) + .requestFocus(focusD2); + verifyAccountFormValue['digit1'] = + val.trim(); checkValue(); } }, ), ), Container( - width: dialogInputWidth, - height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, - - margin: EdgeInsets.symmetric(vertical: 2,horizontal:5), + width: SizeConfig.realScreenWidth * 0.16, + margin: EdgeInsets.all(5), child: TextFormField( focusNode: focusD2, textInputAction: TextInputAction.next, @@ -169,21 +171,23 @@ class SMSOTP { decoration: buildInputDecoration(context), onSaved: (val) {}, onFieldSubmitted: (_) { - FocusScope.of(context).requestFocus(focusD3); + FocusScope.of(context) + .requestFocus(focusD3); }, onChanged: (val) { if (val.length == 1) { - FocusScope.of(context).requestFocus(focusD3); - verifyAccountFormValue['digit2'] = val.trim(); + FocusScope.of(context) + .requestFocus(focusD3); + verifyAccountFormValue['digit2'] = + val.trim(); checkValue(); } }, validator: validateCodeDigit), ), Container( - margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), - width: dialogInputWidth, - height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + margin: EdgeInsets.all(5), + width: SizeConfig.realScreenWidth * 0.16, child: TextFormField( focusNode: focusD3, textInputAction: TextInputAction.next, @@ -192,23 +196,26 @@ class SMSOTP { textAlign: TextAlign.center, style: buildTextStyle(), keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), + decoration: + buildInputDecoration(context), onSaved: (val) {}, onFieldSubmitted: (_) { - FocusScope.of(context).requestFocus(focusD4); + FocusScope.of(context) + .requestFocus(focusD4); }, onChanged: (val) { if (val.length == 1) { - FocusScope.of(context).requestFocus(focusD4); - verifyAccountFormValue['digit3'] = val.trim(); + FocusScope.of(context) + .requestFocus(focusD4); + verifyAccountFormValue['digit3'] = + val.trim(); checkValue(); } }, validator: validateCodeDigit)), Container( - margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), - width: dialogInputWidth, - height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + margin: EdgeInsets.all(5), + width: SizeConfig.realScreenWidth * 0.16, child: TextFormField( focusNode: focusD4, maxLength: 1, @@ -216,13 +223,16 @@ class SMSOTP { style: buildTextStyle(), controller: digit4, keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), + decoration: + buildInputDecoration(context), onFieldSubmitted: (_) { - FocusScope.of(context).requestFocus(focusD4); + FocusScope.of(context) + .requestFocus(focusD4); }, onChanged: (val) { if (val.length == 1) { - verifyAccountFormValue['digit4'] = val.trim(); + verifyAccountFormValue['digit4'] = + val.trim(); checkValue(); } }, @@ -231,46 +241,38 @@ class SMSOTP { )), ), ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).validationMessage! + ' ',textAlign: TextAlign.start, - fontWeight: FontWeight.w700, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, - ), - AppText( - displayTime, - color: Colors.red, - textAlign: TextAlign.start, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, - ) - ]) - ], + Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).validationMessage + + ' ', + fontWeight: FontWeight.w600, + fontSize: 14, ), - ), - ); - - }) - - - ), - ), - ), - ), - ), - ), - - ); + AppText( + displayTime, + color: Colors.red, + textAlign: TextAlign.start, + fontWeight: FontWeight.bold, + fontSize: 14, + ) + ]), + ) + ], + ))), + ); + }), + ); + }); } TextStyle buildTextStyle() { return TextStyle( - fontSize: SizeConfig.textMultiplier * 2.5, + fontSize: SizeConfig.textMultiplier * 3, ); } @@ -279,15 +281,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)), @@ -297,7 +299,7 @@ class SMSOTP { } // ignore: missing_return - String? validateCodeDigit(value) { + String validateCodeDigit(value) { if (value.isEmpty) { return ' '; } else if (value.length == 3) { @@ -308,21 +310,28 @@ 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; } @@ -332,7 +341,7 @@ class SMSOTP { displayTime = this.getSecondsAsDigitalClock(this.remainingTime); }); - Future.delayed(Duration(seconds: 1), () { + Future.delayed(Duration(seconds: 1), () { if (this.remainingTime > 0) { if (isClosed == false) { startTimer(setState); diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index cbd665ef..27dbe8bf 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -9,25 +9,26 @@ import 'package:provider/provider.dart'; class VerificationMethodsList extends StatefulWidget { final AuthMethodTypes authMethodType; - final Function(AuthMethodTypes type, bool isActive)? authenticateUser; - final GestureTapCallback? onShowMore; + final Function(AuthMethodTypes type, bool isActive) authenticateUser; + final Function onShowMore; final AuthenticationViewModel authenticationViewModel; const VerificationMethodsList( - {Key? key, - required this.authMethodType, + {Key key, + this.authMethodType, this.authenticateUser, this.onShowMore, - required this.authenticationViewModel}) + this.authenticationViewModel}) : super(key: key); @override - _VerificationMethodsListState createState() => _VerificationMethodsListState(); + _VerificationMethodsListState createState() => + _VerificationMethodsListState(); } class _VerificationMethodsListState extends State { final LocalAuthentication auth = LocalAuthentication(); - ProjectViewModel? projectsProvider; + ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { @@ -37,46 +38,58 @@ class _VerificationMethodsListState extends State { case AuthMethodTypes.WhatsApp: return MethodTypeCard( assetPath: 'assets/images/verify-whtsapp.png', - onTap: () => {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)}, - label: TranslationBase.of(context).verifyWith! + "\n"+ TranslationBase.of(context).verifyWhatsApp!, + onTap: () => + {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, + label: TranslationBase + .of(context) + .verifyWith+ TranslationBase.of(context).verifyWhatsApp, ); break; case AuthMethodTypes.SMS: return MethodTypeCard( assetPath: "assets/images/verify-sms.png", - onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)}, - label: TranslationBase.of(context).verifyWith! + "\n"+ TranslationBase.of(context).verifySMS!, + onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, + label:TranslationBase + .of(context) + .verifyWith+ TranslationBase.of(context).verifySMS, ); break; case AuthMethodTypes.Fingerprint: return MethodTypeCard( assetPath: 'assets/images/verification_fingerprint_icon.png', 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! + "\n"+TranslationBase.of(context).verifyFingerprint!, + label: TranslationBase + .of(context) + .verifyWith+TranslationBase.of(context).verifyFingerprint, ); break; case AuthMethodTypes.FaceID: return MethodTypeCard( assetPath: 'assets/images/verification_faceid_icon.png', 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! + "\n"+TranslationBase.of(context).verifyFaceID!, + label: TranslationBase + .of(context) + .verifyWith+TranslationBase.of(context).verifyFaceID, ); break; default: return MethodTypeCard( assetPath: 'assets/images/login/more_icon.png', - onTap: widget.onShowMore!, - label: TranslationBase.of(context).moreVerification!, - // height: 40, + onTap: widget.onShowMore, + label: TranslationBase.of(context).moreVerification, + height: 0, ); } } diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart new file mode 100644 index 00000000..aa532306 --- /dev/null +++ b/lib/widgets/charts/app_bar_chart.dart @@ -0,0 +1,43 @@ +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 e3265595..1a29b1e6 100644 --- a/lib/widgets/charts/app_line_chart.dart +++ b/lib/widgets/charts/app_line_chart.dart @@ -15,9 +15,9 @@ class AppLineChart extends StatelessWidget { final bool stacked; AppLineChart( - {Key? key, - required this.seriesList, - required this.chartTitle, + {Key key, + @required this.seriesList, + this.chartTitle, this.animate = true, this.includeArea = false, this.stacked = true}); @@ -33,7 +33,9 @@ class AppLineChart extends StatelessWidget { ), Expanded( child: charts.LineChart(seriesList, - defaultRenderer: charts.LineRendererConfig(includeArea: false, stacked: true), animate: animate), + defaultRenderer: charts.LineRendererConfig( + includeArea: false, stacked: true), + animate: animate), ), ], ), diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart index eed6289f..670284a1 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 = '', - required this.startDate, - required this.endDate, + this.startDate, + this.endDate, }); final String chartName; @@ -41,7 +41,8 @@ class AppTimeSeriesChart extends StatelessWidget { behaviors: [ charts.RangeAnnotation( [ - charts.RangeAnnotationSegment(startDate, endDate, charts.RangeAnnotationAxisType.domain), + charts.RangeAnnotationSegment(startDate, endDate, + charts.RangeAnnotationAxisType.domain ), ], ), ], diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart new file mode 100644 index 00000000..ff9db962 --- /dev/null +++ b/lib/widgets/dashboard/activity_button.dart @@ -0,0 +1,44 @@ +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class GetActivityButton extends StatelessWidget { + final value; + + GetActivityButton(this.value); + + @override + Widget build(BuildContext context) { + return Container( + width: MediaQuery.of(context).size.height * 0.125, + padding: EdgeInsets.all(5), + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + ), + child: Padding( + padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + value.value.toString(), + fontSize: 27, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + ), + AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: 10, + color: Color(0xFF2B353E), + textAlign: TextAlign.start, + fontWeight: FontWeight.w700, + ), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart deleted file mode 100644 index 30e889f8..00000000 --- a/lib/widgets/dashboard/activity_card.dart +++ /dev/null @@ -1,50 +0,0 @@ -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'; - -class GetActivityCard extends StatelessWidget { - final value; - - GetActivityCard(this.value); - - @override - Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:SizeConfig.isHeightLarge?15:13); - return Container( - width: width, - padding: EdgeInsets.symmetric(horizontal: SizeConfig.heightMultiplier * .4, vertical: SizeConfig.heightMultiplier * .2), - margin: EdgeInsets.all(SizeConfig.widthMultiplier *1), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - ), - child: Padding( - padding: const EdgeInsets.fromLTRB(8,8, 8, 4), - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - value.value.toString(), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25, - fontWeight: FontWeight.bold, - color: Color(0xFF2B353E), - letterSpacing: -0.93, - ), - AppText( - value.kPIParameter, - textOverflow: TextOverflow.clip, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9), - color: Color(0xFF2B353E), - textAlign: TextAlign.start, - fontWeight: FontWeight.w700, - letterSpacing: -0.33, - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/widgets/dashboard/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart new file mode 100644 index 00000000..659e4562 --- /dev/null +++ b/lib/widgets/dashboard/dashboard_item_texts_widget.dart @@ -0,0 +1,66 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../shared/app_texts_widget.dart'; +import '../shared/rounded_container_widget.dart'; + +class DashboardItemTexts extends StatefulWidget { + final String label; + final String value; + final Color backgroundColor; + final bool showBorder; + final Color borderColor; + +// OWNER : Ibrahim albitar +// DATE : 05-04-2020 +// DESCRIPTION : Custom widget for dashboard items has texts widgets + + DashboardItemTexts(this.label, this.value, + {this.backgroundColor = Colors.white, + this.showBorder = false, + this.borderColor = Colors.white}); + + @override + _DashboardItemTextsState createState() => _DashboardItemTextsState(); +} + +class _DashboardItemTextsState extends State { + ProjectViewModel projectsProvider; + @override + Widget build(BuildContext context) { + projectsProvider = Provider.of(context); + return new RoundedContainer( + child: Stack( + children: [ + Align( + alignment: projectsProvider.isArabic + ? FractionalOffset.topRight + : FractionalOffset.topLeft, + child: Container( + margin: EdgeInsets.all(5), + child: AppText( + widget.label, + fontSize: 12, + ), + )), + Align( + alignment: projectsProvider.isArabic + ? FractionalOffset.bottomLeft + : FractionalOffset.bottomRight, + child: Container( + margin: EdgeInsets.all(10), + child: AppText( + widget.value, + fontWeight: FontWeight.bold, + ), + )), + ], + ), + backgroundColor: widget.backgroundColor, + showBorder: widget.showBorder, + borderColor: widget.borderColor, + margin: EdgeInsets.all(4), + ); + } +} diff --git a/lib/widgets/dashboard/guage_chart.dart b/lib/widgets/dashboard/guage_chart.dart index 1980fe61..6769c568 100644 --- a/lib/widgets/dashboard/guage_chart.dart +++ b/lib/widgets/dashboard/guage_chart.dart @@ -1,9 +1,10 @@ + import 'package:charts_flutter/flutter.dart' as charts; import 'package:flutter/material.dart'; class GaugeChart extends StatelessWidget { final List seriesList; - final bool? animate; + final bool animate; GaugeChart(this.seriesList, {this.animate}); @@ -18,16 +19,19 @@ class GaugeChart extends StatelessWidget { @override Widget build(BuildContext context) { return new charts.PieChart(seriesList, - animate: animate, defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10)); + animate: animate, + defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10)); //); } static List> _createSampleData() { final data = [ new GaugeSegment('Low', 75, charts.MaterialPalette.blue.shadeDefault), - new GaugeSegment('Acceptable', 100, charts.MaterialPalette.blue.shadeDefault), + new GaugeSegment( + 'Acceptable', 100, charts.MaterialPalette.blue.shadeDefault), new GaugeSegment('High', 50, charts.MaterialPalette.blue.shadeDefault), - new GaugeSegment('Highly Unusual', 55, charts.MaterialPalette.blue.shadeDefault), + new GaugeSegment( + 'Highly Unusual', 55, charts.MaterialPalette.blue.shadeDefault), ]; return [ diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 049f3fd8..fe05d69d 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,7 +1,4 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/screens/home/label.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -12,37 +9,22 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { - 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); - var list = []; - value.summaryoptions.forEach((result) => {list.add(getStack(result, value.summaryoptions.first.value, context, barHeight)) - }); + var list = new List(); + value.summaryoptions.forEach((result) => + {list.add(getStack(result, value.summaryoptions.first.value,context))}); return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Container( - padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5), - child: Label( - firstLine: Helpers.getLabelFromKPI(value.kPIName), - secondLine: Helpers.getNameFromKPI(value.kPIName), - color: Color(0xFF2B353E), - firstLineFontSize: - SizeConfig.getHeightMultiplier(height: barHeight) * - (SizeConfig.isHeightVeryShort - ? 10 - : SizeConfig.isHeightShort - ? 10 - : 8.5), - secondLineFontSize: - SizeConfig.getHeightMultiplier(height: barHeight) * - (SizeConfig.isHeightVeryShort - ? 15 - : SizeConfig.isHeightShort - ? 15 - : 14.5), + height: 30, + child: AppText( + value.kPIName, + medium: true, + fontSize: 14, ), ), Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) @@ -50,18 +32,19 @@ class GetOutPatientStack extends StatelessWidget { ); } - getStack(Summaryoptions value, max, context, barHeight) { + getStack(Summaryoptions value, max,context) { return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), decoration: BoxDecoration( 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[50]!], // red to yellow + end: Alignment( + 0.0, 1.0), // 10% of the width, so there are ten blinds. + colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), - borderRadius: BorderRadius.circular(4), + borderRadius: BorderRadius.circular(8), // color: Colors.red[50], ), child: Stack(children: [ @@ -72,15 +55,15 @@ class GetOutPatientStack extends StatelessWidget { child: Container( child: SizedBox(), padding: EdgeInsets.all(10), - height: max != 0 ? ((barHeight) * value.value!) / max : 0, + height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4), + borderRadius: BorderRadius.circular(8), color: Color(0x63D02127), ), ), ), Container( - height: barHeight, + height: (MediaQuery.of(context).size.height * 0.24 ), margin: EdgeInsets.only(left: 5, top: 5), padding: EdgeInsets.all(10), child: RotatedBox( @@ -92,18 +75,16 @@ class GetOutPatientStack extends StatelessWidget { children: [ AppText( value.kPIParameter, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + fontSize: 10, textAlign: TextAlign.center, color: Color(0xFF2B353E), fontWeight: FontWeight.w700, - letterSpacing: -0.3, ), AppText( ' (' + value.value.toString() + ') ', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + fontSize: 12, textAlign: TextAlign.center, color: Color(0xFF2B353E), - letterSpacing: -0.3, fontWeight: FontWeight.bold, ), ], @@ -115,5 +96,4 @@ class GetOutPatientStack extends StatelessWidget { ), ); } - } diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index ce401b2f..a22932f4 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -1,17 +1,15 @@ -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'; class RowCounts extends StatelessWidget { final name; final int count; - final double? height; final Color c; - RowCounts(this.name, this.count, this.c, {this.height}); + RowCounts(this.name, this.count, this.c); @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only(top:SizeConfig.getHeightMultiplier(height:height )* 0.2 , bottom: SizeConfig.getHeightMultiplier(height:height )* 0.2), + padding: EdgeInsets.only(top: 5, bottom: 5), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -26,7 +24,7 @@ class RowCounts extends StatelessWidget { name, color: Colors.black, textAlign: TextAlign.start, // from TextAlign.center - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + fontSize: 11, textOverflow: TextOverflow.ellipsis, ), ), @@ -34,7 +32,7 @@ class RowCounts extends StatelessWidget { ' (' + count.toString() + ')', color: Colors.black, textAlign: TextAlign.center, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontSize: 12, fontWeight: FontWeight.bold, ) ], @@ -47,8 +45,8 @@ class RowCounts extends StatelessWidget { Widget dot(Color c) { return Container( - padding: EdgeInsets.all(SizeConfig.getHeightMultiplier(height:height )* 2), - margin: EdgeInsets.all(SizeConfig.getHeightMultiplier(height:height )* 1), + padding: EdgeInsets.all(5.0), + margin: EdgeInsets.all(5.0), decoration: BoxDecoration(color: c, shape: BoxShape.circle)); } } diff --git a/lib/widgets/dashboard/swiper_rounded_pagination.dart b/lib/widgets/dashboard/swiper_rounded_pagination.dart index c0360d96..7e5c2c70 100644 --- a/lib/widgets/dashboard/swiper_rounded_pagination.dart +++ b/lib/widgets/dashboard/swiper_rounded_pagination.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/material.dart'; class SwiperRoundedPagination extends StatelessWidget { @@ -8,14 +7,15 @@ class SwiperRoundedPagination extends StatelessWidget { Widget build(BuildContext context) { return active == true ? Container( - height: SizeConfig.heightMultiplier * .6, - width: SizeConfig.widthMultiplier * 6, + height: 5, + width: 30, + // margin: EdgeInsets.only(10), decoration: BoxDecoration( borderRadius: BorderRadius.circular(5), color: Colors.black), ) : Container( - height: SizeConfig.heightMultiplier * .6, - width: SizeConfig.widthMultiplier * 2, + height: 5, + width: 8, margin: EdgeInsets.all(2), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.grey)); diff --git a/lib/widgets/data_display/list/custom_Item.dart b/lib/widgets/data_display/list/custom_Item.dart index 4361749c..c11af999 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, - required this.startIcon, + {Key key, + this.startIcon, this.disabled: false, - required this.onTap, - required this.startIconColor, + this.onTap, + this.startIconColor, this.endIcon = EvaIcons.chevronRight, - required this.padding, - required this.child, - required this.endIconColor, + this.padding, + this.child, + this.endIconColor, this.endIconSize = 20, - required this.decoration, + this.decoration, this.startIconSize = 19}) : super(key: key); @@ -52,7 +52,9 @@ class CustomItem extends StatelessWidget { if (onTap != null) onTap(); }, child: Padding( - padding: padding != null ? padding : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), + padding: padding != null + ? padding + : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), child: Row( children: [ if (startIcon != null) @@ -75,7 +77,9 @@ class CustomItem extends StatelessWidget { flex: 1, child: Icon( endIcon, - color: endIconColor != null ? endIconColor : Colors.grey[500], + color: endIconColor != null + ? endIconColor + : Colors.grey[500], size: endIconSize, ), ) diff --git a/lib/widgets/data_display/list/flexible_container.dart b/lib/widgets/data_display/list/flexible_container.dart index 7faf32b4..a35fa279 100644 --- a/lib/widgets/data_display/list/flexible_container.dart +++ b/lib/widgets/data_display/list/flexible_container.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; - /// Flexible container widget /// [widthFactor] If non-null, the fraction of the incoming width given to the child. /// If non-null, the child is given a tight width constraint that is the max @@ -15,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, - required this.child, + this.child, }) : super(key: key); @override @@ -39,7 +38,8 @@ class FlexibleContainer extends StatelessWidget { padding: padding, width: double.infinity, decoration: BoxDecoration( - border: Border.all(color: Theme.of(context).dividerColor, width: 2.0), + border: Border.all( + color: Theme.of(context).dividerColor, width: 2.0), borderRadius: BorderRadius.circular(8.0)), child: child, ), diff --git a/lib/widgets/dialog/AskPermissionDialog.dart b/lib/widgets/dialog/AskPermissionDialog.dart index f7a23925..58718373 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({required this.type, required this.onTapGrant}); + AskPermissionDialog({this.type, 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 0a63a4e3..c4343a4b 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, required this.labResult}); + LabResultWidget({Key key, this.labResult}); @override _LabResultWidgetState createState() => _LabResultWidgetState(); @@ -41,7 +41,9 @@ class _LabResultWidgetState extends State { _showDetails = !_showDetails; }); }, - child: Icon(_showDetails ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), + child: Icon(_showDetails + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down)), ], ), Divider( @@ -82,7 +84,9 @@ class _LabResultWidgetState extends State { child: Container( color: HexColor('#515B5D'), child: Center( - child: AppText(TranslationBase.of(context).value, color: Colors.white), + child: AppText( + TranslationBase.of(context).value, + color: Colors.white), ), height: 60), ), @@ -95,7 +99,9 @@ class _LabResultWidgetState extends State { ), ), child: Center( - child: AppText(TranslationBase.of(context).range, color: Colors.white), + child: AppText( + TranslationBase.of(context).range, + color: Colors.white), ), height: 60), ), @@ -108,7 +114,8 @@ class _LabResultWidgetState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10)), border: Border( - bottom: BorderSide(color: Colors.grey, width: 0.5), + bottom: + BorderSide(color: Colors.grey, width: 0.5), top: BorderSide(color: Colors.grey, width: 0.5), left: BorderSide(color: Colors.grey, width: 0.5), right: BorderSide(color: Colors.grey, width: 0.5), @@ -139,14 +146,17 @@ class _LabResultWidgetState extends State { Expanded( child: Container( child: Center( - child: AppText('${result.resultValue}', color: Colors.grey[800]), + child: AppText('${result.resultValue}', + 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 e6469186..453cff30 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/referral_view_model.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import '../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/expandable-widget-header-body.dart'; @@ -19,25 +19,27 @@ class MyReferralPatientWidget extends StatefulWidget { final Function expandClick; MyReferralPatientWidget( - {Key? key, - required this.myReferralPatientModel, - required this.model, - required this.isExpand, - required this.expandClick}); + {Key key, + this.myReferralPatientModel, + this.model, + this.isExpand, + this.expandClick}); @override - _MyReferralPatientWidgetState createState() => _MyReferralPatientWidgetState(); + _MyReferralPatientWidgetState createState() => + _MyReferralPatientWidgetState(); } class _MyReferralPatientWidgetState extends State { bool _isLoading = false; final _formKey = GlobalKey(); - late String error; - late TextEditingController answerController; + String error; + TextEditingController answerController; @override void initState() { - answerController = new TextEditingController(text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); + answerController = new TextEditingController( + text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); super.initState(); } @@ -63,7 +65,8 @@ class _MyReferralPatientWidgetState extends State { headerWidget: Column( children: [ Container( - padding: EdgeInsets.only(left: 16, top: 8, right: 8, bottom: 0), + padding: + EdgeInsets.only(left: 16, top: 8, right: 8, bottom: 0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -73,7 +76,8 @@ class _MyReferralPatientWidgetState extends State { children: [ Container( color: Color(0xFFB8382C), - padding: EdgeInsets.symmetric(vertical: 4, horizontal: 4), + padding: EdgeInsets.symmetric( + vertical: 4, horizontal: 4), child: AppText( '${widget.myReferralPatientModel.priorityDescription}', fontSize: 1.7 * SizeConfig.textMultiplier, @@ -120,9 +124,10 @@ class _MyReferralPatientWidgetState extends State { ), ), Container( - margin: EdgeInsets.symmetric(horizontal: 8, vertical: 8), + 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, @@ -151,7 +156,8 @@ class _MyReferralPatientWidgetState extends State { ), Container( height: 1.8 * SizeConfig.textMultiplier * 6, - padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), + padding: + EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( child: Row( children: [ @@ -248,7 +254,8 @@ class _MyReferralPatientWidgetState extends State { ), Container( height: 1.8 * SizeConfig.textMultiplier * 6, - padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), + padding: + EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( child: Row( children: [ @@ -316,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, @@ -344,7 +351,8 @@ class _MyReferralPatientWidgetState extends State { height: 10, ), Container( - padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), + padding: + EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( child: Row( children: [ @@ -357,7 +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, @@ -405,12 +414,13 @@ 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) { if (value.isEmpty) - return TranslationBase.of(context).pleaseEnterAnswer; + return TranslationBase.of(context) + .pleaseEnterAnswer; else return null; }, @@ -421,13 +431,16 @@ 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(), widget.myReferralPatientModel); - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).replySuccessfully); + await widget.model.replay( + answerController.text.toString(), + widget.myReferralPatientModel); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).replySuccessfully); } catch (e) { DrAppToastMsg.showErrorToast(e); } diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index e7a571c5..54df8cd9 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -12,13 +12,13 @@ import 'package:provider/provider.dart'; class MyScheduleWidget extends StatelessWidget { final ListDoctorWorkingHoursTable workingHoursTable; - MyScheduleWidget({Key? key, required this.workingHoursTable}); + MyScheduleWidget({Key key, 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, @@ -33,15 +33,13 @@ 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', @@ -53,14 +51,15 @@ class MyScheduleWidget extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.55, child: CardWithBgWidget( - bgColor: AppDateUtils.isToday(workingHoursTable.date!) ? Colors.green[500]! : 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, @@ -75,33 +74,33 @@ class MyScheduleWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: workingHours.map((work) { return Container( - margin: EdgeInsets.only(bottom: workingHours.length > 1 ? 15 : 0), + margin: EdgeInsets.only(bottom:workingHours.length>1? 15:0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 5, ), - if (workingHoursTable.clinicName != null) - AppText( - workingHoursTable.clinicName ?? "", - fontSize: 15, - fontWeight: FontWeight.w700, - ), + if(workingHoursTable.clinicName!=null) + AppText( + workingHoursTable.clinicName??"", + fontSize: 15, + fontWeight: FontWeight.w700, + ), Container( - width: MediaQuery.of(context).size.width * 0.55, + width: MediaQuery.of(context).size.width*0.55, child: AppText( - '${work.from} - ${work.to}', + '${work.from} - ${work.to}', fontSize: 15, fontWeight: FontWeight.w300, ), ), - if (workingHoursTable.projectName != null) - AppText( - workingHoursTable.projectName ?? "", - fontSize: 15, - fontWeight: FontWeight.w700, - ), + if(workingHoursTable.projectName!=null) + AppText( + workingHoursTable.projectName??"", + fontSize: 15, + fontWeight: FontWeight.w700, + ), ], ), ); diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index 482a251b..f4f78c08 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,7 +62,9 @@ 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 new file mode 100644 index 00000000..c903bd7b --- /dev/null +++ b/lib/widgets/patients/clinic_list_dropdwon.dart @@ -0,0 +1,99 @@ +// 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 new file mode 100644 index 00000000..d2a68acd --- /dev/null +++ b/lib/widgets/patients/dynamic_elements.dart @@ -0,0 +1,163 @@ +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 1ef79976..ff1cb256 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,30 +1,32 @@ 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/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; 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, @@ -48,6 +50,8 @@ class PatientReferralItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), child: Column( @@ -89,7 +93,7 @@ class PatientReferralItemWidget extends StatelessWidget { : Colors.red[900], ), AppText( - referredDate ?? '', + referredDate, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -102,7 +106,7 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ Expanded( child: AppText( - patientName ?? '', + patientName, fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, color: Colors.black, @@ -125,7 +129,7 @@ class PatientReferralItemWidget extends StatelessWidget { width: 4, ), AppText( - referredTime ?? '', + referredTime, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -151,7 +155,7 @@ class PatientReferralItemWidget extends StatelessWidget { color: Color(0XFF575757), ), AppText( - patientID!, + patientID, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.6 * SizeConfig.textMultiplier, @@ -176,11 +180,12 @@ class PatientReferralItemWidget extends StatelessWidget { Expanded( child: AppText( !isReferralClinic - ! ? isSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context).otherBranch - : " " + referralClinic!, + ? TranslationBase.of(context) + .sameBranch + : TranslationBase.of(context) + .otherBranch + : " " + referralClinic, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.6 * SizeConfig.textMultiplier, @@ -195,7 +200,7 @@ class PatientReferralItemWidget extends StatelessWidget { Row( children: [ AppText( - nationality != null ? nationality! : "", + nationality != null ? nationality : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), fontSize: 1.4 * SizeConfig.textMultiplier, @@ -204,10 +209,12 @@ 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(''); }, )) @@ -221,7 +228,7 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).remarks ?? "" + " : ", + TranslationBase.of(context).remarks + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -245,7 +252,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, @@ -253,7 +260,8 @@ class PatientReferralItemWidget extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), + margin: EdgeInsets.only( + left: 0, top: 25, right: 0, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: Container( width: 40, @@ -262,10 +270,12 @@ 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'); }, )) @@ -282,12 +292,13 @@ class PatientReferralItemWidget extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), + margin: EdgeInsets.only( + left: 10, top: 25, right: 10, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - referralDoctorName ?? '', + referralDoctorName, fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -295,7 +306,7 @@ class PatientReferralItemWidget extends StatelessWidget { ), if (clinicDescription != null) AppText( - clinicDescription!, + clinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.4 * SizeConfig.textMultiplier, @@ -307,7 +318,10 @@ class PatientReferralItemWidget extends StatelessWidget { ), ], ), - Container(width: double.infinity, alignment: Alignment.centerRight, child: infoIcon ?? Container()) + Container( + width: double.infinity, + alignment: Alignment.centerRight, + child: infoIcon ?? Container()) ], ), // onTap: onTap, diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 65876517..ea3a0940 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -16,7 +16,7 @@ import 'ShowTimer.dart'; class PatientCard extends StatelessWidget { final PatiantInformtion patientInfo; - final GestureTapCallback onTap; + final Function onTap; final String patientType; final String arrivalType; final bool isInpatient; @@ -25,12 +25,12 @@ class PatientCard extends StatelessWidget { final bool isFromLiveCare; PatientCard( - {Key? key, - required this.patientInfo, - required this.onTap, - required this.patientType, - required this.arrivalType, - required this.isInpatient, + {Key key, + this.patientInfo, + this.onTap, + this.patientType, + this.arrivalType, + this.isInpatient, this.isMyPatient = false, this.isFromSearch = false, this.isFromLiveCare = false}) @@ -38,10 +38,10 @@ class PatientCard extends StatelessWidget { @override Widget build(BuildContext context) { - String? nationalityName = patientInfo.nationalityName != null - ? patientInfo.nationalityName!.trim() + String nationalityName = patientInfo.nationalityName != null + ? patientInfo.nationalityName.trim() : patientInfo.nationality != null - ? patientInfo.nationality!.trim() + ? patientInfo.nationality.trim() : patientInfo.nationalityId != null ? patientInfo.nationalityId @@ -63,15 +63,15 @@ class PatientCard extends StatelessWidget { bgColor: isFromLiveCare ? Colors.white : (isMyPatient && !isFromSearch) - ? Colors.green[500]! + ? Colors.green[500] : patientInfo.patientStatusType == 43 - ? Colors.green[500]! + ? Colors.green[500] : isMyPatient - ? Colors.green[500]! + ? Colors.green[500] : isInpatient ? Colors.white : !isFromSearch - ? Colors.red[800]! + ? Colors.red[800] : Colors.white, widget: Container( color: Colors.white, @@ -92,7 +92,8 @@ class PatientCard extends StatelessWidget { ? Row( children: [ AppText( - TranslationBase.of(context).arrivedP, + TranslationBase.of(context) + .arrivedP, color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -112,8 +113,12 @@ class PatientCard extends StatelessWidget { width: 8, ), AppText( - patientInfo.status == 2 ? 'Confirmed' : 'Booked', - color: patientInfo.status == 2 ? Colors.green : Colors.grey, + patientInfo.status == 2 + ? 'Confirmed' + : 'Booked', + color: patientInfo.status == 2 + ? Colors.green + : Colors.grey, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, @@ -124,7 +129,8 @@ class PatientCard extends StatelessWidget { ? Row( children: [ AppText( - TranslationBase.of(context).notArrived, + TranslationBase.of(context) + .notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -144,19 +150,27 @@ class PatientCard extends StatelessWidget { width: 8, ), AppText( - patientInfo.status == 2 ? 'Confirmed' : 'Booked', - color: patientInfo.status == 2 ? Colors.green : Colors.grey, + patientInfo.status == 2 + ? 'Confirmed' + : 'Booked', + color: patientInfo.status == 2 + ? Colors.green + : Colors.grey, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, ), ], ) - : !isFromSearch && !isFromLiveCare && patientInfo.patientStatusType == null + : !isFromSearch && + !isFromLiveCare && + patientInfo.patientStatusType == + null ? Row( children: [ AppText( - TranslationBase.of(context).notArrived, + TranslationBase.of(context) + .notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -176,8 +190,13 @@ class PatientCard extends StatelessWidget { width: 8, ), AppText( - patientInfo.status == 2 ? 'Booked' : 'Confirmed', - color: patientInfo.status == 2 ? Colors.grey : Colors.green, + patientInfo.status == 2 + ? 'Booked' + : 'Confirmed', + color: + patientInfo.status == 2 + ? Colors.grey + : Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, @@ -187,27 +206,33 @@ class PatientCard extends StatelessWidget { : SizedBox(), this.arrivalType == '1' ? AppText( - patientInfo.startTime != null ? patientInfo.startTime : patientInfo.startTimes, + patientInfo.startTime != null + ? patientInfo.startTime + : patientInfo.startTimes, fontFamily: 'Poppins', fontWeight: FontWeight.w400, ) : patientInfo.arrivedOn != null ? AppText( - AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( - patientInfo.arrivedOn ?? "", + AppDateUtils.getDayMonthYearDate( + AppDateUtils + .convertStringToDate( + patientInfo.arrivedOn, )) + " " + - "${AppDateUtils.getStartTime(patientInfo.startTime ?? "")}", + "${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, ) - : (patientInfo.appointmentDate != null && - patientInfo.appointmentDate!.isNotEmpty) + : (patientInfo.appointmentDate != + null && + patientInfo + .appointmentDate.isNotEmpty) ? AppText( "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( - patientInfo.appointmentDate ?? "", - ))} ${AppDateUtils.getStartTime(patientInfo.startTime ?? "")}", + patientInfo.appointmentDate, + ))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, @@ -242,37 +267,41 @@ class PatientCard extends StatelessWidget { child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: - MainAxisAlignment.start,children: [ - Expanded( - // width: MediaQuery.of(context).size.width*0.51, - child: AppText( - isFromLiveCare - ? Helpers.capitalize(patientInfo.fullName) - : (Helpers.capitalize(patientInfo.firstName) + - " " + - Helpers.capitalize(patientInfo.lastName)), - fontSize: 16, - color: Color(0xff2e303a), - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - textOverflow: TextOverflow.ellipsis, - ), - ), - if (patientInfo.gender == 1) - Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - else - Icon( - DoctorApp.female_1, - color: Colors.pink, - -), if (isFromLiveCare) - ShowTimer( - patientInfo: patientInfo, - ), - ]), + MainAxisAlignment.start, + children: [ + Expanded( + // width: MediaQuery.of(context).size.width*0.51, + child: AppText( + isFromLiveCare + ? Helpers.capitalize( + patientInfo.fullName) + : (Helpers.capitalize( + patientInfo.firstName) + + " " + + Helpers.capitalize( + patientInfo.lastName)), + fontSize: 16, + color: Color(0xff2e303a), + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, + ), + ), + if (patientInfo.gender == 1) + Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + else + Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + if (isFromLiveCare) + ShowTimer( + patientInfo: patientInfo, + ), + ]), ), Expanded( child: Row( @@ -283,7 +312,7 @@ class PatientCard extends StatelessWidget { child: Container( alignment: Alignment.centerRight, child: AppText( - nationalityName!.truncate(14), + nationalityName.truncate(14), fontWeight: FontWeight.bold, fontSize: 14, textOverflow: TextOverflow.ellipsis, @@ -352,16 +381,16 @@ class PatientCard extends StatelessWidget { ), CustomRow( label: - TranslationBase.of(context).age! + " : ", + TranslationBase.of(context).age + " : ", value: - "${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", ), if (isInpatient) CustomRow( label: patientInfo.admissionDate == null ? "" : TranslationBase.of(context) - .admissionDate! + + .admissionDate + " : ", value: patientInfo.admissionDate == null ? "" @@ -370,22 +399,22 @@ 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}", ), if (patientInfo.admissionDate != null) CustomRow( label: - TranslationBase.of(context).roomNo! + + TranslationBase.of(context).roomNo + " : ", value: "${patientInfo.roomId}", ), @@ -394,9 +423,9 @@ class PatientCard extends StatelessWidget { children: [ CustomRow( label: TranslationBase.of(context) - .clinic! + + .clinic + " : ", - value: patientInfo!.clinicName!, + value: patientInfo.clinicName, ), ], ), @@ -424,29 +453,36 @@ class PatientCard extends StatelessWidget { ], ) : !isInpatient && !isFromSearch - ? Row(mainAxisAlignment: MainAxisAlignment.end, children: [ - Container( - padding: EdgeInsets.all(4), - child: Image.asset( - patientInfo.appointmentType == 'Regular' && patientInfo.visitTypeId == 100 - ? 'assets/images/livecare.png' - : patientInfo.appointmentType == 'Walkin' - ? 'assets/images/walkin.png' - : 'assets/images/booked.png', - height: 25, - width: 35, - )), - ]) - : (isInpatient == true) - ? Row(mainAxisAlignment: MainAxisAlignment.end, children: [ + ? Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ Container( padding: EdgeInsets.all(4), child: Image.asset( - 'assets/images/inpatient.png', + patientInfo.appointmentType == + 'Regular' && + patientInfo.visitTypeId == 100 + ? 'assets/images/livecare.png' + : patientInfo.appointmentType == + 'Walkin' + ? 'assets/images/walkin.png' + : 'assets/images/booked.png', height: 25, width: 35, )), ]) + : (isInpatient == true) + ? Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(4), + child: Image.asset( + 'assets/images/inpatient.png', + height: 25, + width: 35, + )), + ]) : SizedBox() ], ), diff --git a/lib/widgets/patients/patient_card/ShowTimer.dart b/lib/widgets/patients/patient_card/ShowTimer.dart index 022571fa..b769588b 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, required this.patientInfo, + Key key, 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/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 2bbb36a2..073a6d51 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -9,35 +9,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 GestureTapCallback? onTap; + final Function 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, - required this.patient, - required this.patientType, - required this.arrivalType, - this.nameLine1, - this.nameLine2, - required this.icon, + Key key, + this.patient, + this.patientType, + this.arrivalType, + this.nameLine1, + this.nameLine2, + this.icon, this.route, this.isDisable = false, this.onTap, diff --git a/lib/widgets/patients/profile/Profile_general_info_Widget.dart b/lib/widgets/patients/profile/Profile_general_info_Widget.dart new file mode 100644 index 00000000..e0eb5b12 --- /dev/null +++ b/lib/widgets/patients/profile/Profile_general_info_Widget.dart @@ -0,0 +1,45 @@ +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 52929c86..275888e3 100644 --- a/lib/widgets/patients/profile/add-order/addNewOrder.dart +++ b/lib/widgets/patients/profile/add-order/addNewOrder.dart @@ -3,12 +3,11 @@ import 'package:flutter/material.dart'; class AddNewOrder extends StatelessWidget { const AddNewOrder({ - Key? key, - required this.onTap, - required this.label, + Key key, + this.onTap, this.label, }) : super(key: key); - final GestureTapCallback onTap; + final Function onTap; final String label; @override @@ -46,7 +45,7 @@ class AddNewOrder extends StatelessWidget { height: 10, ), AppText( - label, + label ??'', color: Colors.grey[600], fontWeight: FontWeight.w600, ) diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index 62c23c6a..80f54e12 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, - required this.name, + {Key key, + this.name, this.url, this.disableProfileView: false, this.radius = 60.0, @@ -15,21 +15,23 @@ 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, + radius: + SizeConfig.imageSizeMultiplier * 12, // radius: (52) child: ClipRRect( - borderRadius: BorderRadius.circular(50), + borderRadius:BorderRadius.circular(50), + child: Image.network( - url!, + url, fit: BoxFit.fill, width: 700, ), @@ -65,11 +67,19 @@ class LargeAvatar extends StatelessWidget { }, child: Container( decoration: BoxDecoration( - gradient: LinearGradient(begin: Alignment(-1, -1), end: Alignment(1, 1), colors: [ - Colors.grey[100]!, - Colors.grey[800]!, - ]), - boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)], + gradient: LinearGradient( + begin: Alignment(-1, -1), + end: Alignment(1, 1), + colors: [ + Colors.grey[100], + Colors.grey[800], + ]), + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], borderRadius: BorderRadius.all(Radius.circular(50.0)), ), width: width, diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 05372d81..174da04d 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -2,7 +2,6 @@ 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/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/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -14,33 +13,29 @@ import 'package:url_launcher/url_launcher.dart'; import 'large_avatar.dart'; class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { - final PatiantInformtion? patient; - final PatientProfileAppBarModel? patientProfileAppBarModel; - final double? height; + final PatiantInformtion patient; + final double height; final bool isInpatient; final bool isDischargedPatient; final bool isFromLiveCare; - final String? doctorName; - final String? branch; - final DateTime? appointmentDate; - final String? profileUrl; - final String? invoiceNO; - final String? orderNo; - final bool? isPrescriptions; - final bool? isMedicalFile; - final String? episode; - final String? visitDate; - final String? clinic; - final bool? isAppointmentHeader; - final bool? isFromLabResult; - final VoidCallback? onPressed; + final String doctorName; + final String branch; + final DateTime appointmentDate; + final String profileUrl; + final String invoiceNO; + final String orderNo; + final bool isPrescriptions; + final bool isMedicalFile; + final String episode; + final String visitDate; + final String clinic; + final bool isAppointmentHeader; + final bool isFromLabResult; + final VoidCallback onPressed; PatientProfileAppBar(this.patient, - { this.patientProfileAppBarModel, - this.isFromLabResult = false, - this.onPressed, - this.height, + {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, @@ -50,28 +45,24 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { this.profileUrl, this.invoiceNO, this.orderNo, - this.isPrescriptions, - this.isMedicalFile, + this.isPrescriptions = false, + this.clinic, + this.isMedicalFile = false, this.episode, this.visitDate, - this.clinic, - this.isAppointmentHeader}); - late PatiantInformtion localPatient; + this.isAppointmentHeader = false, + this.isFromLabResult = false, + this.onPressed}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - if (patient == null) { - localPatient = patientProfileAppBarModel!.patient!; - } else { - localPatient = patient!; - } int gender = 1; - if (localPatient!.patientDetails != null) { - gender = localPatient!.patientDetails!.gender!; + if (patient.patientDetails != null) { + gender = patient.patientDetails.gender; } else { - gender = localPatient!.gender!; + gender = patient.gender; } return Container( @@ -96,18 +87,18 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { icon: Icon(Icons.arrow_back_ios), color: Color(0xFF2B353E), //Colors.black, onPressed: () { - if (onPressed != null) onPressed!(); + if (onPressed != null) onPressed(); Navigator.pop(context); }, ), Expanded( child: AppText( - localPatient!.firstName != null - ? (Helpers.capitalize(localPatient!.firstName) + + patient.firstName != null + ? (Helpers.capitalize(patient.firstName) + " " + - Helpers.capitalize(localPatient!.lastName)) - : Helpers.capitalize(localPatient!.fullName ?? - localPatient!.patientDetails!.fullName!), + Helpers.capitalize(patient.lastName)) + : Helpers.capitalize(patient.fullName ?? + patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -128,7 +119,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + localPatient!.mobileNumber!); + launch("tel://" + patient.mobileNumber); }, child: Icon( Icons.phone, @@ -136,30 +127,6 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), ), ), - if (patientProfileAppBarModel!.videoCallDurationStream != null) - StreamBuilder( - stream: patientProfileAppBarModel!.videoCallDurationStream, - builder: - (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.hasData && snapshot.data != null) - return InkWell( - onTap: () {}, - child: Container( - decoration: BoxDecoration( - color: Colors.red, - borderRadius: BorderRadius.circular(20)), - padding: EdgeInsets.symmetric( - vertical: 2, horizontal: 10), - child: Text( - snapshot.data!, - style: TextStyle(color: Colors.white), - ), - ), - ); - else - return Container(); - }, - ), ]), ), Row(children: [ @@ -170,9 +137,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: SizeConfig.getTextMultiplierBasedOnWidth() * 20, height: SizeConfig.getTextMultiplierBasedOnWidth() * 20, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -184,12 +149,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - localPatient!.patientStatusType != null + patient.patientStatusType != null ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - localPatient!.patientStatusType == 43 + patient.patientStatusType == 43 ? AppText( TranslationBase.of(context).arrivedP, color: Colors.green, @@ -208,11 +173,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { .getTextMultiplierBasedOnWidth() * 3.5, ), - localPatient!.startTime != null - ? AppText( - localPatient!.startTime != null - ? localPatient!.startTime - : '', + patient.startTime != null + ? AppText(patient.startTime != null ? patient.startTime : '', fontWeight: FontWeight.w700, fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -240,7 +202,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: 1, ), AppText( - localPatient!.patientId.toString(), + patient.patientId.toString(), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, @@ -253,25 +215,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Row( children: [ AppText( - localPatient!.nationalityName ?? - localPatient!.nationality ?? - localPatient!.nationalityId ?? + patient.nationalityName ?? + patient.nationality ?? + patient.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ), - localPatient!.nationalityFlagURL != null + patient.nationalityFlagURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - localPatient!.nationalityFlagURL!, + patient.nationalityFlagURL, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace? stackTrace) { + StackTrace stackTrace) { return Text('No Image'); }, )) @@ -282,48 +244,49 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), HeaderRow( - label: TranslationBase.of(context).age! + " : ", + label: TranslationBase.of(context).age + " : ", value: - "${AppDateUtils.getAgeByBirthday(localPatient!.patientDetails != null ? localPatient!.patientDetails!.dateofBirth ?? "" : localPatient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), - if (localPatient!.appointmentDate != null && - localPatient!.appointmentDate!.isNotEmpty && - !isFromLabResult!) + + if (patient.appointmentDate != null && + patient.appointmentDate.isNotEmpty && + !isFromLabResult) HeaderRow( - label: TranslationBase.of(context).appointmentDate! + - " : ", + label: + TranslationBase.of(context).appointmentDate + " : ", value: AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.convertStringToDate( - localPatient!.appointmentDate!)), + patient.appointmentDate)), ), - if (patientProfileAppBarModel!.isFromLabResult!) + if (isFromLabResult) HeaderRow( label: "Result Date: ", value: - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel!.appointmentDate!, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', ), // if(isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (localPatient!.admissionDate != null && - localPatient!.admissionDate!.isNotEmpty) + if (patient.admissionDate != null && + patient.admissionDate.isNotEmpty) HeaderRow( - label: localPatient!.admissionDate == null + label: patient.admissionDate == null ? "" - : TranslationBase.of(context).admissionDate! + + : TranslationBase.of(context).admissionDate + " : ", - value: localPatient!.admissionDate == null + value: patient.admissionDate == null ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate.toString())))}", + : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", ), - if (localPatient!.admissionDate != null) + if (patient.admissionDate != null) HeaderRow( label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && - localPatient!.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(localPatient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}", + patient.dischargeDate != null + ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", ) ], ), @@ -331,7 +294,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), ), ]), - if (patientProfileAppBarModel!.isAppointmentHeader!) + if (isAppointmentHeader) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -339,16 +302,13 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: 30, height: 30, margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, - right: projectViewModel.isArabic ? 85 : 10, - top: 5), + left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5), decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border( bottom: - BorderSide(color: Colors.grey[400]!, width: 2.5), - left: - BorderSide(color: Colors.grey[400]!, width: 2.5), + BorderSide(color: Colors.grey[400], width: 2.5), + left: BorderSide(color: Colors.grey[400], width: 2.5), )), ), Expanded( @@ -359,8 +319,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { children: [ Container( child: LargeAvatar( - name: patientProfileAppBarModel!.doctorName ?? "", - url: patientProfileAppBarModel!.profileUrl, + name: doctorName ?? "", + url: profileUrl, ), width: 25, height: 25, @@ -382,14 +342,14 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { 3.5, isCopyable: true, ), - if (orderNo != null && !isPrescriptions!) + if (orderNo != null && !isPrescriptions) HeaderRow( label: 'Order No: ', value: orderNo ?? '', ), - if (invoiceNO != null && !isPrescriptions!) + if (invoiceNO != null && !isPrescriptions) HeaderRow( - label: 'Invoice: ', + label: 'Invoice: ', value: invoiceNO ?? "", ), if (branch != null) @@ -402,25 +362,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { label: 'Clinic: ', value: clinic ?? '', ), - if (isMedicalFile! && episode != null) + if (isMedicalFile && episode != null) HeaderRow( label: 'Episode: ', value: episode ?? '', ), - if (isMedicalFile! && visitDate != null) + if (isMedicalFile && visitDate != null) HeaderRow( label: 'Visit Date: ', value: visitDate ?? '', ), - if (!isMedicalFile!) + if (!isMedicalFile) HeaderRow( - label: !isPrescriptions! + label: !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ', value: - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', - ), - ]), + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + ), + ]), ), ), ], @@ -438,28 +398,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { @override Size get preferredSize => Size( double.maxFinite, - patientProfileAppBarModel!.height == 0 - ? patientProfileAppBarModel!.isAppointmentHeader! - ? 270 - : ((localPatient!.appointmentDate!.isNotEmpty) - ? patientProfileAppBarModel!.isFromLabResult! - ? 190 - : 170 - : localPatient!.admissionDate != null - ? patientProfileAppBarModel!.isFromLabResult! + height == 0 + ? isInpatient + ? (isFromLabResult ? 210 : 200) + : isAppointmentHeader + ? 290 + : SizeConfig.isHeightVeryShort + ? 137 + : SizeConfig.isHeightShort ? 190 - : 170 - : patientProfileAppBarModel!.isDischargedPatient! - ? 240 - : 130) - : patientProfileAppBarModel!.height!); + : SizeConfig.heightMultiplier * + (SizeConfig.isWidthLarge ? 25 : 20) + : height); } class HeaderRow extends StatelessWidget { - final String? label; - final String? value; + final String label; + final String value; - const HeaderRow({Key? key, this.label, this.value}) : super(key: key); + const HeaderRow({Key key, this.label, this.value}) : super(key: key); @override Widget build(BuildContext context) { 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 f1ab00e0..f0678e22 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), ), ), @@ -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) { - late String newDate; + 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 37a0d90a..9d22962a 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -13,7 +13,8 @@ import 'large_avatar.dart'; class PrescriptionInPatientWidget extends StatelessWidget { final List prescriptionReportForInPatientList; - PrescriptionInPatientWidget({Key? key, required this.prescriptionReportForInPatientList}); + PrescriptionInPatientWidget( + {Key key, this.prescriptionReportForInPatientList}); @override Widget build(BuildContext context) { @@ -27,7 +28,8 @@ class PrescriptionInPatientWidget extends StatelessWidget { Container( padding: EdgeInsets.all(40), decoration: BoxDecoration( - border: Border.all(color: HexColor('#B8382C'), width: 4), + border: + Border.all(color: HexColor('#B8382C'), width: 4), borderRadius: BorderRadius.all(Radius.circular(100))), child: IconButton( icon: Icon( @@ -54,14 +56,19 @@ class PrescriptionInPatientWidget extends StatelessWidget { ), )) : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, + SizeConfig.realScreenWidth * 0.05, 0), child: ListView.builder( itemCount: prescriptionReportForInPatientList.length, itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { - Navigator.of(context).pushNamed(IN_PATIENT_PRESCRIPTIONS_DETAILS, - arguments: {'prescription': prescriptionReportForInPatientList[index]}); + Navigator.of(context).pushNamed( + IN_PATIENT_PRESCRIPTIONS_DETAILS, + arguments: { + 'prescription': + prescriptionReportForInPatientList[index] + }); }, child: CardWithBgWidgetNew( widget: Column( @@ -70,26 +77,34 @@ class PrescriptionInPatientWidget extends StatelessWidget { Row( children: [ LargeAvatar( - name: prescriptionReportForInPatientList[index].createdByName ?? "", + name: + prescriptionReportForInPatientList[index] + .createdByName, radius: 10, width: 70, ), Expanded( child: Container( - margin: EdgeInsets.only(left: 15, right: 15), + margin: + EdgeInsets.only(left: 15, right: 15), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( '${prescriptionReportForInPatientList[index].createdByName}', - fontSize: 2.5 * SizeConfig.textMultiplier, + fontSize: + 2.5 * SizeConfig.textMultiplier, ), SizedBox( height: 8, ), - AppText('${prescriptionReportForInPatientList[index].itemDescription}', - fontSize: 2.5 * SizeConfig.textMultiplier, - color: Theme.of(context).primaryColor), + AppText( + '${prescriptionReportForInPatientList[index].itemDescription}', + fontSize: + 2.5 * SizeConfig.textMultiplier, + color: + Theme.of(context).primaryColor), SizedBox( height: 8, ), diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index f160d78e..50afbdcf 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, required this.patientPrescriptionsList}); + PrescriptionOutPatientWidget({Key key, this.patientPrescriptionsList}); @override Widget build(BuildContext context) { @@ -28,7 +28,8 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Container( padding: EdgeInsets.all(40), decoration: BoxDecoration( - border: Border.all(color: HexColor('#B8382C'), width: 4), + border: + Border.all(color: HexColor('#B8382C'), width: 4), borderRadius: BorderRadius.all(Radius.circular(100))), child: IconButton( icon: Icon( @@ -55,7 +56,8 @@ class PrescriptionOutPatientWidget extends StatelessWidget { ), )) : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, + SizeConfig.realScreenWidth * 0.05, 0), child: ListView.builder( itemCount: patientPrescriptionsList.length, itemBuilder: (BuildContext context, int index) { @@ -64,8 +66,10 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Navigator.push( context, MaterialPageRoute( - builder: (context) => OutPatientPrescriptionDetailsScreen( - prescriptionResModel: patientPrescriptionsList[index], + builder: (context) => + OutPatientPrescriptionDetailsScreen( + prescriptionResModel: + patientPrescriptionsList[index], ), settings: RouteSettings(name: 'OutPatientPrescriptionDetailsScreen') ), @@ -78,27 +82,35 @@ 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, ), Expanded( child: Container( - margin: EdgeInsets.only(left: 15, right: 15), + margin: + EdgeInsets.only(left: 15, right: 15), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( '${patientPrescriptionsList[index].name}', - fontSize: 2.5 * SizeConfig.textMultiplier, + fontSize: + 2.5 * SizeConfig.textMultiplier, ), SizedBox( height: 8, ), - AppText('${patientPrescriptionsList[index].clinicDescription}', - fontSize: 2.5 * SizeConfig.textMultiplier, - color: Theme.of(context).primaryColor), + AppText( + '${patientPrescriptionsList[index].clinicDescription}', + fontSize: + 2.5 * SizeConfig.textMultiplier, + color: + Theme.of(context).primaryColor), SizedBox( height: 8, ), diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 5c6eb5f6..0a405d8d 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -23,19 +22,22 @@ class ProfileWelcomeWidget extends StatelessWidget { widthFactor: 0.9, child: Row( mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ this.isClinic == true ? clinicWidget : SizedBox(), + SizedBox( + width: 20, + ), if (authenticationViewModel.doctorProfile != null) CircleAvatar( // radius: (52) child: ClipRRect( borderRadius: BorderRadius.circular(20), child: CachedNetworkImage( - imageUrl: authenticationViewModel.doctorProfile!.doctorImageURL ?? "", + imageUrl: authenticationViewModel.doctorProfile.doctorImageURL, fit: BoxFit.fill, - width: SizeConfig.widthMultiplier* 11, - height: SizeConfig.widthMultiplier* 11, + width: 75, + height: 75, ), ), backgroundColor: Colors.transparent, diff --git a/lib/widgets/patients/profile/profile_general_info_content_widget.dart b/lib/widgets/patients/profile/profile_general_info_content_widget.dart new file mode 100644 index 00000000..f5c70ae6 --- /dev/null +++ b/lib/widgets/patients/profile/profile_general_info_content_widget.dart @@ -0,0 +1,45 @@ +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 5f417a20..a7832481 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, required this.patient, required this.patientType, required this.arrivalType, required this.from, required this.to, this.isInpatient = false}); + {Key key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient}); @override Widget build(BuildContext context) { @@ -57,7 +57,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab??'', + nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), PatientProfileButton( 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 new file mode 100644 index 00000000..17feaf0a --- /dev/null +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -0,0 +1,176 @@ +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: 'patient/vital_signs.png'), + 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: 'patient/lab_results.png'), + 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: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + 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: 'patient/Progress_notes.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + 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: 'patient/health_summary.png'), + 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: 'patient/health_summary.png'), + 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: 'patient/vital_signs.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ); + } +} 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 e457b6dd..573ada32 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -4,38 +4,31 @@ 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:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class ProfileMedicalInfoWidgetSearch extends StatefulWidget { +class ProfileMedicalInfoWidgetSearch extends StatelessWidget { 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, - required this.patient, - required this.patientType, + {Key key, + this.patient, + this.patientType, this.arrivalType, - required this.from, - required this.to, - this.isInpatient = false, + this.from, + this.to, + this.isInpatient, this.isDischargedPatient}); - - @override - _ProfileMedicalInfoWidgetSearchState createState() => _ProfileMedicalInfoWidgetSearchState(); -} - -class _ProfileMedicalInfoWidgetSearchState extends State - with SingleTickerProviderStateMixin { - late TabController _tabController; - + TabController _tabController; void initState() { - _tabController = TabController(length: 2, vsync: this); + _tabController = TabController(length: 2); } void dispose() { @@ -48,7 +41,7 @@ class _ProfileMedicalInfoWidgetSearchState extends State DefaultTabController( length: 2, - initialIndex: widget.isInpatient! ? 0 : 1, + initialIndex: isInpatient ? 0 : 1, child: SizedBox( height: MediaQuery.of(context).size.height * 1.0, width: double.infinity, @@ -62,21 +55,22 @@ class _ProfileMedicalInfoWidgetSearchState extends State _VitalSignDetailsWidgetState(); @@ -24,7 +24,10 @@ class _VitalSignDetailsWidgetState extends State { return Container( decoration: BoxDecoration( color: Colors.transparent, - borderRadius: BorderRadius.only(topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + topRight: Radius.circular(10.0) + ), border: Border.all(color: Colors.grey, width: 1), ), margin: EdgeInsets.all(20), @@ -35,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(), ), @@ -45,7 +48,7 @@ class _VitalSignDetailsWidgetState extends State { ); } - List fullData() { + List fullData(){ List tableRow = []; tableRow.add(TableRow(children: [ Container( @@ -87,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, ), ), @@ -109,4 +112,5 @@ class _VitalSignDetailsWidgetState extends State { }); return tableRow; } + } diff --git a/lib/widgets/shared/StarRating.dart b/lib/widgets/shared/StarRating.dart index 1caded9b..f391e7bf 100644 --- a/lib/widgets/shared/StarRating.dart +++ b/lib/widgets/shared/StarRating.dart @@ -8,21 +8,30 @@ 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) ? EvaIcons.star : EvaIcons.starOutline, + child: Icon( + (index + 1) <= (totalAverage ?? 0) + ? EvaIcons.star + : EvaIcons.starOutline, size: size, - color: (index + 1) <= (totalAverage) + color: (index + 1) <= (totalAverage ?? 0) ? Color.fromRGBO(255, 186, 0, 1.0) : Theme.of(context).hintColor), )), diff --git a/lib/widgets/shared/text_fields/TextFields.dart b/lib/widgets/shared/TextFields.dart similarity index 52% rename from lib/widgets/shared/text_fields/TextFields.dart rename to lib/widgets/shared/TextFields.dart index ee86ad24..18d8e778 100644 --- a/lib/widgets/shared/text_fields/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -4,7 +4,8 @@ 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; @@ -26,7 +27,8 @@ 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), @@ -37,90 +39,87 @@ 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 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; + 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; @override _TextFieldsState createState() => _TextFieldsState(); @@ -143,7 +142,7 @@ class _TextFieldsState extends State { @override void didUpdateWidget(TextFields oldWidget) { - if (widget.focus!) _focusNode.requestFocus(); + if (widget.focus) _focusNode.requestFocus(); super.didUpdateWidget(oldWidget); } @@ -153,7 +152,7 @@ class _TextFieldsState extends State { super.dispose(); } - Widget? _buildSuffixIcon() { + Widget _buildSuffixIcon() { switch (widget.type) { case "password": { @@ -166,30 +165,35 @@ class _TextFieldsState extends State { view = false; }); }, - child: Icon(EvaIcons.eye, size: 24.0, color: Color?.fromRGBO(78, 62, 253, 1.0))) + 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]))); + child: Icon(EvaIcons.eyeOff, + size: 24.0, color: Colors.grey[500]))); } break; default: if (widget.suffixIcon != null) return InkWell( - onTap: widget.onSuffixTap??null, + onTap: widget.onSuffixTap, 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 { @@ -199,18 +203,19 @@ 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), + // 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), + color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0), offset: Offset(0.0, 13.0), blurRadius: focus ? 34.0 : 12.0) ]), @@ -220,10 +225,10 @@ class _TextFieldsState extends State { onTap: widget.onTapTextFields, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate!, - textCapitalization: widget.textCapitalization!, - onFieldSubmitted: widget.inputAction! == TextInputAction.next - ? (widget.onSubmit! != null + autovalidate: widget.autoValidate, + textCapitalization: widget.textCapitalization, + onFieldSubmitted: widget.inputAction == TextInputAction.next + ? (widget.onSubmit != null ? widget.onSubmit : (val) { _focusNode.nextFocus(); @@ -232,10 +237,10 @@ class _TextFieldsState extends State { 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; @@ -246,21 +251,19 @@ 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, @@ -268,7 +271,7 @@ class _TextFieldsState extends State { ] : widget.inputFormatters, decoration: InputDecoration( - labelText: widget.hasLabelText! ? widget.hintText : null, + labelText: widget.hasLabelText ? widget.hintText : null, labelStyle: TextStyle( fontSize: widget.fontSize, fontWeight: widget.fontWeight, @@ -278,54 +281,68 @@ 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 e5146645..49f7d4e8 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.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/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:provider/provider.dart'; @@ -16,6 +17,7 @@ import 'app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + class AppDrawer extends StatefulWidget { @override _AppDrawerState createState() => _AppDrawerState(); @@ -23,13 +25,12 @@ class AppDrawer extends StatefulWidget { class _AppDrawerState extends State { Helpers helpers = new Helpers(); - late ProjectViewModel projectsProvider; + ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { AuthenticationViewModel authenticationViewModel = Provider.of(context); projectsProvider = Provider.of(context); - double drawerWidth = SizeConfig.realScreenWidth * 0.60; return RoundedContainer( child: Container( color: Colors.white, @@ -40,6 +41,7 @@ class _AppDrawerState extends State { child: ListView(padding: EdgeInsets.zero, children: [ Container( margin: EdgeInsets.symmetric(horizontal: 15), + // height: SizeConfig.heightMultiplier * 50, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -48,11 +50,8 @@ class _AppDrawerState extends State { Container( child: Image.asset( 'assets/images/dr_app_logo.png', - width: SizeConfig.getWidthMultiplier( - width: drawerWidth) * (SizeConfig.isHeightVeryShort? 25:SizeConfig.isHeightShort?32: 32), - ), - margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?1:2), bottom: SizeConfig.heightMultiplier * 0.5), + margin: EdgeInsets.only(top: 10, bottom: 10), ), Container( child: InkWell( @@ -61,16 +60,16 @@ class _AppDrawerState extends State { }, child: Icon( DoctorApp.close_1, - size: SizeConfig.heightMultiplier * 2, + size: 20, ), ), - margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?2:3), bottom: SizeConfig.heightMultiplier * 0.5), + margin: EdgeInsets.only(top: 20, bottom: 10), ) ], crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, ), - SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?0.5:1),), + SizedBox(height: 5), if (authenticationViewModel.doctorProfile != null) InkWell( onTap: () { @@ -86,41 +85,31 @@ class _AppDrawerState extends State { Padding( padding: EdgeInsets.only(top: 10), child: AppText( - TranslationBase - .of(context) - .dr ?? - "" + authenticationViewModel.doctorProfile!.doctorName!, + TranslationBase.of(context).dr + + authenticationViewModel.doctorProfile?.doctorName, fontWeight: FontWeight.bold, color: Color(0xFF2E303A), fontFamily: 'Poppins', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth( - width: drawerWidth) * (SizeConfig.isWidthLarge?5: 8), + fontSize: 17, ), ), Padding( padding: EdgeInsets.only(top: 0), child: AppText( - authenticationViewModel.doctorProfile - ?.clinicDescription, + authenticationViewModel.doctorProfile?.clinicDescription, fontWeight: FontWeight.w600, color: Color(0xFF2E303A), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth( - width: drawerWidth) * (SizeConfig.isWidthLarge?3: 6), + fontSize: 15, fontFamily: 'Poppins', )) ], ), ), - SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?4:6),), + SizedBox(height: 40), InkWell( child: DrawerItem( - TranslationBase - .of(context) - .applyOrRescheduleLeave!, + TranslationBase.of(context).applyOrRescheduleLeave, icon: DoctorApp.reschedule__1, - drawerWidth: drawerWidth, // subTitle: , ), onTap: () { @@ -134,26 +123,19 @@ class _AppDrawerState extends State { )); }, ), - SizedBox(height: SizeConfig.heightMultiplier *2), + SizedBox(height: 15), InkWell( child: DrawerItem( - TranslationBase - .of(context) - .myQRCode!, + TranslationBase.of(context).myQRCode, icon: DoctorApp.qr_code_3, - drawerWidth: drawerWidth, - // subTitle: , ), ), - SizedBox(height: SizeConfig.heightMultiplier *1.5), + SizedBox(height: 15), InkWell( child: Container( - // height: 80, - child: Image.asset('assets/images/qr_code.png', - width: SizeConfig.getWidthMultiplier( - width: drawerWidth) * (SizeConfig.isHeightVeryShort?25:30), - ), + height: 80, + child: Image.asset('assets/images/qr_code.png'), ), onTap: () {}, ), @@ -161,7 +143,7 @@ class _AppDrawerState extends State { ), ), SizedBox( - height: SizeConfig.heightMultiplier *(SizeConfig.isHeightVeryShort?8:SizeConfig.isHeightShort?10:16), + height: MediaQuery.of(context).size.height * 0.09, ), Container( margin: EdgeInsets.symmetric(horizontal: 20), @@ -169,19 +151,13 @@ class _AppDrawerState extends State { children: [ 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' : 'assets/images/saudi-arabia-flag.png', - drawerWidth: drawerWidth, ), onTap: () { if (projectsProvider.isArabic) @@ -190,19 +166,16 @@ class _AppDrawerState extends State { projectsProvider.changeLanguage('ar'); }, ), - SizedBox(height: SizeConfig.heightMultiplier *(SizeConfig.isHeightVeryShort?0.5:1) ), + SizedBox(height: 10), InkWell( child: DrawerItem( - TranslationBase - .of(context) - .logout!, + TranslationBase.of(context).logout, icon: DoctorApp.logout_1, - drawerWidth: drawerWidth, - ), onTap: () async { Navigator.pop(context); await authenticationViewModel.logout(isFromLogin: false); + }, ), ], @@ -214,6 +187,7 @@ class _AppDrawerState extends State { flex: 1, child: Column(children: [ Container( + // This align moves the children to the bottom child: Align( alignment: FractionalOffset.bottomCenter, child: Container( @@ -228,9 +202,7 @@ class _AppDrawerState extends State { style: TextStyle( color: Color(0xFF989898), fontWeight: FontWeight.bold, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth( - width: drawerWidth) * (SizeConfig.isWidthLarge?4: 6), + fontSize: 14, fontFamily: 'Poppins', ), children: [ @@ -238,25 +210,24 @@ class _AppDrawerState extends State { text: ' Cloud Solutions', style: TextStyle( color: Color(0xFF2E303A), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth( - width: drawerWidth) * (SizeConfig.isWidthLarge?5: 7), + fontSize: 15, fontFamily: 'Poppins', ), ) ]), ), ), + // Text("Powered by"), Image.asset( 'assets/images/cs_logo_container.png', width: SizeConfig.imageSizeMultiplier * 20, ) ], - )))) + )))) ])) - ])), + ])), ), - width: drawerWidth, + width: SizeConfig.realScreenWidth * 0.60, margin: EdgeInsets.all(0), customCornerRaduis: false, diff --git a/lib/widgets/shared/app_expandable_notifier.dart b/lib/widgets/shared/app_expandable_notifier.dart new file mode 100644 index 00000000..76a7f57e --- /dev/null +++ b/lib/widgets/shared/app_expandable_notifier.dart @@ -0,0 +1,58 @@ +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 new file mode 100644 index 00000000..848f5265 --- /dev/null +++ b/lib/widgets/shared/app_expandable_notifier_new.dart @@ -0,0 +1,127 @@ +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 40f87654..4b6d753b 100644 --- a/lib/widgets/shared/app_loader_widget.dart +++ b/lib/widgets/shared/app_loader_widget.dart @@ -1,29 +1,33 @@ 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(); } class _AppLoaderWidgetState extends State { + + @override Widget build(BuildContext context) { return Container( height: MediaQuery.of(context).size.height, + child: Stack( children: [ Container( - color: widget.containerColor ?? Colors.grey.withOpacity(0.6), + color: widget.containerColor??Colors.grey.withOpacity(0.6), ), - Container( - child: GifLoaderContainer(), margin: EdgeInsets.only(bottom: MediaQuery.of(context).size.height * 0.09)) + Container(child: GifLoaderContainer(), margin: EdgeInsets.only( + bottom: MediaQuery.of(context).size.height * 0.09)) ], ), ); diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 5511f949..b930c21a 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -2,9 +2,7 @@ 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'; @@ -14,20 +12,18 @@ 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 PreferredSizeWidget? appBar; - final Widget? drawer; - final Widget? bottomNavigationBar; - final String? subtitle; + final BaseViewModel baseViewModel; + final Widget bottomSheet; + final Color backgroundColor; + final Widget appBar; + final Widget drawer; + final Widget bottomNavigationBar; + final String subtitle; final bool isHomeIcon; final bool extendBody; - final PatientProfileAppBarModel? patientProfileAppBarModel; - AppScaffold( {this.appBarTitle = '', this.body, @@ -37,10 +33,7 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - - this.subtitle, - this.patientProfileAppBarModel, - this.drawer, this.extendBody = false, this.bottomNavigationBar, this.appBar}); + this.appBar, this.subtitle, this.drawer, this.extendBody = false, this.bottomNavigationBar}); @override Widget build(BuildContext context) { @@ -56,26 +49,21 @@ class AppScaffold extends StatelessWidget { extendBody: extendBody, bottomNavigationBar: bottomNavigationBar, appBar: isShowAppBar - ? 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: [ + ? 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) { @@ -91,7 +79,8 @@ class AppScaffold extends StatelessWidget { ? IconButton( icon: Icon(DoctorApp.home_icon_active), color: Colors.black, //Colors.black, - onPressed: () => Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false), + onPressed: () => Navigator.pushNamedAndRemoveUntil( + context, HOME, (r) => false), ) : SizedBox() ], @@ -104,7 +93,8 @@ 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 57b85141..56a503a8 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,9 +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, @@ -111,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, @@ -127,7 +127,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( @@ -157,14 +157,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) @@ -174,12 +174,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 : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), @@ -192,18 +192,18 @@ class _AppTextState extends State { ); } else { return Text( - !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) ? TextOverflow.fade : TextOverflow.ellipsis) : null, + overflow: widget.maxLines != null ? ((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 ?? (widget.variant == "overline" ? 1.5 : null), @@ -218,27 +218,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(); } @@ -323,7 +323,7 @@ class _AppTextState extends State { return FontWeight.w500; } } else { - return FontWeight.normal; + return null; } } } diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index edca36e4..16988d82 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, required this.changeIndex, required this.index}) : super(key: key); + BottomNavBar({Key key, this.changeIndex, 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 37dbe28c..02b64c78 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -1,5 +1,4 @@ import 'package:badges/badges.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:flutter/cupertino.dart'; @@ -9,24 +8,30 @@ import 'package:provider/provider.dart'; import '../../locator.dart'; class BottomNavigationItem extends StatelessWidget { - final IconData? icon; - final IconData? activeIcon; + final IconData icon; + final IconData activeIcon; final ValueChanged changeIndex; - final int? index; + final int index; final int currentIndex; - final String? name; - final DashboardViewModel? dashboardViewModel; + final String name; + final DashboardViewModel dashboardViewModel; + BottomNavigationItem( - {this.icon, this.activeIcon, required this.changeIndex, this.index, required this.currentIndex, this.name, this.dashboardViewModel}); + {this.icon, + this.activeIcon, + this.changeIndex, + this.index, + this.currentIndex, + this.name, this.dashboardViewModel}); + @override Widget build(BuildContext context) { return Expanded( child: SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10 :SizeConfig.isHeightShort ? 8: 8), + height: 70.0, child: Material( type: MaterialType.transparency, child: InkWell( @@ -42,30 +47,28 @@ class BottomNavigationItem extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 12:SizeConfig.isHeightShort ?10 : 9) ) * 10,), - Container( - margin: EdgeInsets.only(bottom: 3), - child: Icon(currentIndex == index ? activeIcon : icon, - color: currentIndex == index ? Color(0xFF333C45) : Color(0xFF989898), size: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10:SizeConfig.isHeightShort ?8.5 : 7) ) * 40,), - ), - SizedBox( - height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10 : 6) ) * 0.5, + SizedBox(height: 15,), + Container( + child: Icon(currentIndex == index ? activeIcon : icon, + color: currentIndex == index + ? Color(0xFF333C45) + : Theme.of(context).dividerColor, + size: 22.0), ), - Expanded( - child: Text( - name ?? "", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2,color: currentIndex == index ? Color(0xFF333C45) : Color(0xFF989898)//#989898, + SizedBox(height: 5,), + Expanded( + child: Text( + name, + style: TextStyle( + color: currentIndex == index + ? Theme.of(context).primaryColor + : Theme.of(context).dividerColor, ), ), ), ], ), - if(currentIndex == 3 && dashboardViewModel!.notRepliedCount != 0) + if(currentIndex == 3 && dashboardViewModel.notRepliedCount != 0) Positioned( right: 18.0, bottom: 40.0, @@ -77,7 +80,7 @@ class BottomNavigationItem extends StatelessWidget { borderRadius: BorderRadius.circular(8), badgeContent: Container( // padding: EdgeInsets.all(2.0), - child: Text(dashboardViewModel!.notRepliedCount.toString(), + child: Text(dashboardViewModel.notRepliedCount.toString(), style: TextStyle( 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 a4dafc9e..acbd27fe 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -6,23 +6,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, @@ -40,7 +40,8 @@ class AppButton extends StatefulWidget { this.hPadding = 0, this.radius = 8.0, this.hasBorder = false, - this.borderColor, this.height, + this.borderColor, + this.height, }); _AppButtonState createState() => _AppButtonState(); @@ -50,22 +51,21 @@ class _AppButtonState extends State { @override Widget build(BuildContext context) { return Container( + // 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! - ? Colors.grey - : widget.color != null - ? widget.color - : HexColor("#B8382C"), + fillColor: widget.disabled + ? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"), 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 ), @@ -73,7 +73,8 @@ class _AppButtonState extends State { mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, children: [ - if (widget.icon != null) Container(width: 25, height: 25, child: widget.icon), + if (widget.icon != null) + Container(width: 25, height: 25, child: widget.icon), if (widget.iconData != null) Icon( widget.iconData, @@ -83,7 +84,7 @@ class _AppButtonState extends State { SizedBox( width: 5.0, ), - widget.loading! + widget.loading ? Padding( padding: EdgeInsets.all(2.6), child: SizedBox( @@ -92,7 +93,7 @@ class _AppButtonState extends State { child: CircularProgressIndicator( backgroundColor: Colors.white, valueColor: AlwaysStoppedAnimation( - Colors.grey[300]!, + Colors.grey[300], ), ), ), @@ -101,24 +102,22 @@ class _AppButtonState extends State { child: AppText( widget.title, color: widget.fontColor, - fontSize: SizeConfig.textMultiplier * widget.fontSize!, + fontSize: SizeConfig.textMultiplier * widget.fontSize, fontWeight: widget.fontWeight, ), ), ], ), ), - onPressed: widget.disabled! ? () {} : widget.onPressed, + onPressed: widget.disabled ? (){} : widget.onPressed, shape: RoundedRectangleBorder( side: BorderSide( - color: widget.hasBorder! - ? widget.borderColor! - : widget.disabled! - ? Colors.grey - : widget.color ?? Color(0xFFB8382C), + color: + widget.hasBorder ? widget.borderColor : 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 883a6a9b..3c5cc32d 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; - ButtonBottomSheet({ - @required this.onPressed, + 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, this.title, this.iconData, this.icon, @@ -36,8 +36,7 @@ class ButtonBottomSheet extends StatelessWidget { this.hPadding = 0, this.radius = 8.0, this.hasBorder = false, - this.borderColor, - }); + this.borderColor,}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/buttons/secondary_button.dart b/lib/widgets/shared/buttons/secondary_button.dart index 7fd680e3..48c65baf 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,14 +45,15 @@ class SecondaryButton extends StatefulWidget { _SecondaryButtonState createState() => _SecondaryButtonState(); } -class _SecondaryButtonState extends State with TickerProviderStateMixin { +class _SecondaryButtonState extends State + with TickerProviderStateMixin { double _buttonSize = 1.0; - late AnimationController _animationController; - late Animation _animation; + AnimationController _animationController; + Animation _animation; double _rippleSize = 0.0; - late AnimationController _rippleController; - late Animation _rippleAnimation; + AnimationController _rippleController; + Animation _rippleAnimation; @override void initState() { @@ -61,19 +62,28 @@ class _SecondaryButtonState extends State with TickerProviderSt _rippleSize = 1.0; }); } - _animationController = - AnimationController(vsync: this, lowerBound: 0.7, upperBound: 1.0, duration: Duration(milliseconds: 120)); - _animation = - CurvedAnimation(parent: _animationController, curve: Curves.easeOutQuad, reverseCurve: Curves.easeOutQuad); + _animationController = AnimationController( + vsync: this, + lowerBound: 0.7, + upperBound: 1.0, + duration: Duration(milliseconds: 120)); + _animation = CurvedAnimation( + parent: _animationController, + curve: Curves.easeOutQuad, + reverseCurve: Curves.easeOutQuad); _animation.addListener(() { setState(() { _buttonSize = _animation.value; }); }); - _rippleController = - AnimationController(vsync: this, lowerBound: 0.0, upperBound: 1.0, duration: Duration(seconds: 1)); - _rippleAnimation = CurvedAnimation(parent: _rippleController, curve: Curves.easeInOutQuint); + _rippleController = AnimationController( + vsync: this, + lowerBound: 0.0, + upperBound: 1.0, + duration: Duration(seconds: 1)); + _rippleAnimation = CurvedAnimation( + parent: _rippleController, curve: Curves.easeInOutQuint); _rippleAnimation.addListener(() { setState(() { _rippleSize = _rippleAnimation.value; @@ -92,7 +102,8 @@ class _SecondaryButtonState extends State with TickerProviderSt Widget _buildIcon() { if (widget.icon != null && (widget.label != null && widget.label != "")) { return Container(height: 25.0, child: widget.icon); - } else if (widget.icon != null && (widget.label == null || widget.label == "")) { + } else if (widget.icon != null && + (widget.label == null || widget.label == "")) { return Container(height: 25.0, width: 25, child: widget.icon); } else { return Container(); @@ -103,7 +114,7 @@ class _SecondaryButtonState extends State with TickerProviderSt void didUpdateWidget(SecondaryButton oldWidget) { super.didUpdateWidget(oldWidget); if (oldWidget.disabled != widget.disabled) { - bool d = widget.disabled; + bool d = widget.disabled ?? false; if (!d) { _rippleController.forward(); } else { @@ -131,7 +142,7 @@ class _SecondaryButtonState extends State with TickerProviderSt _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, @@ -140,12 +151,16 @@ class _SecondaryButtonState extends State with TickerProviderSt 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: [ BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.04), spreadRadius: -0.0, offset: Offset(0, 4.0), blurRadius: 18.0) + color: Color.fromRGBO(0, 0, 0, 0.04), + spreadRadius: -0.0, + offset: Offset(0, 4.0), + blurRadius: 18.0) ], ), child: ClipRRect( @@ -161,7 +176,9 @@ class _SecondaryButtonState extends State with TickerProviderSt width: MediaQuery.of(context).size.width, height: 100, decoration: BoxDecoration( - color: widget.disabled ? Colors.grey : widget.color ?? Theme.of(context).buttonColor), + color: widget.disabled + ? Colors.grey + : widget.color ?? Theme.of(context).buttonColor), ), ), Positioned( @@ -174,7 +191,9 @@ class _SecondaryButtonState extends State with TickerProviderSt height: MediaQuery.of(context).size.width * 2.2, decoration: BoxDecoration( shape: BoxShape.circle, - color: widget.disabled ? Colors.grey : widget.color ?? Theme.of(context).buttonColor, + color: widget.disabled + ? Colors.grey + : widget.color ?? Theme.of(context).buttonColor, ), ), ), @@ -183,7 +202,10 @@ class _SecondaryButtonState extends State with TickerProviderSt padding: widget.iconOnly ? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0) : EdgeInsets.only( - top: widget.small ? 8.0 : 14.0, bottom: widget.small ? 6.0 : 14.0, left: 18.0, right: 18.0), + top: widget.small ? 8.0 : 14.0, + bottom: widget.small ? 6.0 : 14.0, + left: 18.0, + right: 18.0), child: Stack( children: [ Positioned( @@ -202,20 +224,22 @@ class _SecondaryButtonState extends State with TickerProviderSt width: 19.0, child: CircularProgressIndicator( backgroundColor: Colors.white, - valueColor: AlwaysStoppedAnimation( - Colors.grey[300]!, + valueColor: + AlwaysStoppedAnimation( + Colors.grey[300], ), ), ), ) : Padding( - padding: EdgeInsets.only(bottom: widget.small ? 4.0 : 3.0), + padding: EdgeInsets.only( + bottom: widget.small ? 4.0 : 3.0), child: Text( widget.label, style: TextStyle( color: widget.textColor, fontSize: 16, - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w700, fontFamily: 'Poppins'), ), ) diff --git a/lib/widgets/shared/card_with_bgNew_widget.dart b/lib/widgets/shared/card_with_bgNew_widget.dart index 1b17236a..00b836bc 100644 --- a/lib/widgets/shared/card_with_bgNew_widget.dart +++ b/lib/widgets/shared/card_with_bgNew_widget.dart @@ -1,10 +1,18 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +/* + *@author: Amjad Amireh Modify for new design created by Mohammad Aljammal + *@Date:Modify date 21/5/2020 Original date 27/4/2020 + *@param: Widget + *@return: + *@desc: Card With Bg Widget + */ + class CardWithBgWidgetNew extends StatelessWidget { final Widget widget; - CardWithBgWidgetNew({required this.widget}); + CardWithBgWidgetNew({@required this.widget}); @override Widget build(BuildContext context) { @@ -13,10 +21,10 @@ class CardWithBgWidgetNew extends StatelessWidget { margin: EdgeInsets.symmetric(vertical: 10.0), width: double.infinity, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), ), - ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), color: HexColor('#FFFFFF'), @@ -25,16 +33,18 @@ class CardWithBgWidgetNew extends StatelessWidget { Center( child: Container( - // padding:EdgeInsets.fromLTRB(0, 10,0, 10), //EdgeInsets.all(10.0),//10 - // margin: EdgeInsets.only(left: 10), + // padding:EdgeInsets.fromLTRB(0, 10,0, 10), //EdgeInsets.all(10.0),//10 + // margin: EdgeInsets.only(left: 10), child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center(child: widget), - )), + padding: const EdgeInsets.all(8.0), + child: Center(child: widget), + )), ) ], ), ), ); } + + } diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index 1fcee64c..c8e187a1 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -2,21 +2,17 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; + class CardWithBgWidget extends StatelessWidget { final Widget widget; - final Color? bgColor; + final Color bgColor; final bool hasBorder; final double padding; final double marginLeft; final double marginSymmetric; CardWithBgWidget( - {required this.widget, - this.bgColor, - this.hasBorder = true, - this.padding = 15.0, - this.marginLeft = 10.0, - this.marginSymmetric = 10.0}); + {@required this.widget, this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, this.marginSymmetric=10.0}); @override Widget build(BuildContext context) { @@ -28,7 +24,9 @@ class CardWithBgWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: hasBorder ? Color(0xFF707070) : Colors.transparent, width: hasBorder ? 0.30 : 0), + border: Border.all( + color: hasBorder ? Color(0xFF707070) : Colors.transparent, + width: hasBorder ? 0.30 : 0), ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -36,14 +34,12 @@ class CardWithBgWidget extends StatelessWidget { children: [ if (projectProvider.isArabic) Positioned( - child: Container( + child: Container( decoration: BoxDecoration( color: bgColor ?? Color(0xFF58434F), borderRadius: BorderRadius.only( topRight: Radius.circular(10), - bottomRight: Radius.circular(10), - ), - ), + bottomRight: Radius.circular(10),),), width: 10, ), bottom: 1, @@ -64,7 +60,10 @@ class CardWithBgWidget extends StatelessWidget { top: 1, left: 1, ), - Container(padding: EdgeInsets.all(padding), margin: EdgeInsets.only(left: marginLeft), child: widget) + Container( + padding: EdgeInsets.all(padding), + margin: EdgeInsets.only(left: marginLeft), + child: widget) ], ), ), diff --git a/lib/widgets/shared/charts/app_line_chart.dart b/lib/widgets/shared/charts/app_line_chart.dart new file mode 100644 index 00000000..422468d7 --- /dev/null +++ b/lib/widgets/shared/charts/app_line_chart.dart @@ -0,0 +1,41 @@ +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 new file mode 100644 index 00000000..f4bd354e --- /dev/null +++ b/lib/widgets/shared/charts/app_time_series_chart.dart @@ -0,0 +1,121 @@ +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/custom_shape_clipper.dart b/lib/widgets/shared/custom_shape_clipper.dart new file mode 100644 index 00000000..81f5ee20 --- /dev/null +++ b/lib/widgets/shared/custom_shape_clipper.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; + +class CustomShapeClipper extends CustomClipper { + @override + Path getClip(Size size) { + final Path path = Path(); + path.lineTo(0.0, size.height); + + var firstEndPoint = Offset(size.width * .5, size.height / 2); + var firstControlpoint = Offset(size.width * 0.25, size.height * 0.95 + 30); + path.quadraticBezierTo(firstControlpoint.dx, firstControlpoint.dy, + firstEndPoint.dx, firstEndPoint.dy); + + var secondEndPoint = Offset(size.width, size.height * 0.10); + var secondControlPoint = Offset(size.width * .75, size.height * .10 - 20); + path.quadraticBezierTo(secondControlPoint.dx, secondControlPoint.dy, + secondEndPoint.dx, secondEndPoint.dy); + + path.lineTo(size.width, 0.0); + path.close(); + return path; + } + + @override + bool shouldReclip(CustomClipper oldClipper) => true; +} diff --git a/lib/widgets/shared/dialogs/ShowImageDialog.dart b/lib/widgets/shared/dialogs/ShowImageDialog.dart index 06875fb4..302366b7 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, required this.imageUrl}) : super(key: key); + const ShowImageDialog({Key key, this.imageUrl}) : super(key: key); @override Widget build(BuildContext context) { return SimpleDialog( @@ -12,8 +12,10 @@ class ShowImageDialog extends StatelessWidget { Container( width: 340, height: 340, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12)), - child: Image.network( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12) + ), + child: Image.network( imageUrl, fit: BoxFit.fill, ), @@ -21,4 +23,4 @@ class ShowImageDialog extends StatelessWidget { ], ); } -} +} \ No newline at end of file diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 45b9f217..dfaf9143 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 items = List(); @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,42 +73,44 @@ class _ListSelectDialogState extends State { height: MediaQuery.of(context).size.height * 0.5, child: Column( children: [ - 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 ?? "", "", false, - suffixIcon: Icon( - Icons.search, - )), - enabled: true, - keyboardType: TextInputType.text, - onChanged: (value) { - filterSearchResults(value); - }, - )),Expanded( + 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, + suffixIcon: Icon( + Icons.search, + )), + enabled: true, + keyboardType: TextInputType.text, + onChanged: (value) { + filterSearchResults(value); + }, + )), + Expanded( child: SingleChildScrollView( child: Column( children: [ - ...items - .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() - ], - ),), + ...items + .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() + ], + ), + ), ), ], ), @@ -120,10 +122,10 @@ class _ListSelectDialogState extends State { } void filterSearchResults(String query) { - List dummySearchList = []; + List dummySearchList = List(); dummySearchList.addAll(widget.list); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); 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 a2a7e02d..7c12b54a 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -12,11 +12,15 @@ 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(); @@ -45,7 +49,7 @@ class _MasterKeyDailogState extends State { 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 @@ -68,15 +72,23 @@ 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 new file mode 100644 index 00000000..68dce5a4 --- /dev/null +++ b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart @@ -0,0 +1,92 @@ +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 63a5380e..b43557cb 100644 --- a/lib/widgets/shared/divider_with_spaces_around.dart +++ b/lib/widgets/shared/divider_with_spaces_around.dart @@ -2,10 +2,9 @@ import 'package:flutter/material.dart'; class DividerWithSpacesAround extends StatelessWidget { DividerWithSpacesAround({ - Key? key, - this.height = 0, + Key key, this.height = 0, }); - final double height; + final double height ; @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 1c2872c7..5bd12bb8 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 GestureTapCallback? onTap; + final String invoiceNO; + final String orderNo; + final Function onTap; final bool isPrescriptions; final String clinic; final bool isShowEye; @@ -23,24 +23,22 @@ class DoctorCard extends StatelessWidget { final bool isNoMargin; DoctorCard( - {required this.doctorName, - required this.branch, - required this.profileUrl, + {this.doctorName, + this.branch, + this.profileUrl, this.invoiceNO, this.onTap, - required this.appointmentDate, + this.appointmentDate, this.orderNo, this.isPrescriptions = false, - required this.clinic, - this.isShowEye = true, - this.isShowTime = true, - this.isNoMargin = false}); + this.clinic, + this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - margin: EdgeInsets.all(!isNoMargin ? 10 : 0), + margin: EdgeInsets.all(!isNoMargin? 10:0), decoration: BoxDecoration( border: Border.all( width: 0.5, @@ -61,7 +59,7 @@ class DoctorCard extends StatelessWidget { children: [ Expanded( child: AppText( - doctorName, + doctorName ?? "", fontSize: 15, bold: true, )), @@ -75,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, @@ -105,68 +103,76 @@ class DoctorCard extends StatelessWidget { Expanded( child: Container( margin: EdgeInsets.all(10), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (orderNo != null && !isPrescriptions) - Row( - children: [ - AppText( - TranslationBase.of(context).orderNo ?? "" + " ", - color: Colors.grey[500], - fontSize: 14, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (orderNo != null && !isPrescriptions) + Row( + children: [ + AppText( + TranslationBase.of(context).orderNo + + " ", + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + orderNo ?? '', + fontSize: 14, + ) + ], ), - AppText( - orderNo ?? '', - fontSize: 14, - ) - ], - ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - AppText( - TranslationBase.of(context).invoiceNo ?? "" + " ", - fontSize: 14, - color: Colors.grey[500], + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + AppText( + TranslationBase.of(context) + .invoiceNo + + " ", + fontSize: 14, + color: Colors.grey[500], + ), + AppText( + invoiceNO, + fontSize: 14, + ) + ], ), - AppText( - invoiceNO, - fontSize: 14, - ) - ], - ), - if (clinic != null) - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).clinic ?? "" + ": ", - color: Colors.grey[500], - fontSize: 14, + if (clinic != null) + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).clinic + + ": ", + color: Colors.grey[500], + fontSize: 14, + ), + Expanded( + child: AppText( + clinic, + fontSize: 14, + ), + ) + ], ), - Expanded( - child: AppText( - clinic, - fontSize: 14, - ), + if (branch != null) + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).branch + + ": ", + fontSize: 14, + color: Colors.grey[500], + ), + Expanded( + child: AppText( + branch, + fontSize: 14, + ), + ) + ], ) - ], - ), - if (branch != null) - Row( - crossAxisAlignment: CrossAxisAlignment.start,children: [ - AppText( - TranslationBase.of(context).branch ?? "" + ": ", - fontSize: 14, - color: Colors.grey[500], - ), - Expanded( - child:AppText( - branch, - fontSize: 14, - ), - ) - ], - ) ]), ), ), diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index 6588e580..5615015e 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -8,18 +8,18 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class DoctorCardInsurance extends StatelessWidget { - final String? doctorName; - final String? branch; - final DateTime? appointmentDate; - final String? profileUrl; - final String? invoiceNO; - final String? orderNo; - final GestureTapCallback? onTap; + 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? approvalStatus; - final String? patientOut; - final String? branch2; + final String clinic; + final String approvalStatus; + final String patientOut; + final String branch2; DoctorCardInsurance( {this.doctorName, @@ -113,7 +113,7 @@ class DoctorCardInsurance extends StatelessWidget { children: [ Container( child: LargeAvatar( - name: doctorName ?? "", + name: doctorName, url: profileUrl, ), width: 55, @@ -152,7 +152,7 @@ class DoctorCardInsurance extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).clinic ?? "" + ": ", + TranslationBase.of(context).clinic + ": ", color: Colors.grey[500], fontSize: 14, //fontWeight: FontWeight.w600, @@ -171,7 +171,7 @@ class DoctorCardInsurance extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).branch ?? "" + ": ", + TranslationBase.of(context).branch + ": ", fontSize: 14, color: Colors.grey[500], ), @@ -184,7 +184,7 @@ class DoctorCardInsurance extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).approvalNo ?? "" + ": ", + TranslationBase.of(context).approvalNo + ": ", fontSize: 14, color: Colors.grey[500], //color: Colors.grey[500], diff --git a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart index 1c7db539..2c476ec8 100644 --- a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart +++ b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart @@ -1,8 +1,7 @@ import 'package:flutter/material.dart'; - class DrAppCircularProgressIndeicator extends StatelessWidget { const DrAppCircularProgressIndeicator({ - Key? key, + Key key, }) : super(key: key); @override @@ -12,4 +11,4 @@ class DrAppCircularProgressIndeicator extends StatelessWidget { child: Center(child: const CircularProgressIndicator()), ); } -} +} \ No newline at end of file diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 5da3f232..2b8ce40d 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -8,12 +8,11 @@ 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 double? drawerWidth; + final IconData icon; + final Color color; + final String assetLink; - DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink, this.drawerWidth}); + DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink}); @override _DrawerItemState createState() => _DrawerItemState(); @@ -27,31 +26,31 @@ class _DrawerItemState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (widget.assetLink != null) + if(widget.assetLink!=null) Container( - height: SizeConfig.imageSizeMultiplier * (SizeConfig.isWidthLarge?3: 5), - width: SizeConfig.imageSizeMultiplier * (SizeConfig.isWidthLarge?3: 5), - child: Image.asset(widget.assetLink!), - ), - if (widget.assetLink == null) - Icon( - widget.icon, - color: widget.color ?? Colors.black87, - size: SizeConfig.imageSizeMultiplier * (SizeConfig.isWidthLarge?3: 5), + height: 20, + width: 20, + child: Image.asset(widget.assetLink), ), + if(widget.assetLink==null) + Icon( + widget.icon, + color: widget.color ?? Colors.black87, + size: SizeConfig.imageSizeMultiplier * 5, + ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - width: MediaQuery.of(context).size.width * 0.45, + width: MediaQuery.of(context).size.width *0.45, child: AppText( widget.title, marginLeft: 5, marginRight: 5, - color: widget.color ?? Color(0xFF2E303A), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: widget.drawerWidth ) * (SizeConfig.isHeightVeryShort?5:(SizeConfig.isWidthLarge?4: 6)), + color:widget.color ??Color(0xFF2E303A), + fontSize: 14, fontFamily: 'Poppins', fontWeight: FontWeight.w600, ), diff --git a/lib/widgets/shared/errors/dr_app_embedded_error.dart b/lib/widgets/shared/errors/dr_app_embedded_error.dart index 9948ad2a..de9fd698 100644 --- a/lib/widgets/shared/errors/dr_app_embedded_error.dart +++ b/lib/widgets/shared/errors/dr_app_embedded_error.dart @@ -2,10 +2,17 @@ import 'package:flutter/material.dart'; import '../app_texts_widget.dart'; +/* + *@author: Elham Rababah + *@Date:12/5/2020 + *@param: error + *@return: StatelessWidget + *@desc: DrAppEmbeddedError class + */ class DrAppEmbeddedError extends StatelessWidget { const DrAppEmbeddedError({ - Key? key, - required this.error, + Key key, + @required this.error, }) : super(key: key); final String error; @@ -13,12 +20,12 @@ class DrAppEmbeddedError extends StatelessWidget { @override Widget build(BuildContext context) { return Center( - child: AppText( - error, - color: Theme.of(context).errorColor, - textAlign: TextAlign.center, - margin: 10, - ), - ); + child: AppText( + error, + color: Theme.of(context).errorColor, + textAlign: TextAlign.center, + margin: 10, + ), + ); } -} +} \ No newline at end of file diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index 056f2fd7..21e04e6c 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -4,8 +4,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; @@ -17,22 +17,17 @@ class ErrorMessage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox( - height: 100, - ), + SizedBox(height: 100,), Image.asset('assets/images/no-data.png'), Center( child: Center( child: Padding( - padding: const EdgeInsets.only(top: 12, bottom: 12, right: 20, left: 30), - child: Center( - child: AppText( - error, - textAlign: TextAlign.center, - )), + padding: const EdgeInsets.only(top: 12, bottom: 12,right: 20, left: 30), + child: Center(child: AppText(error??'' , textAlign: TextAlign.center,)), ), ), ) + ], ), ), diff --git a/lib/widgets/shared/expandable-widget-header-body.dart b/lib/widgets/shared/expandable-widget-header-body.dart index 13b1438c..20d95bcd 100644 --- a/lib/widgets/shared/expandable-widget-header-body.dart +++ b/lib/widgets/shared/expandable-widget-header-body.dart @@ -2,30 +2,33 @@ 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(); HeaderBodyExpandableNotifier({this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand}); @override - _HeaderBodyExpandableNotifierState createState() => _HeaderBodyExpandableNotifierState(); + _HeaderBodyExpandableNotifierState createState() => + _HeaderBodyExpandableNotifierState(); } -class _HeaderBodyExpandableNotifierState extends State { +class _HeaderBodyExpandableNotifierState + extends State { + @override void initState() { super.initState(); - } + } @override Widget build(BuildContext context) { setState(() { if (widget.isExpand == true) { - widget.expandFlag = widget.isExpand!; + widget.expandFlag = widget.isExpand; widget.controller.expanded = true; } }); @@ -47,7 +50,7 @@ class _HeaderBodyExpandableNotifierState extends StatelistItems; + final String headerTitle; + + ExpandableItem(this.headerTitle,this.listItems); + + @override + _ExpandableItemState createState() => _ExpandableItemState(); + +} +class _ExpandableItemState extends State +{ + bool isExpand=false; + @override + void initState() { + super.initState(); + isExpand=false; + } + @override + Widget build(BuildContext context) { + ListlistItem=this.widget.listItems; + return Container( + child: Padding( + padding: (isExpand==true)?const EdgeInsets.all(6.0):const EdgeInsets.all(8.0), + child: Container( + decoration:BoxDecoration( + color: Colors.white, + borderRadius: (isExpand!=true)?BorderRadius.all(Radius.circular(50)):BorderRadius.all(Radius.circular(25)), + + + + + + ), + child: ExpansionTile( + key: PageStorageKey(this.widget.headerTitle), + title: Container( + width: double.infinity, + + child: Text(this.widget.headerTitle,style: TextStyle(fontSize: (isExpand!=true)?18:22,color: Colors.black,fontWeight: FontWeight.bold),)), + + trailing: (isExpand==true)?Icon(Icons.keyboard_arrow_up,color: Colors.black,):Icon(Icons.keyboard_arrow_down,color: Colors.black), + onExpansionChanged: (value){ + setState(() { + isExpand=value; + }); + }, + children: [ + for(final item in listItem) + Padding( + padding: const EdgeInsets.all(8.0), + child: InkWell( + onTap: (){ + print(Text("Selected Item $item "+this.widget.headerTitle )); + //========Stop Snak bar=========== Scaffold.of(context).showSnackBar(SnackBar(backgroundColor: Colors.black,duration:Duration(microseconds: 500),content: Text("Selected Item $item "+this.widget.headerTitle ))); + }, + child: Container( + width: double.infinity, + decoration:BoxDecoration( + color: Colors.white, + + border: Border(top: BorderSide(color: Theme.of(context).dividerColor)) + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(item,style: TextStyle(color: Colors.black),), + + )), + ), + ) + + + ], + + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/shared/in_patient_doctor_card.dart b/lib/widgets/shared/in_patient_doctor_card.dart deleted file mode 100644 index 483d040c..00000000 --- a/lib/widgets/shared/in_patient_doctor_card.dart +++ /dev/null @@ -1,194 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/cupertino.dart'; -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 createdBy; - - InPatientDoctorCard( - {this.doctorName, - this.branch, - this.profileUrl, - this.invoiceNO, - this.onTap, - this.appointmentDate, - this.orderNo, - this.isPrescriptions = false, - this.clinic, - this.createdBy}); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return 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(15.0), - child: InkWell( - onTap: onTap!(), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Expanded( - child: AppText( - doctorName, - bold: true, - )), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate ?? DateTime.now(), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 14, - ), - if (!isPrescriptions) - AppText( - '${AppDateUtils.getHour(appointmentDate ?? DateTime.now())}', - fontWeight: FontWeight.w600, - color: Colors.grey[700], - fontSize: 14, - ), - ], - ), - ), - ], - ), - Row( - children: [ - AppText( - 'CreatedBy ', - //bold: true, - ), - Expanded( - child: AppText( - createdBy, - bold: true, - ), - ), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // Container( - // child: LargeAvatar( - // name: doctorName, - // url: profileUrl, - // ), - // width: 55, - // height: 55, - // ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(10), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - // if (orderNo != null && !isPrescriptions) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).orderNo + - // ": ", - // color: Colors.grey[500], - // fontSize: 14, - // ), - // AppText( - // orderNo ?? '', - // fontSize: 14, - // ) - // ], - // ), - // if (invoiceNO != null && !isPrescriptions) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context) - // .invoiceNo + - // ": ", - // fontSize: 14, - // color: Colors.grey[500], - // ), - // AppText( - // invoiceNO, - // fontSize: 14, - // ) - // ], - // ), - // if (clinic != null) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).clinic + - // ": ", - // color: Colors.grey[500], - // fontSize: 14, - // ), - // AppText( - // clinic, - // fontSize: 14, - // ) - // ], - // ), - // if (branch != null) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).branch + - // ": ", - // fontSize: 14, - // color: Colors.grey[500], - // ), - // AppText( - // branch, - // fontSize: 14, - // ) - // ], - // ) - ]), - ), - ), - Icon( - EvaIcons.eye, - ) - ], - ), - ), - ], - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/loader/gif_loader_container.dart b/lib/widgets/shared/loader/gif_loader_container.dart index 0d7649ee..b2c2224b 100644 --- a/lib/widgets/shared/loader/gif_loader_container.dart +++ b/lib/widgets/shared/loader/gif_loader_container.dart @@ -6,15 +6,17 @@ class GifLoaderContainer extends StatefulWidget { _GifLoaderContainerState createState() => _GifLoaderContainerState(); } -class _GifLoaderContainerState extends State with TickerProviderStateMixin { - late GifController controller1; +class _GifLoaderContainerState extends State + with TickerProviderStateMixin { + 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(); } @@ -28,14 +30,15 @@ class _GifLoaderContainerState extends State with TickerProv @override Widget build(BuildContext context) { return Center( - //progress-loading.gif + //progress-loading.gif child: Container( - // margin: EdgeInsets.only(bottom: 40), - child: GifImage( - controller: controller1, - image: AssetImage( - "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), - ), - )); + // margin: EdgeInsets.only(bottom: 40), + child: GifImage( + + controller: controller1, + image: AssetImage( + "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), + ), + )); } -} +} \ No newline at end of file diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 2baa1c18..c61913a4 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -19,29 +19,32 @@ 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, - required this.model, - required this.addSelectedHistories, - required this.removeHistory, - required this.masterList, - required this.addHistory, - required this.isServiceSelected, + {Key key, + this.model, + this.addSelectedHistories, + this.removeHistory, + this.masterList, + this.addHistory, + this.isServiceSelected, this.buttonName, this.hintSearchText}) : super(key: key); @override - _MasterKeyCheckboxSearchWidgetState createState() => _MasterKeyCheckboxSearchWidgetState(); + _MasterKeyCheckboxSearchWidgetState createState() => + _MasterKeyCheckboxSearchWidgetState(); } -class _MasterKeyCheckboxSearchWidgetState extends State { - List items = []; +class _MasterKeyCheckboxSearchWidgetState + extends State { + List items = List(); TextEditingController filteredSearchController = TextEditingController(); + @override void initState() { items.addAll(widget.masterList); @@ -68,7 +71,9 @@ class _MasterKeyCheckboxSearchWidgetState extends State dummySearchList = []; + List dummySearchList = List(); dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); 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 68b6c1cd..32232628 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,9 +31,7 @@ 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 804ffca8..3db93f9d 100644 --- a/lib/widgets/shared/profile_image_widget.dart +++ b/lib/widgets/shared/profile_image_widget.dart @@ -10,15 +10,21 @@ 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) { @@ -26,21 +32,24 @@ class ProfileImageWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - height: height, - width: width, - child: CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, - // radius: (52) - child: ClipRRect( - borderRadius: BorderRadius.circular(50), - child: Image.network( - url!, - fit: BoxFit.fill, - width: 700, - ), + height: height, + width: width, + child:CircleAvatar( + radius: + SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius:BorderRadius.circular(50), + + child: Image.network( + url, + fit: BoxFit.fill, + width: 700, ), - backgroundColor: Colors.transparent, - )), + ), + backgroundColor: Colors.transparent, + ) + ), name == null || des == null ? SizedBox() : SizedBox( @@ -51,14 +60,18 @@ class ProfileImageWidget extends StatelessWidget { : AppText( name, fontWeight: FontWeight.bold, - fontSize: fontsize == null ? SizeConfig.textMultiplier * 3.5 : fontsize, + fontSize: fontsize == null + ? SizeConfig.textMultiplier * 3.5 + : fontsize, color: color, ), des == null ? SizedBox() : AppText( des, - fontSize: fontsize == null ? SizeConfig.textMultiplier * 2.5 : fontsize, + fontSize: fontsize == null + ? SizeConfig.textMultiplier * 2.5 + : fontsize, ) ], ); diff --git a/lib/widgets/shared/rounded_container_widget.dart b/lib/widgets/shared/rounded_container_widget.dart index 3f8804de..9c622dd3 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,21 +54,22 @@ 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 ), ], ) @@ -76,13 +77,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 48049274..dad7e2d1 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,12 +57,15 @@ 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() { streamSubscription = event.controller.stream.listen((p) { - if ((p['searchText'] != 'null' && p['searchText'] != null && p['searchText'] != "" && isClosed == false) && + if ((p['searchText'] != 'null' && + p['searchText'] != null && + p['searchText'] != "" && + isClosed == false) && mounted) { setState(() { searchText = p['searchText']; @@ -101,7 +104,8 @@ class _MyStatefulBuilderState extends State { margin: EdgeInsets.all(20), padding: EdgeInsets.all(10), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100), border: Border.all(width: 2, color: Colors.red)), + borderRadius: BorderRadius.circular(100), + border: Border.all(width: 2, color: Colors.red)), child: Icon( Icons.mic, color: Colors.blue, @@ -130,7 +134,8 @@ class _MyStatefulBuilderState extends State { ? Center( child: InkWell( child: Container( - decoration: BoxDecoration(border: Border.all(color: Colors.grey[300]!)), + decoration: BoxDecoration( + 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 a9da7546..086375bb 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -9,26 +9,26 @@ import 'package:provider/provider.dart'; import '../app_texts_widget.dart'; class AppTextFieldCustom extends StatefulWidget { - final double? height; - final GestureTapCallback? onClick; - final String? hintText; - final TextEditingController? controller; - final bool? isTextFieldHasSuffix; - final bool? hasBorder; - final String? dropDownText; - final IconButton? suffixIcon; - final Color? dropDownColor; - final bool? enabled; - final TextInputType? inputType; - final int? minLines; - final int? maxLines; - final List? inputFormatters; - final Function(String)? onChanged; - final Function? onFieldSubmitted; + final double height; + final Function onClick; + final String hintText; + final TextEditingController controller; + final bool isTextFieldHasSuffix; + final bool hasBorder; + final String dropDownText; + final IconButton suffixIcon; + final Color dropDownColor; + final bool enabled; + final TextInputType inputType; + final int minLines; + final int maxLines; + final List inputFormatters; + final Function(String) onChanged; + final Function 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,12 +94,18 @@ class _AppTextFieldCustomState extends State { return Column( children: [ Container( - height: widget.height != 0 && widget.maxLines == 1 ? widget.height! + 8 : null, - decoration: widget.hasBorder! + height: widget.height != 0 && widget.maxLines == 1 + ? widget.height + 8 + : null, + decoration: widget.hasBorder ? TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), widget.validationError == null ? Color(0xFFEFEFEF) : Colors.red.shade700) + Color(0Xffffffff), + widget.validationError == null + ? Color(0xFFEFEFEF) + : Colors.red.shade700) : null, - padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), + padding: + EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), child: InkWell( onTap: widget.onClick ?? null, child: Row( @@ -116,24 +122,34 @@ class _AppTextFieldCustomState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - if ((widget.controller != null && widget.controller!.text != "") || widget.dropDownText != null) + if ((widget.controller != null && + widget.controller.text != "") || + widget.dropDownText != null) AppText( widget.hintText, // marginTop: widget.hasHintmargin ? 0 : 30, color: Color(0xFF2E303A), - fontSize: widget.isPrscription == false ? SizeConfig.getHeightMultiplier() * + fontSize: widget.isPrscription == false + ? SizeConfig.getHeightMultiplier() * (SizeConfig.isWidthLarge ? 1.1 : 1.3) : 0, fontWeight: FontWeight.w700, ), widget.dropDownText == null ? Container( - height: widget.height != 0 && widget.maxLines == 1 ? widget.height! - 22 : null, + height: + widget.height != 0 && widget.maxLines == 1 + ? widget.height - 22 + : null, child: TextFormField( - textAlign: projectViewModel.isArabic ? TextAlign.right : TextAlign.left, + textAlign: projectViewModel.isArabic + ? TextAlign.right + : TextAlign.left, focusNode: _focusNode, textAlignVertical: TextAlignVertical.center, - decoration: TextFieldsUtils.textFieldSelectorDecoration(widget.hintText!, "", true), + decoration: TextFieldsUtils + .textFieldSelectorDecoration( + widget.hintText, null, true), style: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, fontFamily: 'Poppins', @@ -141,19 +157,24 @@ class _AppTextFieldCustomState extends State { ), controller: widget.controller, keyboardType: widget.inputType ?? - (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline), + (widget.maxLines == 1 + ? TextInputType.text + : TextInputType.multiline), enabled: widget.enabled, minLines: widget.minLines, maxLines: widget.maxLines, - inputFormatters: widget.inputFormatters != null ? widget.inputFormatters : [], + inputFormatters: + widget.inputFormatters != null + ? widget.inputFormatters + : [], onChanged: (value) { setState(() {}); if (widget.onChanged != null) { - widget.onChanged!(value); + widget.onChanged(value); } }, - onFieldSubmitted: widget.onFieldSubmitted!(), - obscureText: widget.isSecure!), + onFieldSubmitted: widget.onFieldSubmitted, + obscureText: widget.isSecure), ) : AppText( widget.dropDownText, @@ -165,12 +186,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 @@ -179,7 +200,9 @@ class _AppTextFieldCustomState extends State { : InkWell( child: Icon( Icons.keyboard_arrow_down, - color: widget.dropDownColor != null ? widget.dropDownColor : Colors.black, + color: widget.dropDownColor != null + ? widget.dropDownColor + : Colors.black, ), ) : Container(), @@ -187,7 +210,8 @@ 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 cdc6b09d..2a5304e2 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 @@ -7,7 +7,7 @@ import 'app-textfield-custom.dart'; class AppTextFieldCustomSearch extends StatelessWidget { const AppTextFieldCustomSearch({ - Key? key, + Key key, this.onChangeFun, this.positionedChild, this.marginTop, @@ -20,23 +20,23 @@ class AppTextFieldCustomSearch extends StatelessWidget { this.hintText, }); - final TextEditingController? searchController; + final TextEditingController searchController; - final Function? onChangeFun; - final Function? onFieldSubmitted; + final Function onChangeFun; + final Function 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) { 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( @@ -54,11 +54,11 @@ class AppTextFieldCustomSearch extends StatelessWidget { onPressed: () {}, ), controller: searchController, - onChanged: onChangeFun!(), + onChanged: onChangeFun, onFieldSubmitted: onFieldSubmitted, validationError: validationError), if (positionedChild != null) - 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 1418b590..cf5f0abf 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( @@ -55,17 +55,24 @@ class AppTextFormField extends FormField { hintStyle: TextStyle( fontSize: SizeConfig.textMultiplier * 1.8, ), - contentPadding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + contentPadding: + EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), labelText: labelText, labelStyle: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(6)), - borderSide: BorderSide(color: borderColor != null ? borderColor : HexColor("#CCCCCC")), + borderSide: BorderSide( + color: borderColor != null + ? borderColor + : HexColor("#CCCCCC")), ), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: borderColor != null ? borderColor : HexColor("#CCCCCC")), + borderSide: BorderSide( + color: borderColor != null + ? borderColor + : HexColor("#CCCCCC")), borderRadius: BorderRadius.all(Radius.circular(6)), ) //BorderRadius.all(Radius.circular(20)); @@ -76,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 d5875d43..3b563f3f 100644 --- a/lib/widgets/shared/text_fields/auto_complete_text_field.dart +++ b/lib/widgets/shared/text_fields/auto_complete_text_field.dart @@ -8,11 +8,13 @@ class CustomAutoCompleteTextField extends StatelessWidget { final Widget child; const CustomAutoCompleteTextField({ - Key? key, - required this.isShowError, - required this.child, + Key key, + this.isShowError, + this.child, }) : super(key: key); + + @override Widget build(BuildContext context) { return Container( @@ -23,12 +25,13 @@ class CustomAutoCompleteTextField extends StatelessWidget { Color(0Xffffffff), isShowError ? Colors.red.shade700 : Color(0xFFEFEFEF), ), - padding: EdgeInsets.only(top: 0.2, bottom: 2.0, left: 8.0, right: 0.0), + padding: + EdgeInsets.only(top: 0.2, bottom: 2.0, left: 8.0, right: 0.0), child: child, ), 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 145ece5e..baed4995 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 df174f47..71359604 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -12,16 +12,7 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; import '../speech-text-popup.dart'; class HtmlRichEditor extends StatefulWidget { - 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({ + HtmlRichEditor({ key, this.hint = "Your text here...", this.initialText, @@ -30,18 +21,26 @@ 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 { - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); + @override void initState() { @@ -56,6 +55,8 @@ class _HtmlRichEditorState extends State { super.initState(); } + + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -63,42 +64,51 @@ class _HtmlRichEditorState extends State { return Stack( children: [ HtmlEditor( - 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), - ), - )), + 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]) + ], + ), 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()}); }, ), ], @@ -107,10 +117,12 @@ 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, @@ -138,15 +150,15 @@ class _HtmlRichEditorState extends State { ].request(); } - void resultListener(result) async { + void resultListener(result)async { recognizedWord = result.recognizedWords; event.setValue({"searchText": recognizedWord}); - String txt = await widget.controller.getText(); + String txt = await HtmlEditor.getText(); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - widget.controller.setText(txt + recognizedWord); + HtmlEditor.setText(txt+recognizedWord); }); } else { print(result.finalResult); @@ -154,7 +166,8 @@ class _HtmlRichEditorState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } diff --git a/lib/widgets/shared/text_fields/new_text_Field.dart b/lib/widgets/shared/text_fields/new_text_Field.dart index 70729446..9917b04f 100644 --- a/lib/widgets/shared/text_fields/new_text_Field.dart +++ b/lib/widgets/shared/text_fields/new_text_Field.dart @@ -5,7 +5,8 @@ import 'package:hexcolor/hexcolor.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,7 +28,8 @@ 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,88 +41,77 @@ 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, - this.onTapTextFields, - this.fillColor, - this.hasBorder, - this.showLabelText, - this.borderRadius, - this.borderWidth}) + {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}) : super(key: key); - 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; + + 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; @override _NewTextFieldsState createState() => _NewTextFieldsState(); } @@ -142,7 +133,7 @@ class _NewTextFieldsState extends State { @override void didUpdateWidget(NewTextFields oldWidget) { - if (widget.focus!) _focusNode.requestFocus(); + if (widget.focus) _focusNode.requestFocus(); super.didUpdateWidget(oldWidget); } @@ -153,7 +144,7 @@ class _NewTextFieldsState extends State { } bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly!) { + if (widget.readOnly != null && widget.readOnly) { _focusNode.unfocus(); return true; } else { @@ -167,30 +158,34 @@ class _NewTextFieldsState extends State { duration: Duration(milliseconds: 300), decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - border: Border.all(color: HexColor('#707070'), width: 0.30), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), color: Colors.white), child: Container( margin: EdgeInsets.only(top: 8), padding: EdgeInsets.only(top: 8), + + child: TextFormField( enabled: widget.isEnabled, 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 - : (val) { - _focusNode.nextFocus(); - }) + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) : widget.onSubmit, 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, @@ -200,30 +195,34 @@ class _NewTextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText1!.copyWith( - fontSize: widget.fontSize, - fontWeight: widget.fontWeight, - color: Color(0xFF575757), - fontFamily: 'Poppins'), + style: Theme.of(context).textTheme.body2.copyWith( + fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), fontFamily: 'Poppins'), inputFormatters: widget.keyboardType == TextInputType.phone ? [ - WhitelistingTextInputFormatter.digitsOnly, - _mobileFormatter, - ] + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] : widget.inputFormatters, decoration: InputDecoration( labelText: widget.hintText, - labelStyle: TextStyle(color: Color(0xFF2E303A), fontSize: 15, fontWeight: FontWeight.w700), + labelStyle: + TextStyle(color: Color(0xFF2E303A), fontSize:15,fontWeight: FontWeight.w700), errorBorder: OutlineInputBorder( - borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), + borderSide: BorderSide( + color: Theme.of(context).errorColor.withOpacity(0.5), + width: 1.0), borderRadius: BorderRadius.circular(12.0)), focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), + borderSide: BorderSide( + color: Theme.of(context).errorColor.withOpacity(0.5), + width: 1.0), borderRadius: BorderRadius.circular(8.0)), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), + borderSide: BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), + borderSide: BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12), diff --git a/lib/widgets/shared/text_fields/text_field_error.dart b/lib/widgets/shared/text_fields/text_field_error.dart index b327388c..9c781db0 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 316e45ac..1f1ff2bb 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; -class TextFieldsUtils { - static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, +class TextFieldsUtils{ + + static BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor, {double borderWidth = -1, double borderRadius = 12}) { return BoxDecoration( color: containerColor, @@ -14,8 +16,9 @@ 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), @@ -43,15 +46,13 @@ class TextFieldsUtils { borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderRadius: BorderRadius.circular(8), ),*/ - hintText: selectedText != "" ? selectedText : hintText??"", - suffixIcon: Icon( - suffixIcon ?? null, - color: Colors.grey.shade600, - ), + hintText: selectedText != null ? selectedText : hintText??"", + suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,), + hintStyle: TextStyle( fontSize: 14, color: Colors.grey.shade600, ), ); } -} +} \ No newline at end of file diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index a88e89dd..b66d4926 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -5,17 +5,17 @@ import '../app_texts_widget.dart'; class CustomRow extends StatelessWidget { const CustomRow({ - Key? key, - this.label, - required this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true, + Key key, + this.label, + 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 new file mode 100644 index 00000000..8a4891fd --- /dev/null +++ b/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart @@ -0,0 +1,183 @@ +/* + * 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 new file mode 100644 index 00000000..c0430994 --- /dev/null +++ b/lib/widgets/shared/user-guid/app_get_position.dart @@ -0,0 +1,75 @@ +/* + * 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 new file mode 100644 index 00000000..925d18d0 --- /dev/null +++ b/lib/widgets/shared/user-guid/app_shape_painter.dart @@ -0,0 +1,42 @@ +/* + * 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 new file mode 100644 index 00000000..38625279 --- /dev/null +++ b/lib/widgets/shared/user-guid/app_showcase.dart @@ -0,0 +1,349 @@ +/* + * 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 new file mode 100644 index 00000000..07577b3b --- /dev/null +++ b/lib/widgets/shared/user-guid/app_showcase_widget.dart @@ -0,0 +1,97 @@ +/* + * 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 new file mode 100644 index 00000000..285caa8e --- /dev/null +++ b/lib/widgets/shared/user-guid/app_tool_tip_widget.dart @@ -0,0 +1,290 @@ +/* + * 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 bbdb1f1a..fd1f2125 100644 --- a/lib/widgets/shared/user-guid/custom_validation_error.dart +++ b/lib/widgets/shared/user-guid/custom_validation_error.dart @@ -1,18 +1,21 @@ + 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'; // 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 Widget build(BuildContext context) { - if (error == null) error = TranslationBase.of(context).emptyMessage; + if(error == null ) + error = TranslationBase + .of(context) + .emptyMessage; return Column( children: [ SizedBox( @@ -20,13 +23,11 @@ class CustomValidationError extends StatelessWidget { ), Container( margin: EdgeInsets.symmetric(horizontal: 3), - child: AppText( - error, - color: Theme.of(context).errorColor, - fontSize: 14, - ), + child: AppText(error, color: Theme + .of(context) + .errorColor, fontSize: 14,), ), ], ); } -} +} \ No newline at end of file diff --git a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart new file mode 100644 index 00000000..9197a4a1 --- /dev/null +++ b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart @@ -0,0 +1,196 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +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 createdBy; + + InPatientDoctorCard( + {this.doctorName, + this.branch, + this.profileUrl, + this.invoiceNO, + this.onTap, + this.appointmentDate, + this.orderNo, + this.isPrescriptions = false, + this.clinic, + this.createdBy}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return 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(15.0), + child: InkWell( + onTap: onTap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: AppText( + doctorName, + bold: true, + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + if (!isPrescriptions) + AppText( + '${AppDateUtils.getHour(appointmentDate)}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ), + ], + ), + Row( + children: [ + AppText( + 'CreatedBy ', + //bold: true, + ), + Expanded( + child: AppText( + createdBy, + bold: true, + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // Container( + // child: LargeAvatar( + // name: doctorName, + // url: profileUrl, + // ), + // width: 55, + // height: 55, + // ), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // if (orderNo != null && !isPrescriptions) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderNo + + // ": ", + // color: Colors.grey[500], + // fontSize: 14, + // ), + // AppText( + // orderNo ?? '', + // fontSize: 14, + // ) + // ], + // ), + // if (invoiceNO != null && !isPrescriptions) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context) + // .invoiceNo + + // ": ", + // fontSize: 14, + // color: Colors.grey[500], + // ), + // AppText( + // invoiceNO, + // fontSize: 14, + // ) + // ], + // ), + // if (clinic != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).clinic + + // ": ", + // color: Colors.grey[500], + // fontSize: 14, + // ), + // AppText( + // clinic, + // fontSize: 14, + // ) + // ], + // ), + // if (branch != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).branch + + // ": ", + // fontSize: 14, + // color: Colors.grey[500], + // ), + // AppText( + // branch, + // fontSize: 14, + // ) + // ], + // ) + ]), + ), + ), + Icon( + EvaIcons.eye, + ) + ], + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/widgets/transitions/fade_page.dart b/lib/widgets/transitions/fade_page.dart index 242fd84b..7cd3826c 100644 --- a/lib/widgets/transitions/fade_page.dart +++ b/lib/widgets/transitions/fade_page.dart @@ -4,25 +4,30 @@ import 'package:flutter/material.dart'; /// [page] class FadePage extends PageRouteBuilder { final Widget page; - 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); - }); -} + 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 + ); + } + ); +} \ 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 1893a172..ee0b7473 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({required this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) + SlideUpPageRoute({this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) : super( pageBuilder: ( BuildContext context, diff --git a/pubspec.lock b/pubspec.lock index 957312ba..3e9968d3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,35 +7,35 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "30.0.0" + version: "12.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "2.7.0" + version: "0.40.6" archive: dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.6" + version: "2.0.13" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "1.6.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.5.0-nullsafety.1" autocomplete_textfield: dependency: "direct main" description: @@ -63,84 +63,84 @@ packages: name: bazel_worker url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.1.25" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" build: dependency: transitive description: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "1.6.2" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.4.5" build_daemon: dependency: transitive description: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.1.7" build_modules: dependency: transitive description: name: build_modules url: "https://pub.dartlang.org" source: hosted - version: "4.0.3" + version: "3.0.4" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "1.5.3" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "1.11.1" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "7.2.2" + version: "6.1.7" build_web_compilers: dependency: "direct dev" description: name: build_web_compilers url: "https://pub.dartlang.org" source: hosted - version: "3.2.1" + version: "2.12.2" built_collection: dependency: transitive description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "5.1.1" + version: "4.3.2" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.1.3" + version: "7.1.0" cached_network_image: dependency: "direct main" description: @@ -154,301 +154,287 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.1.0-nullsafety.3" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.2.0-nullsafety.1" charts_common: dependency: transitive description: name: charts_common url: "https://pub.dartlang.org" source: hosted - version: "0.10.0" + version: "0.9.0" charts_flutter: dependency: "direct main" description: name: charts_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.10.0" + version: "0.9.0" checked_yaml: dependency: transitive description: name: checked_yaml url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.0.4" chewie: dependency: transitive description: name: chewie url: "https://pub.dartlang.org" source: hosted - version: "1.2.2" + version: "0.9.10" chewie_audio: dependency: transitive description: name: chewie_audio url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.0.0+1" cli_util: dependency: transitive description: name: cli_util url: "https://pub.dartlang.org" source: hosted - version: "0.3.5" + version: "0.2.0" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" code_builder: dependency: transitive description: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "3.7.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.15.0-nullsafety.3" connectivity: dependency: "direct main" description: name: connectivity url: "https://pub.dartlang.org" source: hosted - version: "3.0.6" + version: "0.4.9+5" connectivity_for_web: dependency: transitive description: name: connectivity_for_web url: "https://pub.dartlang.org" source: hosted - version: "0.4.0+1" + version: "0.3.1+4" connectivity_macos: dependency: transitive description: name: connectivity_macos url: "https://pub.dartlang.org" source: hosted - version: "0.2.1+2" + version: "0.1.0+7" connectivity_platform_interface: dependency: transitive description: name: connectivity_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.0.6" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.1.1" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.1.5" + css_colors: + dependency: transitive + description: + name: css_colors + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" csslib: dependency: transitive description: name: csslib url: "https://pub.dartlang.org" source: hosted - version: "0.17.1" + version: "0.16.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "0.1.3" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "1.3.10" date_time_picker: dependency: "direct main" description: name: date_time_picker url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "1.1.1" device_info: dependency: "direct main" description: name: device_info url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "0.4.2+10" device_info_platform_interface: dependency: transitive description: name: device_info_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.0.1" dropdown_search: dependency: "direct main" description: name: dropdown_search url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.4.9" equatable: dependency: transitive description: name: equatable url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "1.2.6" eva_icons_flutter: dependency: "direct main" description: name: eva_icons_flutter url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "2.0.1" expandable: dependency: "direct main" description: name: expandable url: "https://pub.dartlang.org" source: hosted - version: "5.0.1" + version: "4.1.4" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" ffi: dependency: transitive description: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "0.1.3" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.2" - file_picker: - dependency: "direct main" - description: - name: file_picker - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.4" + version: "5.2.1" firebase: dependency: transitive description: name: firebase url: "https://pub.dartlang.org" source: hosted - version: "9.0.2" + version: "7.3.3" firebase_analytics: dependency: "direct main" description: name: firebase_analytics url: "https://pub.dartlang.org" source: hosted - version: "8.3.4" + version: "6.3.0" firebase_analytics_platform_interface: dependency: transitive description: name: firebase_analytics_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.0.3" firebase_analytics_web: dependency: transitive description: name: firebase_analytics_web url: "https://pub.dartlang.org" source: hosted - version: "0.3.0+1" + version: "0.1.1" firebase_core: dependency: transitive description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "0.5.3" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "2.1.0" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "0.2.1+1" firebase_messaging: dependency: "direct main" description: name: firebase_messaging url: "https://pub.dartlang.org" source: hosted - version: "10.0.9" - firebase_messaging_platform_interface: - dependency: transitive - description: - name: firebase_messaging_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.9" - firebase_messaging_web: - dependency: transitive - description: - name: firebase_messaging_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" + version: "7.0.3" fixnum: dependency: transitive description: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.10.11" fl_chart: dependency: "direct main" description: name: fl_chart url: "https://pub.dartlang.org" source: hosted - version: "0.36.4" + version: "0.12.3" flutter: dependency: "direct main" description: flutter @@ -468,20 +454,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.2" - flutter_colorpicker: - dependency: "direct main" - description: - name: flutter_colorpicker - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.0" flutter_device_type: dependency: "direct main" description: name: flutter_device_type url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.2.0" flutter_flexible_toast: dependency: "direct main" description: @@ -502,54 +481,19 @@ packages: name: flutter_html url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "1.0.2" flutter_inappwebview: dependency: transitive description: name: flutter_inappwebview url: "https://pub.dartlang.org" source: hosted - version: "5.3.2" - flutter_keyboard_visibility: - dependency: transitive - description: - name: flutter_keyboard_visibility - url: "https://pub.dartlang.org" - source: hosted - version: "5.1.0" - flutter_keyboard_visibility_platform_interface: - dependency: transitive - description: - name: flutter_keyboard_visibility_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - flutter_keyboard_visibility_web: - dependency: transitive - description: - name: flutter_keyboard_visibility_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - flutter_layout_grid: - dependency: transitive - description: - name: flutter_layout_grid - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" + version: "4.0.0+4" flutter_localizations: dependency: "direct main" description: flutter source: sdk version: "0.0.0" - flutter_math_fork: - dependency: transitive - description: - name: flutter_math_fork - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.3+1" flutter_page_indicator: dependency: transitive description: @@ -563,21 +507,21 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "1.0.11" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "0.3.4" flutter_svg: dependency: transitive description: name: flutter_svg url: "https://pub.dartlang.org" source: hosted - version: "0.22.0" + version: "0.18.1" flutter_swiper: dependency: "direct main" description: @@ -601,42 +545,35 @@ packages: name: font_awesome_flutter url: "https://pub.dartlang.org" source: hosted - version: "9.2.0" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" + version: "8.12.0" get_it: dependency: "direct main" description: name: get_it url: "https://pub.dartlang.org" source: hosted - version: "7.2.0" + version: "4.0.4" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "1.2.0" graphs: dependency: transitive description: name: graphs url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "0.2.0" hexcolor: dependency: "direct main" description: name: hexcolor url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "1.0.6" hijri: dependency: transitive description: @@ -657,49 +594,49 @@ packages: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.15.0" + version: "0.14.0+4" html_editor_enhanced: dependency: "direct main" description: name: html_editor_enhanced url: "https://pub.dartlang.org" source: hosted - version: "2.2.0+1-dev.1" + version: "1.3.0" http: dependency: "direct main" description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.13.4" + version: "0.12.2" http_interceptor: dependency: "direct main" description: name: http_interceptor url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "0.2.0" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.2.0" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "3.1.4" image: dependency: transitive description: name: image url: "https://pub.dartlang.org" source: hosted - version: "3.0.8" + version: "2.1.19" imei_plugin: dependency: "direct main" description: @@ -707,104 +644,97 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" - infinite_listview: - dependency: transitive - description: - name: infinite_listview - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" intl: dependency: "direct main" description: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.17.0" + version: "0.16.1" io: dependency: transitive description: name: io url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "0.3.5" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.3.0" + version: "3.1.1" local_auth: dependency: "direct main" description: name: local_auth url: "https://pub.dartlang.org" source: hosted - version: "1.1.8" + version: "0.6.3+4" logging: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "0.11.4" maps_launcher: dependency: "direct main" description: name: maps_launcher url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.2.2+2" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.10-nullsafety.1" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.9.7" nested: dependency: transitive description: name: nested url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" - numberpicker: + version: "0.0.4" + node_interop: dependency: transitive description: - name: numberpicker + name: node_interop url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" - numerus: + version: "1.2.1" + node_io: dependency: transitive description: - name: numerus + name: node_io url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.2.0" octo_image: dependency: transitive description: @@ -812,188 +742,181 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.3.0" + open_iconic_flutter: + dependency: transitive + description: + name: open_iconic_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "1.9.3" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.0-nullsafety.1" path_drawing: dependency: transitive description: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.5.1+1" + version: "0.4.1+1" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "0.1.4" path_provider: dependency: transitive description: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.8" - path_provider_ios: - dependency: transitive - description: - name: path_provider_ios - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.7" + version: "1.6.28" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "0.0.1+2" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "0.0.4+8" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.0.4" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "0.0.4+3" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.11.1" + version: "1.9.2" percent_indicator: dependency: "direct main" description: name: percent_indicator url: "https://pub.dartlang.org" source: hosted - version: "3.4.0" + version: "2.1.9+1" permission_handler: dependency: "direct main" description: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "8.3.0" + version: "5.1.0+2" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.7.0" + version: "2.0.2" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "3.1.0" platform: dependency: transitive description: name: platform url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "2.2.1" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" - pointer_interceptor: - dependency: transitive - description: - name: pointer_interceptor - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0+1" + version: "1.0.3" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "1.4.0" process: dependency: transitive description: name: process url: "https://pub.dartlang.org" source: hosted - version: "4.2.4" + version: "3.0.13" + progress_hud_v2: + dependency: "direct main" + description: + name: progress_hud_v2 + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" protobuf: dependency: transitive description: name: protobuf url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.1.4" provider: dependency: "direct main" description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "4.3.3" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "1.4.4" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "0.1.8" quiver: dependency: "direct main" description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "3.0.1+1" + version: "2.1.5" rxdart: dependency: transitive description: @@ -1007,77 +930,70 @@ packages: name: scratch_space url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.9" - shared_preferences_android: + version: "0.0.4+3" + screen: dependency: transitive description: - name: shared_preferences_android + name: screen url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" - shared_preferences_ios: - dependency: transitive + version: "0.0.5" + shared_preferences: + dependency: "direct main" description: - name: shared_preferences_ios + name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "0.5.12+4" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "0.0.2+4" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "0.0.1+11" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.0.4" shared_preferences_web: dependency: transitive description: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "0.1.2+7" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "0.0.2+3" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "0.7.9" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.2.4+1" sky_engine: dependency: transitive description: flutter @@ -1089,14 +1005,14 @@ packages: name: source_maps url: "https://pub.dartlang.org" source: hosted - version: "0.10.10" + version: "0.10.9" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.0-nullsafety.2" speech_to_text: dependency: "direct main" description: @@ -1110,77 +1026,77 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "2.0.0+4" + version: "1.3.2+4" sqflite_common: dependency: transitive description: name: sqflite_common url: "https://pub.dartlang.org" source: hosted - version: "2.0.1+1" + version: "1.0.3+3" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: name: sticky_headers url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.1.8+1" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" stream_transform: dependency: transitive description: name: stream_transform url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.2.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" synchronized: dependency: transitive description: name: synchronized url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "2.2.0+2" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.3" + version: "0.2.19-nullsafety.2" timing: dependency: transitive description: name: timing url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.1.1+3" transformer_page_view: dependency: transitive description: @@ -1188,209 +1104,146 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.6" - tuple: - dependency: transitive - description: - name: tuple - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.0-nullsafety.3" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.15" + version: "5.7.10" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "0.0.1+4" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "0.0.1+9" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "1.0.9" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "0.1.5+3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "0.0.1+3" uuid: dependency: transitive description: name: uuid url: "https://pub.dartlang.org" source: hosted - version: "3.0.5" + version: "2.2.2" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.0-nullsafety.3" video_player: dependency: transitive description: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "2.2.7" + version: "0.10.12+5" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.2.0" + version: "2.2.0" video_player_web: dependency: transitive description: name: video_player_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" - visibility_detector: - dependency: transitive - description: - name: visibility_detector - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.2" + version: "0.1.4+1" wakelock: dependency: transitive description: name: wakelock url: "https://pub.dartlang.org" source: hosted - version: "0.5.6" - wakelock_macos: - dependency: transitive - description: - name: wakelock_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - wakelock_platform_interface: - dependency: transitive - description: - name: wakelock_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - wakelock_web: - dependency: transitive - description: - name: wakelock_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - wakelock_windows: - dependency: transitive - description: - name: wakelock_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" + version: "0.1.4+2" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.9.7+15" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "1.2.0" webview_flutter: dependency: transitive description: name: webview_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.3.1" - webview_flutter_android: - dependency: transitive - description: - name: webview_flutter_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.3.0" - webview_flutter_platform_interface: - dependency: transitive - description: - name: webview_flutter_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.1" - webview_flutter_wkwebview: - dependency: transitive - description: - name: webview_flutter_wkwebview - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" + version: "0.3.24" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "1.7.4+1" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.1.2" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "4.5.1" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "2.2.1" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.10.2 <2.11.0" + flutter: ">=1.22.2 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 323cb1b0..23d6a2aa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,7 @@ description: A new Flutter project. version: 1.2.2+2 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.8.0 <3.0.0" #dependency_overrides: @@ -24,79 +24,77 @@ environment: dependencies: flutter: sdk: flutter - hexcolor: ^2.0.4 + hexcolor: ^1.0.1 flutter_localizations: sdk: flutter - flutter_device_type: ^0.4.0 - intl: ^0.17.0 - http: ^0.13.0 - provider: ^5.0.0 - shared_preferences: ^2.0.6 - imei_plugin: ^1.2.0 + flutter_device_type: ^0.2.0 + intl: ^0.16.0 + http: ^0.12.0+4 + provider: ^4.0.5+1 + shared_preferences: ^0.5.6+3 + imei_plugin: ^1.1.6 flutter_flexible_toast: ^0.1.4 - local_auth: ^1.1.6 - http_interceptor: ^0.4.1 - - connectivity: ^3.0.6 - maps_launcher: ^2.0.0 - url_launcher: ^6.0.6 - charts_flutter: ^0.10.0 + local_auth: ^0.6.1+3 + http_interceptor: ^0.2.0 + progress_hud_v2: ^2.0.0 + connectivity: ^0.4.8+2 + maps_launcher: ^1.2.0 + url_launcher: ^5.4.5 + charts_flutter: ^0.9.0 flutter_swiper: ^1.1.6 #Icons - eva_icons_flutter: ^3.0.0 - font_awesome_flutter: ^9.0.0 - dropdown_search: ^0.6.1 - flutter_staggered_grid_view: ^0.4.0 + eva_icons_flutter: ^2.0.0 + font_awesome_flutter: ^8.11.0 + dropdown_search: ^0.4.8 + flutter_staggered_grid_view: ^0.3.2 - expandable: ^5.0.1 + expandable: ^4.1.4 # Qr code Scanner barcode_scan_fix: ^1.0.2 # permissions - permission_handler: ^8.0.1 - device_info: ^2.0.2 + permission_handler: ^5.0.0+hotfix.3 + device_info: ^0.4.2+4 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.3 + cupertino_icons: ^0.1.2 # SVG #flutter_svg: ^0.17.4 - percent_indicator: ^3.0.1 + percent_indicator: ^2.1.1 #Dependency Injection - get_it: ^7.1.3 + get_it: ^4.0.2 #chart - fl_chart: ^0.36.1 + fl_chart: ^0.12.1 # Firebase - firebase_messaging: ^10.0.1 - firebase_analytics : ^8.3.4 + firebase_messaging: ^7.0.3 + firebase_analytics: 6.3.0 #GIF image flutter_gifimage: ^1.0.1 #Autocomplete TextField autocomplete_textfield: ^1.7.3 - date_time_picker: ^2.0.0 + date_time_picker: ^1.1.1 # Html - html: ^0.15.0 + html: ^0.14.0+4 # Flutter Html View - flutter_html: ^2.1.0 - sticky_headers: ^0.2.0 - file_picker: ^3.0.2+2 + flutter_html: 1.0.2 + sticky_headers: "^0.1.8" #speech to text speech_to_text: path: speech_to_text - quiver: ^3.0.0 - flutter_colorpicker: ^0.5.0 + quiver: ^2.1.5 # Html Editor Enhanced - html_editor_enhanced: ^2.1.1 + html_editor_enhanced: ^1.3.0 #Network Image cached_network_image: ^2.5.0 diff --git a/speech_to_text/example/pubspec.lock b/speech_to_text/example/pubspec.lock index 1538589c..6809f75f 100644 --- a/speech_to_text/example/pubspec.lock +++ b/speech_to_text/example/pubspec.lock @@ -7,42 +7,42 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.5.0-nullsafety.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.3" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.15.0-nullsafety.3" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" flutter: dependency: "direct main" description: flutter @@ -73,21 +73,21 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "3.0.1" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.10-nullsafety.1" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.0-nullsafety.3" nested: dependency: transitive description: @@ -101,7 +101,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.0-nullsafety.1" permission_handler: dependency: "direct main" description: @@ -141,7 +141,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.0-nullsafety.2" speech_to_text: dependency: "direct dev" description: @@ -155,49 +155,49 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "1.10.0-nullsafety.1" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.2.19-nullsafety.2" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.0-nullsafety.3" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.3" sdks: - dart: ">=2.12.0 <3.0.0" - flutter: ">=1.16.0" + dart: ">=2.10.0-110 <2.11.0" + flutter: ">=1.16.0 <2.0.0" diff --git a/speech_to_text/pubspec.lock b/speech_to_text/pubspec.lock index 95b0d050..efc63cc7 100644 --- a/speech_to_text/pubspec.lock +++ b/speech_to_text/pubspec.lock @@ -7,182 +7,175 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "22.0.0" + version: "5.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "1.7.1" + version: "0.39.13" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "1.6.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.5.0-nullsafety.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" build: dependency: transitive description: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "1.3.0" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.4.2" build_daemon: dependency: transitive description: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "2.1.4" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "1.3.10" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "1.10.0" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "7.0.0" + version: "5.2.0" built_collection: dependency: transitive description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "4.3.2" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.0.6" + version: "7.1.0" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.3" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" checked_yaml: dependency: transitive description: name: checked_yaml url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" + version: "1.0.2" clock: dependency: "direct main" description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" code_builder: dependency: transitive description: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "3.4.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.15.0-nullsafety.3" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "2.1.1" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.1.4" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.3.6" fake_async: dependency: "direct dev" description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.1" + version: "1.2.0-nullsafety.1" fixnum: dependency: transitive description: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.10.11" flutter: dependency: "direct main" description: flutter @@ -193,153 +186,174 @@ packages: description: flutter source: sdk version: "0.0.0" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.2.0" graphs: dependency: transitive description: name: graphs url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "0.2.0" + html: + dependency: transitive + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+3" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.2.0" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "3.1.4" io: dependency: transitive description: name: io url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.3.4" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.2" json_annotation: dependency: "direct main" description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "3.0.1" json_serializable: dependency: "direct dev" description: name: json_serializable url: "https://pub.dartlang.org" source: hosted - version: "4.1.3" + version: "3.3.0" logging: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.11.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.10-nullsafety.1" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.9.6+3" + node_interop: + dependency: transitive + description: + name: node_interop + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" + node_io: + dependency: transitive + description: + name: node_io + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.9.3" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.0-nullsafety.1" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.11.0" + version: "1.9.0" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "1.4.0" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.4.4" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.1.5" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.1.4" + version: "0.7.7" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.2.3" sky_engine: dependency: transitive description: flutter @@ -351,98 +365,98 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.9.6" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.0-nullsafety.2" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "1.10.0-nullsafety.1" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" stream_transform: dependency: transitive description: name: stream_transform url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.2.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.2.19-nullsafety.2" timing: dependency: transitive description: name: timing url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.1.1+2" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.0-nullsafety.3" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.3" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.9.7+15" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "1.1.0" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "2.2.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.10.0-110 <2.11.0" flutter: ">=1.10.0" diff --git a/speech_to_text/pubspec.yaml b/speech_to_text/pubspec.yaml index a40fe1ec..34b3da29 100644 --- a/speech_to_text/pubspec.yaml +++ b/speech_to_text/pubspec.yaml @@ -10,15 +10,15 @@ environment: dependencies: flutter: sdk: flutter - json_annotation: ^4.0.1 - clock: ^1.1.0 + json_annotation: ^3.0.0 + clock: ^1.0.1 dev_dependencies: flutter_test: sdk: flutter - build_runner: ^2.0.4 - json_serializable: ^4.1.3 - fake_async: ^1.2.0 + build_runner: ^1.0.0 + json_serializable: ^3.0.0 + fake_async: ^1.0.1 flutter: plugin: