Null Safety

ipd-changes-for-vida-plus
Aamir 3 years ago
parent dc802e2bda
commit d4cb4d7ad3

@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 50; objectVersion = 54;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@ -210,7 +210,7 @@
97C146E61CF9000F007C117D /* Project object */ = { 97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1300; LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "The Chromium Authors"; ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {
@ -256,10 +256,12 @@
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = ( inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
); );
name = "Thin Binary"; name = "Thin Binary";
outputPaths = ( outputPaths = (
@ -292,6 +294,7 @@
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
@ -342,13 +345,10 @@
"${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework", "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
"${BUILT_PRODUCTS_DIR}/path_provider_ios/path_provider_ios.framework", "${BUILT_PRODUCTS_DIR}/path_provider_ios/path_provider_ios.framework",
"${BUILT_PRODUCTS_DIR}/shared_preferences_ios/shared_preferences_ios.framework", "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework",
"${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework", "${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework",
"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework", "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
"${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework", "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework",
"${BUILT_PRODUCTS_DIR}/video_player_avfoundation/video_player_avfoundation.framework",
"${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework",
"${BUILT_PRODUCTS_DIR}/webview_flutter_wkwebview/webview_flutter_wkwebview.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
@ -383,13 +383,10 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_ios.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_ios.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player_avfoundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter_wkwebview.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
@ -501,7 +498,10 @@
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
@ -637,7 +637,10 @@
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
@ -668,7 +671,10 @@
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",

@ -67,5 +67,7 @@
<false/> <false/>
<key>CADisableMinimumFrameDurationOnPhone</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<true/> <true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict> </dict>
</plist> </plist>

@ -1,5 +1,3 @@
//@dart=2.9
import 'dart:convert'; import 'dart:convert';
import 'dart:io' show Platform; import 'dart:io' show Platform;
@ -24,9 +22,9 @@ Utils helpers = new Utils();
class BaseAppClient { class BaseAppClient {
//TODO change the post fun to nun static when you change all service //TODO change the post fun to nun static when you change all service
post(String endPoint, post(String endPoint,
{Map<String, dynamic> body, {Map<String, dynamic>? body,
Function(dynamic response, int statusCode) onSuccess, required Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure, required Function(String error, int statusCode) onFailure,
bool isAllowAny = false, bool isAllowAny = false,
bool isLiveCare = false, bool isLiveCare = false,
bool isFallLanguage = false}) async { bool isFallLanguage = false}) async {
@ -38,24 +36,24 @@ class BaseAppClient {
bool callLog = true; bool callLog = true;
try { try {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
if (profile != null) { if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) { if (body!['DoctorID'] == null) {
body['DoctorID'] = doctorProfile?.doctorID; body['DoctorID'] = doctorProfile.doctorID;
} }
if (body['DoctorID'] == "") body['DoctorID'] = null; 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) { if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID; body['ProjectID'] = doctorProfile.projectID;
} }
if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile.clinicID;
} else { } else {
String doctorID = await sharedPref.getString(DOCTOR_ID); String? doctorID = await sharedPref.getString(DOCTOR_ID);
if (body['DoctorID'] == '') { if (body!['DoctorID'] == '') {
body['DoctorID'] = null; body['DoctorID'] = null;
} else if (doctorID != null) body['DoctorID'] = int.parse(doctorID); } else if (doctorID != null) body['DoctorID'] = int.parse(doctorID);
} }
@ -74,7 +72,7 @@ class BaseAppClient {
} }
if (!isFallLanguage) { if (!isFallLanguage) {
String lang = await sharedPref.getString(APP_Language); String? lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar') if (lang != null && lang == 'ar')
body['LanguageID'] = 1; body['LanguageID'] = 1;
else else
@ -167,12 +165,11 @@ class BaseAppClient {
} }
} }
postPatient(String endPoint, postPatient(String endPoint,
{Map<String, dynamic> body, {Map<String, dynamic>? body,
Function(dynamic response, int statusCode) onSuccess, required Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure, required Function(String error, int statusCode) onFailure,
@required PatiantInformtion patient, PatiantInformtion? patient,
bool isExternal = false}) async { bool isExternal = false}) async {
String url = BASE_URL + endPoint; String url = BASE_URL + endPoint;
@ -180,19 +177,19 @@ class BaseAppClient {
Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) { if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) { if (body!['DoctorID'] == null) {
body['DoctorID'] = doctorProfile?.doctorID; body['DoctorID'] = doctorProfile.doctorID;
} }
} }
if (body['DoctorID'] == 0) { if (body!['DoctorID'] == 0) {
body['DoctorID'] = null; body['DoctorID'] = null;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body!.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
? body['SetupID'] ? body['SetupID']
: await sharedPref.getString(DOCTOR_SETUP_ID) : await sharedPref.getString(DOCTOR_SETUP_ID)
@ -223,7 +220,7 @@ class BaseAppClient {
body['PatientType'] = body.containsKey('PatientType') body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null ? body['PatientType'] != null
? body['PatientType'] ? body['PatientType']
: patient.patientType != null : patient!.patientType != null
? patient.patientType ? patient.patientType
: PATIENT_TYPE : PATIENT_TYPE
: PATIENT_TYPE; : PATIENT_TYPE;
@ -231,13 +228,13 @@ class BaseAppClient {
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
: patient.patientType != null : patient!.patientType != null
? patient.patientType ? patient.patientType
: PATIENT_TYPE_ID : PATIENT_TYPE_ID
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] ?? token : token; body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] ?? token : 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['PatientOutSA'] = 0; //user['OutSA']; //TODO change it
body['SessionID'] = SESSION_ID; //getSe body['SessionID'] = SESSION_ID; //getSe
@ -347,11 +344,10 @@ class BaseAppClient {
} }
return error; return error;
} }
get({String endPoint,
Function(dynamic response, int statusCode) onSuccess, get({required String endPoint, required Function(dynamic response, int statusCode) onSuccess, required Function(String error, int statusCode) onFailure}) async {
Function(String error, int statusCode) onFailure}) async{
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
String url = DOCTOR_ROTATION + endPoint+'&token='+token; String url = DOCTOR_ROTATION + endPoint + '&token=' + token;
final response = await http.get(Uri.parse(url)); final response = await http.get(Uri.parse(url));
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
@ -359,7 +355,7 @@ class BaseAppClient {
onFailure(Utils.generateContactAdminMsg(), statusCode); onFailure(Utils.generateContactAdminMsg(), statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
onSuccess(parsed,statusCode); onSuccess(parsed, statusCode);
} }
} }
} }

@ -1,8 +1,8 @@
class DoctorErSignAssessmentReqModel { class DoctorErSignAssessmentReqModel {
// String setupID; // String setupID;
int signInType; int? signInType;
int loginDoctorID; int? loginDoctorID;
int patientID; int? patientID;
DoctorErSignAssessmentReqModel( DoctorErSignAssessmentReqModel(
{ {

@ -1,29 +1,23 @@
class PostAssessmentRequestModel { class PostAssessmentRequestModel {
int patientMRN; int? patientMRN;
int appointmentNo; int? appointmentNo;
int episodeId; int? episodeId;
String createdByName; String? createdByName;
int createdBy; int? createdBy;
List<IcdCodeDetails> icdCodeDetails; List<IcdCodeDetails>? icdCodeDetails;
PostAssessmentRequestModel( PostAssessmentRequestModel({this.patientMRN, this.appointmentNo, this.episodeId, this.createdByName, this.createdBy, this.icdCodeDetails});
{this.patientMRN,
this.appointmentNo,
this.episodeId,
this.createdByName,
this.createdBy,
this.icdCodeDetails});
PostAssessmentRequestModel.fromJson(Map<String, dynamic> json) { PostAssessmentRequestModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeID']; episodeId = json['EpisodeID'];
createdByName = json['CreatedByName']; createdByName = json['CreatedByName'];
createdBy= json['CreatedBy']; createdBy = json['CreatedBy'];
if (json['icdCodeDetails'] != null) { if (json['icdCodeDetails'] != null) {
icdCodeDetails = new List<IcdCodeDetails>(); icdCodeDetails = <IcdCodeDetails>[];
json['icdCodeDetails'].forEach((v) { json['icdCodeDetails'].forEach((v) {
icdCodeDetails.add(new IcdCodeDetails.fromJson(v)); icdCodeDetails!.add(new IcdCodeDetails.fromJson(v));
}); });
} }
} }
@ -36,26 +30,20 @@ class PostAssessmentRequestModel {
data['CreatedByName'] = this.createdByName; data['CreatedByName'] = this.createdByName;
data['CreatedBy'] = this.createdBy; data['CreatedBy'] = this.createdBy;
if (this.icdCodeDetails != null) { if (this.icdCodeDetails != null) {
data['icdCodeDetails'] = data['icdCodeDetails'] = this.icdCodeDetails!.map((v) => v.toJson()).toList();
this.icdCodeDetails.map((v) => v.toJson()).toList();
} }
return data; return data;
} }
} }
class IcdCodeDetails { class IcdCodeDetails {
String icdcode10Id; String? icdcode10Id;
int conditionId; int? conditionId;
int diagnosisTypeId; int? diagnosisTypeId;
bool complexDiagnosis; bool? complexDiagnosis;
String remarks; String? remarks;
IcdCodeDetails( IcdCodeDetails({this.icdcode10Id, this.conditionId, this.diagnosisTypeId, this.complexDiagnosis, this.remarks});
{this.icdcode10Id,
this.conditionId,
this.diagnosisTypeId,
this.complexDiagnosis,
this.remarks});
IcdCodeDetails.fromJson(Map<String, dynamic> json) { IcdCodeDetails.fromJson(Map<String, dynamic> json) {
icdcode10Id = json['icdcode10Id']; icdcode10Id = json['icdcode10Id'];

@ -5,19 +5,10 @@ class PostProgressNoteRequestModel {
String? planNote; String? planNote;
dynamic doctorID; dynamic doctorID;
dynamic editedBy; dynamic editedBy;
String createdByName; String? createdByName;
int createdBy; int? createdBy;
PostProgressNoteRequestModel( PostProgressNoteRequestModel({this.appointmentNo, this.episodeId, this.patientMRN, this.planNote, this.doctorID, this.editedBy, this.createdByName, this.createdBy});
{this.appointmentNo,
this.episodeId,
this.patientMRN,
this.planNote,
this.doctorID,
this.editedBy,
this.createdByName,
this.createdBy
});
PostProgressNoteRequestModel.fromJson(Map<String, dynamic> json) { PostProgressNoteRequestModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];

@ -1,46 +1,46 @@
class AdmissionRequest { class AdmissionRequest {
int patientMRN; int? patientMRN;
int admitToClinic; int? admitToClinic;
bool isPregnant; bool? isPregnant;
int pregnancyWeeks; int? pregnancyWeeks;
int pregnancyType; int? pregnancyType;
int noOfBabies; int? noOfBabies;
int mrpDoctorID; int? mrpDoctorID;
String admissionDate; String? admissionDate;
int expectedDays; int? expectedDays;
int admissionType; int? admissionType;
int admissionLocationID; int? admissionLocationID;
int roomCategoryID; int? roomCategoryID;
int wardID; int? wardID;
bool isSickLeaveRequired; bool? isSickLeaveRequired;
String sickLeaveComments; String? sickLeaveComments;
bool isTransport; bool? isTransport;
String transportComments; String? transportComments;
bool isPhysioAppointmentNeeded; bool? isPhysioAppointmentNeeded;
String physioAppointmentComments; String? physioAppointmentComments;
bool isOPDFollowupAppointmentNeeded; bool? isOPDFollowupAppointmentNeeded;
String opdFollowUpComments; String? opdFollowUpComments;
bool isDietType; bool? isDietType;
int dietType; int? dietType;
String dietRemarks; String? dietRemarks;
String diagnosis; String? diagnosis;
bool isPhysicalActivityModification; bool? isPhysicalActivityModification;
String physicalActivityModificationComments; String? physicalActivityModificationComments;
int orStatus; int? orStatus;
String mainLineOfTreatment; String? mainLineOfTreatment;
int estimatedCost; int? estimatedCost;
String elementsForImprovement; String? elementsForImprovement;
bool isPackagePatient; bool? isPackagePatient;
String complications; String? complications;
String otherDepartmentInterventions; String? otherDepartmentinterventions;
String otherProcedures; String? otherProcedures;
String pastMedicalHistory; String? pastMedicalHistory;
String pastSurgicalHistory; String? pastSurgicalHistory;
List<dynamic> admissionRequestDiagnoses; List<dynamic>? admissionRequestDiagnoses;
List<dynamic> admissionRequestProcedures; List<dynamic>? admissionRequestProcedures;
int appointmentNo; int? appointmentNo;
int episodeID; int? episodeID;
int admissionRequestNo; int? admissionRequestNo;
AdmissionRequest( AdmissionRequest(
{this.patientMRN, {this.patientMRN,
@ -76,7 +76,7 @@ class AdmissionRequest {
this.elementsForImprovement, this.elementsForImprovement,
this.isPackagePatient = false, this.isPackagePatient = false,
this.complications = "", this.complications = "",
this.otherDepartmentInterventions = "", this.otherDepartmentinterventions = "",
this.otherProcedures = "", this.otherProcedures = "",
this.pastMedicalHistory = "", this.pastMedicalHistory = "",
this.pastSurgicalHistory = "", this.pastSurgicalHistory = "",
@ -120,22 +120,22 @@ class AdmissionRequest {
elementsForImprovement = json['elementsForImprovement']; elementsForImprovement = json['elementsForImprovement'];
isPackagePatient = json['isPackagePatient']; isPackagePatient = json['isPackagePatient'];
complications = json['complications']; complications = json['complications'];
otherDepartmentInterventions = json['otherDepartmentInterventions']; otherDepartmentinterventions = json['otherDepartmentInterventions'];
otherProcedures = json['otherProcedures']; otherProcedures = json['otherProcedures'];
pastMedicalHistory = json['pastMedicalHistory']; pastMedicalHistory = json['pastMedicalHistory'];
pastSurgicalHistory = json['pastSurgicalHistory']; pastSurgicalHistory = json['pastSurgicalHistory'];
if (json['admissionRequestDiagnoses'] != null) { if (json['admissionRequestDiagnoses'] != null) {
admissionRequestDiagnoses = new List<dynamic>(); admissionRequestDiagnoses = [];
json['admissionRequestDiagnoses'].forEach((v) { json['admissionRequestDiagnoses'].forEach((v) {
admissionRequestDiagnoses.add(v); admissionRequestDiagnoses!.add(v);
// admissionRequestDiagnoses // admissionRequestDiagnoses
// .add(new AdmissionRequestDiagnoses.fromJson(v)); // .add(new AdmissionRequestDiagnoses.fromJson(v));
}); });
} }
if (json['admissionRequestProcedures'] != null) { if (json['admissionRequestProcedures'] != null) {
admissionRequestProcedures = new List<dynamic>(); admissionRequestProcedures = [];
json['admissionRequestProcedures'].forEach((v) { json['admissionRequestProcedures'].forEach((v) {
admissionRequestProcedures.add(v); admissionRequestProcedures!.add(v);
// admissionRequestProcedures // admissionRequestProcedures
// .add(new AdmissionRequestProcedures.fromJson(v)); // .add(new AdmissionRequestProcedures.fromJson(v));
}); });
@ -180,7 +180,7 @@ class AdmissionRequest {
data['elementsForImprovement'] = this.elementsForImprovement; data['elementsForImprovement'] = this.elementsForImprovement;
data['isPackagePatient'] = this.isPackagePatient; data['isPackagePatient'] = this.isPackagePatient;
data['complications'] = this.complications; data['complications'] = this.complications;
data['otherDepartmentInterventions'] = this.otherDepartmentInterventions; data['otherDepartmentInterventions'] = this.otherDepartmentinterventions;
data['otherProcedures'] = this.otherProcedures; data['otherProcedures'] = this.otherProcedures;
data['pastMedicalHistory'] = this.pastMedicalHistory; data['pastMedicalHistory'] = this.pastMedicalHistory;
data['pastSurgicalHistory'] = this.pastSurgicalHistory; data['pastSurgicalHistory'] = this.pastSurgicalHistory;
@ -189,7 +189,7 @@ class AdmissionRequest {
// this.admissionRequestDiagnoses.map((v) => v.toJson()).toList(); // this.admissionRequestDiagnoses.map((v) => v.toJson()).toList();
} }
if (this.admissionRequestProcedures != null) { 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['appointmentNo'] = this.appointmentNo;
data['episodeID'] = this.episodeID; data['episodeID'] = this.episodeID;

@ -1,79 +1,62 @@
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
class CheckActivationCodeForDoctorAppResponseModel { class CheckActivationCodeForDoctorAppResponseModel {
String authenticationTokenID; String? authenticationTokenID;
List<ListDoctorsClinic> listDoctorsClinic; List<ListDoctorsClinic>? listDoctorsClinic;
List<DoctorProfileModel> listDoctorProfile; List<DoctorProfileModel>? listDoctorProfile;
MemberInformation memberInformation; MemberInformation? memberInformation;
String vidaAuthTokenID; String? vidaAuthTokenID;
String vidaRefreshTokenID; String? vidaRefreshTokenID;
CheckActivationCodeForDoctorAppResponseModel( CheckActivationCodeForDoctorAppResponseModel({this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation, this.listDoctorProfile, this.vidaAuthTokenID, this.vidaRefreshTokenID});
{this.authenticationTokenID,
this.listDoctorsClinic, CheckActivationCodeForDoctorAppResponseModel.fromJson(Map<String, dynamic> json) {
this.memberInformation,
this.listDoctorProfile,
this.vidaAuthTokenID,
this.vidaRefreshTokenID});
CheckActivationCodeForDoctorAppResponseModel.fromJson(
Map<String, dynamic> json) {
authenticationTokenID = json['AuthenticationTokenID']; authenticationTokenID = json['AuthenticationTokenID'];
if (json['List_DoctorsClinic'] != null) { if (json['List_DoctorsClinic'] != null) {
listDoctorsClinic = new List<ListDoctorsClinic>(); listDoctorsClinic = <ListDoctorsClinic>[];
json['List_DoctorsClinic'].forEach((v) { json['List_DoctorsClinic'].forEach((v) {
listDoctorsClinic.add(new ListDoctorsClinic.fromJson(v)); listDoctorsClinic!.add(new ListDoctorsClinic.fromJson(v));
}); });
} }
if (json['List_DoctorProfile'] != null) { if (json['List_DoctorProfile'] != null) {
listDoctorProfile = new List<DoctorProfileModel>(); listDoctorProfile = <DoctorProfileModel>[];
json['List_DoctorProfile'].forEach((v) { json['List_DoctorProfile'].forEach((v) {
listDoctorProfile.add(new DoctorProfileModel.fromJson(v)); listDoctorProfile!.add(new DoctorProfileModel.fromJson(v));
}); });
} }
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
memberInformation = json['memberInformation'] != null memberInformation = json['memberInformation'] != null ? new MemberInformation.fromJson(json['memberInformation']) : null;
? new MemberInformation.fromJson(json['memberInformation'])
: null;
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['AuthenticationTokenID'] = this.authenticationTokenID; data['AuthenticationTokenID'] = this.authenticationTokenID;
if (this.listDoctorsClinic != null) { if (this.listDoctorsClinic != null) {
data['List_DoctorsClinic'] = data['List_DoctorsClinic'] = this.listDoctorsClinic!.map((v) => v.toJson()).toList();
this.listDoctorsClinic.map((v) => v.toJson()).toList();
} }
if (this.listDoctorProfile != null) { if (this.listDoctorProfile != null) {
data['List_DoctorProfile'] = data['List_DoctorProfile'] = this.listDoctorProfile!.map((v) => v.toJson()).toList();
this.listDoctorProfile.map((v) => v.toJson()).toList();
} }
if (this.memberInformation != null) { if (this.memberInformation != null) {
data['memberInformation'] = this.memberInformation.toJson(); data['memberInformation'] = this.memberInformation!.toJson();
} }
return data; return data;
} }
} }
class ListDoctorsClinic { class ListDoctorsClinic {
String setupID; String? setupID;
int projectID; int? projectID;
int doctorID; int? doctorID;
int clinicID; int? clinicID;
bool isActive; bool? isActive;
String clinicName; String? clinicName;
ListDoctorsClinic( ListDoctorsClinic({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName});
{this.setupID,
this.projectID,
this.doctorID,
this.clinicID,
this.isActive,
this.clinicName});
ListDoctorsClinic.fromJson(Map<String, dynamic> json) { ListDoctorsClinic.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];
@ -97,32 +80,23 @@ class ListDoctorsClinic {
} }
class MemberInformation { class MemberInformation {
List<Clinics> clinics; List<Clinics>? clinics;
int doctorId; int? doctorId;
String email; String? email;
int employeeId; int? employeeId;
int memberId; int? memberId;
Null memberName; dynamic memberName;
Null memberNameArabic; dynamic memberNameArabic;
String preferredLanguage; String? preferredLanguage;
List<Roles> roles; List<Roles>? roles;
MemberInformation( MemberInformation({this.clinics, this.doctorId, this.email, this.employeeId, this.memberId, this.memberName, this.memberNameArabic, this.preferredLanguage, this.roles});
{this.clinics,
this.doctorId,
this.email,
this.employeeId,
this.memberId,
this.memberName,
this.memberNameArabic,
this.preferredLanguage,
this.roles});
MemberInformation.fromJson(Map<String, dynamic> json) { MemberInformation.fromJson(Map<String, dynamic> json) {
if (json['clinics'] != null) { if (json['clinics'] != null) {
clinics = new List<Clinics>(); clinics = <Clinics>[];
json['clinics'].forEach((v) { json['clinics'].forEach((v) {
clinics.add(new Clinics.fromJson(v)); clinics!.add(new Clinics.fromJson(v));
}); });
} }
doctorId = json['doctorId']; doctorId = json['doctorId'];
@ -133,9 +107,9 @@ class MemberInformation {
memberNameArabic = json['memberNameArabic']; memberNameArabic = json['memberNameArabic'];
preferredLanguage = json['preferredLanguage']; preferredLanguage = json['preferredLanguage'];
if (json['roles'] != null) { if (json['roles'] != null) {
roles = new List<Roles>(); roles =<Roles>[];
json['roles'].forEach((v) { json['roles'].forEach((v) {
roles.add(new Roles.fromJson(v)); roles!.add(new Roles.fromJson(v));
}); });
} }
} }
@ -143,7 +117,7 @@ class MemberInformation {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.clinics != null) { 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['doctorId'] = this.doctorId;
data['email'] = this.email; data['email'] = this.email;
@ -153,16 +127,16 @@ class MemberInformation {
data['memberNameArabic'] = this.memberNameArabic; data['memberNameArabic'] = this.memberNameArabic;
data['preferredLanguage'] = this.preferredLanguage; data['preferredLanguage'] = this.preferredLanguage;
if (this.roles != null) { if (this.roles != null) {
data['roles'] = this.roles.map((v) => v.toJson()).toList(); data['roles'] = this.roles!.map((v) => v.toJson()).toList();
} }
return data; return data;
} }
} }
class Clinics { class Clinics {
bool defaultClinic; bool? defaultClinic;
int id; int? id;
String name; String? name;
Clinics({this.defaultClinic, this.id, this.name}); Clinics({this.defaultClinic, this.id, this.name});
@ -182,8 +156,8 @@ class Clinics {
} }
class Roles { class Roles {
String name; String? name;
int roleId; int? roleId;
Roles({this.name, this.roleId}); Roles({this.name, this.roleId});

@ -1,14 +1,15 @@
import 'dart:convert'; import 'dart:convert';
List<DoctorSchedule> doctorScheduleFromJson(String str) => List<DoctorSchedule>.from(json.decode(str).map((x) => DoctorSchedule.fromJson(x))); List<DoctorSchedule> doctorScheduleFromJson(String str) => List<DoctorSchedule>.from(json.decode(str).map((x) => DoctorSchedule.fromJson(x)));
String doctorScheduleToJson(List<DoctorSchedule> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson()))); String doctorScheduleToJson(List<DoctorSchedule> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class DoctorSchedule { class DoctorSchedule {
int scheduledid; int? scheduledid;
int status; int? status;
String clinicname; String? clinicname;
int clinicid; int? clinicid;
List<Scheduleforuser> scheduleforuser; List<Scheduleforuser>? scheduleforuser;
DoctorSchedule({ DoctorSchedule({
this.scheduledid, this.scheduledid,
@ -19,26 +20,26 @@ class DoctorSchedule {
}); });
factory DoctorSchedule.fromJson(Map<String, dynamic> json) => DoctorSchedule( factory DoctorSchedule.fromJson(Map<String, dynamic> json) => DoctorSchedule(
scheduledid: json["scheduledid"], scheduledid: json["scheduledid"],
status: json["status"], status: json["status"],
clinicname: json["clinicname"], clinicname: json["clinicname"],
clinicid: json["clinicid"], clinicid: json["clinicid"],
scheduleforuser: List<Scheduleforuser>.from(json["scheduleforuser"].map((x) => Scheduleforuser.fromJson(x))), scheduleforuser: List<Scheduleforuser>.from(json["scheduleforuser"].map((x) => Scheduleforuser.fromJson(x))),
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"scheduledid": scheduledid, "scheduledid": scheduledid,
"status": status, "status": status,
"clinicname": clinicname, "clinicname": clinicname,
"clinicid": clinicid, "clinicid": clinicid,
"scheduleforuser": List<dynamic>.from(scheduleforuser.map((x) => x.toJson())), "scheduleforuser": List<dynamic>.from(scheduleforuser!.map((x) => x.toJson())),
}; };
} }
class Scheduleforuser { class Scheduleforuser {
DateTime days; DateTime? days;
int duration; int? duration;
List<Shiftforuser> shiftforuser; List<Shiftforuser>? shiftforuser;
Scheduleforuser({ Scheduleforuser({
this.days, this.days,
@ -47,21 +48,21 @@ class Scheduleforuser {
}); });
factory Scheduleforuser.fromJson(Map<String, dynamic> json) => Scheduleforuser( factory Scheduleforuser.fromJson(Map<String, dynamic> json) => Scheduleforuser(
days: DateTime.parse(json["days"]), days: DateTime.parse(json["days"]),
duration: json["duration"], duration: json["duration"],
shiftforuser: List<Shiftforuser>.from(json["shiftforuser"].map((x) => Shiftforuser.fromJson(x))), shiftforuser: List<Shiftforuser>.from(json["shiftforuser"].map((x) => Shiftforuser.fromJson(x))),
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"days": days.toIso8601String(), "days": days!.toIso8601String(),
"duration": duration, "duration": duration,
"shiftforuser": List<dynamic>.from(shiftforuser.map((x) => x.toJson())), "shiftforuser": List<dynamic>.from(shiftforuser!.map((x) => x.toJson())),
}; };
} }
class Shiftforuser { class Shiftforuser {
int fromtime; int? fromtime;
int totime; int? totime;
Shiftforuser({ Shiftforuser({
this.fromtime, this.fromtime,
@ -69,12 +70,12 @@ class Shiftforuser {
}); });
factory Shiftforuser.fromJson(Map<String, dynamic> json) => Shiftforuser( factory Shiftforuser.fromJson(Map<String, dynamic> json) => Shiftforuser(
fromtime: json["fromtime"], fromtime: json["fromtime"],
totime: json["totime"], totime: json["totime"],
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"fromtime": fromtime, "fromtime": fromtime,
"totime": totime, "totime": totime,
}; };
} }

@ -1,25 +1,12 @@
/*
*@author: Elham Rababah
*@Date:17/5/2020
*@param:
*@return:
*@desc: Clinic Model
*/
class ClinicModel { class ClinicModel {
String setupID; String? setupID;
int projectID; int? projectID;
int doctorID; int? doctorID;
int clinicID; int? clinicID;
bool isActive; bool? isActive;
String clinicName; String? clinicName;
ClinicModel( ClinicModel({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName});
{this.setupID,
this.projectID,
this.doctorID,
this.clinicID,
this.isActive,
this.clinicName});
ClinicModel.fromJson(Map<String, dynamic> json) { ClinicModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];

@ -1,5 +1,5 @@
class VidaPlusProjectListModel { class VidaPlusProjectListModel {
int projectID; int? projectID;
VidaPlusProjectListModel({this.projectID}); VidaPlusProjectListModel({this.projectID});

@ -1,27 +1,27 @@
class GetHospitalsRequestModel { class GetHospitalsRequestModel {
int languageID; int? languageID;
String stamp; String? stamp;
String iPAdress; String? iPAdress;
double versionID; double? versionID;
int channel; int? channel;
String tokenID; String? tokenID;
String sessionID; String? sessionID;
bool isLoginForDoctorApp; bool? isLoginForDoctorApp;
String memberID; String? memberID;
String doctorID; String? doctorID;
GetHospitalsRequestModel( GetHospitalsRequestModel({
{this.languageID, this.languageID,
this.stamp, this.stamp,
this.iPAdress, this.iPAdress,
this.versionID, this.versionID,
this.channel, this.channel,
this.tokenID, this.tokenID,
this.sessionID, this.sessionID,
this.isLoginForDoctorApp, this.isLoginForDoctorApp,
this.memberID, this.memberID,
this.doctorID, this.doctorID,
}); });
GetHospitalsRequestModel.fromJson(Map<String, dynamic> json) { GetHospitalsRequestModel.fromJson(Map<String, dynamic> json) {
languageID = json['LanguageID']; languageID = json['LanguageID'];

@ -1,42 +1,42 @@
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
class PatientLabOrders { class PatientLabOrders {
int actualDoctorRate; int? actualDoctorRate;
String clinicDescription; String? clinicDescription;
String clinicDescriptionEnglish; String? clinicDescriptionEnglish;
Null clinicDescriptionN; dynamic clinicDescriptionN;
int clinicID; int? clinicID;
int doctorID; int? doctorID;
String doctorImageURL; String? doctorImageURL;
String doctorName; String? doctorName;
String doctorNameEnglish; String? doctorNameEnglish;
Null doctorNameN; dynamic doctorNameN;
int doctorRate; int? doctorRate;
String doctorTitle; String? doctorTitle;
int gender; int? gender;
String genderDescription; String? genderDescription;
String invoiceNo; String? invoiceNo;
bool isActiveDoctorProfile; bool? isActiveDoctorProfile;
bool isDoctorAllowVedioCall; bool? isDoctorAllowVedioCall;
bool isExecludeDoctor; bool? isExecludeDoctor;
bool isInOutPatient; bool? isInOutPatient;
String isInOutPatientDescription; String? isInOutPatientDescription;
String isInOutPatientDescriptionN; String? isInOutPatientDescriptionN;
bool isRead; bool? isRead;
String nationalityFlagURL; String? nationalityFlagURL;
int noOfPatientsRate; int? noOfPatientsRate;
DateTime orderDate; DateTime? orderDate;
DateTime createdOn; DateTime? createdOn;
String orderNo; String? orderNo;
String patientID; String? patientID;
String projectID; String? projectID;
String projectName; String? projectName;
Null projectNameN; dynamic projectNameN;
String qR; String? qR;
String setupID; String? setupID;
List<String> speciality; List<String>? speciality;
bool isLiveCareAppointment; bool? isLiveCareAppointment;
String invoiceType; String? invoiceType;
PatientLabOrders( PatientLabOrders(
{this.actualDoctorRate, {this.actualDoctorRate,
this.clinicDescription, this.clinicDescription,
@ -72,8 +72,7 @@ class PatientLabOrders {
this.setupID, this.setupID,
this.speciality, this.speciality,
this.isLiveCareAppointment, this.isLiveCareAppointment,
this.invoiceType this.invoiceType});
});
PatientLabOrders.fromJson(Map<String, dynamic> json) { PatientLabOrders.fromJson(Map<String, dynamic> json) {
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
@ -157,10 +156,9 @@ class PatientLabOrders {
class PatientLabOrdersList { class PatientLabOrdersList {
String filterName = ""; String filterName = "";
List<PatientLabOrders> patientLabOrdersList = List(); List<PatientLabOrders> patientLabOrdersList = [];
PatientLabOrdersList( PatientLabOrdersList({required this.filterName, required PatientLabOrders patientDoctorAppointment}) {
{this.filterName, PatientLabOrders patientDoctorAppointment}) {
patientLabOrdersList.add(patientDoctorAppointment); patientLabOrdersList.add(patientDoctorAppointment);
} }
} }

@ -1,17 +1,17 @@
class DoctorsByClinicIdRequest { class DoctorsByClinicIdRequest {
int clinicID; int? clinicID;
int projectID; int? projectID;
bool continueDentalPlan; bool? continueDentalPlan;
bool isSearchAppointmnetByClinicID; bool? isSearchAppointmnetByClinicID;
int patientID; int? patientID;
int doctorID; int? doctorID;
int gender; int? gender;
bool isGetNearAppointment; bool? isGetNearAppointment;
bool isVoiceCommand; bool? isVoiceCommand;
int latitude; int? latitude;
int longitude; int? longitude;
bool license; bool? license;
bool isDentalAllowedBackend; bool? isDentalAllowedBackend;
DoctorsByClinicIdRequest({ DoctorsByClinicIdRequest({
this.clinicID, this.clinicID,

@ -1,33 +1,33 @@
class VitalSignData { class VitalSignData {
int appointmentNo; int? appointmentNo;
int bloodPressureCuffLocation; int? bloodPressureCuffLocation;
int bloodPressureCuffSize; int? bloodPressureCuffSize;
int bloodPressureHigher; int? bloodPressureHigher;
int bloodPressureLower; int? bloodPressureLower;
int bloodPressurePatientPosition; int? bloodPressurePatientPosition;
var bodyMassIndex; var bodyMassIndex;
int fio2; int? fio2;
int headCircumCm; int? headCircumCm;
var heightCm; var heightCm;
int idealBodyWeightLbs; int? idealBodyWeightLbs;
bool isPainManagementDone; bool? isPainManagementDone;
bool isVitalsRequired; bool? isVitalsRequired;
int leanBodyWeightLbs; int? leanBodyWeightLbs;
String painCharacter; String? painCharacter;
String painDuration; String? painDuration;
String painFrequency; String? painFrequency;
String painLocation; String? painLocation;
int painScore; int? painScore;
int patientMRN; int? patientMRN;
int patientType; int? patientType;
int pulseBeatPerMinute; int? pulseBeatPerMinute;
int pulseRhythm; int? pulseRhythm;
num respirationBeatPerMinute; dynamic respirationBeatPerMinute;
int respirationPattern; int? respirationPattern;
int sao2; int? sao2;
int status; int? status;
var temperatureCelcius; var temperatureCelcius;
int temperatureCelciusMethod; int? temperatureCelciusMethod;
var waistSizeInch; var waistSizeInch;
var weightKg; var weightKg;

@ -1,21 +1,21 @@
class InterventionMedicationHistoryResModel { class InterventionMedicationHistoryResModel {
String setupId; String? setupId;
String projectId; String? projectId;
int patientId; int? patientId;
int admissionNo; int? admissionNo;
int prescriptionId; int? prescriptionId;
int orderNo; int? orderNo;
int id; int? id;
int interventionId; int? interventionId;
dynamic intervention; dynamic intervention;
String remark; String? remark;
int commentedBy; int? commentedBy;
bool isDoctor; bool? isDoctor;
bool isActive; bool? isActive;
int createdBy; int? createdBy;
String createdByName; String? createdByName;
String createdByNameN; String? createdByNameN;
String createdOn; String? createdOn;
dynamic editedBy; dynamic editedBy;
dynamic editedByName; dynamic editedByName;
dynamic editedByNameN; dynamic editedByNameN;
@ -23,26 +23,26 @@ class InterventionMedicationHistoryResModel {
InterventionMedicationHistoryResModel( InterventionMedicationHistoryResModel(
{this.setupId, {this.setupId,
this.projectId, this.projectId,
this.patientId, this.patientId,
this.admissionNo, this.admissionNo,
this.prescriptionId, this.prescriptionId,
this.orderNo, this.orderNo,
this.id, this.id,
this.interventionId, this.interventionId,
this.intervention, this.intervention,
this.remark, this.remark,
this.commentedBy, this.commentedBy,
this.isDoctor, this.isDoctor,
this.isActive, this.isActive,
this.createdBy, this.createdBy,
this.createdByName, this.createdByName,
this.createdByNameN, this.createdByNameN,
this.createdOn, this.createdOn,
this.editedBy, this.editedBy,
this.editedByName, this.editedByName,
this.editedByNameN, this.editedByNameN,
this.editedOn}); this.editedOn});
InterventionMedicationHistoryResModel.fromJson(Map<String, dynamic> json) { InterventionMedicationHistoryResModel.fromJson(Map<String, dynamic> json) {
setupId = json['SetupId']; setupId = json['SetupId'];

@ -9,17 +9,17 @@ class FinalRadiology {
dynamic invoiceNo_VP; dynamic invoiceNo_VP;
dynamic doctorID; dynamic doctorID;
dynamic clinicID; dynamic clinicID;
DateTime orderDate; DateTime? orderDate;
DateTime reportDate; DateTime? reportDate;
dynamic reportData; dynamic reportData;
dynamic imageURL; dynamic imageURL;
dynamic procedureID; dynamic procedureID;
dynamic appodynamicmentNo; dynamic appodynamicmentNo;
dynamic dIAPacsURL; dynamic dIAPacsURL;
bool isRead; bool? isRead;
dynamic readOn; dynamic readOn;
var admissionNo; var admissionNo;
bool isInOutPatient; bool? isInOutPatient;
dynamic actualDoctorRate; dynamic actualDoctorRate;
dynamic clinicDescription; dynamic clinicDescription;
dynamic dIAPACSURL; dynamic dIAPACSURL;
@ -29,8 +29,8 @@ class FinalRadiology {
dynamic doctorTitle; dynamic doctorTitle;
dynamic gender; dynamic gender;
dynamic genderDescription; dynamic genderDescription;
bool isActiveDoctorProfile; bool? isActiveDoctorProfile;
bool isExecludeDoctor; bool? isExecludeDoctor;
dynamic isInOutPatientDescription; dynamic isInOutPatientDescription;
dynamic isInOutPatientDescriptionN; dynamic isInOutPatientDescriptionN;
dynamic nationalityFlagURL; dynamic nationalityFlagURL;
@ -40,12 +40,13 @@ class FinalRadiology {
dynamic qR; dynamic qR;
dynamic reportDataHTML; dynamic reportDataHTML;
dynamic reportDataTextdynamic; dynamic reportDataTextdynamic;
List<dynamic> speciality; List<dynamic>? speciality;
bool isCVI; bool? isCVI;
bool isRadMedicalReport; bool? isRadMedicalReport;
bool isLiveCareAppodynamicment; bool? isLiveCareAppodynamicment;
bool isRecordFromVidaPlus; bool? isRecordFromVidaPlus;
String invoiceType; String? invoiceType;
FinalRadiology( FinalRadiology(
{this.setupID, {this.setupID,
this.projectID, this.projectID,
@ -89,7 +90,9 @@ class FinalRadiology {
this.speciality, this.speciality,
this.isCVI, this.isCVI,
this.isRadMedicalReport, this.isRadMedicalReport,
this.isLiveCareAppodynamicment, this.isRecordFromVidaPlus, this.invoiceType}); this.isLiveCareAppodynamicment,
this.isRecordFromVidaPlus,
this.invoiceType});
FinalRadiology.fromJson(Map<dynamic, dynamic> json) { FinalRadiology.fromJson(Map<dynamic, dynamic> json) {
try { try {
@ -187,16 +190,16 @@ class FinalRadiology {
data['isCVI'] = this.isCVI; data['isCVI'] = this.isCVI;
data['isRadMedicalReport'] = this.isRadMedicalReport; data['isRadMedicalReport'] = this.isRadMedicalReport;
data['IsRecordFromVidaPlus'] = this.isRecordFromVidaPlus; data['IsRecordFromVidaPlus'] = this.isRecordFromVidaPlus;
data["InvoiceType"] =invoiceType; data["InvoiceType"] = invoiceType;
return data; return data;
} }
} }
class FinalRadiologyList { class FinalRadiologyList {
dynamic filterName = ""; dynamic filterName = "";
List<FinalRadiology> finalRadiologyList = List(); List<FinalRadiology> finalRadiologyList = [];
FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) { FinalRadiologyList({this.filterName, required FinalRadiology finalRadiology}) {
finalRadiologyList.add(finalRadiology); finalRadiologyList.add(finalRadiology);
} }
} }

@ -1,6 +1,4 @@
import 'package:firebase_analytics/firebase_analytics.dart'; import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:flutter/cupertino.dart';
class AnalyticsService { class AnalyticsService {
// final FirebaseAnalytics _analytics = FirebaseAnalytics(); // final FirebaseAnalytics _analytics = FirebaseAnalytics();
@ -8,7 +6,7 @@ class AnalyticsService {
static FirebaseAnalytics analytics = FirebaseAnalytics.instance; static FirebaseAnalytics analytics = FirebaseAnalytics.instance;
FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: analytics); 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: { await analytics.logEvent(name: 'event', parameters: {
"eventCategory": eventCategory, "eventCategory": eventCategory,
"eventAction": eventAction, "eventAction": eventAction,

@ -1,12 +1,12 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart'; import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart'; import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart';
import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/video_channel_utils.dart'; import 'package:doctor_app_flutter/utils/video_channel_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -17,40 +17,29 @@ import '../../routes.dart';
import 'NavigationService.dart'; import 'NavigationService.dart';
class VideoCallService extends BaseService { class VideoCallService extends BaseService {
StartCallRes startCallRes; late StartCallRes startCallRes;
PatiantInformtion patient; late PatiantInformtion patient;
LiveCarePatientServices _liveCarePatientServices = LiveCarePatientServices _liveCarePatientServices = locator<LiveCarePatientServices>();
locator<LiveCarePatientServices>();
openVideo( openVideo(StartCallRes startModel, PatiantInformtion patientModel, bool isRecording, VoidCallback onCallConnected, VoidCallback onCallDisconnected) async {
StartCallRes startModel,
PatiantInformtion patientModel,
bool isRecording,
VoidCallback onCallConnected,
VoidCallback onCallDisconnected) async {
this.startCallRes = startModel; this.startCallRes = startModel;
this.patient = patientModel; this.patient = patientModel;
DoctorProfileModel doctorProfile = DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true);
await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen( await VideoChannel.openVideoCallScreen(
// TODO MOSA TEST // TODO MOSA TEST
kApiKey: '46209962', kApiKey: '46209962',
kToken: startCallRes.openTokenID, kToken: startCallRes.openTokenID,
kSessionId: startCallRes.openSessionID, kSessionId: startCallRes.openSessionID,
// //
// kToken: "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9NzE0MGE4YzM0ZTU2YjQ5NmQzOTgwOTNkYmU1NzEzMmQxYTdkMDliZTpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTVNakkxTkRjMU1EUTRObjVCVFZsM2MwODFNV1ZhTjFsUlEyZGxiRFZxZVZjNWNHMS1mbjQmY3JlYXRlX3RpbWU9MTY5MjI1NDc1MCZub25jZT0wLjY5OTQyNzkzMTg1NDg4NSZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjkyMjU2NTUwJmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9", // kToken: "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9NzE0MGE4YzM0ZTU2YjQ5NmQzOTgwOTNkYmU1NzEzMmQxYTdkMDliZTpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTVNakkxTkRjMU1EUTRObjVCVFZsM2MwODFNV1ZhTjFsUlEyZGxiRFZxZVZjNWNHMS1mbjQmY3JlYXRlX3RpbWU9MTY5MjI1NDc1MCZub25jZT0wLjY5OTQyNzkzMTg1NDg4NSZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjkyMjU2NTUwJmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
// kSessionId: "1_MX40NjIwOTk2Mn5-MTY5MjI1NDc1MDQ4Nn5BTVl3c081MWVaN1lRQ2dlbDVqeVc5cG1-fn4", // kSessionId: "1_MX40NjIwOTk2Mn5-MTY5MjI1NDc1MDQ4Nn5BTVl3c081MWVaN1lRQ2dlbDVqeVc5cG1-fn4",
vcId: patient.vcId, vcId: patient.vcId!,
isRecording: isRecording, isRecording: isRecording,
patientName: patient.fullName ?? patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
(patient.firstName != null
? "${patient.firstName} ${patient.lastName}"
: "-"),
tokenID: await sharedPref.getString(TOKEN), tokenID: await sharedPref.getString(TOKEN),
generalId: GENERAL_ID, generalId: GENERAL_ID,
doctorId: doctorProfile.doctorID, doctorId: doctorProfile.doctorID!,
onFailure: (String error) { onFailure: (String error) {
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
}, },
@ -58,19 +47,16 @@ class VideoCallService extends BaseService {
onCallDisconnected: onCallDisconnected, onCallDisconnected: onCallDisconnected,
onCallEnd: () { onCallEnd: () {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext!);
locator<NavigationService>().navigatorKey.currentContext);
endCall( endCall(
patient.vcId, patient.vcId!,
false, false,
).then((value) { ).then((value) {
GifLoaderDialogUtils.hideDialog( GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext!);
locator<NavigationService>().navigatorKey.currentContext);
if (hasError) { if (hasError) {
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
} else } else
locator<NavigationService>() locator<NavigationService>().navigateTo(PATIENTS_END_Call, arguments: {
.navigateTo(PATIENTS_END_Call, arguments: {
"patient": patient, "patient": patient,
}); });
}); });
@ -78,19 +64,16 @@ class VideoCallService extends BaseService {
}, },
onCallNotRespond: (SessionStatusModel sessionStatusModel) { onCallNotRespond: (SessionStatusModel sessionStatusModel) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext!);
locator<NavigationService>().navigatorKey.currentContext);
endCall( endCall(
patient.vcId, patient.vcId!,
sessionStatusModel.sessionStatus == 3, sessionStatusModel.sessionStatus == 3,
).then((value) { ).then((value) {
GifLoaderDialogUtils.hideDialog( GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext!);
locator<NavigationService>().navigatorKey.currentContext);
if (hasError) { if (hasError) {
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
} else { } else {
locator<NavigationService>() locator<NavigationService>().navigateTo(PATIENTS_END_Call, arguments: {
.navigateTo(PATIENTS_END_Call, arguments: {
"patient": patient, "patient": patient,
}); });
} }
@ -103,7 +86,7 @@ class VideoCallService extends BaseService {
hasError = false; hasError = false;
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
EndCallReq endCallReq = new EndCallReq(); EndCallReq endCallReq = new EndCallReq();
endCallReq.doctorId = doctorProfile.doctorID; endCallReq.doctorId = doctorProfile!.doctorID;
endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.generalid = 'Cs2020@2016\$2958';
endCallReq.vCID = vCID; endCallReq.vCID = vCID;
endCallReq.isDestroy = isPatient; endCallReq.isDestroy = isPatient;

@ -48,7 +48,7 @@ class AuthenticationService extends BaseService {
}, body: {"IMEI": imei}); }, body: {"IMEI": imei});
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error; super.error = error.toString();
} }
} }
@ -64,7 +64,7 @@ class AuthenticationService extends BaseService {
}, body: userInfo.toJson()); }, body: userInfo.toJson());
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error; super.error = error.toString();
} }
} }
@ -80,7 +80,7 @@ class AuthenticationService extends BaseService {
}, body: activationCodeModel.toJson()); }, body: activationCodeModel.toJson());
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error; super.error = error.toString();
} }
} }
@ -96,7 +96,7 @@ class AuthenticationService extends BaseService {
}, body: activationCodeModel.toJson()); }, body: activationCodeModel.toJson());
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error; super.error = error.toString();
} }
} }
@ -112,7 +112,7 @@ class AuthenticationService extends BaseService {
}, body: checkActivationCodeRequestModel.toJson()); }, body: checkActivationCodeRequestModel.toJson());
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error; super.error = error.toString();
} }
} }
@ -128,7 +128,7 @@ class AuthenticationService extends BaseService {
}, body: insertIMEIDetailsModel.toJson()); }, body: insertIMEIDetailsModel.toJson());
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error; super.error = error.toString();
} }
} }
@ -146,7 +146,7 @@ class AuthenticationService extends BaseService {
}, body: profileReqModel.toJson()); }, body: profileReqModel.toJson());
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error; super.error = error.toString();
} }
} }
} }

@ -5,8 +5,8 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class HospitalsService extends BaseService { class HospitalsService extends BaseService {
List<GetHospitalsResponseModel> hospitals = List(); List<GetHospitalsResponseModel> hospitals = [];
List<VidaPlusProjectListModel> vidaPlusProjectListModel = List(); List<VidaPlusProjectListModel> vidaPlusProjectListModel = [];
Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async {
hasError = false; hasError = false;

@ -1,46 +1,13 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart'; import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:flutter/cupertino.dart';
class ERSignInService extends LookupService { class ERSignInService extends LookupService {
Future signInERPatient({required DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async {
Future signInERPatient({DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async {
hasError = false; hasError = false;
await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT, await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: doctorErSignAssessmentReqModel.toJson()); }, body: doctorErSignAssessmentReqModel.toJson());
} }
} }

@ -1,9 +1,9 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart';
import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart'; import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart';
import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_request.dart'; import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_request.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
import 'package:doctor_app_flutter/core/model/labs/request_patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/request_patient_lab_special_result.dart';
@ -13,22 +13,20 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import '../../base/base_service.dart'; import '../../base/base_service.dart';
class LabsService extends BaseService { class LabsService extends BaseService {
List<PatientLabOrders> patientLabOrdersList = List(); List<PatientLabOrders> patientLabOrdersList = [];
List<AllSpecialLabResultModel> _allSpecialLab = List(); List<AllSpecialLabResultModel> _allSpecialLab = [];
List<AllSpecialLabResultModel> get allSpecialLab => _allSpecialLab; List<AllSpecialLabResultModel> get allSpecialLab => _allSpecialLab;
AllSpecialLabResultRequestModel _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel();
AllSpecialLabResultRequestModel();
Future getPatientLabOrdersList( Future getPatientLabOrdersList(PatiantInformtion patient, bool isInpatient) async {
PatiantInformtion patient, bool isInpatient) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
String url = ""; String url = "";
if (isInpatient) { if (isInpatient) {
await getDoctorProfile(); await getDoctorProfile();
body['ProjectID'] = doctorProfile.projectID; body['ProjectID'] = doctorProfile?.projectID;
url = GET_PATIENT_LAB_OREDERS; url = GET_PATIENT_LAB_OREDERS;
} else { } else {
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
@ -36,8 +34,7 @@ class LabsService extends BaseService {
} }
patientLabOrdersList = []; patientLabOrdersList = [];
patientLabOrdersList.clear(); patientLabOrdersList.clear();
await baseAppClient.postPatient(url, patient: patient, await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
patientLabOrdersList = []; patientLabOrdersList = [];
if (!isInpatient) { if (!isInpatient) {
response['ListPLO'].forEach((hospital) { response['ListPLO'].forEach((hospital) {
@ -55,21 +52,14 @@ class LabsService extends BaseService {
}, body: body); }, body: body);
} }
RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult();
RequestPatientLabSpecialResult();
List<PatientLabSpecialResult> patientLabSpecialResult = [];
List<PatientLabSpecialResult> patientLabSpecialResult = List(); List<LabResult> labResultList = [];
List<LabResult> labResultList = List(); List<LabOrderResult> labOrdersResultsList = [];
List<LabOrderResult> labOrdersResultsList = List(); List<LabResultHistory> labOrdersResultHistoryList = [];
List<LabResultHistory> labOrdersResultHistoryList = List();
Future getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? orderNo, required PatiantInformtion patient, bool isInpatient = false}) async {
Future getLaboratoryResult(
{String projectID,
int clinicID,
String invoiceNo,
String orderNo,
PatiantInformtion patient,
bool isInpatient = false}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -79,8 +69,7 @@ class LabsService extends BaseService {
_requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.orderNo = orderNo;
body = _requestPatientLabSpecialResult.toJson(); body = _requestPatientLabSpecialResult.toJson();
await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient, onSuccess: (dynamic response, int statusCode) {
patient: patient, onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear(); patientLabSpecialResult.clear();
response['ListPLSR'].forEach((hospital) { response['ListPLSR'].forEach((hospital) {
@ -92,10 +81,7 @@ class LabsService extends BaseService {
}, body: body); }, body: body);
} }
Future getPatientLabResult( Future getPatientLabResult({required PatientLabOrders patientLabOrder, required PatiantInformtion patient, bool isInpatient = false}) async {
{PatientLabOrders patientLabOrder,
PatiantInformtion patient,
bool isInpatient}) async {
hasError = false; hasError = false;
String url = ""; String url = "";
@ -112,9 +98,8 @@ class LabsService extends BaseService {
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = patientLabOrder.projectID; body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID ?? 0; body['ClinicID'] = patientLabOrder.clinicID ?? 0;
body['InvoiceType'] = patientLabOrder.invoiceType ??""; body['InvoiceType'] = patientLabOrder.invoiceType ?? "";
await baseAppClient.postPatient(url, patient: patient, await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult = []; patientLabSpecialResult = [];
labResultList = []; labResultList = [];
@ -123,8 +108,7 @@ class LabsService extends BaseService {
labResultList.add(LabResult.fromJson(hospital)); labResultList.add(LabResult.fromJson(hospital));
}); });
response['List_GetLabSpecial'].forEach((hospital) { response['List_GetLabSpecial'].forEach((hospital) {
patientLabSpecialResult patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital));
.add(PatientLabSpecialResult.fromJson(hospital));
}); });
} else { } else {
response['ListPLR'].forEach((lab) { response['ListPLR'].forEach((lab) {
@ -137,10 +121,7 @@ class LabsService extends BaseService {
}, body: body); }, body: body);
} }
Future getPatientLabOrdersResults( Future getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, required String procedure, required PatiantInformtion patient}) async {
{PatientLabOrders patientLabOrder,
String procedure,
PatiantInformtion patient}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
if (patientLabOrder != null) { if (patientLabOrder != null) {
@ -152,8 +133,7 @@ class LabsService extends BaseService {
} }
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['Procedure'] = procedure; body['Procedure'] = procedure;
await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, patient: patient, onSuccess: (dynamic response, int statusCode) {
patient: patient, onSuccess: (dynamic response, int statusCode) {
labOrdersResultsList.clear(); labOrdersResultsList.clear();
response['ListPLR'].forEach((lab) { response['ListPLR'].forEach((lab) {
labOrdersResultsList.add(LabOrderResult.fromJson(lab)); labOrdersResultsList.add(LabOrderResult.fromJson(lab));
@ -164,10 +144,9 @@ class LabsService extends BaseService {
}, body: body); }, body: body);
} }
RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail();
RequestSendLabReportEmail();
Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { Future sendLabReportEmail({required PatientLabOrders patientLabOrder}) async {
// _requestSendLabReportEmail.projectID = patientLabOrder.projectID; // _requestSendLabReportEmail.projectID = patientLabOrder.projectID;
// _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; // _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo;
// _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; // _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
@ -191,10 +170,7 @@ class LabsService extends BaseService {
// }, body: _requestSendLabReportEmail.toJson()); // }, body: _requestSendLabReportEmail.toJson());
} }
Future getPatientLabOrdersResultHistoryByDescription( Future getPatientLabOrdersResultHistoryByDescription({PatientLabOrders? patientLabOrder, String? procedureDescription, required PatiantInformtion patient}) async {
{PatientLabOrders patientLabOrder,
String procedureDescription,
PatiantInformtion patient}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
if (patientLabOrder != null) { if (patientLabOrder != null) {
@ -204,9 +180,7 @@ class LabsService extends BaseService {
} }
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['ProcedureDescription'] = procedureDescription; body['ProcedureDescription'] = procedureDescription;
await baseAppClient.postPatient( await baseAppClient.postPatient(GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, patient: patient, onSuccess: (dynamic response, int statusCode) {
GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION,
patient: patient, onSuccess: (dynamic response, int statusCode) {
labOrdersResultHistoryList.clear(); labOrdersResultHistoryList.clear();
response['ListGeneralResultHistory'].forEach((lab) { response['ListGeneralResultHistory'].forEach((lab) {
labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab)); labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab));
@ -217,7 +191,7 @@ class LabsService extends BaseService {
}, body: body); }, body: body);
} }
Future getAllSpecialLabResult({int mrn}) async { Future getAllSpecialLabResult({required int mrn}) async {
_allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel( _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel(
patientID: mrn, patientID: mrn,
patientType: 1, patientType: 1,
@ -225,12 +199,10 @@ class LabsService extends BaseService {
); );
hasError = false; hasError = false;
_allSpecialLab.clear(); _allSpecialLab.clear();
await baseAppClient.post(ALL_SPECIAL_LAB_RESULT, await baseAppClient.post(ALL_SPECIAL_LAB_RESULT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
response['ListPLSRALL'].forEach((lab) { response['ListPLSRALL'].forEach((lab) {
var labs = AllSpecialLabResultModel.fromJson(lab); var labs = AllSpecialLabResultModel.fromJson(lab);
if (labs.invoiceNo != "0") if (labs.invoiceNo != "0") _allSpecialLab.add(AllSpecialLabResultModel.fromJson(lab));
_allSpecialLab.add(AllSpecialLabResultModel.fromJson(lab));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -1,16 +1,15 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:flutter/cupertino.dart';
import '../../base/base_service.dart'; import '../../base/base_service.dart';
class RadiologyService extends BaseService { class RadiologyService extends BaseService {
List<FinalRadiology> finalRadiologyList = List(); List<FinalRadiology> finalRadiologyList = [];
String url = ''; String url = '';
bool isRadiologyVIDAPlus = false; bool isRadiologyVIDAPlus = false;
Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient,String invoiceType}) async { Future getRadImageURL({required invoiceNo, required int lineItem, required int projectId, bool isVidaPlus = false, required PatiantInformtion patient, String? invoiceType}) async {
hasError = false; hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo; body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo;

@ -1,33 +1,29 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_model.dart'; import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_model.dart';
import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_request_model.dart'; import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_request_model.dart';
import 'package:doctor_app_flutter/core/model/pending_orders/pending_order_request_model.dart'; import 'package:doctor_app_flutter/core/model/pending_orders/pending_order_request_model.dart';
import 'package:doctor_app_flutter/core/model/pending_orders/pending_orders_model.dart'; import 'package:doctor_app_flutter/core/model/pending_orders/pending_orders_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class PendingOrderService extends BaseService { class PendingOrderService extends BaseService {
List<PendingOrderModel> _pendingOrderList = List(); List<PendingOrderModel> _pendingOrderList = [];
List<PendingOrderModel> get pendingOrderList => _pendingOrderList; List<PendingOrderModel> get pendingOrderList => _pendingOrderList;
List<AdmissionOrdersModel> _admissionOrderList = List(); List<AdmissionOrdersModel> _admissionOrderList = [];
List<AdmissionOrdersModel> get admissionOrderList => _admissionOrderList; List<AdmissionOrdersModel> get admissionOrderList => _admissionOrderList;
Future getPendingOrders( Future getPendingOrders({PendingOrderRequestModel? pendingOrderRequestModel, int? patientId, int? admissionNo}) async {
{PendingOrderRequestModel pendingOrderRequestModel,
int patientId,
int admissionNo}) async {
pendingOrderRequestModel = PendingOrderRequestModel( pendingOrderRequestModel = PendingOrderRequestModel(
patientID: patientId, patientID: patientId,
admissionNo: admissionNo, admissionNo: admissionNo,
patientTypeID: 1, patientTypeID: 1,
patientType: 1, patientType: 1,
); );
hasError = false; hasError = false;
await baseAppClient.post(GET_PENDING_ORDERS, await baseAppClient.post(GET_PENDING_ORDERS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
_pendingOrderList.clear(); _pendingOrderList.clear();
response['List_PendingOrders'].forEach( response['List_PendingOrders'].forEach(
@ -41,20 +37,16 @@ class PendingOrderService extends BaseService {
}, body: pendingOrderRequestModel.toJson()); }, body: pendingOrderRequestModel.toJson());
} }
Future getAdmissionOrders( Future getAdmissionOrders({AdmissionOrdersRequestModel? admissionOrdersRequestModel, int? patientId, int? admissionNo}) async {
{AdmissionOrdersRequestModel admissionOrdersRequestModel,
int patientId,
int admissionNo}) async {
admissionOrdersRequestModel = AdmissionOrdersRequestModel( admissionOrdersRequestModel = AdmissionOrdersRequestModel(
patientID: patientId, patientID: patientId,
admissionNo: admissionNo, admissionNo: admissionNo,
patientTypeID: 1, patientTypeID: 1,
patientType: 1, patientType: 1,
); );
hasError = false; hasError = false;
await baseAppClient.post(GET_ADMISSION_ORDERS, await baseAppClient.post(GET_ADMISSION_ORDERS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
//admissionOrderList.clear(); //admissionOrderList.clear();
response['List_AdmissionOrders'].forEach( response['List_AdmissionOrders'].forEach(

@ -1,33 +1,18 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart'; import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/ER_signin/ER_signin_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/ER_signin/ER_signin_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:flutter/cupertino.dart';
class ERSignInViewModel extends BaseViewModel { class ERSignInViewModel extends BaseViewModel {
bool hasError = false; bool hasError = false;
ERSignInService _ERSignInService = locator<ERSignInService>(); ERSignInService _ERSignInService = locator<ERSignInService>();
Future signInERPatient({int patientId, int signInType}) async { Future signInERPatient({required int patientId, required int signInType}) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType: signInType, loginDoctorID: doctorProfile.doctorID, patientID: patientId); DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType: signInType, loginDoctorID: doctorProfile!.doctorID, patientID: patientId);
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel); await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel);
if (_ERSignInService.hasError) { if (_ERSignInService.hasError) {

@ -1,40 +1,39 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/post_chief_complaint_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart';
import 'package:doctor_app_flutter/core/model/SOAP/history/get_history_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/history/get_history_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/history/get_history_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/history/get_history_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/history/post_histories_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/get_episode_for_inpatient_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_exam_list_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_exam_list_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_exam_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_exam_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart';
import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/get_episode_for_inpatient_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/history/post_histories_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessment_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessment_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart';
import 'package:flutter/material.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
@ -79,7 +78,7 @@ class SOAPViewModel extends BaseViewModel {
List<GetAssessmentResModel> get patientAssessmentList => _SOAPService.patientAssessmentList; List<GetAssessmentResModel> get patientAssessmentList => _SOAPService.patientAssessmentList;
int get episodeID => _SOAPService.episodeID; int get episodeID => _SOAPService.episodeID!;
bool isAddProgress = true; bool isAddProgress = true;
bool isAddExamInProgress = true; bool isAddExamInProgress = true;
@ -98,7 +97,7 @@ class SOAPViewModel extends BaseViewModel {
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList; List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList;
SubjectiveCallBack subjectiveCallBack; late SubjectiveCallBack subjectiveCallBack;
setSubjectiveCallBack(SubjectiveCallBack callBack) { setSubjectiveCallBack(SubjectiveCallBack callBack) {
this.subjectiveCallBack = callBack; this.subjectiveCallBack = callBack;
@ -108,7 +107,7 @@ class SOAPViewModel extends BaseViewModel {
subjectiveCallBack.nextFunction(model); subjectiveCallBack.nextFunction(model);
} }
ObjectiveCallBack objectiveCallBack; late ObjectiveCallBack objectiveCallBack;
setObjectiveCallBack(ObjectiveCallBack callBack) { setObjectiveCallBack(ObjectiveCallBack callBack) {
this.objectiveCallBack = callBack; this.objectiveCallBack = callBack;
@ -118,7 +117,7 @@ class SOAPViewModel extends BaseViewModel {
objectiveCallBack.nextFunction(model); objectiveCallBack.nextFunction(model);
} }
AssessmentCallBack assessmentCallBack; late AssessmentCallBack assessmentCallBack;
setAssessmentCallBack(AssessmentCallBack callBack) { setAssessmentCallBack(AssessmentCallBack callBack) {
this.assessmentCallBack = callBack; this.assessmentCallBack = callBack;
@ -128,7 +127,7 @@ class SOAPViewModel extends BaseViewModel {
assessmentCallBack.nextFunction(model); assessmentCallBack.nextFunction(model);
} }
PlanCallBack planCallBack; late PlanCallBack planCallBack;
setPlanCallBack(PlanCallBack callBack) { setPlanCallBack(PlanCallBack callBack) {
this.planCallBack = callBack; this.planCallBack = callBack;
@ -250,8 +249,8 @@ class SOAPViewModel extends BaseViewModel {
String getAllergicNames(isArabic) { String getAllergicNames(isArabic) {
String allergiesString = ''; String allergiesString = '';
patientAllergiesList.forEach((element) { patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType!)!;
if (selectedAllergy != null && element.isChecked) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + ' , '; if (selectedAllergy != null && element.isChecked!) allergiesString += ((isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , ')!;
}); });
return allergiesString; return allergiesString;
} }
@ -268,8 +267,8 @@ class SOAPViewModel extends BaseViewModel {
patientInfo.appointmentNo.toString(), patientInfo.appointmentNo.toString(),
), ),
); );
if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty) if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty)
getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo); getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo!);
else else
getPhysicalExamReqModel.admissionNo = 0; getPhysicalExamReqModel.admissionNo = 0;
setState(ViewState.Busy); setState(ViewState.Busy);
@ -303,7 +302,7 @@ class SOAPViewModel extends BaseViewModel {
Future getEpisodeForInpatient(PatiantInformtion patient) async { Future getEpisodeForInpatient(PatiantInformtion patient) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo), patientTypeID: 1); GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo!), patientTypeID: 1);
await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel); await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
@ -315,7 +314,7 @@ class SOAPViewModel extends BaseViewModel {
} }
// ignore: missing_return // ignore: missing_return
MasterKeyModel getOneMasterKey({@required MasterKeysService masterKeys, dynamic id, int typeId}) { MasterKeyModel? getOneMasterKey({required MasterKeysService masterKeys, dynamic id, int? typeId}) {
switch (masterKeys) { switch (masterKeys) {
case MasterKeysService.Allergies: case MasterKeysService.Allergies:
List<MasterKeyModel> result = allergiesList.where((element) { List<MasterKeyModel> result = allergiesList.where((element) {
@ -406,7 +405,28 @@ class SOAPViewModel extends BaseViewModel {
return result.first; return result.first;
} }
break; break;
break; case MasterKeysService.physiotherapyGoals:
return MasterKeyModel();
case MasterKeysService.TemperatureMethods:
return MasterKeyModel();
case MasterKeysService.Speciality:
return MasterKeyModel();
case MasterKeysService.MedicationStrength:
return MasterKeyModel();
case MasterKeysService.MedicationDuration:
return MasterKeyModel();
case MasterKeysService.MedicationRoute:
return MasterKeyModel();
case MasterKeysService.MedicationFrequency:
return MasterKeyModel();
case MasterKeysService.MedicationDoseTime:
return MasterKeyModel();
case MasterKeysService.MedicationIndications:
return MasterKeyModel();
case MasterKeysService.AdmissionRequestType:
return MasterKeyModel();
case MasterKeysService.DiagnosisSelectionType:
return MasterKeyModel();
} }
} }
@ -421,7 +441,7 @@ class SOAPViewModel extends BaseViewModel {
onUpdateSubjectStepStart(PatiantInformtion patientInfo) async { onUpdateSubjectStepStart(PatiantInformtion patientInfo) async {
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null, admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo!) : null,
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null, appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null,
episodeId: patientInfo.episodeNo, episodeId: patientInfo.episodeNo,
@ -541,7 +561,7 @@ class SOAPViewModel extends BaseViewModel {
final results = await Future.wait(services ?? []); final results = await Future.wait(services ?? []);
if (_SOAPService.hasError || _prescriptionService.hasError) { if (_SOAPService.hasError || _prescriptionService.hasError) {
error = _SOAPService.error + _prescriptionService.error; error = _SOAPService.error! + _prescriptionService.error!;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
@ -601,11 +621,11 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
postSubjectServices({patientInfo, String complaintsText, String medicationText, String illnessText, List<MySelectedHistory> myHistoryList, List<MySelectedAllergy> myAllergiesList}) async { postSubjectServices({patientInfo, String? complaintsText, String? medicationText, String? illnessText, List<MySelectedHistory>? myHistoryList, List<MySelectedAllergy>? myAllergiesList}) async {
var services; var services;
PostChiefComplaintRequestModel postChiefComplaintRequestModel = PostChiefComplaintRequestModel postChiefComplaintRequestModel =
createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText, medicationText: medicationText, complaintsText: complaintsText); createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText!, medicationText: medicationText!, complaintsText: complaintsText!);
if (patientChiefComplaintList.isEmpty) { if (patientChiefComplaintList.isEmpty) {
postChiefComplaintRequestModel.editedBy = ''; postChiefComplaintRequestModel.editedBy = '';
services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)]; services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)];
@ -614,7 +634,7 @@ class SOAPViewModel extends BaseViewModel {
services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)]; services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)];
} }
if (myHistoryList.length != 0) { if (myHistoryList!.length != 0) {
PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList); PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList);
if (patientHistoryList.isEmpty) { if (patientHistoryList.isEmpty) {
@ -624,7 +644,7 @@ class SOAPViewModel extends BaseViewModel {
} }
} }
if (myAllergiesList.length != 0) { if (myAllergiesList!.length != 0) {
PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo); PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo);
if (patientAllergiesList.isEmpty) { if (patientAllergiesList.isEmpty) {
services.add(_SOAPService.postAllergy(postAllergyRequestModel)); services.add(_SOAPService.postAllergy(postAllergyRequestModel));
@ -642,7 +662,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String complaintsText, String medicationText, String illnessText}) { PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String? complaintsText, String? medicationText, String? illnessText}) {
return new PostChiefComplaintRequestModel( return new PostChiefComplaintRequestModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null, admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
@ -657,17 +677,17 @@ class SOAPViewModel extends BaseViewModel {
numberOfWeeks: 0); numberOfWeeks: 0);
} }
PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List<MySelectedHistory> myHistoryList}) { PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List<MySelectedHistory>? myHistoryList}) {
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
myHistoryList.forEach((history) { myHistoryList!.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM(
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo, episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo, appointmentNo: patientInfo.appointmentNo,
remarks: "", remarks: "",
historyId: history.selectedHistory.id, historyId: history.selectedHistory!.id,
historyType: history.selectedHistory.typeId, historyType: history.selectedHistory!.typeId,
isChecked: history.isChecked, isChecked: history.isChecked,
)); ));
}); });
@ -679,7 +699,7 @@ class SOAPViewModel extends BaseViewModel {
PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel();
myAllergiesList.forEach((allergy) { myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM( postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId, allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
@ -687,9 +707,9 @@ class SOAPViewModel extends BaseViewModel {
appointmentNo: patientInfo.appointmentNo, appointmentNo: patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id, severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark, remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile.doctorID, createdBy: allergy.createdBy ?? doctorProfile!.doctorID,
createdOn: DateTime.now().toIso8601String(), createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID, editedBy: doctorProfile!.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked, isChecked: allergy.isChecked,
isUpdatedByNurse: false)); isUpdatedByNurse: false));

@ -27,11 +27,10 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:local_auth/auth_strings.dart';
// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; // import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
// import 'package:local_auth/auth_strings.dart'; // import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:local_auth_ios/local_auth_ios.dart';
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED } enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED }
@ -55,12 +54,12 @@ class AuthenticationViewModel extends BaseViewModel {
List<VidaPlusProjectListModel> get vidaPlusProjectList => _hospitalsService.vidaPlusProjectListModel; List<VidaPlusProjectListModel> get vidaPlusProjectList => _hospitalsService.vidaPlusProjectListModel;
NewLoginInformationModel loggedUser; NewLoginInformationModel loggedUser = NewLoginInformationModel();
GetIMEIDetailsModel user; GetIMEIDetailsModel user = GetIMEIDetailsModel();
UserModel userInfo = UserModel(); UserModel userInfo = UserModel();
final LocalAuthentication auth = LocalAuthentication(); final LocalAuthentication auth = LocalAuthentication();
List<BiometricType> _availableBiometrics; List<BiometricType> _availableBiometrics = [];
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
bool isLogin = false; bool isLogin = false;
@ -88,7 +87,7 @@ class AuthenticationViewModel extends BaseViewModel {
profileInfo['IMEI'] = token; profileInfo['IMEI'] = token;
profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE);
profileInfo['BioMetricEnabled'] = true; profileInfo['BioMetricEnabled'] = true;
profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user!.mobile;
InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo);
insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description'];
insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN'];
@ -96,12 +95,12 @@ class AuthenticationViewModel extends BaseViewModel {
insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description'];
insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN'];
insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID);
insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID; insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user!.doctorID;
insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA;
insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
insertIMEIDetailsModel.password = userInfo.password; insertIMEIDetailsModel.password = userInfo.password;
insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()); insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser!.listMemberInformation![0].employeeID : int.parse(user!.editedBy.toString());
await _authService.insertDeviceImei(insertIMEIDetailsModel); await _authService.insertDeviceImei(insertIMEIDetailsModel);
if (_authService.hasError) { if (_authService.hasError) {
@ -119,11 +118,11 @@ class AuthenticationViewModel extends BaseViewModel {
error = _authService.error; error = _authService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
sharedPref.setInt(PROJECT_ID, userInfo.projectID); sharedPref.setInt(PROJECT_ID, userInfo.projectID!);
loggedUser = loginInfo; loggedUser = loginInfo;
saveObjToString(LOGGED_IN_USER, loginInfo); saveObjToString(LOGGED_IN_USER, loginInfo);
sharedPref.remove(LAST_LOGIN_USER); sharedPref.remove(LAST_LOGIN_USER);
sharedPref.setString(TOKEN, loginInfo.logInTokenID); sharedPref.setString(TOKEN, loginInfo.logInTokenID!);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
@ -132,17 +131,17 @@ class AuthenticationViewModel extends BaseViewModel {
Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel(
iMEI: user.iMEI, iMEI: user!.iMEI,
facilityId: user.projectID, facilityId: user!.projectID,
memberID: user.doctorID, memberID: user!.doctorID,
loginDoctorID: int.parse(user.editedBy.toString()), loginDoctorID: int.parse(user!.editedBy.toString()),
zipCode: user.outSA == true ? '971' : '966', zipCode: user!.outSA == true ? '971' : '966',
mobileNumber: user.mobile, mobileNumber: user!.mobile,
oTPSendType: authMethodType.getTypeIdService(), oTPSendType: authMethodType.getTypeIdService(),
isMobileFingerPrint: 1, isMobileFingerPrint: 1,
vidaAuthTokenID: user.vidaAuthTokenID, vidaAuthTokenID: user!.vidaAuthTokenID,
vidaRefreshTokenID: user.vidaRefreshTokenID); vidaRefreshTokenID: user!.vidaRefreshTokenID);
await sharedPref.setString(DOCTOR_ID, user.editedBy.toString()); await sharedPref.setString(DOCTOR_ID, user!.editedBy.toString());
await _authService.sendActivationCodeVerificationScreen(activationCodeModel); await _authService.sendActivationCodeVerificationScreen(activationCodeModel);
if (_authService.hasError) { if (_authService.hasError) {
@ -153,28 +152,28 @@ class AuthenticationViewModel extends BaseViewModel {
} }
/// send activation code for silent login /// send activation code for silent login
Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password}) async { Future sendActivationCodeForDoctorApp({required AuthMethodTypes authMethodType, required String password}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
int projectID = await sharedPref.getInt(PROJECT_ID); int projectID = await sharedPref.getInt(PROJECT_ID);
ActivationCodeModel activationCodeModel = ActivationCodeModel( ActivationCodeModel activationCodeModel = ActivationCodeModel(
facilityId: projectID, facilityId: projectID,
memberID: loggedUser.listMemberInformation[0].memberID, memberID: loggedUser.listMemberInformation![0].memberID,
loginDoctorID: loggedUser.listMemberInformation[0].employeeID, loginDoctorID: loggedUser.listMemberInformation![0].employeeID,
otpSendType: authMethodType.getTypeIdService().toString(), otpSendType: authMethodType.getTypeIdService().toString(),
); );
await sharedPref.setString(DOCTOR_ID, (loggedUser.listMemberInformation[0].employeeID).toString()); await sharedPref.setString(DOCTOR_ID, (loggedUser.listMemberInformation![0].employeeID).toString());
await _authService.sendActivationCodeForDoctorApp(activationCodeModel); await _authService.sendActivationCodeForDoctorApp(activationCodeModel);
if (_authService.hasError) { if (_authService.hasError) {
error = _authService.error; error = _authService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID); await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID!);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
/// check activation code for sms and whats app /// check activation code for sms and whats app
Future checkActivationCodeForDoctorApp({String activationCode, bool isSilentLogin = false}) async { Future checkActivationCodeForDoctorApp({String? activationCode, bool isSilentLogin = false}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel(
@ -183,12 +182,12 @@ class AuthenticationViewModel extends BaseViewModel {
projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user.projectID, projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user.projectID,
logInTokenID: await sharedPref.getString(TOKEN), logInTokenID: await sharedPref.getString(TOKEN),
activationCode: activationCode ?? '0000', activationCode: activationCode ?? '0000',
memberID: userInfo.userID != null ? int.parse(userInfo.userID) : user.doctorID, memberID: userInfo.userID != null ? int.parse(userInfo.userID!) : user.doctorID,
password: userInfo.password, password: userInfo.password,
facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user.projectID.toString(), facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE), oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken, iMEI: localToken,
loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()), loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation![0].employeeID : int.parse(user.editedBy.toString()),
///loggedUser.listMemberInformation[0].employeeID, ///loggedUser.listMemberInformation[0].employeeID,
// loggedUser.listMemberInformation[0].employeeID, // loggedUser.listMemberInformation[0].employeeID,
@ -242,10 +241,10 @@ class AuthenticationViewModel extends BaseViewModel {
setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async {
// print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
await sharedPref.setString( await sharedPref.setString(
DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : ""); DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic![0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic![0].setupID! : "");
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!);
await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!);
} }
saveObjToString(String key, value) async { saveObjToString(String key, value) async {
@ -254,10 +253,16 @@ class AuthenticationViewModel extends BaseViewModel {
/// ask user to add his biometric /// ask user to add his biometric
showIOSAuthMessages() async { showIOSAuthMessages() async {
const iosStrings = const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please Enable Your Touch ID'); const iosStrings = IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please Enable Your Touch ID');
try { try {
await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings); await auth.authenticate(
localizedReason: 'Scan your fingerprint to authenticate',
authMessages: [iosStrings],
options: AuthenticationOptions(
useErrorDialogs: true,
stickyAuth: true,
),
);
} on PlatformException catch (e) { } on PlatformException catch (e) {
DrAppToastMsg.showErrorToast(e.toString()); DrAppToastMsg.showErrorToast(e.toString());
} }
@ -285,12 +290,12 @@ class AuthenticationViewModel extends BaseViewModel {
/// add some logic in case of check activation code is success /// add some logic in case of check activation code is success
onCheckActivationCodeSuccess({bool isSilentLogin = false}) async { onCheckActivationCodeSuccess({bool isSilentLogin = false}) async {
sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID); sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!);
if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) { if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) {
localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile![0]);
} else { } else {
sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic);
ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson()); ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic![0].toJson());
await getDoctorProfileBasedOnClinic(clinic); await getDoctorProfileBasedOnClinic(clinic);
} }
} }
@ -350,8 +355,8 @@ class AuthenticationViewModel extends BaseViewModel {
if (_authService.dashboardItemsList.length > 0) { if (_authService.dashboardItemsList.length > 0) {
user = _authService.dashboardItemsList[0]; user = _authService.dashboardItemsList[0];
sharedPref.setObj(LAST_LOGIN_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_REFRESH_TOKEN_ID, user.vidaRefreshTokenID!);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID!);
this.unverified = true; this.unverified = true;
} }
setState(ViewState.Idle); setState(ViewState.Idle);
@ -405,7 +410,7 @@ class AuthenticationViewModel extends BaseViewModel {
} }
deleteUser() { deleteUser() {
user = null; user = GetIMEIDetailsModel();
unverified = false; unverified = false;
isLogin = false; isLogin = false;
} }

@ -1,12 +1,11 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart'; import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart';
import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart';
import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -16,23 +15,20 @@ import 'base_view_model.dart';
class DashboardViewModel extends BaseViewModel { class DashboardViewModel extends BaseViewModel {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
DashboardService _dashboardService = locator<DashboardService>(); DashboardService _dashboardService = locator<DashboardService>();
SpecialClinicsService _specialClinicsService = SpecialClinicsService _specialClinicsService = locator<SpecialClinicsService>();
locator<SpecialClinicsService>();
DoctorReplyService _doctorReplyService = locator<DoctorReplyService>(); DoctorReplyService _doctorReplyService = locator<DoctorReplyService>();
List<DashboardModel> get dashboardItemsList => List<DashboardModel> get dashboardItemsList => _dashboardService.dashboardItemsList;
_dashboardService.dashboardItemsList;
bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; bool get hasVirtualClinic => _dashboardService.hasVirtualClinic;
String get sServiceID => _dashboardService.sServiceID; String? get sServiceID => _dashboardService.sServiceID;
int get notRepliedCount => _doctorReplyService.notRepliedCount; int get notRepliedCount => _doctorReplyService.notRepliedCount;
List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList => List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList => _specialClinicsService.specialClinicalCareList;
_specialClinicsService.specialClinicalCareList;
Future startHomeScreenServices(ProjectViewModel projectsProvider, Future startHomeScreenServices(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async {
AuthenticationViewModel authProvider) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
@ -53,14 +49,13 @@ class DashboardViewModel extends BaseViewModel {
} }
Future setFirebaseNotification(AuthenticationViewModel authProvider) async { Future setFirebaseNotification(AuthenticationViewModel authProvider) async {
_firebaseMessaging.requestPermission( _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true);
sound: true, badge: true, alert: true, provisional: true);
_firebaseMessaging.getToken().then((String token) async { _firebaseMessaging.getToken().then((String? token) async {
if (token != '') { if (token != '') {
// DEVICE_TOKEN = token; // DEVICE_TOKEN = token;
///TODO Elham* return it back ///TODO Elham* return it back
authProvider.insertDeviceImei(token); authProvider.insertDeviceImei(token);
} }
}); });
} }
@ -85,14 +80,13 @@ class DashboardViewModel extends BaseViewModel {
// setState(ViewState.Idle); // setState(ViewState.Idle);
} }
Future changeClinic( Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async {
int clinicId, AuthenticationViewModel authProvider) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await getDoctorProfile(); await getDoctorProfile();
ClinicModel clinicModel = ClinicModel( ClinicModel clinicModel = ClinicModel(
doctorID: doctorProfile.doctorID, doctorID: doctorProfile!.doctorID,
clinicID: clinicId, clinicID: clinicId,
projectID: doctorProfile.projectID, projectID: doctorProfile!.projectID,
); );
await authProvider.getDoctorProfileBasedOnClinic(clinicModel); await authProvider.getDoctorProfileBasedOnClinic(clinicModel);
if (authProvider.state == ViewState.ErrorLocal) { if (authProvider.state == ViewState.ErrorLocal) {
@ -102,13 +96,13 @@ class DashboardViewModel extends BaseViewModel {
getPatientCount(DashboardModel inPatientCount) { getPatientCount(DashboardModel inPatientCount) {
int value = 0; int value = 0;
inPatientCount.summaryoptions.forEach((result) => {value += result.value}); inPatientCount.summaryoptions!.forEach((result) => {value += result.value!});
return value.toString(); return value.toString();
} }
GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId) { GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId) {
GetSpecialClinicalCareListResponseModel special; GetSpecialClinicalCareListResponseModel special = GetSpecialClinicalCareListResponseModel();
specialClinicalCareList.forEach((element) { specialClinicalCareList.forEach((element) {
if (element.clinicID == clinicId) { if (element.clinicID == clinicId) {
special = element; special = element;
@ -130,6 +124,4 @@ class DashboardViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
} }

@ -1,8 +1,8 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/model/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/list_gt_my_patients_question_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/replay/request_create_doctor_response.dart'; import 'package:doctor_app_flutter/core/model/doctor/replay/request_create_doctor_response.dart';
import 'package:doctor_app_flutter/core/model/doctor/replay/request_doctor_reply.dart'; import 'package:doctor_app_flutter/core/model/doctor/replay/request_doctor_reply.dart';
import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
@ -10,30 +10,21 @@ import 'base_view_model.dart';
class DoctorReplayViewModel extends BaseViewModel { class DoctorReplayViewModel extends BaseViewModel {
DoctorReplyService _doctorReplyService = locator<DoctorReplyService>(); DoctorReplyService _doctorReplyService = locator<DoctorReplyService>();
List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable => List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable => _doctorReplyService.listDoctorWorkingHoursTable;
_doctorReplyService.listDoctorWorkingHoursTable;
List<ListGtMyPatientsQuestions> get listDoctorNotRepliedQuestions => List<ListGtMyPatientsQuestions> get listDoctorNotRepliedQuestions => _doctorReplyService.listDoctorNotRepliedQuestions;
_doctorReplyService.listDoctorNotRepliedQuestions;
Future getDoctorReply( Future getDoctorReply({int pageSize = 10, int pageIndex = 1, bool isLocalBusy = true, bool isGettingNotReply = false}) async {
{int pageSize = 10,
int pageIndex = 1,
bool isLocalBusy = true,
bool isGettingNotReply = false}) async {
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
await getDoctorProfile(); await getDoctorProfile();
RequestDoctorReply _requestDoctorReply = RequestDoctorReply _requestDoctorReply = RequestDoctorReply(pageIndex: pageIndex, pageSize: pageSize);
RequestDoctorReply(pageIndex: pageIndex, pageSize: pageSize); if (isGettingNotReply) _requestDoctorReply.infoStatus = 99; //to get the not replied only
if (isGettingNotReply)
_requestDoctorReply.infoStatus = 99; //to get the not replied only
await _doctorReplyService.getDoctorReply(_requestDoctorReply, await _doctorReplyService.getDoctorReply(_requestDoctorReply, clearData: !isLocalBusy, isGettingNotReply: isGettingNotReply);
clearData: !isLocalBusy, isGettingNotReply: isGettingNotReply);
if (_doctorReplyService.hasError) { if (_doctorReplyService.hasError) {
error = _doctorReplyService.error; error = _doctorReplyService.error;
if (isLocalBusy) { if (isLocalBusy) {
@ -45,17 +36,15 @@ class DoctorReplayViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future createDoctorResponse( Future createDoctorResponse(String response, ListGtMyPatientsQuestions model) async {
String response, ListGtMyPatientsQuestions model) async {
await getDoctorProfile(); await getDoctorProfile();
CreateDoctorResponseModel createDoctorResponseModel = CreateDoctorResponseModel createDoctorResponseModel = CreateDoctorResponseModel(
CreateDoctorResponseModel( transactionNo: model.transactionNo.toString(),
transactionNo: model.transactionNo.toString(), doctorResponse: response,
doctorResponse: response, infoStatus: 6,
infoStatus: 6, createdBy: this.doctorProfile!.doctorID,
createdBy: this.doctorProfile.doctorID, infoEnteredBy: this.doctorProfile!.doctorID,
infoEnteredBy: this.doctorProfile.doctorID, );
);
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _doctorReplyService.createDoctorResponse(createDoctorResponseModel); await _doctorReplyService.createDoctorResponse(createDoctorResponseModel);
if (_doctorReplyService.hasError) { if (_doctorReplyService.hasError) {

@ -1,14 +1,14 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart';
import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart'; import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/lab_order/labs_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/lab_order/labs_service.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
@ -17,22 +17,16 @@ class LabsViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic; FilterType filterType = FilterType.Clinic;
LabsService _labsService = locator<LabsService>(); LabsService _labsService = locator<LabsService>();
List<LabOrderResult> get labOrdersResultsList => List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList;
_labsService.labOrdersResultsList;
List<AllSpecialLabResultModel> get allSpecialLabList => List<AllSpecialLabResultModel> get allSpecialLabList => _labsService.allSpecialLab;
_labsService.allSpecialLab;
List<PatientLabOrdersList> _patientLabOrdersListClinic =[]; List<PatientLabOrdersList> _patientLabOrdersListClinic = [];
List<PatientLabOrdersList> _patientLabOrdersListHospital =[]; List<PatientLabOrdersList> _patientLabOrdersListHospital = [];
List<PatientLabOrdersList> get patientLabOrdersList => List<PatientLabOrdersList> get patientLabOrdersList => filterType == FilterType.Clinic ? _patientLabOrdersListClinic : _patientLabOrdersListHospital;
filterType == FilterType.Clinic
? _patientLabOrdersListClinic
: _patientLabOrdersListHospital;
List<LabResultHistory> get labOrdersResultHistoryList => List<LabResultHistory> get labOrdersResultHistoryList => _labsService.labOrdersResultHistoryList;
_labsService.labOrdersResultHistoryList;
void getLabs(PatiantInformtion patient) async { void getLabs(PatiantInformtion patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -42,41 +36,25 @@ class LabsViewModel extends BaseViewModel {
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
_labsService.patientLabOrdersList.forEach((element) { _labsService.patientLabOrdersList.forEach((element) {
List<PatientLabOrdersList> patientLabOrdersClinic = List<PatientLabOrdersList> patientLabOrdersClinic = _patientLabOrdersListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList();
_patientLabOrdersListClinic
.where((elementClinic) =>
elementClinic.filterName == element.clinicDescription)
.toList();
if (patientLabOrdersClinic.length != 0) { if (patientLabOrdersClinic.length != 0) {
_patientLabOrdersListClinic[_patientLabOrdersListClinic _patientLabOrdersListClinic[_patientLabOrdersListClinic.indexOf(patientLabOrdersClinic[0])].patientLabOrdersList.add(element);
.indexOf(patientLabOrdersClinic[0])]
.patientLabOrdersList
.add(element);
} else { } else {
_patientLabOrdersListClinic.add(PatientLabOrdersList( _patientLabOrdersListClinic.add(PatientLabOrdersList(filterName: element.clinicDescription!, patientDoctorAppointment: element));
filterName: element.clinicDescription!,
patientDoctorAppointment: element));
} }
// doctor list sort via project // doctor list sort via project
List<PatientLabOrdersList> patientLabOrdersHospital = List<PatientLabOrdersList> patientLabOrdersHospital = _patientLabOrdersListHospital
_patientLabOrdersListHospital .where(
.where( (elementClinic) => elementClinic.filterName == element.projectName,
(elementClinic) => )
elementClinic.filterName == element.projectName, .toList();
)
.toList();
if (patientLabOrdersHospital.length != 0) { if (patientLabOrdersHospital.length != 0) {
_patientLabOrdersListHospital[_patientLabOrdersListHospital _patientLabOrdersListHospital[_patientLabOrdersListHospital.indexOf(patientLabOrdersHospital[0])].patientLabOrdersList.add(element);
.indexOf(patientLabOrdersHospital[0])]
.patientLabOrdersList
.add(element);
} else { } else {
_patientLabOrdersListHospital.add(PatientLabOrdersList( _patientLabOrdersListHospital.add(PatientLabOrdersList(filterName: element.projectName!, patientDoctorAppointment: element));
filterName: element.projectName!,
patientDoctorAppointment: element));
} }
}); });
@ -89,28 +67,15 @@ class LabsViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
} }
List<PatientLabSpecialResult> get patientLabSpecialResult => List<PatientLabSpecialResult> get patientLabSpecialResult => _labsService.patientLabSpecialResult;
_labsService.patientLabSpecialResult;
List<LabResult> get labResultList => _labsService.labResultList; List<LabResult> get labResultList => _labsService.labResultList;
List<LabResultList> labResultLists =[]; List<LabResultList> labResultLists = [];
getLaboratoryResult( getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? orderNo, PatiantInformtion? patient, bool? isInpatient}) async {
{String? projectID,
int? clinicID,
String? invoiceNo,
String? orderNo,
PatiantInformtion? patient,
bool? isInpatient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getLaboratoryResult( await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient!, isInpatient: isInpatient!);
invoiceNo: invoiceNo,
orderNo: orderNo,
projectID: projectID,
clinicID: clinicID,
patient: patient,
isInpatient: isInpatient);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -119,15 +84,9 @@ class LabsViewModel extends BaseViewModel {
} }
} }
getPatientLabResult( getPatientLabResult({PatientLabOrders? patientLabOrder, PatiantInformtion? patient, bool? isInpatient}) async {
{PatientLabOrders? patientLabOrder,
PatiantInformtion? patient,
bool? isInpatient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabResult( await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder!, patient: patient!, isInpatient: isInpatient!);
patientLabOrder: patientLabOrder,
patient: patient,
isInpatient: isInpatient!);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -138,31 +97,19 @@ class LabsViewModel extends BaseViewModel {
void setLabResultDependOnFilterName() { void setLabResultDependOnFilterName() {
_labsService.labResultList.forEach((element) { _labsService.labResultList.forEach((element) {
List<LabResultList> patientLabOrdersClinic = labResultLists List<LabResultList> patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList();
.where(
(elementClinic) => elementClinic.filterName == element.testCode)
.toList();
if (patientLabOrdersClinic.length != 0) { if (patientLabOrdersClinic.length != 0) {
labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element);
.patientLabResultList
.add(element);
} else { } else {
labResultLists labResultLists.add(LabResultList(filterName: element.testCode!, lab: element));
.add(LabResultList(filterName: element.testCode!, lab: element));
} }
}); });
} }
getPatientLabOrdersResults( getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async {
{PatientLabOrders? patientLabOrder,
String? procedure,
PatiantInformtion? patient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabOrdersResults( await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure!, patient: patient!);
patientLabOrder: patientLabOrder,
procedure: procedure,
patient: patient);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -170,9 +117,7 @@ class LabsViewModel extends BaseViewModel {
bool isShouldClear = false; bool isShouldClear = false;
if (_labsService.labOrdersResultsList.length == 1) { if (_labsService.labOrdersResultsList.length == 1) {
labOrdersResultsList.forEach((element) { labOrdersResultsList.forEach((element) {
if (element.resultValue!.contains('/') || if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) isShouldClear = true;
element.resultValue!.contains('*') ||
element.resultValue!.isEmpty) isShouldClear = true;
}); });
} }
if (isShouldClear) _labsService.labOrdersResultsList.clear(); if (isShouldClear) _labsService.labOrdersResultsList.clear();
@ -180,15 +125,9 @@ class LabsViewModel extends BaseViewModel {
} }
} }
getPatientLabResultHistoryByDescription( getPatientLabResultHistoryByDescription({PatientLabOrders? patientLabOrder, String? procedureDescription, PatiantInformtion? patient}) async {
{PatientLabOrders? patientLabOrder,
String? procedureDescription,
PatiantInformtion? patient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabOrdersResultHistoryByDescription( await _labsService.getPatientLabOrdersResultHistoryByDescription(patientLabOrder: patientLabOrder, procedureDescription: procedureDescription, patient: patient!);
patientLabOrder: patientLabOrder,
procedureDescription: procedureDescription,
patient: patient);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -198,7 +137,7 @@ class LabsViewModel extends BaseViewModel {
} }
sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes}) async { sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes}) async {
await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder!);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
} else } else

@ -7,8 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import '../../locator.dart'; import '../../locator.dart';
class AdmissionRequestViewModel extends BaseViewModel { class AdmissionRequestViewModel extends BaseViewModel {
AdmissionRequestService _admissionRequestService = AdmissionRequestService _admissionRequestService = locator<AdmissionRequestService>();
locator<AdmissionRequestService>();
List<dynamic> get clinicList => _admissionRequestService.clinicList; List<dynamic> get clinicList => _admissionRequestService.clinicList;
@ -20,26 +19,21 @@ class AdmissionRequestViewModel extends BaseViewModel {
List<dynamic> get wardList => _admissionRequestService.wardList; List<dynamic> get wardList => _admissionRequestService.wardList;
List<dynamic> get roomCategoryList => List<dynamic> get roomCategoryList => _admissionRequestService.roomCategoryList;
_admissionRequestService.roomCategoryList;
List<dynamic> get admissionTypeList => List<dynamic> get admissionTypeList => _admissionRequestService.listOfAdmissionType;
_admissionRequestService.listOfAdmissionType;
List<dynamic> get diagnosisTypesList => List<dynamic> get diagnosisTypesList => _admissionRequestService.diagnosisTypesList;
_admissionRequestService.diagnosisTypesList;
List<dynamic> get allergiesList => List<dynamic> get allergiesList => _admissionRequestService.allergiesLookupList;
_admissionRequestService.allergiesLookupList;
List<dynamic> get dietTypesList => _admissionRequestService.dietTypesList; List<dynamic> get dietTypesList => _admissionRequestService.dietTypesList;
List<dynamic> get icdCodes => _admissionRequestService.icdCodes; List<dynamic> get icdCodes => _admissionRequestService.icdCodes;
List<dynamic> get listOfDiagnosisSelectionTypes => List<dynamic> get listOfDiagnosisSelectionTypes => _admissionRequestService.listOfDiagnosisSelectionTypes;
_admissionRequestService.listOfDiagnosisSelectionTypes;
AdmissionRequest? admissionRequestData; AdmissionRequest admissionRequestData = AdmissionRequest();
Future getSpecialityList() async { Future getSpecialityList() async {
await getMasterLookup(MasterKeysService.Speciality); await getMasterLookup(MasterKeysService.Speciality);

@ -4,23 +4,22 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/order-procedure.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart';
import 'package:doctor_app_flutter/core/model/procedure/order-procedure.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:flutter/material.dart';
import '../../locator.dart'; import '../../locator.dart';
class UcafViewModel extends BaseViewModel { class UcafViewModel extends BaseViewModel {
UcafService _ucafService = locator<UcafService>(); UcafService _ucafService = locator<UcafService>();
List<GetChiefComplaintResModel> get patientChiefComplaintList => _ucafService.patientChiefComplaintList; List<GetChiefComplaintResModel>? get patientChiefComplaintList => _ucafService.patientChiefComplaintList;
List<VitalSignHistory> get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory; List<VitalSignHistory>? get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory;
List<GetAssessmentResModel> get patientAssessmentList => _ucafService.patientAssessmentList; List<GetAssessmentResModel> get patientAssessmentList => _ucafService.patientAssessmentList;
@ -28,13 +27,13 @@ class UcafViewModel extends BaseViewModel {
List<MasterKeyModel> get diagnosisConditions => _ucafService.listOfDiagnosisCondition; List<MasterKeyModel> get diagnosisConditions => _ucafService.listOfDiagnosisCondition;
PrescriptionModel get prescriptionList => _ucafService.prescriptionList; PrescriptionModel? get prescriptionList => _ucafService.prescriptionList;
List<OrderProcedure> get orderProcedures => _ucafService.orderProcedureList; List<OrderProcedure>? get orderProcedures => _ucafService.orderProcedureList;
Function saveUCAFOnTap; late Function saveUCAFOnTap;
String selectedLanguage; String selectedLanguage = 'en';
String heightCm = "0"; String heightCm = "0";
String weightKg = "0"; String weightKg = "0";
String bodyMax = "0"; String bodyMax = "0";
@ -60,8 +59,8 @@ class UcafViewModel extends BaseViewModel {
Future getUCAFData(PatiantInformtion patient) async { Future getUCAFData(PatiantInformtion patient) async {
// setState(ViewState.Busy); // setState(ViewState.Busy);
String from; String? from;
String to; String? to;
if (from == null || from == "0") { if (from == null || from == "0") {
from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
} }
@ -77,7 +76,7 @@ class UcafViewModel extends BaseViewModel {
error = _ucafService.error; error = _ucafService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
patientVitalSignsHistory.forEach((element) { patientVitalSignsHistory!.forEach((element) {
if (heightCm == "0" || heightCm == null || heightCm == 'null') { if (heightCm == "0" || heightCm == null || heightCm == 'null') {
heightCm = element.heightCm.toString(); heightCm = element.heightCm.toString();
} }
@ -132,7 +131,7 @@ class UcafViewModel extends BaseViewModel {
} }
Future getOrderProcedures(PatiantInformtion patient) async { Future getOrderProcedures(PatiantInformtion patient) async {
if (orderProcedures.isEmpty) { if (orderProcedures!.isEmpty) {
// setState(ViewState.Busy); // setState(ViewState.Busy);
await _ucafService.getOrderProcedures(patient); await _ucafService.getOrderProcedures(patient);
if (_ucafService.hasError) { if (_ucafService.hasError) {
@ -157,7 +156,7 @@ class UcafViewModel extends BaseViewModel {
} }
} }
MasterKeyModel findMasterDataById({@required MasterKeysService masterKeys, dynamic id}) { MasterKeyModel findMasterDataById({required MasterKeysService masterKeys, dynamic id}) {
switch (masterKeys) { switch (masterKeys) {
case MasterKeysService.DiagnosisCondition: case MasterKeysService.DiagnosisCondition:
List<MasterKeyModel> result = diagnosisConditions.where((element) { List<MasterKeyModel> result = diagnosisConditions.where((element) {
@ -166,7 +165,7 @@ class UcafViewModel extends BaseViewModel {
if (result.isNotEmpty) { if (result.isNotEmpty) {
return result.first; return result.first;
} }
return null; return MasterKeyModel();
case MasterKeysService.DiagnosisType: case MasterKeysService.DiagnosisType:
List<MasterKeyModel> result = diagnosisTypes.where((element) { List<MasterKeyModel> result = diagnosisTypes.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService(); return element.id == id && element.typeId == masterKeys.getMasterKeyService();
@ -174,9 +173,9 @@ class UcafViewModel extends BaseViewModel {
if (result.isNotEmpty) { if (result.isNotEmpty) {
return result.first; return result.first;
} }
return null; return MasterKeyModel();
default: default:
return null; return MasterKeyModel();
} }
} }

@ -5,9 +5,10 @@ import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe;
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart';
@ -22,11 +23,9 @@ import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/p
import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
class ProcedureViewModel extends BaseViewModel { class ProcedureViewModel extends BaseViewModel {
@ -44,8 +43,8 @@ class ProcedureViewModel extends BaseViewModel {
List<dynamic> get categoryList => _procedureService.categoryList; List<dynamic> get categoryList => _procedureService.categoryList;
RadiologyService _radiologyService = locator<RadiologyService>(); RadiologyService _radiologyService = locator<RadiologyService>();
LabsService _labsService = locator<LabsService>(); LabsService _labsService = locator<LabsService>();
List<FinalRadiologyList> _finalRadiologyListClinic = List(); List<FinalRadiologyList> _finalRadiologyListClinic = [];
List<FinalRadiologyList> _finalRadiologyListHospital = List(); List<FinalRadiologyList> _finalRadiologyListHospital = [];
List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
@ -56,7 +55,7 @@ class ProcedureViewModel extends BaseViewModel {
List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList; List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList;
List<ProcedureTempleteDetailsModel> get procedureTemplate => _procedureService.templateList; List<ProcedureTempleteDetailsModel> get procedureTemplate => _procedureService.templateList;
List<ProcedureTempleteDetailsModelList> templateList = List(); List<ProcedureTempleteDetailsModelList> templateList = [];
List<ProcedureTempleteDetailsModel> get procedureTemplateDetails => _procedureService.templateDetailsList; List<ProcedureTempleteDetailsModel> get procedureTemplateDetails => _procedureService.templateDetailsList;
@ -64,7 +63,7 @@ class ProcedureViewModel extends BaseViewModel {
bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus; bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus;
Future getProcedure({int mrn, String patientType, int appointmentNo, bool isLocalBusy = false}) async { Future getProcedure({required int mrn, String? patientType, int? appointmentNo, bool isLocalBusy = false}) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
if (isLocalBusy) if (isLocalBusy)
@ -82,7 +81,7 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getProcedureCategory({String categoryName, String categoryID, patientId, bool isLocalBusy = false}) async { Future getProcedureCategory({String? categoryName, String? categoryID, patientId, bool isLocalBusy = false}) async {
if (categoryName == null) return; if (categoryName == null) return;
hasError = false; hasError = false;
if (isLocalBusy) if (isLocalBusy)
@ -109,7 +108,7 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async { Future getProcedureTemplate({String? categoryID, bool isLocalBusy = false, BuildContext? context}) async {
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
@ -140,7 +139,7 @@ class ProcedureViewModel extends BaseViewModel {
int tempId = 0; int tempId = 0;
Future getProcedureTemplateDetails({int templateId}) async { Future getProcedureTemplateDetails({required int templateId}) async {
tempId = templateId; tempId = templateId;
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
@ -185,7 +184,7 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn, bool isLocalBusy = false}) async { Future updateProcedure({required UpdateProcedureRequestModel updateProcedureRequestModel, int? mrn, bool isLocalBusy = false}) async {
hasError = false; hasError = false;
if (isLocalBusy) if (isLocalBusy)
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
@ -200,7 +199,7 @@ class ProcedureViewModel extends BaseViewModel {
//await getProcedure(mrn: mrn); //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); setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient);
_isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus; _isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus;
@ -240,7 +239,7 @@ class ProcedureViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url; String get radImageURL => _radiologyService.url;
getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { getRadImageURL({int? invoiceNo, int lineItem = 0, int projectId = 0, required PatiantInformtion patient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
@ -259,7 +258,7 @@ class ProcedureViewModel extends BaseViewModel {
List<LabResult> get labResultList => _labsService.labResultList; List<LabResult> get labResultList => _labsService.labResultList;
List<LabResultList> labResultLists = List(); List<LabResultList> labResultLists = [];
List<LabResultList> get labResultListsCoustom { List<LabResultList> get labResultListsCoustom {
return labResultLists; return labResultLists;
@ -276,7 +275,7 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async { getLaboratoryResult({required String projectID, required int clinicID, required String invoiceNo, required String orderNo, required PatiantInformtion patient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient); await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient);
if (_labsService.hasError) { if (_labsService.hasError) {
@ -287,7 +286,7 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, required String procedure, required PatiantInformtion patient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, patient: patient);
if (_labsService.hasError) { if (_labsService.hasError) {
@ -297,7 +296,7 @@ class ProcedureViewModel extends BaseViewModel {
bool isShouldClear = false; bool isShouldClear = false;
if (_labsService.labOrdersResultsList.length == 1) { if (_labsService.labOrdersResultsList.length == 1) {
labOrdersResultsList.forEach((element) { labOrdersResultsList.forEach((element) {
if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) isShouldClear = true; if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) isShouldClear = true;
}); });
} }
if (isShouldClear) _labsService.labOrdersResultsList.clear(); if (isShouldClear) _labsService.labOrdersResultsList.clear();
@ -305,7 +304,7 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { sendLabReportEmail({required PatientLabOrders patientLabOrder, required String mes}) async {
await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
@ -314,11 +313,11 @@ class ProcedureViewModel extends BaseViewModel {
} }
Future preparePostProcedure({ Future preparePostProcedure({
String remarks, String? remarks,
String orderType, String? orderType,
PatiantInformtion patient, required PatiantInformtion patient,
List<cpe.EntityList> entityList, List<cpe.EntityList>? entityList,
ProcedureType procedureType, ProcedureType? procedureType,
bool isLocalBusy = false, bool isLocalBusy = false,
}) async { }) async {
///TODO Roaa Move it to function ///TODO Roaa Move it to function
@ -333,15 +332,15 @@ class ProcedureViewModel extends BaseViewModel {
procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
List<Procedures> controlsProcedure = List(); List<Procedures> controlsProcedure = [];
postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN; postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) { entityList!.forEach((element) {
procedureValadteRequestModel.procedure = [element.procedureId]; procedureValadteRequestModel.procedure = [element.procedureId!];
List<Controls> controls = List(); List<Controls> controls = [];
controls.add( controls.add(
Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""),
); );
@ -354,12 +353,12 @@ class ProcedureViewModel extends BaseViewModel {
postProcedureReqModel.procedures = controlsProcedure; postProcedureReqModel.procedures = controlsProcedure;
await validationProcedure(procedureValadteRequestModel, isLocalBusy: isLocalBusy); await validationProcedure(procedureValadteRequestModel, isLocalBusy: isLocalBusy);
if (state == ViewState.Idle) { if (state == ViewState.Idle) {
if (valadteProcedureList[0].entityList.length == 0) { if (valadteProcedureList[0].entityList!.length == 0) {
await postProcedure(postProcedureReqModel, patient.patientMRN, isLocalBusy: isLocalBusy); await postProcedure(postProcedureReqModel, patient.patientMRN!, isLocalBusy: isLocalBusy);
if (state == ViewState.ErrorLocal) { if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error); Utils.showErrorToast(error);
getProcedure(mrn: patient.patientMRN, isLocalBusy: isLocalBusy); getProcedure(mrn: patient.patientMRN!, isLocalBusy: isLocalBusy);
} else if (state == ViewState.Idle) { } else if (state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added'); DrAppToastMsg.showSuccesToast('procedure has been added');
if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX); if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX);
@ -368,9 +367,9 @@ class ProcedureViewModel extends BaseViewModel {
} else { } else {
if (state == ViewState.ErrorLocal) { if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error); Utils.showErrorToast(error);
getProcedure(mrn: patient.patientMRN); getProcedure(mrn: patient.patientMRN!);
} else if (state == ViewState.Idle) { } else if (state == ViewState.Idle) {
Utils.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages); Utils.showErrorToast(valadteProcedureList[0].entityList![0].warringMessages);
} }
} }
} else { } else {
@ -400,7 +399,7 @@ class ProcedureViewModel extends BaseViewModel {
} else { } else {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
List<cpe.EntityList> entityList = List(); List<cpe.EntityList> entityList = [];
items.forEach((element) { items.forEach((element) {
entityList.add( entityList.add(
cpe.EntityList( cpe.EntityList(
@ -419,12 +418,12 @@ class ProcedureViewModel extends BaseViewModel {
} }
Future filterSearchResults(String query, List<cpe.EntityList> masterList, List<cpe.EntityList> items) async { Future filterSearchResults(String query, List<cpe.EntityList> masterList, List<cpe.EntityList> items) async {
List<cpe.EntityList> dummySearchList = List(); List<cpe.EntityList> dummySearchList = [];
dummySearchList.addAll(masterList); dummySearchList.addAll(masterList);
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<cpe.EntityList> dummyListData = List(); List<cpe.EntityList> dummyListData = [];
dummySearchList.forEach((item) { dummySearchList.forEach((item) {
if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item); dummyListData.add(item);
} }
}); });
@ -437,12 +436,12 @@ class ProcedureViewModel extends BaseViewModel {
} }
void filterProcedureSearchResults(String query, List<ProcedureTempleteModel> masterList, List<ProcedureTempleteModel> items) { void filterProcedureSearchResults(String query, List<ProcedureTempleteModel> masterList, List<ProcedureTempleteModel> items) {
List<ProcedureTempleteModel> dummySearchList = List(); List<ProcedureTempleteModel> dummySearchList = [];
if (masterList != null) dummySearchList.addAll(masterList); if (masterList != null) dummySearchList.addAll(masterList);
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<ProcedureTempleteModel> dummyListData = List(); List<ProcedureTempleteModel> dummyListData = [];
dummySearchList.forEach((item) { dummySearchList.forEach((item) {
if (item.templateName.toLowerCase().contains(query.toLowerCase())) { if (item.templateName!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item); dummyListData.add(item);
} }
}); });

@ -35,7 +35,7 @@ class ProjectViewModel with ChangeNotifier {
bool get isArabic => _isArabic; bool get isArabic => _isArabic;
late StreamSubscription subscription; late StreamSubscription subscription;
List<VidaPlusProjectListModel> _vidaPlusProjectListModel = List(); List<VidaPlusProjectListModel> _vidaPlusProjectListModel = [];
List<VidaPlusProjectListModel> get vidaPlusProjectList => _vidaPlusProjectListModel; List<VidaPlusProjectListModel> get vidaPlusProjectList => _vidaPlusProjectListModel;

@ -1,9 +1,8 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:flutter/foundation.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
@ -12,8 +11,8 @@ class RadiologyViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic; FilterType filterType = FilterType.Clinic;
RadiologyService _radiologyService = locator<RadiologyService>(); RadiologyService _radiologyService = locator<RadiologyService>();
List<FinalRadiologyList> _finalRadiologyListClinic = List(); List<FinalRadiologyList> _finalRadiologyListClinic = [];
List<FinalRadiologyList> _finalRadiologyListHospital = List(); List<FinalRadiologyList> _finalRadiologyListHospital = [];
List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
@ -53,7 +52,7 @@ class RadiologyViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url; String get radImageURL => _radiologyService.url;
getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient, String invoiceType}) async { getRadImageURL({required int invoiceNo, required int lineItem, required int projectId, required bool isVidaPlus, required PatiantInformtion patient, required String invoiceType}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, patient: patient, invoiceType: invoiceType); await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, patient: patient, invoiceType: invoiceType);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {

@ -1,26 +1,22 @@
import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.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:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../routes.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
Utils helpers = Utils(); Utils helpers = Utils();
@ -31,7 +27,7 @@ class ErSignInScreen extends StatefulWidget {
} }
class _ErSignInScreenState extends State<ErSignInScreen> { class _ErSignInScreenState extends State<ErSignInScreen> {
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
@ -45,7 +41,7 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
), ),
body: Center( body: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), margin: EdgeInsets.only(top: SizeConfig.realScreenHeight! / 7),
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: ListView( child: ListView(
@ -111,7 +107,7 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
} }
} }
signInERPatient({BuildContext context, ERSignInViewModel model, patientId, signInType}) async { signInERPatient({required BuildContext context, required ERSignInViewModel model, patientId, signInType}) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.signInERPatient(patientId: patientId, signInType: signInType); await model.signInERPatient(patientId: patientId, signInType: signInType);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
@ -126,9 +122,9 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
/// TODO Elham* Make this as custom Dialog /// TODO Elham* Make this as custom Dialog
showMyDialog({ showMyDialog({
BuildContext context, required BuildContext context,
Function firstAction, required Function firstAction,
Function secondAction, required Function secondAction,
}) { }) {
showDialog( showDialog(
context: context, context: context,

@ -4,8 +4,8 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.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/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/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-textfield-custom.dart';
@ -21,7 +21,7 @@ class LoginScreen extends StatefulWidget {
} }
class _LoginScreenState extends State<LoginScreen> { class _LoginScreenState extends State<LoginScreen> {
String platformImei; String? platformImei;
bool allowCallApi = true; bool allowCallApi = true;
//TODO change AppTextFormField to AppTextFormFieldCustom //TODO change AppTextFormField to AppTextFormFieldCustom
@ -32,8 +32,8 @@ class _LoginScreenState extends State<LoginScreen> {
List<GetHospitalsResponseModel> projectsList = []; List<GetHospitalsResponseModel> projectsList = [];
FocusNode focusPass = FocusNode(); FocusNode focusPass = FocusNode();
FocusNode focusProject = FocusNode(); FocusNode focusProject = FocusNode();
AuthenticationViewModel authenticationViewModel; late AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -74,11 +74,11 @@ class _LoginScreenState extends State<LoginScreen> {
), ),
Text( Text(
TranslationBase.of(context).drSulaimanAlHabib, TranslationBase.of(context).drSulaimanAlHabib,
style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029, fontFamily: 'Poppins'), style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth! * 0.029, fontFamily: 'Poppins'),
), ),
Text( Text(
"Doctor App", "Doctor App",
style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)), style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth! * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)),
), ),
]), ]),
], ],
@ -92,8 +92,8 @@ class _LoginScreenState extends State<LoginScreen> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Container( Container(
width: SizeConfig.realScreenWidth * 0.90, width: SizeConfig.realScreenWidth! * 0.90,
height: SizeConfig.realScreenHeight * 0.65, height: SizeConfig.realScreenHeight! * 0.65,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
buildSizedBox(), buildSizedBox(),
AppTextFieldCustom( AppTextFieldCustom(
@ -106,6 +106,7 @@ class _LoginScreenState extends State<LoginScreen> {
authenticationViewModel.userInfo.userID = value.trim(); authenticationViewModel.userInfo.userID = value.trim();
}); });
}, },
onFieldSubmitted: () {},
), ),
buildSizedBox(), buildSizedBox(),
AppTextFieldCustom( AppTextFieldCustom(
@ -126,6 +127,7 @@ class _LoginScreenState extends State<LoginScreen> {
// } // }
}, },
onClick: () {}, onClick: () {},
onFieldSubmitted: () {},
), ),
buildSizedBox(), buildSizedBox(),
AppTextFieldCustom( AppTextFieldCustom(
@ -137,6 +139,8 @@ class _LoginScreenState extends State<LoginScreen> {
onClick: () { onClick: () {
Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel); Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel);
}, },
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
buildSizedBox() buildSizedBox()
]), ]),
@ -187,8 +191,8 @@ class _LoginScreenState extends State<LoginScreen> {
login( login(
context, context,
) async { ) async {
if (loginFormKey.currentState.validate()) { if (loginFormKey.currentState!.validate()) {
loginFormKey.currentState.save(); loginFormKey.currentState!.save();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.login(authenticationViewModel.userInfo); await authenticationViewModel.login(authenticationViewModel.userInfo);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
@ -213,10 +217,10 @@ class _LoginScreenState extends State<LoginScreen> {
onSelectProject(index) { onSelectProject(index) {
setState(() { setState(() {
authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; authenticationViewModel.userInfo.projectID = projectsList[index].facilityId;
projectIdController.text = projectsList[index].facilityName; projectIdController.text = projectsList[index].facilityName!;
}); });
primaryFocus.unfocus(); primaryFocus!.unfocus();
} }
String memberID = ""; String memberID = "";
@ -231,7 +235,7 @@ class _LoginScreenState extends State<LoginScreen> {
setState(() { setState(() {
projectViewModel.setVidaPlusProjectList(authenticationViewModel.vidaPlusProjectList); projectViewModel.setVidaPlusProjectList(authenticationViewModel.vidaPlusProjectList);
authenticationViewModel.userInfo.projectID = projectsList[0].facilityId; authenticationViewModel.userInfo.projectID = projectsList[0].facilityId;
projectIdController.text = projectsList[0].facilityName; projectIdController.text = projectsList[0].facilityName!;
}); });
} }
} }

@ -39,12 +39,12 @@ class VerificationMethodsScreen extends StatefulWidget {
} }
class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> { class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
ProjectViewModel projectsProvider; late ProjectViewModel projectsProvider;
bool isMoreOption = false; bool isMoreOption = false;
bool onlySMSBox = false; bool onlySMSBox = false;
AuthMethodTypes fingerPrintBefore; AuthMethodTypes? fingerPrintBefore;
AuthMethodTypes selectedOption; AuthMethodTypes? selectedOption;
AuthenticationViewModel authenticationViewModel; late AuthenticationViewModel authenticationViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -63,7 +63,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4), height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 6 : 4),
), ),
if (authenticationViewModel.isFromLogin) if (authenticationViewModel.isFromLogin)
InkWell( InkWell(
@ -78,7 +78,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Column( Column(
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4), height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 3 : 4),
), ),
authenticationViewModel.user != null && isMoreOption == false authenticationViewModel.user != null && isMoreOption == false
? Column( ? Column(
@ -93,14 +93,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
letterSpacing: -0.72, letterSpacing: -0.72,
), ),
AppText( AppText(
Utils.convertToTitleCase(authenticationViewModel.user.doctorName), Utils.convertToTitleCase(authenticationViewModel.user.doctorName!),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6,
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing: -1.44, letterSpacing: -1.44,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * 4, height: SizeConfig.heightMultiplier! * 4,
), ),
AppText( AppText(
TranslationBase.of(context).accountInfo, TranslationBase.of(context).accountInfo,
@ -109,7 +109,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.64, letterSpacing: -0.64,
), ),
SizedBox(height: SizeConfig.heightMultiplier * 4), SizedBox(height: SizeConfig.heightMultiplier! * 4),
Container( Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -124,7 +124,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
width: SizeConfig.realScreenWidth * .5, width: SizeConfig.realScreenWidth! * .5,
padding: EdgeInsets.all(0), padding: EdgeInsets.all(0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -172,9 +172,9 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
children: [ children: [
AppText( AppText(
authenticationViewModel.user.editedOn != null authenticationViewModel.user.editedOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn), isMonthShort: true) ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn!), isMonthShort: true)
: authenticationViewModel.user.createdOn != null : authenticationViewModel.user.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn), isMonthShort: true) ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn!), isMonthShort: true)
: '--', : '--',
textAlign: TextAlign.right, textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
@ -184,9 +184,9 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
), ),
AppText( AppText(
authenticationViewModel.user.editedOn != null authenticationViewModel.user.editedOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn)) ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn!))
: authenticationViewModel.user.createdOn != null : authenticationViewModel.user.createdOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn)) ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn!))
: '--', : '--',
textAlign: TextAlign.right, textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
@ -201,7 +201,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
), ),
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * 3, height: SizeConfig.heightMultiplier! * 3,
), ),
Row( Row(
children: [ children: [
@ -216,7 +216,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
], ],
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * 2, height: SizeConfig.heightMultiplier! * 2,
), ),
], ],
) )
@ -250,7 +250,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
}, },
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel, authenticationViewModel: authenticationViewModel,
authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID), authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID!),
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
)), )),
), ),
@ -351,7 +351,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.showMyDialog(context); 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) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(authenticationViewModel.error); Utils.showErrorToast(authenticationViewModel.error);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -375,7 +375,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Utils.showErrorToast(authenticationViewModel.error); Utils.showErrorToast(authenticationViewModel.error);
} else { } else {
await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!);
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType, isSilentLogin: true); this.startSMSService(authMethodType, isSilentLogin: true);
@ -407,7 +407,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
default: default:
break; break;
} }
sharedPref.setInt(OTP_TYPE, selectedOption.getTypeIdService()); sharedPref.setInt(OTP_TYPE, selectedOption!.getTypeIdService());
} }
sendActivationCode(AuthMethodTypes authMethodType) async { sendActivationCode(AuthMethodTypes authMethodType) async {
@ -418,7 +418,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
startSMSService(AuthMethodTypes type, {isSilentLogin: false}) { startSMSService(AuthMethodTypes type, {isSilentLogin = false}) {
new SMSOTP( new SMSOTP(
context, context,
type, type,
@ -443,8 +443,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
await authenticationViewModel.showIOSAuthMessages(); await authenticationViewModel.showIOSAuthMessages();
if (!mounted) return; if (!mounted) return;
if (authenticationViewModel.user != null && if (authenticationViewModel.user != null &&
(SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.Fingerprint || (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID!) == AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) { SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID!) == AuthMethodTypes.FaceID)) {
this.sendActivationCode(authMethodTypes); this.sendActivationCode(authMethodTypes);
} else { } else {
setState(() { setState(() {
@ -454,7 +454,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
checkActivationCode({String value, bool isSilentLogin = false}) async { checkActivationCode({String? value, bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value, isSilentLogin: isSilentLogin); await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value, isSilentLogin: isSilentLogin);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context); Navigator.pop(context);

@ -1,20 +1,19 @@
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:flutter_datetime_picker_plus/flutter_datetime_picker_plus.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../../core/viewModel/project_view_model.dart'; import '../../core/viewModel/project_view_model.dart';
import '../../core/viewModel/schedule_view_model.dart'; import '../../core/viewModel/schedule_view_model.dart';
import '../../icons_app/doctor_app_icons.dart'; import '../../icons_app/doctor_app_icons.dart';
import '../../utils/date-utils.dart'; import '../../utils/date-utils.dart';
import '../../utils/dr_app_toast_msg.dart';
import '../../utils/translations_delegate_base_utils.dart'; import '../../utils/translations_delegate_base_utils.dart';
import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart';
import '../../widgets/shared/errors/error_message.dart'; import '../../widgets/shared/errors/error_message.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
import '../patients/register_patient/CustomEditableText.dart';
class DoctorSchedulePage extends StatefulWidget { class DoctorSchedulePage extends StatefulWidget {
@override @override
@ -22,19 +21,21 @@ class DoctorSchedulePage extends StatefulWidget {
} }
class _DoctorSchedulePageState extends State<DoctorSchedulePage> { class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
DashboardService service; late DashboardService service;
PageController _pageController = PageController(); PageController _pageController = PageController();
double currentPage = 0; double currentPage = 0;
int selectedindex = 0; int selectedindex = 0;
List weeks = []; List weeks = [];
// List<DoctorScheduleResponse> doctorScheduleResponse = []; // List<DoctorScheduleResponse> doctorScheduleResponse = [];
int weekMS = 604800 * 1000; int weekMS = 604800 * 1000;
// DoctorList? doctorList; // DoctorList? doctorList;
List<String> freeSlots = []; List<String> freeSlots = [];
bool isPageChange = false; bool isPageChange = false;
String fromDate = DateFormat('yyyy-MM-dd').format(DateTime.now()); String fromDate = DateFormat('yyyy-MM-dd').format(DateTime.now());
String toDate = String toDate = DateFormat('yyyy-MM-dd').format(DateTime.now().add(Duration(days: 30)));
DateFormat('yyyy-MM-dd').format(DateTime.now().add(Duration(days: 30)));
// AppSharedPreferences sharedPref = AppSharedPreferences(); // AppSharedPreferences sharedPref = AppSharedPreferences();
@override @override
@ -75,196 +76,100 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
Text( Text(
TranslationBase.of(context).dateFrom + TranslationBase.of(context).dateFrom +
" " + " " +
DateFormat("dd-MMM").format( DateFormat("dd-MMM").format(DateFormat('yyyy-MM-dd').parse(fromDate)) +
DateFormat('yyyy-MM-dd')
.parse(fromDate)) +
" " + " " +
TranslationBase.of(context).to + TranslationBase.of(context).to +
" " + " " +
DateFormat("dd-MMM").format( DateFormat("dd-MMM").format(DateFormat('yyyy-MM-dd').parse(toDate)),
DateFormat('yyyy-MM-dd')
.parse(toDate)),
style: TextStyle(fontWeight: FontWeight.w600), style: TextStyle(fontWeight: FontWeight.w600),
), ),
Row( Row(
children: [ children: [
IconButton( IconButton(
onPressed: () { onPressed: () {
model.getDoctorRota(
model.getDoctorRota(fromDate, toDate,); fromDate,
toDate,
);
}, },
icon: SvgPicture.asset( icon: SvgPicture.asset('assets/images/svgs/prev.svg', height: 25, width: 10)),
'assets/images/svgs/prev.svg', IconButton(onPressed: () {}, icon: SvgPicture.asset('assets/images/svgs/next.svg', height: 25, width: 10))
height: 25,
width: 10)),
IconButton(
onPressed: () {},
icon: SvgPicture.asset(
'assets/images/svgs/next.svg',
height: 25,
width: 10))
], ],
), ),
], ],
)), )),
], ],
), ),
model.getDoctorRotation.length ==0 ? Center( model.getDoctorRotation.length == 0
child: ErrorMessage( ? Center(
error: TranslationBase.of(context).noDataAvailable, child: ErrorMessage(
)) : error: TranslationBase.of(context).noDataAvailable,
Container( ))
margin: EdgeInsets.only(top: 45), : Container(
child: PageView.builder( margin: EdgeInsets.only(top: 45),
controller: _pageController, child: PageView.builder(
itemCount: model.getDoctorRotation.length, controller: _pageController,
onPageChanged: (index) { itemCount: model.getDoctorRotation.length,
setState(() { onPageChanged: (index) {
isPageChange = true; setState(() {
this.currentPage = index.toDouble(); isPageChange = true;
}); this.currentPage = index.toDouble();
}, });
itemBuilder: (context, index) { },
return Container( itemBuilder: (context, index) {
child: ListView.builder( return Container(
itemCount: model.getDoctorRotation[index] child: ListView.builder(
.scheduleforuser.length, itemCount: model.getDoctorRotation[index].scheduleforuser!.length,
itemBuilder: (context, index2) => InkWell( itemBuilder: (context, index2) => InkWell(
onTap: () { onTap: () {
// final weekDay = weeks[index][index2]['DayName']; // final weekDay = weeks[index][index2]['DayName'];
}, },
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: Padding( child: Padding(
padding: padding: projectViewModel.isArabic ? EdgeInsets.only(right: 17) : EdgeInsets.only(left: 17),
projectViewModel.isArabic child: Row(children: [
? EdgeInsets.only( Column(
right: 17) children: [
: EdgeInsets.only( Text(DateFormat('EEEE').format(model.getDoctorRotation[index].scheduleforuser![index2].days!)
left: 17),
child: Row(children: [
Column(
children: [
Text(DateFormat('EEEE')
.format(model
.getDoctorRotation[
index]
.scheduleforuser[
index2]
.days)
// fontSize: 13, // fontSize: 13,
// fontWeight: projectViewModel.isArabic ? FontWeight.w600 : FontWeight.w500, // fontWeight: projectViewModel.isArabic ? FontWeight.w600 : FontWeight.w500,
), ),
Text(getDayMonths(model Text(getDayMonths(model.getDoctorRotation[index].scheduleforuser![index2].days))
.getDoctorRotation[
index]
.scheduleforuser[
index2]
.days))
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
// fontSize: 18, // fontSize: 18,
], ],
) )
])), ])),
), ),
Expanded( Expanded(
flex: 3, flex: 3,
child: ClipRRect( child: ClipRRect(
borderRadius: borderRadius: const BorderRadius.all(Radius.circular(20.0)),
const BorderRadius.all( child: Container(
Radius.circular( padding: EdgeInsets.only(left: 10, right: 10, top: 15, bottom: 20),
20.0)), margin: EdgeInsets.only(left: 20, right: 20, top: 7, bottom: 7),
child: Container( decoration: BoxDecoration(boxShadow: [
padding: EdgeInsets.only( model.getDoctorRotation[index].scheduleforuser![index2].days.toString().substring(0, 10) == DateTime.now().toString().substring(0, 10)
left: 10, ? BoxShadow(color: Colors.green, offset: Offset(projectViewModel.isArabic ? 5 : -5, 0))
right: 10,
top: 15,
bottom: 20),
margin: EdgeInsets.only(
left: 20,
right: 20,
top: 7,
bottom: 7),
decoration: BoxDecoration(
boxShadow: [
model
.getDoctorRotation[
index]
.scheduleforuser[
index2]
.days
.toString()
.substring(
0,
10) ==
DateTime.now()
.toString()
.substring(
0, 10)
? BoxShadow(
color: Colors
.green,
offset: Offset(
projectViewModel.isArabic
? 5
: -5,
0))
: BoxShadow( : BoxShadow(
color: Colors color: Colors.grey[100]!,
.grey[ blurRadius: 5,
100], spreadRadius: 4,
blurRadius: offset: Offset(0, 10),
5,
spreadRadius:
4,
offset:
Offset(
0,
10),
), ),
], ], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white),
borderRadius: child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
const BorderRadius.all( model.getDoctorRotation[index].scheduleforuser![index2].days.toString().substring(0, 10) == DateTime.now().toString().substring(0, 10)
Radius.circular( ? Text(TranslationBase.of(context).today,
10.0)), style: TextStyle(
color: Colors.white), color: Colors.green,
child: Column( fontWeight: FontWeight.w600,
crossAxisAlignment: fontSize: 12,
CrossAxisAlignment
.start,
children: [
model
.getDoctorRotation[
index]
.scheduleforuser[
index2]
.days
.toString()
.substring(
0,
10) ==
DateTime.now()
.toString()
.substring(
0,
10)
? Text(
TranslationBase.of(
context)
.today,
style:
TextStyle(
color: Colors
.green,
fontWeight:
FontWeight
.w600,
fontSize:
12,
)) ))
: SizedBox(), : SizedBox(),
// : SizedBox(), // : SizedBox(),
@ -272,15 +177,9 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
model model.getDoctorRotation[index].clinicname!,
.getDoctorRotation[ style: TextStyle(
index] fontWeight: FontWeight.w600,
.clinicname,
style:
TextStyle(
fontWeight:
FontWeight
.w600,
), ),
), ),
), ),
@ -289,30 +188,21 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
), ),
Container( Container(
height: 45, height: 45,
child: ListView child: ListView.builder(
.builder( itemCount: model.getDoctorRotation[index].scheduleforuser![index2].shiftforuser!.length,
itemCount: model itemBuilder: (context, index3) => Row(children: [
.getDoctorRotation[ Text(model.getDoctorRotation[index].scheduleforuser![index2].shiftforuser![index3].fromtime.toString()),
index] Text(" To "),
.scheduleforuser[ Text(model.getDoctorRotation[index].scheduleforuser![index2].shiftforuser![index3].totime.toString())
index2] ])))
.shiftforuser
.length,
itemBuilder: (context,
index3) =>
Row(children: [
Text(model.getDoctorRotation[index].scheduleforuser[index2].shiftforuser[index3].fromtime.toString()),
Text(" To "),
Text(model.getDoctorRotation[index].scheduleforuser[index2].shiftforuser[index3].totime.toString())
])))
// ],) // ],)
]))), ]))),
), ),
], ],
)))); ))));
}, },
)), )),
// PageViewIndicator( // PageViewIndicator(
// isActive: true, // isActive: true,
// currentPage: this.currentPage, // currentPage: this.currentPage,
@ -328,138 +218,109 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return StatefulBuilder( return StatefulBuilder(builder: (context, setState) {
builder:(context, setState) { return AlertDialog(
return title: Column(
AlertDialog( crossAxisAlignment: CrossAxisAlignment.start,
title: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ TranslationBase.of(context).search,
Text( style: TextStyle(fontSize: 22),
TranslationBase.of(context).search, ),
style: TextStyle(fontSize: 22), Text(
), TranslationBase.of(context).searchFindSchedule,
Text( style: TextStyle(fontSize: 16),
TranslationBase.of(context).searchFindSchedule, )
style: TextStyle(fontSize: 16), ],
) ),
], content: Container(
), height: 150,
content: Container( child: Column(children: [
height: 150, InkWell(
child: Column(children: [ onTap: () {
InkWell( DatePicker.showDatePicker(
onTap: () { context,
DatePicker.showDatePicker( showTitleActions: true,
context, minTime: DateTime(DateTime.now().year - 1, 1, 1),
showTitleActions: true, maxTime: DateTime.now().add(Duration(days: 365)),
minTime: DateTime(DateTime.now().year - 1, 1, 1), onConfirm: (date) {
maxTime: DateTime.now().add(Duration(days:365)), setState(() {
onConfirm: (date) { fromDate = DateFormat('yyyy-MM-dd').format(date);
setState(() { });
fromDate = DateFormat('yyyy-MM-dd').format(date); },
}); );
}, },
); child: Container(
}, padding: EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5),
child: Container( width: double.infinity,
padding: height: 55,
EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5), decoration: BoxDecoration(
width: double.infinity, borderRadius: BorderRadius.circular(12), color: Colors.white, boxShadow: [BoxShadow(blurRadius: .26, spreadRadius: 1 * 1.5, color: Colors.black.withOpacity(.05))]),
height: 55, child: Column(
decoration: BoxDecoration( crossAxisAlignment: CrossAxisAlignment.start,
borderRadius: BorderRadius.circular(12), children: [
color: Colors.white, Text(
boxShadow: [ TranslationBase.of(context).dateFrom,
BoxShadow( style: TextStyle(fontSize: 12),
blurRadius: .26, ),
spreadRadius: 1 * 1.5, Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [Text(fromDate), Icon(Icons.calendar_month_outlined)])
color: Colors.black.withOpacity(.05)) ],
]), ))),
child: Column( SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, height: 20,
children: [ ),
Text( InkWell(
TranslationBase.of(context).dateFrom, onTap: () {
style: TextStyle(fontSize: 12), DatePicker.showDatePicker(
), context,
Row( showTitleActions: true,
mainAxisAlignment: MainAxisAlignment.spaceBetween, minTime: DateTime(DateTime.now().year - 1, 1, 1),
children: [ maxTime: DateTime.now().add(Duration(days: 365)),
Text(fromDate), onConfirm: (date) {
Icon(Icons.calendar_month_outlined) setState(() {
]) toDate = DateFormat('yyyy-MM-dd').format(date);
], });
))), },
SizedBox(height: 20,), );
InkWell( },
onTap: () { child: Container(
DatePicker.showDatePicker( padding: EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5),
context, width: double.infinity,
showTitleActions: true, height: 55,
minTime: DateTime(DateTime.now().year - 1, 1, 1), decoration: BoxDecoration(
maxTime: DateTime.now().add(Duration(days:365)), borderRadius: BorderRadius.circular(12), color: Colors.white, boxShadow: [BoxShadow(blurRadius: .26, spreadRadius: 1 * 1.5, color: Colors.black.withOpacity(.05))]),
onConfirm: (date) { child: Column(
setState(() { crossAxisAlignment: CrossAxisAlignment.start,
toDate = DateFormat('yyyy-MM-dd').format(date); children: [
}); Text(
}, TranslationBase.of(context).toDate,
); style: TextStyle(fontSize: 12),
}, ),
child: Container( Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [Text(toDate), Icon(Icons.calendar_month_outlined)])
padding: ],
EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5), )))
width: double.infinity, ]),
height: 55, ),
decoration: BoxDecoration( actions: [
borderRadius: BorderRadius.circular(12), AppButton(
color: Colors.white, title: TranslationBase.of(context).search,
boxShadow: [ onPressed: () {
BoxShadow( setState(() {
blurRadius: .26, model.getDoctorRota(fromDate, toDate);
spreadRadius: 1 * 1.5, Navigator.pop(context);
color: Colors.black.withOpacity(.05)) });
]), },
child: Column( )
crossAxisAlignment: CrossAxisAlignment.start, ],
children: [ );
Text( ;
TranslationBase.of(context).toDate, });
style: TextStyle(fontSize: 12),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(toDate),
Icon(Icons.calendar_month_outlined)
])
],
)))
]),
),
actions: [
AppButton(
title:TranslationBase.of(context).search,
onPressed: () {
setState((){
model.getDoctorRota(fromDate, toDate);
Navigator.pop(context);
});
},
)
],
);
;
}
);
}, },
); );
} }
String getDayMonths(DateTime dateTime) { String getDayMonths(DateTime? dateTime) {
String dateFormat = String dateFormat = '${dateTime!.day} ${AppDateUtils.getMonth(dateTime.month).toString().substring(0, 3)}';
'${dateTime.day} ${AppDateUtils.getMonth(dateTime.month).toString().substring(0, 3)}';
return dateFormat; return dateFormat;
} }
} }

@ -2,14 +2,14 @@ import 'dart:async';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart'; import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart';
import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/video_channel_utils.dart'; import 'package:doctor_app_flutter/utils/video_channel_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -19,7 +19,7 @@ class VideoCallPage extends StatefulWidget {
final listContext; final listContext;
final LiveCarePatientViewModel model; final LiveCarePatientViewModel model;
VideoCallPage({this.patientData, this.listContext, this.model}); VideoCallPage({required this.patientData, this.listContext, required this.model});
@override @override
_VideoCallPageState createState() => _VideoCallPageState(); _VideoCallPageState createState() => _VideoCallPageState();
@ -28,10 +28,10 @@ class VideoCallPage extends StatefulWidget {
DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
class _VideoCallPageState extends State<VideoCallPage> { class _VideoCallPageState extends State<VideoCallPage> {
Timer _timmerInstance; late Timer _timmerInstance;
int _start = 0; int _start = 0;
String _timmer = ''; String _timmer = '';
LiveCareViewModel _liveCareProvider; late LiveCareViewModel _liveCareProvider;
bool _isInit = true; bool _isInit = true;
var _tokenData; var _tokenData;
bool isTransfer = false; bool isTransfer = false;
@ -68,9 +68,9 @@ class _VideoCallPageState extends State<VideoCallPage> {
kSessionId: tokenData.openSessionID, kSessionId: tokenData.openSessionID,
//'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg',
kApiKey: '46209962', kApiKey: '46209962',
vcId: widget.patientData.vcId, vcId: widget.patientData.vcId!,
isRecording: tokenData != null ? tokenData.isRecording : false, isRecording: tokenData != null ? tokenData.isRecording! : false,
patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", patientName: widget.patientData.fullName!.isNotEmpty && widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-",
tokenID: token, tokenID: token,
//"hfkjshdf347r8743", //"hfkjshdf347r8743",
generalId: "Cs2020@2016\$2958", generalId: "Cs2020@2016\$2958",
@ -136,7 +136,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
height: MediaQuery.of(context).size.height * 0.02, height: MediaQuery.of(context).size.height * 0.02,
), ),
Text( Text(
widget.patientData.fullName, widget.patientData.fullName!,
style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, fontSize: 20), style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, fontSize: 20),
), ),
SizedBox( SizedBox(

@ -16,52 +16,52 @@ import 'package:provider/provider.dart';
import '../../widgets/shared/errors/error_message.dart'; import '../../widgets/shared/errors/error_message.dart';
class MedicalFileDetails extends StatefulWidget { class MedicalFileDetails extends StatefulWidget {
String age; String? age;
String firstName; String? firstName;
String lastName; String? lastName;
String gender; String? gender;
int encounterNumber; int? encounterNumber;
int pp; int? pp;
PatiantInformtion patient; PatiantInformtion? patient;
String clinicName; String? clinicName;
String episode; String? episode;
String doctorName; String? doctorName;
String vistDate; String? vistDate;
String doctorImage; String? doctorImage;
MedicalFileDetails( MedicalFileDetails(
{this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage}); {this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage});
@override @override
_MedicalFileDetailsState createState() => _MedicalFileDetailsState( _MedicalFileDetailsState createState() => _MedicalFileDetailsState(
firstName: firstName, firstName: firstName!,
age: age, age: age!,
lastName: lastName, lastName: lastName!,
gender: gender, gender: gender!,
encounterNumber: encounterNumber, encounterNumber: encounterNumber!,
pp: pp, pp: pp!,
patient: patient, patient: patient!,
clinicName: clinicName, clinicName: clinicName!,
doctorName: doctorName, doctorName: doctorName!,
episode: episode, episode: episode!,
vistDate: vistDate, vistDate: vistDate!,
doctorImage: doctorImage, doctorImage: doctorImage!,
); );
} }
class _MedicalFileDetailsState extends State<MedicalFileDetails> { class _MedicalFileDetailsState extends State<MedicalFileDetails> {
int encounterNumber; int? encounterNumber;
String age; String? age;
String firstName; String? firstName;
String lastName; String? lastName;
String gender; String? gender;
int pp; int? pp;
PatiantInformtion patient; PatiantInformtion? patient;
String clinicName; String? clinicName;
String episode; String? episode;
String doctorName; String? doctorName;
String vistDate; String? vistDate;
String doctorImage; String? doctorImage;
_MedicalFileDetailsState( _MedicalFileDetailsState(
{this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage}); {this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage});
@ -77,20 +77,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
return BaseView<MedicalFileViewModel>( return BaseView<MedicalFileViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.medicalFileList.length == 0) { if (model.medicalFileList.length == 0) {
model.getMedicalFile(mrn: pp); model.getMedicalFile(mrn: pp!);
} }
}, },
builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold(
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient!,
doctorName: doctorName, doctorName: doctorName!,
profileUrl: doctorImage, profileUrl: doctorImage!,
clinic: clinicName, clinic: clinicName!,
isPrescriptions: true, isPrescriptions: true,
isMedicalFile: true, isMedicalFile: true,
episode: episode, episode: episode!,
visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
vistDate, vistDate!,
), isArabic: projectViewModel.isArabic)}', ), isArabic: projectViewModel.isArabic)}',
isAppointmentHeader: true, isAppointmentHeader: true,
), ),
@ -103,14 +103,14 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0 model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0
? Padding( ? Padding(
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
SizedBox(height: 25.0), SizedBox(height: 25.0),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10), margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -120,7 +120,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), 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( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -147,7 +147,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint.length, itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint!.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
@ -159,7 +159,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint[index].hOPI model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint![index].hOPI!
.trim(), .trim(),
), ),
), ),
@ -182,7 +182,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10), margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -192,7 +192,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), 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( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -219,7 +219,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments.length, itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments!.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
@ -234,7 +234,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
fontSize: 13.0, fontSize: 13.0,
), ),
AppText( AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].iCD10.trim(), model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].iCD10!
.trim(),
fontSize: 13.5, fontSize: 13.5,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -249,7 +250,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].condition model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index]
.condition!
.trim(), .trim(),
fontSize: 13.0, fontSize: 13.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -261,7 +263,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].description, model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index]
.description!,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15.0, fontSize: 15.0,
), ),
@ -276,7 +279,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].type, model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].type!,
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -287,7 +290,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 15.0, height: 15.0,
), ),
AppText( AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].remarks.trim(), model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].remarks!
.trim(),
), ),
Divider( Divider(
height: 1, height: 1,
@ -310,7 +314,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10), margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -320,7 +324,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), 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( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -347,7 +351,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure.length, itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure!.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
@ -363,7 +367,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
'Procedure ID: ', 'Procedure ID: ',
), ),
AppText( AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procedureId model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index]
.procedureId!
.trim(), .trim(),
fontSize: 13.5, fontSize: 13.5,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -378,7 +383,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
), ),
AppText( AppText(
AppDateUtils.getDateFormatted(DateTime.parse( AppDateUtils.getDateFormatted(DateTime.parse(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].orderDate model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index]
.orderDate!
.trim(), .trim(),
)), )),
fontSize: 13.5, fontSize: 13.5,
@ -395,7 +401,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procName, model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].procName!,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
) )
@ -407,7 +413,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
'CPT Code : ', 'CPT Code : ',
), ),
AppText( AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].patientID model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].patientID
.toString(), .toString(),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -437,7 +443,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10), margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -447,7 +453,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), 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( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -474,7 +480,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam.length, itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam!.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
@ -485,7 +491,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText(TranslationBase.of(context).examType + ": "), AppText(TranslationBase.of(context).examType + ": "),
AppText( AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc, model
.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
], ],
@ -493,7 +500,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc, model
.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
) )
], ],
@ -502,7 +510,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText(TranslationBase.of(context).abnormal + ": "), AppText(TranslationBase.of(context).abnormal + ": "),
AppText( AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].abnormal, model
.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].abnormal!,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
], ],
@ -511,7 +520,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 15.0, height: 15.0,
), ),
AppText( AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].remarks, model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].remarks!,
), ),
Divider( Divider(
height: 1, height: 1,

@ -1,4 +1,5 @@
import 'dart:math'; import 'dart:math';
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
@ -6,11 +7,11 @@ import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -25,10 +26,10 @@ import 'package:speech_to_text/speech_to_text.dart';
DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg { class MedicineSearchScreen extends StatefulWidget implements DrAppToastMsg {
MedicineSearchScreen({this.changeLoadingState}); MedicineSearchScreen({this.changeLoadingState});
final Function changeLoadingState; final Function? changeLoadingState;
@override @override
_MedicineSearchState createState() => _MedicineSearchState(); _MedicineSearchState createState() => _MedicineSearchState();
@ -42,27 +43,22 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
String _currentLocaleId = ""; String _currentLocaleId = "";
final SpeechToText speech = SpeechToText(); final SpeechToText speech = SpeechToText();
String lastStatus = ''; String lastStatus = '';
GlobalKey key = GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
String lastError; String? lastError;
double level = 0.0; double level = 0.0;
double minSoundLevel = 50000; double minSoundLevel = 50000;
double maxSoundLevel = -50000; double maxSoundLevel = -50000;
String recognizedWord; String recognizedWord = '';
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
} }
Future<void> initSpeechState() async { Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize( bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
onError: errorListener, onStatus: statusListener); _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; if (!mounted) return;
setState(() { setState(() {
@ -70,54 +66,51 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
}); });
} }
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<MedicineViewModel>(onModelReady: (model) async { return BaseView<MedicineViewModel>(
}, builder: (_, model, w) { onModelReady: (model) async {},
// myController.text = model.searchText; builder: (_, model, w) {
return AppScaffold( // myController.text = model.searchText;
// baseViewModel: model, return AppScaffold(
isShowAppBar: true, // baseViewModel: model,
appBar: BottomSheetTitle( isShowAppBar: true,
title: TranslationBase.of(context).searchMedicine, appBar: BottomSheetTitle(
), title: TranslationBase.of(context).searchMedicine,
body: SingleChildScrollView( ),
child: Column( body: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFieldCustomSearch( AppTextFieldCustomSearch(
hintText: hintText: TranslationBase.of(context).searchMedicineNameHere,
TranslationBase.of(context).searchMedicineNameHere,
searchController: myController, searchController: myController,
onFieldSubmitted: (value) { onFieldSubmitted: (value) {
searchMedicine(context, model); searchMedicine(context, model);
}, },
marginTop: 5, marginTop: 5,
onChangeFun: (String val) {},
), ),
Container( Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: AppText( child: AppText(
TranslationBase.of(context).youCanFind + TranslationBase.of(context).youCanFind +
(myController.text != '' (myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') +
? model.pharmacyItemsList.length.toString()
: '0') +
" " + " " +
TranslationBase.of(context).medicineSearchResult +" '${myController.text}'", TranslationBase.of(context).medicineSearchResult +
" '${myController.text}'",
fontHeight: 1.4, fontHeight: 1.4,
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -134,33 +127,23 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
if (myController.text != '') if (myController.text != '')
Container( Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0),
height: MediaQuery.of(context).size.height * 0.6, height: MediaQuery.of(context).size.height * 0.6,
child: ListView.builder( child: ListView.builder(
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(top: 20),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: model.pharmacyItemsList == null itemCount: model.pharmacyItemsList == null ? 0 : model.pharmacyItemsList.length,
? 0
: model.pharmacyItemsList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return InkWell( return InkWell(
child: MedicineItemWidget( child: MedicineItemWidget(
label: model.pharmacyItemsList[index] label: model.pharmacyItemsList[index]["ItemDescription"],
["ItemDescription"], url: model.pharmacyItemsList[index]["ImageSRCUrl"],
url: model.pharmacyItemsList[index]
["ImageSRCUrl"],
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => PharmaciesListScreen( builder: (context) => PharmaciesListScreen(itemID: model.pharmacyItemsList[index]["ItemID"], url: model.pharmacyItemsList[index]["ImageSRCUrl"]),
itemID: model.pharmacyItemsList[index] settings: RouteSettings(name: 'PharmaciesListScreen'),
["ItemID"],
url: model.pharmacyItemsList[index]
["ImageSRCUrl"]),
settings: RouteSettings(
name: 'PharmaciesListScreen'),
), ),
); );
}, },
@ -170,45 +153,44 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
), ),
], ],
)), )),
bottomSheet: Container( bottomSheet: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(0.0), Radius.circular(0.0),
), ),
border: Border.all(color: HexColor('#707070'), width: 0), border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
), ),
Container( height: MediaQuery.of(context).size.height * 0.1,
child: FractionallySizedBox( width: double.infinity,
widthFactor: .80, child: Column(
child: Center( children: [
child: AppButton( SizedBox(
fontWeight: FontWeight.w700, height: 10,
title: TranslationBase.of(context).search, ),
onPressed: () async { Container(
await searchMedicine(context, model); child: FractionallySizedBox(
}, widthFactor: .80,
color: AppGlobal.appRedColor, child: Center(
child: AppButton(
fontWeight: FontWeight.w700,
title: TranslationBase.of(context).search,
onPressed: () async {
await searchMedicine(context, model);
},
color: AppGlobal.appRedColor,
),
),
), ),
), ),
), SizedBox(
), height: 5,
SizedBox( ),
height: 5, ],
), ),
], ),
), );
), });
);
});
} }
searchMedicine(context, MedicineViewModel model) async { searchMedicine(context, MedicineViewModel model) async {
@ -247,8 +229,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
recognizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
lastStatus = ''; lastStatus = '';
myController.text = recognizedWord; myController.text = recognizedWord;
Future.delayed(const Duration(seconds: 2), () { Future.delayed(const Duration(seconds: 2), () {});
});
}); });
} }
@ -265,7 +246,6 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
}); });
} }
void soundLevelListener(double level) { void soundLevelListener(double level) {
minSoundLevel = min(minSoundLevel, level); minSoundLevel = min(minSoundLevel, level);
maxSoundLevel = max(maxSoundLevel, level); maxSoundLevel = max(maxSoundLevel, level);

@ -3,12 +3,11 @@ import 'package:doctor_app_flutter/core/viewModel/DischargedPatientViewModel.dar
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../routes.dart'; import '../../routes.dart';
@ -29,7 +28,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
//appBarTitle: 'Discharged Patient', //appBarTitle: 'Discharged Patient',
//subtitle: "Last Three Months", //subtitle: "Last Three Months",
backgroundColor: Colors.grey[200], backgroundColor: Colors.grey[200]!,
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: model.myDischargedPatient.isEmpty body: model.myDischargedPatient.isEmpty
@ -59,7 +58,9 @@ class _DischargedPatientState extends State<DischargedPatient> {
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20,
onPressed: () {},
), ),
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -115,11 +116,11 @@ class _DischargedPatientState extends State<DischargedPatient> {
children: [ children: [
AppText( AppText(
model.filterData[index].nationalityName != null model.filterData[index].nationalityName != null
? model.filterData[index].nationalityName.trim() ? model.filterData[index].nationalityName!.trim()
: model.filterData[index].nationality != null : model.filterData[index].nationality != null
? model.filterData[index].nationality.trim() ? model.filterData[index].nationality!.trim()
: model.filterData[index].nationalityId != null : model.filterData[index].nationalityId != null
? model.filterData[index].nationalityId ? model.filterData[index].nationalityId!
: "", : "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
@ -129,10 +130,10 @@ class _DischargedPatientState extends State<DischargedPatient> {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL : '', model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL! : '',
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return AppText( return AppText(
'', '',
fontSize: 10, fontSize: 10,
@ -172,7 +173,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( 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: <TextSpan>[ children: <TextSpan>[
new TextSpan(text: TranslationBase.of(context).fileNumber, style: TextStyle(fontSize: 14, fontFamily: 'Poppins')), new TextSpan(text: TranslationBase.of(context).fileNumber, style: TextStyle(fontSize: 14, fontFamily: 'Poppins')),
new TextSpan( new TextSpan(
@ -186,7 +187,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier!,
color: Colors.black, color: Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
@ -207,7 +208,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier!,
color: Colors.black, color: Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
@ -230,7 +231,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
), ),
AppText( 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, fontSize: 15,
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
], ],

@ -1,8 +1,8 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.dart'; 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/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
@ -10,7 +10,6 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@ -18,7 +17,7 @@ import 'package:url_launcher/url_launcher.dart';
class ECGPage extends StatelessWidget { class ECGPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { 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']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patient-type']; String patientType = routeArgs['patient-type'];
String arrivalType = routeArgs['arrival-type']; String arrivalType = routeArgs['arrival-type'];
@ -57,7 +56,7 @@ class ECGPage extends StatelessWidget {
model.patientMuseResultsModelList.length, model.patientMuseResultsModelList.length,
(index) => InkWell( (index) => InkWell(
onTap: () async { onTap: () async {
Uri ecgImageURL = Uri.parse(model.patientMuseResultsModelList[index].imageURL); Uri ecgImageURL = Uri.parse(model.patientMuseResultsModelList[index].imageURL!);
await canLaunchUrl(ecgImageURL).then((value) async { await canLaunchUrl(ecgImageURL).then((value) async {
await launchUrl(ecgImageURL); await launchUrl(ecgImageURL);
}).catchError((err) { }).catchError((err) {
@ -92,7 +91,7 @@ class ECGPage extends StatelessWidget {
SizedBox(height: 3), SizedBox(height: 3),
RichText( RichText(
text: TextSpan( text: TextSpan(
style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier!, color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan(text: TranslationBase.of(context).orderNo, style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), new TextSpan(text: TranslationBase.of(context).orderNo, style: TextStyle(fontSize: 12, fontFamily: 'Poppins')),
new TextSpan( new TextSpan(
@ -109,15 +108,15 @@ class ECGPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime, isArabic: projectViewModel.isArabic)}', '${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime!, isArabic: projectViewModel.isArabic)}',
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
AppText( AppText(
'${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}', '${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime!)}',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.grey[700], color: Colors.grey[700]!,
fontSize: 14, fontSize: 14,
), ),
], ],

@ -30,13 +30,13 @@ class OutPatientsScreen extends StatefulWidget {
final isAppbar; final isAppbar;
final arrivalType; final arrivalType;
final isView; final isView;
final PatientType selectedPatientType; final PatientType? selectedPatientType;
final PatientSearchRequestModel patientSearchRequestModel; final PatientSearchRequestModel? patientSearchRequestModel;
final bool isSearchWithKeyInfo; final bool isSearchWithKeyInfo;
final bool isSearch; final bool isSearch;
final bool isInpatient; final bool isInpatient;
final bool isSearchAndOut; final bool isSearchAndOut;
final String searchKey; final String? searchKey;
OutPatientsScreen( OutPatientsScreen(
{this.patientSearchForm, {this.patientSearchForm,
@ -57,21 +57,21 @@ class OutPatientsScreen extends StatefulWidget {
} }
class _OutPatientsScreenState extends State<OutPatientsScreen> { class _OutPatientsScreenState extends State<OutPatientsScreen> {
int clinicId; int? clinicId;
AuthenticationViewModel authenticationViewModel; late AuthenticationViewModel authenticationViewModel;
List<String> _times = []; List<String> _times = [];
int _activeLocation = 1; int _activeLocation = 1;
String patientType; String? patientType;
String patientTypeTitle; String? patientTypeTitle;
var selectedFilter = 1; var selectedFilter = 1;
String arrivalType; String arrivalType = '';
ProjectViewModel projectsProvider; late ProjectViewModel projectsProvider;
var isView; var isView;
final _controller = TextEditingController(); final _controller = TextEditingController();
PatientModel patient; PatientModel patient = PatientModel();
OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today;
bool isSortDes = true; bool isSortDes = true;
@ -89,7 +89,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getOutPatient(widget.patientSearchRequestModel); await model.getOutPatient(widget.patientSearchRequestModel!);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
appBarTitle: "Search Patient", appBarTitle: "Search Patient",
@ -196,6 +196,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
isSortDes = !isSortDes; isSortDes = !isSortDes;
}, },
), ),
onFieldSubmitted: () {},
), ),
Expanded( Expanded(
child: Container( child: Container(
@ -215,7 +216,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0), padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0),
child: PatientCard( child: PatientCard(
patientInfo: model.filterData[index], patientInfo: model.filterData[index],
patientType: patientType, patientType: patientType!,
arrivalType: arrivalType, arrivalType: arrivalType,
isFromSearch: widget.isSearchAndOut, isFromSearch: widget.isSearchAndOut,
isInpatient: widget.isInpatient, isInpatient: widget.isInpatient,
@ -224,8 +225,8 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filterData[index], "patient": model.filterData[index],
"patientType": "1", "patientType": "1",
"from": widget.patientSearchRequestModel.from, "from": widget.patientSearchRequestModel!.from,
"to": widget.patientSearchRequestModel.from, "to": widget.patientSearchRequestModel!.from,
"isSearch": false, "isSearch": false,
"isInpatient": false, "isInpatient": false,
"arrivalType": "7", "arrivalType": "7",

@ -15,7 +15,6 @@ import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class UcafDetailScreen extends StatefulWidget { class UcafDetailScreen extends StatefulWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final UcafViewModel model; final UcafViewModel model;
@ -24,8 +23,7 @@ class UcafDetailScreen extends StatefulWidget {
UcafDetailScreen(this.patient, this.model, {this.changeLoadingState}); UcafDetailScreen(this.patient, this.model, {this.changeLoadingState});
@override @override
_UcafDetailScreenState createState() => _UcafDetailScreenState createState() => _UcafDetailScreenState(this.patient, this.model);
_UcafDetailScreenState(this.patient, this.model);
} }
class _UcafDetailScreenState extends State<UcafDetailScreen> { class _UcafDetailScreenState extends State<UcafDetailScreen> {
@ -45,8 +43,7 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
await ucafModel.postUCAF(patient); await ucafModel.postUCAF(patient);
widget.changeLoadingState!(false); widget.changeLoadingState!(false);
if (ucafModel.state == ViewState.Idle) { if (ucafModel.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(TranslationBase.of(context).postUcafSuccessMsg);
TranslationBase.of(context).postUcafSuccessMsg);
Navigator.of(context).popUntil((route) { Navigator.of(context).popUntil((route) {
return route.settings.name == PATIENTS_PROFILE; return route.settings.name == PATIENTS_PROFILE;
}); });
@ -80,18 +77,15 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
treatmentStepsBar( treatmentStepsBar(context, model, screenSize, patient),
context, model, screenSize, patient),
Container( Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
vertical: 16, horizontal: 16),
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: 16, height: 16,
), ),
...getSelectedTreatmentStepItem( ...getSelectedTreatmentStepItem(context, model),
context, model),
], ],
), ),
), ),
@ -105,9 +99,8 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
)); ));
} }
Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, Size screenSize, PatiantInformtion patient) {
Size screenSize, PatiantInformtion patient) { ProjectViewModel projectViewModel = Provider.of(context);
ProjectViewModel projectViewModel= Provider.of(context);
List<String> __treatmentSteps = [ List<String> __treatmentSteps = [
TranslationBase.of(context).diagnosis, TranslationBase.of(context).diagnosis,
TranslationBase.of(context).medications, TranslationBase.of(context).medications,
@ -126,10 +119,13 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
child: Center( child: Center(
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TabUtils.getBoxTabsBoxDecoration(projectViewModel: projectViewModel, isActive:_isActive, isFirst:__treatmentSteps.indexOf(item) == 0, isLast: __treatmentSteps.indexOf(item) == 2, isMiddle: __treatmentSteps.indexOf(item) == 1 ), decoration: TabUtils.getBoxTabsBoxDecoration(
child: Center( projectViewModel: projectViewModel,
child: TabUtils.getTabText(title: item, isActive: _isActive) isActive: _isActive,
)), isFirst: __treatmentSteps.indexOf(item) == 0,
isLast: __treatmentSteps.indexOf(item) == 2,
isMiddle: __treatmentSteps.indexOf(item) == 1),
child: Center(child: TabUtils.getTabText(title: item, isActive: _isActive))),
), ),
onTap: () async { onTap: () async {
print(__treatmentSteps.indexOf(item)); print(__treatmentSteps.indexOf(item));
@ -158,8 +154,7 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
); );
} }
List<Widget> getSelectedTreatmentStepItem( List<Widget> getSelectedTreatmentStepItem(BuildContext _context, UcafViewModel model) {
BuildContext _context, UcafViewModel model) {
switch (_activeTap) { switch (_activeTap) {
case 0: case 0:
if (model.patientAssessmentList != null) { if (model.patientAssessmentList != null) {
@ -170,8 +165,7 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
physics: ScrollPhysics(), physics: ScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return DiagnosisWidget( return DiagnosisWidget(model, model.patientAssessmentList[index]);
model, model.patientAssessmentList[index]);
}) })
]; ];
} else { } else {
@ -181,36 +175,33 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
} }
break; break;
case 1: case 1:
if (model.prescriptionList != null && model.prescriptionList.entityList != null && model.prescriptionList.entityList!.isNotEmpty) { if (model.prescriptionList != null && model.prescriptionList!.entityList != null && model.prescriptionList!.entityList!.isNotEmpty) {
return [ return [
ListView.builder( ListView.builder(
itemCount: model.prescriptionList != null itemCount: model.prescriptionList != null ? model.prescriptionList!.entityList!.length : 0,
? model.prescriptionList.entityList!.length scrollDirection: Axis.vertical,
: 0, physics: ScrollPhysics(),
scrollDirection: Axis.vertical, shrinkWrap: true,
physics: ScrollPhysics(), itemBuilder: (context, index) {
shrinkWrap: true, return MedicationWidget(model, model.prescriptionList!.entityList![index]);
itemBuilder: (context, index) { })
return MedicationWidget( ];
model, model.prescriptionList.entityList![index]); } else {
})
];} else {
return [ return [
ErrorMessage(error: TranslationBase.of(context).noItem), ErrorMessage(error: TranslationBase.of(context).noItem),
]; ];
} }
break; break;
case 2: case 2:
if (model.orderProcedures != null && model.orderProcedures.isNotEmpty) { if (model.orderProcedures != null && model.orderProcedures!.isNotEmpty) {
return [ return [
ListView.builder( ListView.builder(
itemCount: model.orderProcedures.length, itemCount: model.orderProcedures!.length,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
physics: ScrollPhysics(), physics: ScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ProceduresWidget(model, model.orderProcedures[index]); return ProceduresWidget(model, model.orderProcedures![index]);
}) })
]; ];
} else { } else {
@ -226,4 +217,3 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
} }
} }
} }

@ -66,7 +66,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: model.patientVitalSignsHistory != null && model.patientVitalSignsHistory.length > 0 && model.patientChiefComplaintList != null && model.patientChiefComplaintList.length > 0 body: model.patientVitalSignsHistory != null && model.patientVitalSignsHistory!.length > 0 && model.patientChiefComplaintList != null && model.patientChiefComplaintList!.length > 0
? Column( ? Column(
children: [ children: [
Expanded( Expanded(
@ -168,7 +168,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).instruction, hintText: TranslationBase.of(context).instruction,
dropDownText: Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint! + '\n'), dropDownText: Utils.parseHtmlString(model.patientChiefComplaintList![0].chiefComplaint! + '\n'),
controller: _additionalComplaintsController, controller: _additionalComplaintsController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
enabled: false, enabled: false,
@ -192,7 +192,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
: model.patientChiefComplaintList != null || model.patientVitalSignsHistory != null : model.patientChiefComplaintList != null || model.patientVitalSignsHistory != null
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
error: model.patientVitalSignsHistory == null || model.patientVitalSignsHistory.length == 0 error: model.patientVitalSignsHistory == null || model.patientVitalSignsHistory!.length == 0
? TranslationBase.of(context).vitalSignEmptyMsg ? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context).chiefComplaintEmptyMsg)) : TranslationBase.of(context).chiefComplaintEmptyMsg))
: Container(), : Container(),

@ -1,11 +1,11 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -19,9 +19,9 @@ import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dar
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.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-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
class AdmissionRequestFirstScreen extends StatefulWidget { class AdmissionRequestFirstScreen extends StatefulWidget {
@ -42,16 +42,16 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
bool _isSickLeaveRequired = false; bool _isSickLeaveRequired = false;
bool _patientPregnant = false; bool _patientPregnant = false;
String clinicError; String? clinicError = '';
String doctorError; String? doctorError = '';
String sickLeaveCommentError; String? sickLeaveCommentError = '';
String dietTypeError; String? dietTypeError = '';
String medicalHistoryError; String? medicalHistoryError = '';
String surgicalHistoryError; String? surgicalHistoryError = '';
@override @override
Widget build(BuildContext context) { 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']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
@ -99,7 +99,7 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
child: AppText( child: AppText(
Utils.convertToTitleCase(TranslationBase.of(context).specialityAndDoctorDetail), Utils.convertToTitleCase(TranslationBase.of(context).specialityAndDoctorDetail),
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
@ -140,6 +140,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -176,6 +178,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
} }
} }
: null, : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 16, height: 16,
@ -185,7 +189,7 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
child: AppText( child: AppText(
TranslationBase.of(context).patientDetails, TranslationBase.of(context).patientDetails,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
@ -195,13 +199,13 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
TranslationBase.of(context).patientPregnant, TranslationBase.of(context).patientPregnant,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier! * 2.0,
), ),
value: _patientPregnant, value: _patientPregnant,
activeColor: HexColor("#D02127"), activeColor: HexColor("#D02127"),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
_patientPregnant = newValue; _patientPregnant = newValue!;
}); });
}, },
controlAffinity: ListTileControlAffinity.leading, controlAffinity: ListTileControlAffinity.leading,
@ -212,13 +216,13 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
TranslationBase.of(context).isSickLeaveRequired, TranslationBase.of(context).isSickLeaveRequired,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier! * 2.0,
), ),
value: _isSickLeaveRequired, value: _isSickLeaveRequired,
activeColor: HexColor("#D02127"), activeColor: HexColor("#D02127"),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
_isSickLeaveRequired = newValue; _isSickLeaveRequired = newValue!;
}); });
}, },
controlAffinity: ListTileControlAffinity.leading, controlAffinity: ListTileControlAffinity.leading,
@ -234,6 +238,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
maxLines: 4, maxLines: 4,
validationError: sickLeaveCommentError, validationError: sickLeaveCommentError,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -268,6 +274,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -278,6 +286,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -289,6 +299,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
maxLines: 6, maxLines: 6,
validationError: medicalHistoryError, validationError: medicalHistoryError,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -300,6 +312,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
maxLines: 4, maxLines: 4,
validationError: surgicalHistoryError, validationError: surgicalHistoryError,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 100, height: 100,

@ -459,7 +459,7 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
model.admissionRequestData!.expectedDays = int.parse(_expectedDaysController.text); model.admissionRequestData!.expectedDays = int.parse(_expectedDaysController.text);
model.admissionRequestData!.admissionDate = _expectedAdmissionDate!.toIso8601String(); model.admissionRequestData!.admissionDate = _expectedAdmissionDate!.toIso8601String();
model.admissionRequestData!.otherDepartmentInterventions = _otherDepartmentsInterventionsController.text; model.admissionRequestData.otherDepartmentinterventions = _otherDepartmentsInterventionsController.text;
model.admissionRequestData!.admissionLocationID = _selectedFloor['floorID']; model.admissionRequestData!.admissionLocationID = _selectedFloor['floorID'];
model.admissionRequestData!.wardID = _selectedWard != null ? _selectedWard['nursingStationID'] : 0; model.admissionRequestData!.wardID = _selectedWard != null ? _selectedWard['nursingStationID'] : 0;
model.admissionRequestData!.roomCategoryID = _selectedRoomCategory['categoryID']; model.admissionRequestData!.roomCategoryID = _selectedRoomCategory['categoryID'];

@ -5,15 +5,15 @@ import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class LineChartForDiabetic extends StatelessWidget { class LineChartForDiabetic extends StatelessWidget {
final String title; final String? title;
final List<TimeSeriesSales2> timeSeries1; final List<TimeSeriesSales2>? timeSeries1;
final int indexes; final int? indexes;
final bool isOX; final bool isOX;
LineChartForDiabetic({this.title, this.timeSeries1, this.indexes, this.isOX = false}); LineChartForDiabetic({this.title, this.timeSeries1, this.indexes, this.isOX = false});
List<int> xAxixs = List(); List<int> xAxixs = [];
List<double> yAxixs = List(); List<double> yAxixs = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -37,8 +37,8 @@ class LineChartForDiabetic extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
title, title!,
fontSize: SizeConfig.textMultiplier * 2.1, fontSize: SizeConfig.textMultiplier! * 2.1,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -54,7 +54,7 @@ class LineChartForDiabetic extends StatelessWidget {
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( child: LineChart(
sampleData1(context), sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250), duration: const Duration(milliseconds: 250),
), ),
), ),
), ),
@ -68,9 +68,9 @@ class LineChartForDiabetic extends StatelessWidget {
} }
getXaxix() { getXaxix() {
for (int index = 0; index < timeSeries1.length; index++) { for (int index = 0; index < timeSeries1!.length; index++) {
int mIndex = indexes * index; int mIndex = indexes! * index;
if (mIndex < timeSeries1.length) { if (mIndex < timeSeries1!.length) {
xAxixs.add(mIndex); xAxixs.add(mIndex);
} }
} }
@ -82,45 +82,80 @@ class LineChartForDiabetic extends StatelessWidget {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
//touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (FlTouchEvent event, LineTouchResponse? touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (context, value) { getTitlesWidget: (value, meta) {
return TextStyle( if (timeSeries1!.length < 15) {
color: Colors.black, if (timeSeries1!.length > value.toInt()) {
fontSize: 10, return Text(
); '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
}, style: TextStyle(
rotateAngle: -65, color: Colors.black,
//rotateAngle:-65, fontSize: 10,
interval: 100, ),
margin: 22, );
getTitles: (value) {
if (timeSeries1.length < 15) {
if (timeSeries1.length > value.toInt()) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
} else } else
return ''; return Text("");
} else { } else {
if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; if (value.toInt() == 0)
if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; return Text(
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (value.toInt() == timeSeries1!.length - 1)
return Text(
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (xAxixs.contains(value.toInt())) { if (xAxixs.contains(value.toInt())) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; return Text(
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} }
} }
return ''; return Text(
"",
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
}, },
), // rotateAngle: -65,
leftTitles: SideTitles( //rotateAngle:-65,
interval: 100,
reservedSize: 22,
// getTitles: (value) {
//
// },
)),
leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (context, value) { // getTextStyles:
return TextStyle( getTitlesWidget: (val, MetaVal) {
color: Colors.black, return Text(
fontSize: 10, "",
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
); );
}, },
interval: getMaxY() - getMinY() <= 500 interval: getMaxY() - getMinY() <= 500
@ -128,8 +163,8 @@ class LineChartForDiabetic extends StatelessWidget {
: getMaxY() - getMinY() <= 1000 : getMaxY() - getMinY() <= 1000
? 100 ? 100
: 200, : 200,
margin: 12, reservedSize: 12,
), )),
), ),
borderData: FlBorderData( borderData: FlBorderData(
show: true, show: true,
@ -150,7 +185,7 @@ class LineChartForDiabetic extends StatelessWidget {
), ),
), ),
minX: 0, minX: 0,
maxX: (timeSeries1.length - 1).toDouble(), maxX: (timeSeries1!.length - 1).toDouble(),
maxY: getMaxY() + 0.3, maxY: getMaxY() + 0.3,
minY: getMinY(), minY: getMinY(),
lineBarsData: getData(context), lineBarsData: getData(context),
@ -159,8 +194,8 @@ class LineChartForDiabetic extends StatelessWidget {
double getMaxY() { double getMaxY() {
double max = 0; double max = 0;
timeSeries1.forEach((element) { timeSeries1!.forEach((element) {
double resultValueDouble = element.sales; double resultValueDouble = element.sales!;
if (resultValueDouble > max) max = resultValueDouble; if (resultValueDouble > max) max = resultValueDouble;
}); });
// timeSeries2.forEach((element) { // timeSeries2.forEach((element) {
@ -172,9 +207,9 @@ class LineChartForDiabetic extends StatelessWidget {
} }
double getMinY() { double getMinY() {
double min = timeSeries1[0].sales; double min = timeSeries1![0].sales!;
timeSeries1.forEach((element) { timeSeries1!.forEach((element) {
double resultValueDouble = element.sales; double resultValueDouble = element.sales!;
if (resultValueDouble < min) min = resultValueDouble; if (resultValueDouble < min) min = resultValueDouble;
}); });
// timeSeries2.forEach((element) { // timeSeries2.forEach((element) {
@ -188,12 +223,12 @@ class LineChartForDiabetic extends StatelessWidget {
} }
List<LineChartBarData> getData(context) { List<LineChartBarData> getData(context) {
List<FlSpot> spots = List(); List<FlSpot> spots = [];
for (int index = 0; index < timeSeries1.length; index++) { for (int index = 0; index < timeSeries1!.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); spots.add(FlSpot(index.toDouble(), timeSeries1![index].sales!));
} }
List<FlSpot> spots2 = List(); List<FlSpot> spots2 = [];
// for (int index = 0; index < timeSeries2.length; index++) { // for (int index = 0; index < timeSeries2.length; index++) {
// spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); // spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales));
// } // }
@ -201,7 +236,7 @@ class LineChartForDiabetic extends StatelessWidget {
final LineChartBarData lineChartBarData1 = LineChartBarData( final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots, spots: spots,
isCurved: true, isCurved: true,
colors: [Colors.red], color: Colors.red,
barWidth: 5, barWidth: 5,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData( dotData: FlDotData(
@ -214,7 +249,7 @@ class LineChartForDiabetic extends StatelessWidget {
final LineChartBarData lineChartBarData2 = LineChartBarData( final LineChartBarData lineChartBarData2 = LineChartBarData(
spots: spots2, spots: spots2,
isCurved: true, isCurved: true,
colors: [Colors.red], color: Colors.red,
barWidth: 5, barWidth: 5,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData( dotData: FlDotData(
@ -225,7 +260,7 @@ class LineChartForDiabetic extends StatelessWidget {
), ),
); );
List<LineChartBarData> lineChartData = List(); List<LineChartBarData> lineChartData = [];
if (spots.isNotEmpty) { if (spots.isNotEmpty) {
lineChartData.add(lineChartBarData1); lineChartData.add(lineChartBarData1);
} }

@ -9,22 +9,20 @@ class LineChartCurvedLabHistory extends StatefulWidget {
final String title; final String title;
final List<LabResultHistory> labResultHistory; final List<LabResultHistory> labResultHistory;
LineChartCurvedLabHistory({this.title, this.labResultHistory}); LineChartCurvedLabHistory({required this.title, required this.labResultHistory});
@override @override
State<StatefulWidget> createState() => LineChartCurvedLabHistoryState(); State<StatefulWidget> createState() => LineChartCurvedLabHistoryState();
} }
class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> { class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
bool isShowingMainData; List<int> xAxixs = [];
List<int> xAxixs = List();
int indexes = 0; int indexes = 0;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
getXaxix(); getXaxix();
isShowingMainData = true;
} }
getXaxix() { getXaxix() {
@ -56,7 +54,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
), ),
AppText( AppText(
widget.title, widget.title,
fontSize: SizeConfig.textMultiplier * 2.1, fontSize: SizeConfig.textMultiplier! * 2.1,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -69,7 +67,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
padding: const EdgeInsets.only(right: 16.0, left: 8.0), padding: const EdgeInsets.only(right: 16.0, left: 8.0),
child: LineChart( child: LineChart(
sampleData1(), sampleData1(),
swapAnimationDuration: const Duration(milliseconds: 250), duration: const Duration(milliseconds: 250),
), ),
), ),
), ),
@ -90,53 +88,73 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
// touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (event, touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (context, value) { reservedSize: 28,
return TextStyle( // rotateAngle: -65,
color: Colors.black, getTitlesWidget: (value, meta) {
fontSize: 10, DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime!);
);
},
margin: 28,
rotateAngle: -65,
getTitles: (value) {
print(value);
DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime);
if (widget.labResultHistory.length < 8) { if (widget.labResultHistory.length < 8) {
if (widget.labResultHistory.length > value.toInt()) { if (widget.labResultHistory.length > value.toInt()) {
return '${date.day}/ ${date.year}'; return Text(
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} else } else
return ''; return Text("");
} else { } else {
if (value.toInt() == 0) return '${date.day}/ ${date.year}'; if (value.toInt() == 0)
if (value.toInt() == widget.labResultHistory.length - 1) return '${date.day}/ ${date.year}'; return Text(
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (value.toInt() == widget.labResultHistory.length - 1)
return Text(
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (xAxixs.contains(value.toInt())) { if (xAxixs.contains(value.toInt())) {
return '${date.day}/ ${date.year}'; return Text(
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} }
} }
return ''; return Text("");
}, },
), )),
leftTitles: SideTitles( leftTitles: AxisTitles(
showTitles: true, sideTitles: SideTitles(
getTextStyles: (context, value) { showTitles: true,
return TextStyle( getTitlesWidget: (value, meta) {
color: Colors.black, return Text('${value.toInt()}',
fontSize: 10, style: TextStyle(
); color: Colors.black,
}, fontSize: 10,
getTitles: (value) { ));
return '${value.toInt()}'; },
}, reservedSize: 8,
margin: 8, //reservedSize: 30,
//reservedSize: 30, ),
), ),
), ),
borderData: FlBorderData( borderData: FlBorderData(
@ -169,7 +187,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
double max = 0; double max = 0;
widget.labResultHistory.forEach((element) { widget.labResultHistory.forEach((element) {
try { try {
double resultValueDouble = double.parse(element.resultValue); double resultValueDouble = double.parse(element.resultValue!);
if (resultValueDouble > max) max = resultValueDouble; if (resultValueDouble > max) max = resultValueDouble;
} catch (e) { } catch (e) {
print(e); print(e);
@ -182,10 +200,10 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
double getMinY() { double getMinY() {
double min = 0; double min = 0;
try { try {
min = double.parse(widget.labResultHistory[0].resultValue); min = double.parse(widget.labResultHistory[0].resultValue!);
widget.labResultHistory.forEach((element) { widget.labResultHistory.forEach((element) {
double resultValueDouble = double.parse(element.resultValue); double resultValueDouble = double.parse(element.resultValue!);
if (resultValueDouble < min) min = resultValueDouble; if (resultValueDouble < min) min = resultValueDouble;
}); });
} catch (e) { } catch (e) {
@ -197,10 +215,10 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
} }
List<LineChartBarData> getData() { List<LineChartBarData> getData() {
List<FlSpot> spots = List(); List<FlSpot> spots = [];
for (int index = 0; index < widget.labResultHistory.length; index++) { for (int index = 0; index < widget.labResultHistory.length; index++) {
try { try {
var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue); var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue!);
spots.add(FlSpot(index.toDouble(), resultValueDouble)); spots.add(FlSpot(index.toDouble(), resultValueDouble));
} catch (e) { } catch (e) {
print(e); print(e);
@ -211,7 +229,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
final LineChartBarData lineChartBarData1 = LineChartBarData( final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots, spots: spots,
isCurved: true, isCurved: true,
colors: [Colors.red], color: Colors.red,
barWidth: 3, barWidth: 3,
isStrokeCapRound: true, isStrokeCapRound: true,
curveSmoothness: 0.12, curveSmoothness: 0.12,

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; 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/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -16,13 +16,7 @@ class LaboratoryResultPage extends StatefulWidget {
final String arrivalType; final String arrivalType;
final bool isInpatient; final bool isInpatient;
LaboratoryResultPage( LaboratoryResultPage({Key? key, required this.patientLabOrders, required this.patient, required this.patientType, required this.arrivalType, required this.isInpatient});
{Key? key,
required this.patientLabOrders,
required this.patient,
required this.patientType,
required this.arrivalType,
required this.isInpatient});
@override @override
_LaboratoryResultPageState createState() => _LaboratoryResultPageState(); _LaboratoryResultPageState createState() => _LaboratoryResultPageState();
@ -32,10 +26,7 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabResult( onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: true),
patientLabOrder: widget.patientLabOrders,
patient: widget.patient,
isInpatient: true),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
@ -49,17 +40,14 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: LaboratoryResultWidget( child: LaboratoryResultWidget(
onTap: () async {}, onTap: () async {},
billNo: widget.patientLabOrders.invoiceNo!, billNo: widget.patientLabOrders.invoiceNo!,
details: model.patientLabSpecialResult.length > 0 details: model.patientLabSpecialResult.length > 0 ? model.patientLabSpecialResult[0].resultDataHTML! : "",
? model.patientLabSpecialResult[0].resultDataHTML! orderNo: widget.patientLabOrders.orderNo!,
: "", patientLabOrder: widget.patientLabOrders,
orderNo: widget.patientLabOrders.orderNo!, patient: widget.patient,
patientLabOrder: widget.patientLabOrders, isInpatient: widget.patientType == "1",
patient: widget.patient, invoiceType: widget.patientLabOrders.invoiceType!),
isInpatient: widget.patientType == "1",
invoiceType:widget.patientLabOrders.invoiceType
),
), ),
), ),
), ),

@ -1,41 +1,30 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result/lab_result_widget.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result/lab_result_widget.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_html/flutter_html.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class LaboratoryResultWidget extends StatefulWidget { class LaboratoryResultWidget extends StatefulWidget {
final GestureTapCallback onTap; final GestureTapCallback? onTap;
final String billNo; final String? billNo;
final String details; final String? details;
final String orderNo; final String? orderNo;
final PatientLabOrders patientLabOrder; final PatientLabOrders? patientLabOrder;
final PatiantInformtion patient; final PatiantInformtion? patient;
final bool isInpatient; final bool? isInpatient;
final String invoiceType; final String? invoiceType;
const LaboratoryResultWidget(
{Key key, const LaboratoryResultWidget({Key? key, this.onTap, this.billNo, this.details, this.orderNo, this.patientLabOrder, this.patient, this.isInpatient, this.invoiceType}) : super(key: key);
this.onTap,
this.billNo,
this.details,
this.orderNo,
this.patientLabOrder,
this.patient,
this.isInpatient,
this.invoiceType
})
: super(key: key);
@override @override
_LaboratoryResultWidgetState createState() => _LaboratoryResultWidgetState(); _LaboratoryResultWidgetState createState() => _LaboratoryResultWidgetState();
@ -44,7 +33,7 @@ class LaboratoryResultWidget extends StatefulWidget {
class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> { class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
bool _isShowMoreGeneral = true; bool _isShowMoreGeneral = true;
bool _isShowMore = true; bool _isShowMore = true;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -93,22 +82,17 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 0, right: 0),
left: 0, right: 0),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).generalResult,
.generalResult, fontSize: SizeConfig.textMultiplier! * 2.3,
fontSize:
SizeConfig.textMultiplier * 2.3,
bold: false, bold: false,
))), ))),
Container( Container(
width: 25, width: 25,
height: 25, height: 25,
child: Icon( child: Icon(
_isShowMoreGeneral _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.grey[800], color: Colors.grey[800],
size: 22, size: 22,
), ),
@ -142,16 +126,11 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return LabResultWidget( return LabResultWidget(
patientLabOrder: patientLabOrder: widget.patientLabOrder!,
widget.patientLabOrder, filterName: model.labResultLists[index].filterName,
filterName: model patientLabResultList: model.labResultLists[index].patientLabResultList,
.labResultLists[index] patient: widget.patient!,
.filterName, isInpatient: widget.isInpatient!,
patientLabResultList: model
.labResultLists[index]
.patientLabResultList,
patient: widget.patient,
isInpatient: widget.isInpatient,
); );
}), }),
], ],
@ -170,7 +149,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
SizedBox( SizedBox(
height: 15, height: 15,
), ),
if (widget.details != null && widget.details.isNotEmpty) if (widget.details != null && widget.details!.isNotEmpty)
Column( Column(
children: [ children: [
InkWell( InkWell(
@ -192,22 +171,17 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
margin: margin: EdgeInsets.only(left: 0, right: 0),
EdgeInsets.only(left: 0, right: 0),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).specialResult,
.specialResult, fontSize: SizeConfig.textMultiplier! * 2.3,
fontSize:
SizeConfig.textMultiplier * 2.3,
bold: false, bold: false,
))), ))),
Container( Container(
width: 25, width: 25,
height: 25, height: 25,
child: Icon( child: Icon(
_isShowMore _isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.grey[800], color: Colors.grey[800],
size: 22, size: 22,
), ),
@ -230,16 +204,12 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
duration: Duration(milliseconds: 7000), duration: Duration(milliseconds: 7000),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
child: !Utils.isTextHtml(widget.details) child: !Utils.isTextHtml(widget.details!)
? AppText( ? AppText(
widget.details ?? widget.details ?? TranslationBase.of(context).noDataAvailable,
TranslationBase.of(context)
.noDataAvailable,
) )
: Html( : Html(
data: widget.details ?? data: widget.details ?? TranslationBase.of(context).noDataAvailable,
TranslationBase.of(context)
.noDataAvailable,
), ),
), ),
), ),

@ -2,14 +2,14 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart';
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/progress_note_request.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_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/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/progress_note_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/notes/note/update_note.dart'; import 'package:doctor_app_flutter/screens/patients/profile/notes/note/update_note.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
@ -21,7 +21,6 @@ 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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -32,21 +31,21 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class ProgressNoteScreen extends StatefulWidget { class ProgressNoteScreen extends StatefulWidget {
final int visitType; final int visitType;
const ProgressNoteScreen({Key key, this.visitType}) : super(key: key); const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key);
@override @override
_ProgressNoteState createState() => _ProgressNoteState(); _ProgressNoteState createState() => _ProgressNoteState();
} }
class _ProgressNoteState extends State<ProgressNoteScreen> { class _ProgressNoteState extends State<ProgressNoteScreen> {
List<NoteModel> notesList; List<NoteModel> notesList = [];
var filteredNotesList; var filteredNotesList;
bool isDischargedPatient = false; bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel; late AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { 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']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
@ -55,7 +54,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
visitType: widget.visitType, visitType: widget.visitType,
// if equal 5 then this will return progress note // if equal 5 then this will return progress note
admissionNo: int.parse(patient.admissionNo), admissionNo: int.parse(patient.admissionNo!),
projectID: patient.projectId, projectID: patient.projectId,
tokenID: token, tokenID: token,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
@ -69,7 +68,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context); authenticationViewModel = Provider.of(context);
projectViewModel = 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']; PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
@ -118,7 +117,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
widthFactor: 0.95, widthFactor: 0.95,
child: CardWithBgWidget( child: CardWithBgWidget(
hasBorder: false, hasBorder: false,
bgColor: model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy bgColor: model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: model.patientProgressNoteList[index].status == 4 : model.patientProgressNoteList[index].status == 4
? Colors.red.shade700 ? Colors.red.shade700
@ -130,7 +129,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy) if (model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy)
AppText( AppText(
TranslationBase.of(context).notePending, TranslationBase.of(context).notePending,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -153,7 +152,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
if (model.patientProgressNoteList[index].status != 2 && if (model.patientProgressNoteList[index].status != 2 &&
model.patientProgressNoteList[index].status != 4 && model.patientProgressNoteList[index].status != 4 &&
authenticationViewModel.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy) authenticationViewModel.doctorProfile!.doctorID == model.patientProgressNoteList[index].createdBy)
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -209,7 +208,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
confirmFun: () async { confirmFun: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
UpdateNoteReqModel reqModel = UpdateNoteReqModel( UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(patient.admissionNo), admissionNo: int.parse(patient.admissionNo!),
cancelledNote: false, cancelledNote: false,
lineItemNo: model.patientProgressNoteList[index].lineItemNo, lineItemNo: model.patientProgressNoteList[index].lineItemNo,
conditionId: model.patientProgressNoteList[index].condition, conditionId: model.patientProgressNoteList[index].condition,
@ -264,7 +263,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
context, context,
); );
UpdateNoteReqModel reqModel = UpdateNoteReqModel( UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(patient.admissionNo), admissionNo: int.parse(patient.admissionNo!),
conditionId: model.patientProgressNoteList[index].condition, conditionId: model.patientProgressNoteList[index].condition,
cancelledNote: true, cancelledNote: true,
lineItemNo: model.patientProgressNoteList[index].lineItemNo, lineItemNo: model.patientProgressNoteList[index].lineItemNo,
@ -364,7 +363,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
children: [ children: [
AppText( AppText(
model.patientProgressNoteList[index].createdOn != null model.patientProgressNoteList[index].createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn), ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn!),
isArabic: projectViewModel.isArabic, isMonthShort: true) isArabic: projectViewModel.isArabic, isMonthShort: true)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic), : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -373,7 +372,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
AppText( AppText(
model.patientProgressNoteList[index].createdOn != null model.patientProgressNoteList[index].createdOn != null
? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn)) ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn!))
: AppDateUtils.getHour(DateTime.now()), : AppDateUtils.getHour(DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
@ -390,7 +389,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Row(mainAxisAlignment: MainAxisAlignment.start, children: [ Row(mainAxisAlignment: MainAxisAlignment.start, children: [
Expanded( Expanded(
child: AppText( child: AppText(
model.patientProgressNoteList[index].notes, model.patientProgressNoteList[index].notes!,
fontSize: 10, fontSize: 10,
isCopyable: true, isCopyable: true,
), ),
@ -416,7 +415,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
} }
/// TODO Elham* Make this as custom Dialog /// TODO Elham* Make this as custom Dialog
showMyDialog({BuildContext context, Function confirmFun, String actionName}) { showMyDialog({required BuildContext context, required Function confirmFun, required String actionName}) {
showDialog( showDialog(
context: context, context: context,
builder: (ctx) => Center( builder: (ctx) => Center(

@ -14,9 +14,8 @@ 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/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.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/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/loader/gif_loader_dialog_utils.dart';
@ -27,28 +26,20 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../../../widgets/shared/dialogs/dailog-list-select.dart'; import '../../../../../widgets/shared/dialogs/dailog-list-select.dart';
import '../../../../base/base_view.dart'; import '../../../../base/base_view.dart';
class UpdateNoteOrder extends StatefulWidget { class UpdateNoteOrder extends StatefulWidget {
final NoteModel note; final NoteModel? note;
final PatientViewModel patientModel; final PatientViewModel patientModel;
final PatiantInformtion patient; final PatiantInformtion patient;
final int visitType; final int? visitType;
final bool isUpdate; final bool isUpdate;
final List<dynamic> elementList; final List<dynamic>? elementList;
final Function(dynamic) okFunction; final Function(dynamic)? okFunction;
const UpdateNoteOrder( const UpdateNoteOrder({Key? key, this.note, required this.patientModel, required this.patient, this.visitType, required this.isUpdate, this.elementList, this.okFunction}) : super(key: key);
{Key key,
this.note,
this.patientModel,
this.patient,
this.visitType,
this.isUpdate,
this.elementList,
this.okFunction})
: super(key: key);
@override @override
_UpdateNoteOrderState createState() => _UpdateNoteOrderState(); _UpdateNoteOrderState createState() => _UpdateNoteOrderState();
@ -56,12 +47,12 @@ class UpdateNoteOrder extends StatefulWidget {
class _UpdateNoteOrderState extends State<UpdateNoteOrder> { class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
dynamic selectValue; dynamic selectValue;
int selectedType; int selectedType = 0;
bool isSubmitted = false; bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
TextEditingController progressNoteController = TextEditingController(); TextEditingController progressNoteController = TextEditingController();
@ -91,12 +82,10 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
if (widget.note != null) { if (widget.note != null) {
progressNoteController.text = widget.note.notes; progressNoteController.text = widget.note!.notes!;
if(selectValue==null) if (selectValue == null) selectValue = {};
selectValue={}; selectValue[keyId] = widget.note!.condition;
selectValue[keyId] = widget.note.condition; selectValue['Description'] = widget.note!.conditionDescription;
selectValue['Description'] = widget.note.conditionDescription;
} }
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
@ -116,14 +105,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [ children: [
BottomSheetTitle( BottomSheetTitle(
title: widget.visitType == 3 title: widget.visitType == 3
? (widget.isUpdate ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet
? TranslationBase.of(context).noteUpdate : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote,
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).progressNote,
), ),
SizedBox( SizedBox(
height: 10.0, height: 10.0,
@ -137,11 +120,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: model.stpMasterList, list: model.stpMasterList,
attributeName: 'Description', attributeName: 'Description',
attributeValueId: attributeValueId: model.stpMasterList.length == 1 ? model.stpMasterList[0]['${keyId}'].toString() : '${keyId}',
model.stpMasterList.length == 1
? model.stpMasterList[0]['${keyId}']
.toString()
: '${keyId}',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) => { okFunction: (selectedValue) => {
setState(() { setState(() {
@ -160,14 +139,14 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
} }
: null, : null,
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context).selectCondition,//'Select Condition', hintText: TranslationBase.of(context).selectCondition, //'Select Condition',
dropDownText: model.stpMasterList.length == 1 dropDownText: model.stpMasterList.length == 1
? model.stpMasterList[0]['Description'] ? model.stpMasterList[0]['Description']
: selectValue == null : selectValue == null
? null ? null
: selectValue['Description'], : selectValue['Description'],
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true, onChanged: (String value) {}, onFieldSubmitted: () {},
), ),
), ),
), ),
@ -183,19 +162,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
hintText: widget.visitType == 3 hintText: widget.visitType == 3
? (widget.isUpdate ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet
? TranslationBase.of(context) : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote,
.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).addProgressNote, //TranslationBase.of(context).addProgressNote,
controller: progressNoteController, controller: progressNoteController,
maxLines: 40, maxLines: 40,
@ -203,26 +171,19 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: progressNoteController validationError: progressNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, onChanged: (String value) {},
.text.isEmpty && onFieldSubmitted: () {},
isSubmitted
? TranslationBase.of(context).emptyMessage
: null,
), ),
Positioned( Positioned(
top: -2, top: -2,
//MediaQuery.of(context).size.height * 0, //MediaQuery.of(context).size.height * 0,
right: projectViewModel.isArabic right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15,
? MediaQuery.of(context).size.width * 0.75
: 15,
child: Column( child: Column(
children: [ children: [
IconButton( IconButton(
icon: Icon(DoctorApp.speechtotext, icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35),
color: Colors.black, size: 35),
onPressed: () { onPressed: () {
initSpeechState() initSpeechState().then((value) => {onVoiceText()});
.then((value) => {onVoiceText()});
}, },
), ),
], ],
@ -240,7 +201,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
), ),
bottomSheet: Container( bottomSheet: Container(
height: progressNoteController.text.isNotEmpty ? 130 : 70, height: progressNoteController.text.isNotEmpty ? 130 : 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
if (progressNoteController.text.isNotEmpty) if (progressNoteController.text.isNotEmpty)
@ -259,14 +220,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: AppButton( child: AppButton(
title: widget.visitType == 3 title: widget.visitType == 3
? (widget.isUpdate ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet
? TranslationBase.of(context).noteUpdate : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote,
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).progressNote,
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
// disabled: progressNoteController.text.isEmpty, // disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -276,29 +231,25 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
}); });
if (progressNoteController.text.trim().isNotEmpty) { if (progressNoteController.text.trim().isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
DoctorProfileModel.fromJson(profile);
if (widget.isUpdate) { if (widget.isUpdate) {
UpdateNoteReqModel reqModel = UpdateNoteReqModel( UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: admissionNo: int.parse(widget.patient.admissionNo!),
int.parse(widget.patient.admissionNo),
cancelledNote: false, cancelledNote: false,
lineItemNo: widget.note.lineItemNo, lineItemNo: widget.note!.lineItemNo,
createdBy: widget.note.createdBy, createdBy: widget.note!.createdBy,
notes: progressNoteController.text, notes: progressNoteController.text,
verifiedNote: false, verifiedNote: false,
patientTypeID: widget.patient.patientType, patientTypeID: widget.patient.patientType,
patientOutSA: false, patientOutSA: false,
conditionId: selectValue['ParameterCode']); conditionId: selectValue['ParameterCode']);
await widget.patientModel await widget.patientModel.updatePatientProgressNote(reqModel);
.updatePatientProgressNote(reqModel);
} else { } else {
CreateNoteModel reqModel = CreateNoteModel( CreateNoteModel reqModel = CreateNoteModel(
admissionNo: admissionNo: int.parse(widget.patient.admissionNo!),
int.parse(widget.patient.admissionNo),
createdBy: doctorProfile.doctorID, createdBy: doctorProfile.doctorID,
visitType: widget.visitType, visitType: widget.visitType,
patientID: widget.patient.patientId, patientID: widget.patient.patientId,
@ -308,29 +259,23 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
notes: progressNoteController.text, notes: progressNoteController.text,
conditionId: selectValue['ParameterCode']); conditionId: selectValue['ParameterCode']);
await widget.patientModel await widget.patientModel.createPatientProgressNote(reqModel);
.createPatientProgressNote(reqModel);
} }
if (widget.patientModel.state == if (widget.patientModel.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) {
Utils.showErrorToast(widget.patientModel.error); Utils.showErrorToast(widget.patientModel.error);
} else { } else {
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
ProgressNoteRequest( visitType: widget.visitType,
visitType: widget.visitType, // if equal 5 then this will return progress note
// if equal 5 then this will return progress note admissionNo: int.parse(widget.patient.admissionNo!),
admissionNo: projectID: widget.patient.projectId,
int.parse(widget.patient.admissionNo), patientTypeID: widget.patient.patientType,
projectID: widget.patient.projectId, languageID: 2);
patientTypeID: widget.patient.patientType, await widget.patientModel.getPatientProgressNote(progressNoteRequest.toJson());
languageID: 2);
await widget.patientModel.getPatientProgressNote(
progressNoteRequest.toJson());
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(TranslationBase.of(context).yourOrderAddedSuccessfully);
TranslationBase.of(context).yourOrderAddedSuccessfully);
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
Utils.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces); Utils.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces);
@ -346,8 +291,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
onVoiceText() async { onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context); new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize( bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
onStatus: statusListener, onError: errorListener);
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,
@ -378,14 +322,13 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
void resultListener(result) { void resultListener(result) {
recognizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
event.setValue({"searchText": recognizedWord}); event.setValue({"searchText": recognizedWord});
if (result.finalResult ==true) { if (result.finalResult == true) {
setState(() { setState(() {
if (mounted) { if (mounted) {
// speech.stop(); // speech.stop();
progressNoteController.text += recognizedWord + '\n'; progressNoteController.text += recognizedWord + '\n';
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
}
}
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);
@ -393,8 +336,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
} }
Future<void> initSpeechState() async { Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize( bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
onError: errorListener, onStatus: statusListener);
print(hasSpeech); print(hasSpeech);
if (!mounted) return; if (!mounted) return;
} }

@ -1,17 +1,17 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart'; import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart';
import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart'; import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart';
import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart'; import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.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/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/loader/gif_loader_dialog_utils.dart';
@ -23,19 +23,19 @@ import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../../config/config.dart'; import '../../../../config/config.dart';
class UpdateOperationReport extends StatefulWidget { class UpdateOperationReport extends StatefulWidget {
final GetReservationsResponseModel reservation; final GetReservationsResponseModel? reservation;
// final OperationReportViewModel operationReportViewModel; // final OperationReportViewModel operationReportViewModel;
final PatiantInformtion patient; final PatiantInformtion? patient;
final int visitType; final int? visitType;
final bool isUpdate; final bool isUpdate;
const UpdateOperationReport( const UpdateOperationReport(
{Key key, {Key? key,
// this.operationReportViewModel, // this.operationReportViewModel,
this.patient, this.patient,
this.visitType, this.visitType,
this.isUpdate, required this.isUpdate,
this.reservation}) this.reservation})
: super(key: key); : super(key: key);
@ -44,12 +44,12 @@ class UpdateOperationReport extends StatefulWidget {
} }
class _UpdateOperationReportState extends State<UpdateOperationReport> { class _UpdateOperationReportState extends State<UpdateOperationReport> {
int selectedType; int? selectedType;
bool isSubmitted = false; bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
TextEditingController preOpDiagmosisController = TextEditingController(); TextEditingController preOpDiagmosisController = TextEditingController();
TextEditingController postOpDiagmosisNoteController = TextEditingController(); TextEditingController postOpDiagmosisNoteController = TextEditingController();
@ -63,13 +63,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
TextEditingController complicationDetailsController = TextEditingController(); TextEditingController complicationDetailsController = TextEditingController();
TextEditingController bloodLossDetailController = TextEditingController(); TextEditingController bloodLossDetailController = TextEditingController();
TextEditingController histopathSpecimenController = TextEditingController(); TextEditingController histopathSpecimenController = TextEditingController();
TextEditingController microbiologySpecimenController = TextEditingController microbiologySpecimenController = TextEditingController();
TextEditingController();
TextEditingController otherSpecimenController = TextEditingController(); TextEditingController otherSpecimenController = TextEditingController();
TextEditingController scrubNurseController = TextEditingController(); TextEditingController scrubNurseController = TextEditingController();
TextEditingController circulatingNurseController = TextEditingController(); TextEditingController circulatingNurseController = TextEditingController();
TextEditingController BloodTransfusedDetailController = TextEditingController BloodTransfusedDetailController = TextEditingController();
TextEditingController();
TextEditingController anasthetistController = TextEditingController(); TextEditingController anasthetistController = TextEditingController();
TextEditingController OTReservationID = TextEditingController(); TextEditingController OTReservationID = TextEditingController();
@ -91,33 +89,30 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
return BaseView<OperationReportViewModel>( return BaseView<OperationReportViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getOperationReportDetails(widget.reservation); await model.getOperationReportDetails(widget.reservation!);
OTReservationID.text = widget.reservation.oTReservationID.toString(); OTReservationID.text = widget.reservation!.oTReservationID.toString();
if (model.operationDetailsList.isNotEmpty) { if (model.operationDetailsList.isNotEmpty) {
GetOperationDetailsResponseModel oldDetails = GetOperationDetailsResponseModel oldDetails = model.operationDetailsList[0];
model.operationDetailsList[0];
postOpDiagmosisNoteController.text = oldDetails.postOpInstruction!;
postOpDiagmosisNoteController.text = oldDetails.postOpInstruction; preOpDiagmosisController.text = oldDetails.preOpDiagnosis!;
preOpDiagmosisController.text = oldDetails.preOpDiagnosis; surgeonController.text = oldDetails.surgeon!;
surgeonController.text = oldDetails.surgeon; assistantNoteController.text = oldDetails.assistant!;
assistantNoteController.text = oldDetails.assistant; operationController.text = oldDetails.operation!;
operationController.text = oldDetails.operation; inasionController.text = oldDetails.inasion!;
inasionController.text = oldDetails.inasion; findingController.text = oldDetails.finding!;
findingController.text = oldDetails.finding; surgeryProcedureController.text = oldDetails.surgeryProcedure!;
surgeryProcedureController.text = oldDetails.surgeryProcedure; postOpInstructionController.text = oldDetails.postOpInstruction!;
postOpInstructionController.text = oldDetails.postOpInstruction; complicationDetailsController.text = oldDetails.complicationDetail!;
complicationDetailsController.text = oldDetails.complicationDetail; bloodLossDetailController.text = oldDetails.bloodLossDetail!;
bloodLossDetailController.text = oldDetails.bloodLossDetail; histopathSpecimenController.text = oldDetails.histopathSpecimen!;
histopathSpecimenController.text = oldDetails.histopathSpecimen; microbiologySpecimenController.text = oldDetails.microbiologySpecimen!;
microbiologySpecimenController.text = otherSpecimenController.text = oldDetails.otherSpecimen!;
oldDetails.microbiologySpecimen;
otherSpecimenController.text = oldDetails.otherSpecimen;
scrubNurseController.text = oldDetails.scrubNurse; scrubNurseController.text = oldDetails.scrubNurse;
circulatingNurseController.text = oldDetails.circulatingNurse; circulatingNurseController.text = oldDetails.circulatingNurse;
BloodTransfusedDetailController.text = BloodTransfusedDetailController.text = oldDetails.bloodTransfusedDetail;
oldDetails.bloodTransfusedDetail; anasthetistController.text = oldDetails.anasthetist!;
anasthetistController.text = oldDetails.anasthetist;
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -146,107 +141,82 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
child: Column( child: Column(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).reservation,
.reservation,
controller: OTReservationID, controller: OTReservationID,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
enabled: false, enabled: false,
hasBorder: true, hasBorder: true,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).preOperationDiagnosis,
.preOperationDiagnosis,
controller: preOpDiagmosisController, controller: preOpDiagmosisController,
maxLines: 20, maxLines: 20,
minLines: 8, minLines: 8,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: preOpDiagmosisController validationError: preOpDiagmosisController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, onChanged: (String value) {},
.text.isEmpty && onFieldSubmitted: () {},
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).postOperationDiagnosis,
.postOperationDiagnosis,
controller: postOpDiagmosisNoteController, controller: postOpDiagmosisNoteController,
maxLines: 20, maxLines: 20,
minLines: 8, minLines: 8,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: postOpDiagmosisNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, onChanged: (String value) {},
postOpDiagmosisNoteController onFieldSubmitted: () {},
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: TranslationBase.of(context).surgeon,
TranslationBase.of(context).surgeon,
controller: surgeonController, controller: surgeonController,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: surgeonController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, onChanged: (String value) {},
surgeonController.text.isEmpty && onFieldSubmitted: () {},
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: TranslationBase.of(context).assistant,
TranslationBase.of(context).assistant,
controller: assistantNoteController, controller: assistantNoteController,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: assistantNoteController validationError: assistantNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, onChanged: (String value) {},
.text.isEmpty && onFieldSubmitted: () {},
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: TranslationBase.of(context).operation,
TranslationBase.of(context).operation,
controller: operationController, controller: operationController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: operationController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
operationController.text.isEmpty && onChanged: (String value) {}, onFieldSubmitted: () {},
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -260,248 +230,175 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: inasionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
inasionController.text.isEmpty && onChanged: (String value) {}, onFieldSubmitted: () {},
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: TranslationBase.of(context).finding,
TranslationBase.of(context).finding,
controller: findingController, controller: findingController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: findingController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
findingController.text.isEmpty && onChanged: (String value) {}, onFieldSubmitted: () {},
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).surgeryProcedure,
.surgeryProcedure,
controller: surgeryProcedureController, controller: surgeryProcedureController,
maxLines: 20, maxLines: 20,
minLines: 8, minLines: 8,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: surgeryProcedureController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
surgeryProcedureController onChanged: (String value) {}, onFieldSubmitted: () {},
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).postOperationInstruction,
.postOperationInstruction,
controller: postOpInstructionController, controller: postOpInstructionController,
maxLines: 20, maxLines: 20,
minLines: 8, minLines: 8,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: postOpInstructionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
postOpInstructionController onChanged: (String value) {}, onFieldSubmitted: () {},
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).complicationDetails1,
.complicationDetails1,
controller: complicationDetailsController, controller: complicationDetailsController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: complicationDetailsController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
complicationDetailsController onChanged: (String value) {}, onFieldSubmitted: () {},
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).bloodLossDetail,
.bloodLossDetail,
controller: bloodLossDetailController, controller: bloodLossDetailController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: bloodLossDetailController validationError: bloodLossDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
.text.isEmpty && onChanged: (String value) {}, onFieldSubmitted: () {},
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).histopathSpecimen,
.histopathSpecimen,
controller: histopathSpecimenController, controller: histopathSpecimenController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: histopathSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
histopathSpecimenController onChanged: (String value) {}, onFieldSubmitted: () {},
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).microbiologySpecimen,
.microbiologySpecimen, controller: microbiologySpecimenController,
controller:
microbiologySpecimenController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: microbiologySpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
microbiologySpecimenController onChanged: (String value) {}, onFieldSubmitted: () {},
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).otherSpecimen,
.otherSpecimen,
controller: otherSpecimenController, controller: otherSpecimenController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: otherSpecimenController validationError: otherSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
.text.isEmpty && onChanged: (String value) {}, onFieldSubmitted: () {},
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).scrubNurse,
.scrubNurse,
controller: scrubNurseController, controller: scrubNurseController,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: scrubNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
scrubNurseController.text.isEmpty && onChanged: (String value) {}, onFieldSubmitted: () {},
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).circulatingNurse,
.circulatingNurse,
controller: circulatingNurseController, controller: circulatingNurseController,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: circulatingNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
circulatingNurseController onChanged: (String value) {}, onFieldSubmitted: () {},
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).bloodTransfusedDetail,
.bloodTransfusedDetail, controller: BloodTransfusedDetailController,
controller:
BloodTransfusedDetailController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: BloodTransfusedDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
BloodTransfusedDetailController onChanged: (String value) {}, onFieldSubmitted: () {},
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).anesthetist,
.anesthetist,
controller: anasthetistController, controller: anasthetistController,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError: anasthetistController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null,
anasthetistController.text.isEmpty && onChanged: (String value) {}, onFieldSubmitted: () {},
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 250, height: 250,
@ -523,17 +420,13 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
) )
: Container( : Container(
height: 70, height: 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: AppButton( child: AppButton(
title: (widget.isUpdate title: (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + " " + TranslationBase.of(context).operationReports,
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
" " +
TranslationBase.of(context).operationReports,
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
// disabled: operationReportsController.text.isEmpty, // disabled: operationReportsController.text.isEmpty,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -545,55 +438,33 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.getDoctorProfile(); await model.getDoctorProfile();
CreateUpdateOperationReportRequestModel CreateUpdateOperationReportRequestModel createUpdateOperationReportRequestModel = CreateUpdateOperationReportRequestModel(
createUpdateOperationReportRequestModel = inasion: inasionController.text,
CreateUpdateOperationReportRequestModel(
inasion: inasionController.text, /// TODO Elham* Add dynamic reservation
reservationNo: widget.reservation!.oTReservationID,
/// TODO Elham* Add dynamic reservation preOpDiagmosis: preOpDiagmosisController.text,
reservationNo: widget postOpDiagmosis: postOpDiagmosisNoteController.text,
.reservation.oTReservationID, surgeon: surgeonController.text,
preOpDiagmosis: assistant: assistantNoteController.text,
preOpDiagmosisController.text, anasthetist: assistantNoteController.text,
postOpDiagmosis: operation: operationController.text,
postOpDiagmosisNoteController finding: findingController.text,
.text, surgeryProcedure: surgeonController.text,
surgeon: surgeonController.text, postOpInstruction: postOpInstructionController.text,
assistant: complicationDetails: complicationDetailsController.text,
assistantNoteController.text, bloodLossDetail: bloodLossDetailController.text,
anasthetist: histopathSpecimen: histopathSpecimenController.text,
assistantNoteController.text, microbiologySpecimen: microbiologySpecimenController.text,
operation: operationController.text, otherSpecimen: otherSpecimenController.text,
finding: findingController.text, scrubNurse: surgeonController.text,
surgeryProcedure: circulatingNurse: circulatingNurseController.text,
surgeonController.text, bloodTransfusedDetail: bloodLossDetailController.text,
postOpInstruction: patientID: widget.patient!.patientId,
postOpInstructionController.text, admissionNo: int.parse(widget.patient!.admissionNo!),
complicationDetails: createdBy: model.doctorProfile!.doctorID,
complicationDetailsController );
.text, await model.updateOperationReport(createUpdateOperationReportRequestModel);
bloodLossDetail:
bloodLossDetailController.text,
histopathSpecimen:
histopathSpecimenController.text,
microbiologySpecimen:
microbiologySpecimenController
.text,
otherSpecimen:
otherSpecimenController.text,
scrubNurse: surgeonController.text,
circulatingNurse:
circulatingNurseController.text,
bloodTransfusedDetail:
bloodLossDetailController.text,
patientID: widget.patient.patientId,
admissionNo: int.parse(
widget.patient.admissionNo),
createdBy:
model.doctorProfile.doctorID,
);
await model.updateOperationReport(
createUpdateOperationReportRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
@ -601,8 +472,7 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// await model.( // await model.(
// operationReportsRequest.toJson()); // operationReportsRequest.toJson());
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast("Your Order added Successfully");
"Your Order added Successfully");
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }

@ -38,7 +38,7 @@ class PatientProfileScreen extends StatefulWidget {
} }
class _PatientProfileScreenState extends State<PatientProfileScreen> with SingleTickerProviderStateMixin { class _PatientProfileScreenState extends State<PatientProfileScreen> with SingleTickerProviderStateMixin {
PatiantInformtion patient; late PatiantInformtion patient;
LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel(); LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel();
bool isFromSearch = false; bool isFromSearch = false;
@ -52,16 +52,16 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
bool isDischargedPatient = false; bool isDischargedPatient = false;
bool isSearchAndOut = false; bool isSearchAndOut = false;
bool isCallStarted = false; bool isCallStarted = false;
String patientType; String? patientType;
String arrivalType; String? arrivalType;
String from; String? from;
String to; String? to;
TabController _tabController; late TabController _tabController;
int index = 0; int index = 0;
int _activeTab = 0; int _activeTab = 0;
StreamController<String> videoCallDurationStreamController; late StreamController<String> videoCallDurationStreamController;
Stream<String> videoCallDurationStream = (() async* {})(); late Stream<String> videoCallDurationStream;
@override @override
void initState() { void initState() {
@ -76,14 +76,14 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
_tabController.dispose(); _tabController.dispose();
super.dispose(); super.dispose();
if (isFromLiveCare) { if (isFromLiveCare) {
_liveCareViewModel.removePatientFromDoctorList(patient.vcId); _liveCareViewModel.removePatientFromDoctorList(patient.vcId!);
} }
} }
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
patientType = routeArgs['patientType']; patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType']; arrivalType = routeArgs['arrivalType'];
@ -117,7 +117,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
_activeTab = 1; _activeTab = 1;
} }
StreamSubscription callTimer; late StreamSubscription callTimer;
callConnected() { callConnected() {
callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null)
@ -132,7 +132,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
callDisconnected() { callDisconnected() {
callTimer.cancel(); callTimer.cancel();
videoCallDurationStreamController.sink.add(null); videoCallDurationStreamController.sink.add("");
setState(() { setState(() {
isCallStarted = false; isCallStarted = false;
@ -145,7 +145,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context); ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
return BaseView<LiveCarePatientViewModel>( return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId); if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId!);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
@ -158,7 +158,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
children: [ children: [
Column( Column(
children: [ children: [
PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType, PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType!,
videoCallDurationStream: videoCallDurationStream, videoCallDurationStream: videoCallDurationStream,
isInpatient: isInpatient, isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare, isFromLiveCare: isFromLiveCare,
@ -199,12 +199,12 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
) )
: ProfileGridForOther( : ProfileGridForOther(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType!,
arrivalType: arrivalType, arrivalType: arrivalType!,
isInpatient: isInpatient, isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare, isFromLiveCare: isFromLiveCare,
from: from, from: from!,
to: to, to: to!,
projectViewModel: projectViewModel, projectViewModel: projectViewModel,
), ),
), ),
@ -247,7 +247,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
: AppGlobal.appRedColor, : AppGlobal.appRedColor,
fontColor: Colors.white, fontColor: Colors.white,
// vPadding: 8, // vPadding: 8,
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6), height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30, radius: 30,
hPadding: 25, hPadding: 25,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -275,7 +275,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
: AppGlobal.appRedColor, : AppGlobal.appRedColor,
fontColor: Colors.white, fontColor: Colors.white,
// vPadding: 8, // vPadding: 8,
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6), height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30, radius: 30,
hPadding: 25, hPadding: 25,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -349,7 +349,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
); );
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.startCall(isReCall: false, vCID: patient.vcId); await model.startCall(isReCall: false, vCID: patient.vcId!);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -367,7 +367,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
context: context, context: context,
onTapGrant: () { onTapGrant: () {
locator<VideoCallService>() locator<VideoCallService>()
.openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording : true, callConnected, callDisconnected); .openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording! : true, callConnected, callDisconnected);
}); });
} }
} }
@ -382,19 +382,19 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
], ],
), ),
) )
: null, : SizedBox(),
), ),
); );
} }
createEpisode({PatiantInformtion patient, SOAPViewModel model}) async { createEpisode({required PatiantInformtion patient, required SOAPViewModel model}) async {
await locator<AnalyticsService>().logEvent( await locator<AnalyticsService>().logEvent(
eventCategory: "Patient Profile", eventCategory: "Patient Profile",
eventAction: "Create Episode", eventAction: "Create Episode",
); );
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) { if (patient.admissionNo != null && patient.admissionNo!.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo), patientID: patient.patientId); PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo!), patientID: patient.patientId);
await model.postEpisodeForInPatient(postEpisodeReqModel); await model.postEpisodeForInPatient(postEpisodeReqModel);
} else { } else {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN); PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN);

@ -11,16 +11,18 @@ import '../../../../routes.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class ProfileGridForOther extends StatelessWidget { class ProfileGridForOther extends StatelessWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String? patientType;
final String arrivalType; final String? arrivalType;
final double height; final double? height;
final bool isInpatient; final bool isInpatient;
final bool isFromLiveCare; final bool isFromLiveCare;
String from; String? from;
String to; String? to;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
ProfileGridForOther({Key key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient, this.from, this.to, this.isFromLiveCare, this.projectViewModel}) : super(key: key); ProfileGridForOther(
{Key? key, required this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient = false, this.from, this.to, this.isFromLiveCare = false, required this.projectViewModel})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -61,7 +63,7 @@ class ProfileGridForOther extends StatelessWidget {
PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg', PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isDisable:
Utils.isVidaPlusProject(projectViewModel, patient.projectId) || (isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43) || patient.appointmentNo == null), Utils.isVidaPlusProject(projectViewModel, patient.projectId!) || (isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43) || patient.appointmentNo == null),
]; ];
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),

@ -10,22 +10,21 @@ import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-prof
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher_string.dart';
import '../../../../locator.dart'; import '../../../../locator.dart';
class RadiologyDetailsPage extends StatelessWidget { class RadiologyDetailsPage extends StatelessWidget {
final FinalRadiology finalRadiology; final FinalRadiology finalRadiology;
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String? patientType;
final String arrivalType; final String? arrivalType;
final bool isInpatient; final bool isInpatient;
final bool isVidaPlus; final bool isVidaPlus;
RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false, this.isVidaPlus = false}); RadiologyDetailsPage({Key? key, required this.finalRadiology, required this.patient, this.patientType, this.arrivalType, this.isInpatient = false, this.isVidaPlus = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -35,16 +34,17 @@ class RadiologyDetailsPage extends StatelessWidget {
patient: patient, patient: patient,
projectId: finalRadiology.projectID, projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo, lineItem: finalRadiology.invoiceLineItemNo,
invoiceType:finalRadiology.invoiceType, invoiceType: finalRadiology.invoiceType!,
invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo, invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID, isVidaPlus: Utils.isVidaPlusProject(
projectViewModel,
finalRadiology.projectID,
), ),
), ),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient,
appointmentDate: finalRadiology.orderDate, appointmentDate: finalRadiology.orderDate!,
doctorName: finalRadiology.doctorName, doctorName: finalRadiology.doctorName,
clinic: finalRadiology.clinicDescription, clinic: finalRadiology.clinicDescription,
branch: finalRadiology.projectName, branch: finalRadiology.projectName,
@ -111,13 +111,13 @@ class RadiologyDetailsPage extends StatelessWidget {
eventCategory: "RadiologyDetailsPage", eventCategory: "RadiologyDetailsPage",
eventAction: "Open Radiology Image", eventAction: "Open Radiology Image",
); );
launch(model.radImageURL); launchUrlString(model.radImageURL);
}, },
title: TranslationBase.of(context).openRad, title: TranslationBase.of(context).openRad,
), ),
), ),
) )
: null, : SizedBox(),
), ),
); );
} }

@ -14,7 +14,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -26,16 +25,16 @@ class RadiologyHomePage extends StatefulWidget {
} }
class _RadiologyHomePageState extends State<RadiologyHomePage> { class _RadiologyHomePageState extends State<RadiologyHomePage> {
String patientType; String? patientType;
PatiantInformtion patient; late PatiantInformtion patient;
String arrivalType; String? arrivalType;
bool isInpatient; bool isInpatient = false;
bool isFromLiveCare; bool isFromLiveCare = false;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
patientType = routeArgs['patientType']; patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType']; arrivalType = routeArgs['arrivalType'];
@ -51,7 +50,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100]!,
// appBarTitle: TranslationBase.of(context).radiology, // appBarTitle: TranslationBase.of(context).radiology,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient,
@ -114,9 +113,9 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
height: 160, height: 160,
decoration: BoxDecoration( decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545) //Colors.red[900] Color(0xff404545)
color: model.radiologyList[index].isLiveCareAppodynamicment color: model.radiologyList[index].isLiveCareAppodynamicment!
? Colors.red[900] ? Colors.red[900]
: !model.radiologyList[index].isInOutPatient : !model.radiologyList[index].isInOutPatient!
? Colors.black ? Colors.black
: Color(0xffa9a089), : Color(0xffa9a089),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@ -129,9 +128,9 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
quarterTurns: 3, quarterTurns: 3,
child: Center( child: Center(
child: Text( child: Text(
model.radiologyList[index].isLiveCareAppodynamicment model.radiologyList[index].isLiveCareAppodynamicment!
? TranslationBase.of(context).liveCare.toUpperCase() ? TranslationBase.of(context).liveCare.toUpperCase()
: !model.radiologyList[index].isInOutPatient : !model.radiologyList[index].isInOutPatient!
? TranslationBase.of(context).inPatientLabel.toUpperCase() ? TranslationBase.of(context).inPatientLabel.toUpperCase()
: TranslationBase.of(context).outpatient.toUpperCase(), : TranslationBase.of(context).outpatient.toUpperCase(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),

@ -54,7 +54,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
Expanded( Expanded(
child: AppText( child: AppText(
(Utils.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")), (Utils.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier! * 2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
@ -121,8 +121,8 @@ class ReferredPatientDetailScreen extends StatelessWidget {
AppText( AppText(
TranslationBase.of(context).viewProfile, TranslationBase.of(context).viewProfile,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Colors.red[700], color: Colors.red[700]!,
) )
], ],
), ),
@ -137,21 +137,21 @@ class ReferredPatientDetailScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
referredPatient.referralStatusDesc, referredPatient.referralStatusDesc!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: referredPatient.referralStatus == 1 color: referredPatient.referralStatus == 1
? AppGlobal.inProgressColor ? AppGlobal.inProgressColor
: referredPatient.referralStatus == 46 : referredPatient.referralStatus == 46
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: Colors.red[700], : Colors.red[700]!,
), ),
AppText( AppText(
AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "dd MMM,yyyy"), AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate!, "dd MMM,yyyy"),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier!,
color: Color(0XFF28353E), color: Color(0XFF28353E),
) )
], ],
@ -166,7 +166,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).fileNumber, TranslationBase.of(context).fileNumber,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
@ -179,10 +179,10 @@ class ReferredPatientDetailScreen extends StatelessWidget {
], ],
), ),
AppText( AppText(
AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "hh:mm a"), AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate!, "hh:mm a"),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF575757), color: Color(0XFF575757),
) )
], ],
@ -201,12 +201,12 @@ class ReferredPatientDetailScreen extends StatelessWidget {
"${TranslationBase.of(context).refClinic}: ", "${TranslationBase.of(context).refClinic}: ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient.referralClinicDescription, referredPatient.referralClinicDescription!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 13, fontSize: 13,
@ -224,12 +224,12 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).frequency + ": ", TranslationBase.of(context).frequency + ": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient.frequencyDescription, referredPatient.frequencyDescription!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 14, fontSize: 14,
@ -244,19 +244,19 @@ class ReferredPatientDetailScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
referredPatient.nationalityName != null ? referredPatient.nationalityName : "", referredPatient.nationalityName != null ? referredPatient.nationalityName! : "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: 1.4 * SizeConfig.textMultiplier, fontSize: 1.4 * SizeConfig.textMultiplier!,
), ),
referredPatient.nationalityFlagURL != null referredPatient.nationalityFlagURL != null
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient.nationalityFlagURL, referredPatient.nationalityFlagURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -274,11 +274,11 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).priority + ": ", TranslationBase.of(context).priority + ": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
referredPatient.priorityDescription, referredPatient.priorityDescription!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 14, fontSize: 14,
@ -295,15 +295,15 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).maxResponseTime + ": ", TranslationBase.of(context).maxResponseTime + ": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime, "dd MMM,yyyy") : '', referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime!, "dd MMM,yyyy") : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
), ),
@ -327,10 +327,10 @@ class ReferredPatientDetailScreen extends StatelessWidget {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient.doctorImageURL, referredPatient.doctorImageURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -352,14 +352,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
"${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}", "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize: 1.5 * SizeConfig.textMultiplier!,
color: Colors.black, color: Colors.black,
), ),
AppText( AppText(
referredPatient.referralClinicDescription, referredPatient.referralClinicDescription!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.3 * SizeConfig.textMultiplier, fontSize: 1.3 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -399,14 +399,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).remarks, TranslationBase.of(context).remarks,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier, fontSize: 2.4 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
AppText( AppText(
referredPatient.referringDoctorRemarks, referredPatient.referringDoctorRemarks!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
SizedBox( SizedBox(
@ -422,10 +422,10 @@ class ReferredPatientDetailScreen extends StatelessWidget {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient.doctorImageURL, referredPatient.doctorImageURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -444,18 +444,18 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).reply, TranslationBase.of(context).reply,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
AppText( AppText(
referredPatient.referredDoctorRemarks == null referredPatient.referredDoctorRemarks == null
? '' ? ''
: referredPatient.referredDoctorRemarks.isNotEmpty : referredPatient.referredDoctorRemarks!.isNotEmpty
? referredPatient.referredDoctorRemarks ? referredPatient.referredDoctorRemarks!
: TranslationBase.of(context).notRepliedYet, : TranslationBase.of(context).notRepliedYet,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize: 1.6 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -480,7 +480,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
vPadding: 12, vPadding: 12,
disabled: referredPatient.referredDoctorRemarks == null disabled: referredPatient.referredDoctorRemarks == null
? true ? true
: referredPatient.referredDoctorRemarks.isNotEmpty : referredPatient.referredDoctorRemarks!.isNotEmpty
? false ? false
: true, : true,
onPressed: () async { onPressed: () async {

@ -2,27 +2,25 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.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-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/auto_complete_text_field.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -33,7 +31,7 @@ class AddAssessmentDetails extends StatefulWidget {
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final bool isUpdate; final bool isUpdate;
AddAssessmentDetails({Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList}); AddAssessmentDetails({Key? key, required this.mySelectedAssessment, required this.addSelectedAssessment, required this.patientInfo, this.isUpdate = false, required this.mySelectedAssessmentList});
@override @override
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
@ -57,12 +55,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString();
if (widget.isUpdate) { if (widget.isUpdate) {
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) if (widget.mySelectedAssessment.selectedDiagnosisCondition != null)
conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr! : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn!;
if (widget.mySelectedAssessment.selectedDiagnosisType != null) if (widget.mySelectedAssessment.selectedDiagnosisType != null)
typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr : widget.mySelectedAssessment.selectedDiagnosisType.nameEn; typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType!.nameAr! : widget.mySelectedAssessment.selectedDiagnosisType!.nameEn!;
if (widget.mySelectedAssessment.selectedICD != null) icdNameController.text = widget.mySelectedAssessment.selectedICD.code; if (widget.mySelectedAssessment.selectedICD != null) 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( return new InputDecoration(
fillColor: Colors.white, fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
@ -119,23 +117,25 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
enabled: false, enabled: false,
controller: appointmentIdController, controller: appointmentIdController,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Column( Column(children: [
children:[ InkWell( InkWell(
onTap: model.listOfICD10 != null onTap: model.listOfICD10 != null
? () { ? () {
setState(() { setState(() {
widget.mySelectedAssessment.selectedICD = null; widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = null; icdNameController.text = 'null';
}); });
} }
: null, : null,
child: AppTextFieldCustom( child: AppTextFieldCustom(
onChanged: (text){ onChanged: (text) {
setState(() { setState(() {
icdNameController.text; icdNameController.text;
}); });
@ -143,11 +143,11 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: Utils.getTextFieldHeight(), height: Utils.getTextFieldHeight(),
onClick: model.listOfICD10 != null onClick: model.listOfICD10 != null
? () { ? () {
setState(() { setState(() {
widget.mySelectedAssessment.selectedICD = null; widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = null; icdNameController.text = 'null';
}); });
} }
: null, : null,
hintText: TranslationBase.of(context).nameOrICD, hintText: TranslationBase.of(context).nameOrICD,
maxLines: 1, maxLines: 1,
@ -169,77 +169,74 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
Icons.search, Icons.search,
color: Colors.grey.shade600, color: Colors.grey.shade600,
)), )),
onFieldSubmitted: () {},
)), )),
model.listOfICD10.length >0 && icdNameController.text.isNotEmpty ? Container( model.listOfICD10.length > 0 && icdNameController.text.isNotEmpty
color: Colors.white, ? Container(
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height, color: Colors.white,
child:ListView.builder( height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
shrinkWrap: true, child: ListView.builder(
itemCount: model.listOfICD10.length, shrinkWrap: true,
itemBuilder: (context, index) { itemCount: model.listOfICD10.length,
return InkWell(child:ListTile( itemBuilder: (context, index) {
title: AppText( model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)), return InkWell(
onTap: (){ child: ListTile(title: AppText(model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)),
onTap: () {
widget.mySelectedAssessment.selectedICD = model.listOfICD10[index]; widget.mySelectedAssessment.selectedICD = model.listOfICD10[index];
icdNameController.text = model.listOfICD10[index].description; icdNameController.text = model.listOfICD10[index].description;
model.listOfICD10.clear(); model.listOfICD10.clear();
setState(() { setState(() {});
}); });
} },
); ))
: SizedBox()
}, // CustomAutoCompleteTextField(
)) :SizedBox() // isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null,
// CustomAutoCompleteTextField( // child: Row(
// isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
// child: Row( // mainAxisSize: MainAxisSize.min,
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // children: [
// mainAxisSize: MainAxisSize.min, // AutoCompleteTextField<MasterKeyModel>(
// children: [ // decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null),
// AutoCompleteTextField<MasterKeyModel>( // controller: icdNameController,
// decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null), // itemSubmitted: (item) => setState(() {
// controller: icdNameController, // widget.mySelectedAssessment.selectedICD = item;
// itemSubmitted: (item) => setState(() { // // icdNameController.text = '${item.code.trim()}/${item.description}';
// widget.mySelectedAssessment.selectedICD = item; // icdNameController.text = '${item.description}';
// // icdNameController.text = '${item.code.trim()}/${item.description}'; // }),
// icdNameController.text = '${item.description}'; // key: key,
// }), // suggestions: model.listOfICD10,
// key: key, // suggestionsAmount: model.listOfICD10.length,
// suggestions: model.listOfICD10, // itemBuilder: (context, suggestion) =>
// suggestionsAmount: model.listOfICD10.length, // new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)),
// itemBuilder: (context, suggestion) => // itemSorter: (a, b) => 1,
// new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)), // itemFilter: (suggestion, input) =>
// itemSorter: (a, b) => 1, // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// itemFilter: (suggestion, input) => // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || // // suggestion.code.toLowerCase().startsWith(input.toLowerCase()),
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || // suggestion.description.toLowerCase().contains(input.toLowerCase()) ||
// // suggestion.code.toLowerCase().startsWith(input.toLowerCase()), // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// suggestion.description.toLowerCase().contains(input.toLowerCase()) || // suggestion.code.toLowerCase().contains(input.toLowerCase()),
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || //
// suggestion.code.toLowerCase().contains(input.toLowerCase()), // ),
// // Expanded(
// ), // child: IconButton(
// Expanded( // onPressed: () {
// child: IconButton( // print(icdNameController.text);
// onPressed: () { // if (icdNameController.text.length <= 3) {
// print(icdNameController.text); // DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
// if (icdNameController.text.length <= 3) { // } else {
// DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); // model.listOfICD10.clear();
// } else { // model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
// model.listOfICD10.clear(); // }
// model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); // },
// } // icon: Icon(Icons.search),
// }, // ),
// icon: Icon(Icons.search), // ),
// ), // ],
// ), // ),
// ], // )
// ),
// )
]), ]),
if (widget.mySelectedAssessment.selectedICD != null) if (widget.mySelectedAssessment.selectedICD != null)
Column( Column(
@ -250,7 +247,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
Container( Container(
width: MediaQuery.of(context).size.width * 0.7, width: MediaQuery.of(context).size.width * 0.7,
child: AppText( child: AppText(
widget.mySelectedAssessment.selectedICD.description + (' (${widget.mySelectedAssessment.selectedICD.code} )'), widget.mySelectedAssessment.selectedICD!.description + (' (${widget.mySelectedAssessment.selectedICD!.code} )'),
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -269,12 +266,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition, list: model.listOfDiagnosisCondition,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition, selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition!,
okFunction: (MasterKeyModel selectedValue) { okFunction: (MasterKeyModel selectedValue) {
setState(() { setState(() {
widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue; widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue;
conditionController.text = conditionController.text =
projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr! : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn!;
}); });
}, },
); );
@ -295,6 +292,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
enabled: false, enabled: false,
hasBorder: true, hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null, validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -306,11 +305,11 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType, list: model.listOfDiagnosisType,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisType, selectedValue: widget.mySelectedAssessment.selectedDiagnosisType!,
okFunction: (MasterKeyModel selectedValue) { okFunction: (MasterKeyModel selectedValue) {
setState(() { setState(() {
widget.mySelectedAssessment.selectedDiagnosisType = selectedValue; widget.mySelectedAssessment.selectedDiagnosisType = selectedValue;
typeController.text = projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn; typeController.text = projectViewModel.isArabic ? selectedValue.nameAr! : selectedValue.nameEn!;
}); });
}, },
); );
@ -331,6 +330,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
controller: typeController, controller: typeController,
hasBorder: true, hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : null, validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -346,10 +347,11 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onChanged: (value) { onChanged: (value) {
widget.mySelectedAssessment.remark = remarkController.text; widget.mySelectedAssessment.remark = remarkController.text;
}, },
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort (SizeConfig.isHeightVeryShort
? 20 ? 20
: SizeConfig.isHeightShort : SizeConfig.isHeightShort
@ -386,7 +388,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
); );
} }
submitAssessment({SOAPViewModel model, MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { submitAssessment({required SOAPViewModel model, required MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (isUpdate) { if (isUpdate) {
PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel(
@ -395,14 +397,14 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
remarks: mySelectedAssessment.remark, remarks: mySelectedAssessment.remark,
complexDiagnosis: true, complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD.code, icdcode10Id: mySelectedAssessment.selectedICD!.code,
prevIcdCode10ID: mySelectedAssessment.icdCode10ID); prevIcdCode10ID: mySelectedAssessment.icdCode10ID);
await model.patchAssessment(patchAssessmentReqModel); await model.patchAssessment(patchAssessmentReqModel);
} else { } else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel( PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
@ -414,9 +416,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
new IcdCodeDetails( new IcdCodeDetails(
remarks: mySelectedAssessment.remark, remarks: mySelectedAssessment.remark,
complexDiagnosis: true, complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD.code) icdcode10Id: mySelectedAssessment.selectedICD!.code)
]); ]);
await model.postAssessment(postAssessmentRequestModel); await model.postAssessment(postAssessmentRequestModel);
} }
@ -424,10 +426,10 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code;
mySelectedAssessment.doctorName = doctorProfile.doctorName; mySelectedAssessment.doctorName = doctorProfile.doctorName;
widget.addSelectedAssessment(mySelectedAssessment, isUpdate); widget.addSelectedAssessment(mySelectedAssessment, isUpdate);
Navigator.of(context).pop(); Navigator.of(context).pop();

@ -1,17 +1,17 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_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/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -30,7 +30,7 @@ class UpdateAssessmentPage extends StatefulWidget {
final Function changeLoadingState; final Function changeLoadingState;
final int currentIndex; final int currentIndex;
UpdateAssessmentPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); UpdateAssessmentPage({Key? key, required this.changePageViewIndex, required this.patientInfo, required this.changeLoadingState, required this.currentIndex});
@override @override
_UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState();
@ -38,7 +38,7 @@ class UpdateAssessmentPage extends StatefulWidget {
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements AssessmentCallBack { class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements AssessmentCallBack {
bool isAssessmentExpand = false; bool isAssessmentExpand = false;
List<MySelectedAssessment> mySelectedAssessmentList = List(); List<MySelectedAssessment> mySelectedAssessmentList = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -53,17 +53,17 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
if (model.patientAssessmentList.isNotEmpty) { if (model.patientAssessmentList.isNotEmpty) {
model.patientAssessmentList.forEach((element) { model.patientAssessmentList.forEach((element) {
MasterKeyModel diagnosisType = model.getOneMasterKey( MasterKeyModel? diagnosisType = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisType, masterKeys: MasterKeysService.DiagnosisType,
id: element.diagnosisTypeID, id: element.diagnosisTypeID,
); );
MasterKeyModel selectedICD = model.getOneMasterKey( MasterKeyModel? selectedICD = model.getOneMasterKey(
masterKeys: MasterKeysService.ICD10, masterKeys: MasterKeysService.ICD10,
id: element.icdCode10ID, id: element.icdCode10ID,
); );
MasterKeyModel diagnosisCondition = model.getOneMasterKey( MasterKeyModel? diagnosisCondition = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisCondition, masterKeys: MasterKeysService.DiagnosisCondition,
id: element.conditionID, id: element.conditionID!,
); );
if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) { if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) {
MySelectedAssessment temMySelectedAssessment = SoapUtils.generateMySelectedAssessment( MySelectedAssessment temMySelectedAssessment = SoapUtils.generateMySelectedAssessment(
@ -145,7 +145,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
new TextSpan( new TextSpan(
text: "ICD : ".toUpperCase(), text: "ICD : ".toUpperCase(),
), ),
new TextSpan(text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD.code.trim().toUpperCase() ?? "" : ""), new TextSpan(text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD!.code.trim().toUpperCase() ?? "" : ""),
], ],
), ),
), ),
@ -154,13 +154,13 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
children: [ children: [
AppText( AppText(
assessment.createdOn != null assessment.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(assessment.createdOn), isMonthShort: true) ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(assessment.createdOn!), isMonthShort: true)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
), ),
AppText( AppText(
assessment.createdOn != null ? AppDateUtils.getHour(DateTime.parse(assessment.createdOn)) : AppDateUtils.getHour(DateTime.now()), assessment.createdOn != null ? AppDateUtils.getHour(DateTime.parse(assessment.createdOn!)) : AppDateUtils.getHour(DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
@ -191,7 +191,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD.description.toString() : "", text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD!.description.toString() : "",
// text: assessment.selectedICD.description.toString(), // text: assessment.selectedICD.description.toString(),
), ),
], ],
@ -239,7 +239,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
), ),
), ),
new TextSpan( new TextSpan(
text: projectViewModel.isArabic ? assessment.selectedDiagnosisCondition.nameAr : assessment.selectedDiagnosisCondition.nameEn, text: projectViewModel.isArabic ? assessment.selectedDiagnosisCondition!.nameAr : assessment.selectedDiagnosisCondition!.nameEn,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -262,7 +262,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
), ),
), ),
new TextSpan( new TextSpan(
text: projectViewModel.isArabic ? assessment.selectedDiagnosisType.nameAr : assessment.selectedDiagnosisType.nameEn, text: projectViewModel.isArabic ? assessment.selectedDiagnosisType!.nameAr : assessment.selectedDiagnosisType!.nameEn,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -358,7 +358,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
); );
} }
openAssessmentDialog(BuildContext context, {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { openAssessmentDialog(BuildContext context, {MySelectedAssessment? assessment, bool isUpdate = false, required SOAPViewModel model}) {
if (assessment == null) { if (assessment == null) {
assessment = SoapUtils.generateMySelectedAssessment(remark: '', appointmentNo: widget.patientInfo.appointmentNo); assessment = SoapUtils.generateMySelectedAssessment(remark: '', appointmentNo: widget.patientInfo.appointmentNo);
} }
@ -368,7 +368,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
context: context, context: context,
builder: (context) { builder: (context) {
return AddAssessmentDetails( return AddAssessmentDetails(
mySelectedAssessment: assessment, mySelectedAssessment: assessment!,
patientInfo: widget.patientInfo, patientInfo: widget.patientInfo,
isUpdate: isUpdate, isUpdate: isUpdate,
mySelectedAssessmentList: mySelectedAssessmentList, mySelectedAssessmentList: mySelectedAssessmentList,

@ -3,16 +3,16 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
@ -31,7 +31,7 @@ class UpdateObjectivePage extends StatefulWidget {
final int currentIndex; final int currentIndex;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
UpdateObjectivePage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); UpdateObjectivePage({Key? key, required this.changePageViewIndex, required this.patientInfo, required this.changeLoadingState, required this.currentIndex});
@override @override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState(); _UpdateObjectivePageState createState() => _UpdateObjectivePageState();
@ -39,7 +39,7 @@ class UpdateObjectivePage extends StatefulWidget {
class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements ObjectiveCallBack { class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements ObjectiveCallBack {
bool isSysExaminationExpand = false; bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = List(); List<MySelectedExamination> mySelectedExamination = [];
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) {
return BoxDecoration( return BoxDecoration(
@ -66,7 +66,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
await model.getMasterLookup(MasterKeysService.PhysicalExamination); await model.getMasterLookup(MasterKeysService.PhysicalExamination);
} }
model.patientPhysicalExamList.forEach((element) { model.patientPhysicalExamList.forEach((element) {
MasterKeyModel examMaster = model.getOneMasterKey( MasterKeyModel? examMaster = model.getOneMasterKey(
masterKeys: MasterKeysService.PhysicalExamination, masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId, id: element.examId,
); );
@ -135,7 +135,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
.sublist(0, model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination)) .sublist(0, model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination))
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination(examination.selectedExamination); removeExamination(examination.selectedExamination!);
}); });
}).toList(), }).toList(),
), ),
@ -155,7 +155,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
.sublist(model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination)) .sublist(model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination))
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination(examination.selectedExamination); removeExamination(examination.selectedExamination!);
}); });
}).toList(), }).toList(),
) )
@ -164,7 +164,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
isExpanded: isSysExaminationExpand, isExpanded: isSysExaminationExpand,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 14 : 12), height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 14 : 12),
) )
], ],
), ),
@ -177,11 +177,11 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if (mySelectedExamination.isNotEmpty) { if (mySelectedExamination.isNotEmpty) {
if (!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { if (!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo!.isNotEmpty) {
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
widget.changeLoadingState(true); widget.changeLoadingState(true);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
@ -196,8 +196,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID, editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id, examId: exam.selectedExamination!.id,
examType: exam.selectedExamination.typeId, examType: exam.selectedExamination!.typeId,
isAbnormal: exam.isAbnormal, isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal, isNormal: exam.isNormal,
notExamined: exam.notExamined, notExamined: exam.notExamined,
@ -213,12 +213,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
: "Not Examined", : "Not Examined",
isNew: exam.isNew, isNew: exam.isNew,
); );
if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo!.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo.admissionNo); listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo.admissionNo!);
} else { } else {
listHisProgNotePhysicalExaminationVM.admissionNo = 0; listHisProgNotePhysicalExaminationVM.admissionNo = 0;
} }
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(listHisProgNotePhysicalExaminationVM); postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!.add(listHisProgNotePhysicalExaminationVM);
}); });
if (model.patientPhysicalExamList.isEmpty) { if (model.patientPhysicalExamList.isEmpty) {
@ -230,12 +230,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
widget.changeLoadingState(false); widget.changeLoadingState(false);
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
model.isAddExamInProgress = false; model.isAddExamInProgress = false;
} }
} else { } else {
if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
widget.changeLoadingState(false); widget.changeLoadingState(false);
model.isAddExamInProgress = false; model.isAddExamInProgress = false;
@ -251,7 +251,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
} }
removeExamination(MasterKeyModel masterKey) { removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = mySelectedExamination.where((element) => masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId); Iterable<MySelectedExamination> history = mySelectedExamination.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId);
if (history.length > 0) { if (history.length > 0) {
setState(() { setState(() {
@ -276,7 +276,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
setState(() { setState(() {
{ {
mySelectedExaminationLocal.forEach((element) { mySelectedExaminationLocal.forEach((element) {
if ((mySelectedExamination.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) { if ((mySelectedExamination.singleWhere((it) => it.selectedExamination!.id == element.selectedExamination!.id, orElse: () => MySelectedExamination())) == null) {
mySelectedExamination.insert(0, element); mySelectedExamination.insert(0, element);
} }
}); });
@ -284,13 +284,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
/// remove items. /// remove items.
List<MySelectedExamination> removedList = []; List<MySelectedExamination> removedList = [];
mySelectedExamination.forEach((element) { mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) { if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination!.id == element.selectedExamination!.id, orElse: () => MySelectedExamination())) == null) {
removedList.add(element); removedList.add(element);
} }
}); });
removedList.forEach((element) { removedList.forEach((element) {
removeExamination(element.selectedExamination); removeExamination(element.selectedExamination!);
}); });
Navigator.of(context).pop(); Navigator.of(context).pop();
} }

@ -30,7 +30,14 @@ class UpdatePlanPage extends StatefulWidget {
final int currentIndex; final int currentIndex;
UpdatePlanPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex, this.sOAPViewModel, this.changeStateFun}); UpdatePlanPage(
{Key? key,
required this.changePageViewIndex,
required this.patientInfo,
required this.changeLoadingState,
required this.currentIndex,
required this.sOAPViewModel,
required this.changeStateFun});
@override @override
_UpdatePlanPageState createState() => _UpdatePlanPageState(); _UpdatePlanPageState createState() => _UpdatePlanPageState();
@ -76,7 +83,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
///TODO set progressNote in model; ///TODO set progressNote in model;
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote); progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName; patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
@ -106,7 +113,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote); progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName; patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn; patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
@ -169,6 +176,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
widget.changeStateFun(); widget.changeStateFun();
}); });
}, },
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
@ -206,7 +214,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
), ),
AppText( AppText(
patientProgressNote.createdOn != null patientProgressNote.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(patientProgressNote.createdOn)) ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(patientProgressNote.createdOn!))
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
@ -230,7 +238,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
// ], // ],
// ), // ),
AppText( AppText(
patientProgressNote.createdOn != null ? AppDateUtils.getHour(DateTime.parse(patientProgressNote.createdOn)) : AppDateUtils.getHour(DateTime.now()), patientProgressNote.createdOn != null ? AppDateUtils.getHour(DateTime.parse(patientProgressNote.createdOn!)) : AppDateUtils.getHour(DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
@ -272,7 +280,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
isExpanded: isProgressExpanded, isExpanded: isProgressExpanded,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 20 : 10),
), ),
], ],
), ),
@ -291,14 +299,14 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
planNote: patientProgressNote.planNote, planNote: patientProgressNote.planNote,
doctorID: widget.patientInfo.doctorId, doctorID: widget.patientInfo.doctorId,
createdBy:widget.patientInfo.doctorId , createdBy: widget.patientInfo.doctorId,
createdByName:widget.patientInfo.doctorName , createdByName: widget.patientInfo.doctorName,
editedBy: ''); editedBy: '');
if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) {
await widget.sOAPViewModel.postProgressNote(postProgressNoteRequestModel); await widget.sOAPViewModel.postProgressNote(postProgressNoteRequestModel);
} else { } else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
await widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel); await widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel);
@ -315,7 +323,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
doctorID: ''); doctorID: '');
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote); progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName; patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn; patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
@ -331,7 +339,6 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
Navigator.of(context).pop(); Navigator.of(context).pop();
Utils.showErrorToast("Episode Created Successfully"); Utils.showErrorToast("Episode Created Successfully");
} }
widget.changeLoadingState(false); widget.changeLoadingState(false);
} else { } else {

@ -9,7 +9,7 @@ class SoapUtils {
return mySelectedHistory; return mySelectedHistory;
} }
static MySelectedAllergy generateMySelectedAllergy({allergy, allergySeverity, isChecked = false, remark, isLocal = true, int createdBy, bool isExpanded = false}) { static MySelectedAllergy generateMySelectedAllergy({allergy, allergySeverity, isChecked = false, remark, isLocal = true, int createdBy = 0, bool isExpanded = false}) {
MySelectedAllergy mySelectedAllergy = MySelectedAllergy mySelectedAllergy =
MySelectedAllergy(selectedAllergy: allergy, selectedAllergySeverity: allergySeverity, isChecked: isChecked, remark: remark, isLocal: isLocal, createdBy: createdBy, isExpanded: isExpanded); MySelectedAllergy(selectedAllergy: allergy, selectedAllergySeverity: allergySeverity, isChecked: isChecked, remark: remark, isLocal: isLocal, createdBy: createdBy, isExpanded: isExpanded);
return mySelectedAllergy; return mySelectedAllergy;

@ -1,15 +1,12 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../shared_soap_widgets/bottom_sheet_title.dart'; import '../../shared_soap_widgets/bottom_sheet_title.dart';
@ -77,7 +74,7 @@ class _AddAllergiesState extends State<AddAllergies> {
}, },
addSelectedAllergy: () { addSelectedAllergy: () {
setState(() { setState(() {
widget.addAllergiesFun(myAllergiesListLocal); widget.addAllergiesFun!(myAllergiesListLocal);
}); });
}, },
isServiceSelected: (master) => isServiceSelected(master), isServiceSelected: (master) => isServiceSelected(master),
@ -105,7 +102,7 @@ class _AddAllergiesState extends State<AddAllergies> {
label: TranslationBase.of(context).addAllergies, label: TranslationBase.of(context).addAllergies,
onTap: () { onTap: () {
setState(() { setState(() {
widget.addAllergiesFun(myAllergiesListLocal); widget.addAllergiesFun!(myAllergiesListLocal);
}); });
}, },
), ),
@ -114,7 +111,7 @@ class _AddAllergiesState extends State<AddAllergies> {
isServiceSelected(MasterKeyModel masterKey) { isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy = Iterable<MySelectedAllergy> allergy =
myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked); myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy!.id && masterKey.typeId == element.selectedAllergy!.typeId && element.isChecked);
if (allergy.length > 0) { if (allergy.length > 0) {
return true; return true;
} }
@ -122,16 +119,16 @@ class _AddAllergiesState extends State<AddAllergies> {
} }
removeAllergyFromLocalList(MasterKeyModel masterKey) { removeAllergyFromLocalList(MasterKeyModel masterKey) {
myAllergiesListLocal.removeWhere((element) => element.selectedAllergy.id == masterKey.id); myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id);
} }
MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy = Iterable<MySelectedAllergy> allergy =
myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked); myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy!.id && masterKey.typeId == element.selectedAllergy!.typeId && element.isChecked);
if (allergy.length > 0) { if (allergy.length > 0) {
return allergy.first; return allergy.first;
} }
return null; return MySelectedAllergy();
} }
addAllergyLocally(MySelectedAllergy mySelectedAllergy) { addAllergyLocally(MySelectedAllergy mySelectedAllergy) {
@ -141,7 +138,7 @@ class _AddAllergiesState extends State<AddAllergies> {
setState(() { setState(() {
List<MySelectedAllergy> allergy = List<MySelectedAllergy> allergy =
// ignore: missing_return // ignore: missing_return
myAllergiesListLocal.where((element) => mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id).toList(); myAllergiesListLocal.where((element) => mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id).toList();
if (allergy.isEmpty) { if (allergy.isEmpty) {
myAllergiesListLocal.add(mySelectedAllergy); myAllergiesListLocal.add(mySelectedAllergy);

@ -1,13 +1,12 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'allergies_item.dart'; import 'allergies_item.dart';
@ -21,20 +20,20 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy; final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
final List<MasterKeyModel> masterList; final List<MasterKeyModel> masterList;
final String buttonName; final String? buttonName;
final String hintSearchText; final String? hintSearchText;
MasterKeyCheckboxSearchAllergiesWidget( MasterKeyCheckboxSearchAllergiesWidget(
{Key key, {Key? key,
this.model, required this.model,
this.addSelectedAllergy, required this.addSelectedAllergy,
this.removeAllergy, required this.removeAllergy,
this.masterList, required this.masterList,
this.addAllergy, required this.addAllergy,
this.isServiceSelected, required this.isServiceSelected,
this.buttonName, this.buttonName,
this.hintSearchText, this.hintSearchText,
this.getServiceSelectedAllergy}) required this.getServiceSelectedAllergy})
: super(key: key); : super(key: key);
@override @override
@ -42,7 +41,8 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
} }
class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckboxSearchAllergiesWidget> { class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckboxSearchAllergiesWidget> {
List<MasterKeyModel> items = List(); List<MasterKeyModel> items = [];
TextEditingController filteredSearchController = TextEditingController(); TextEditingController filteredSearchController = TextEditingController();
@override @override
@ -72,10 +72,14 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckb
onChanged: (value) { onChanged: (value) {
// filterSearchResults(value); // filterSearchResults(value);
}, },
onFieldSubmitted: (value) { onFieldSubmitted: () {
widget.model.getMasterLookup(MasterKeysService.Allergies, searchKey: filteredSearchController.text); widget.model.getMasterLookup(MasterKeysService.Allergies, searchKey: filteredSearchController.text);
widget.model.getMasterLookup(MasterKeysService.AllergySeverity, searchKey: ""); widget.model.getMasterLookup(MasterKeysService.AllergySeverity, searchKey: "");
}, },
// onFieldSubmitted: (value) {
// widget.model.getMasterLookup(MasterKeysService.Allergies!, searchKey: filteredSearchController.text!);
// widget.model.getMasterLookup(MasterKeysService.AllergySeverity, searchKey: "");
// },
suffixIcon: IconButton( suffixIcon: IconButton(
icon: Icon( icon: Icon(
Icons.search, Icons.search,
@ -131,12 +135,12 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckb
} }
void filterSearchResults(String query) { void filterSearchResults(String query) {
List<MasterKeyModel> dummySearchList = List(); List<MasterKeyModel> dummySearchList = [];
dummySearchList.addAll(widget.masterList); dummySearchList.addAll(widget.masterList);
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = List(); List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((items) { dummySearchList.forEach((items) {
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || items.nameEn.toLowerCase().contains(query.toLowerCase())) { if (items.nameAr!.toLowerCase().contains(query.toLowerCase()) || items.nameEn!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(items); dummyListData.add(items);
} }
}); });

@ -2,13 +2,13 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -26,25 +26,25 @@ class AddMedication extends StatefulWidget {
final Function addMedicationFun; final Function addMedicationFun;
TextEditingController medicationController; TextEditingController medicationController;
AddMedication({Key key, this.addMedicationFun, this.medicationController}) : super(key: key); AddMedication({Key? key, required this.addMedicationFun, required this.medicationController}) : super(key: key);
@override @override
_AddMedicationState createState() => _AddMedicationState(); _AddMedicationState createState() => _AddMedicationState();
} }
class _AddMedicationState extends State<AddMedication> { class _AddMedicationState extends State<AddMedication> {
MasterKeyModel _selectedMedicationDose; MasterKeyModel _selectedMedicationDose = MasterKeyModel();
MasterKeyModel _selectedMedicationStrength; MasterKeyModel _selectedMedicationStrength = MasterKeyModel();
MasterKeyModel _selectedMedicationRoute; MasterKeyModel _selectedMedicationRoute = MasterKeyModel();
MasterKeyModel _selectedMedicationFrequency; MasterKeyModel _selectedMedicationFrequency = MasterKeyModel();
TextEditingController doseController = TextEditingController(); TextEditingController doseController = TextEditingController();
TextEditingController strengthController = TextEditingController(); TextEditingController strengthController = TextEditingController();
TextEditingController routeController = TextEditingController(); TextEditingController routeController = TextEditingController();
TextEditingController frequencyController = TextEditingController(); TextEditingController frequencyController = TextEditingController();
GetMedicationResponseModel _selectedMedication; GetMedicationResponseModel _selectedMedication = GetMedicationResponseModel();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
@override @override
@ -74,7 +74,7 @@ class _AddMedicationState extends State<AddMedication> {
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort (SizeConfig.isHeightVeryShort
? 2 ? 2
: SizeConfig.isHeightShort : SizeConfig.isHeightShort
@ -87,7 +87,7 @@ class _AddMedicationState extends State<AddMedication> {
onTap: model.allMedicationList != null onTap: model.allMedicationList != null
? () { ? () {
setState(() { setState(() {
_selectedMedication = null; _selectedMedication = GetMedicationResponseModel();
}); });
} }
: null, : null,
@ -95,32 +95,36 @@ class _AddMedicationState extends State<AddMedication> {
? CustomAutoCompleteTextField( ? CustomAutoCompleteTextField(
isShowError: isFormSubmitted && _selectedMedication == null, isShowError: isFormSubmitted && _selectedMedication == null,
child: AutoCompleteTextField<GetMedicationResponseModel>( child: AutoCompleteTextField<GetMedicationResponseModel>(
decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, null, true, suffixIcon: Icons.search), decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, "", true, suffixIcon: Icons.search),
itemSubmitted: (item) => setState(() => _selectedMedication = item), itemSubmitted: (item) => setState(() => _selectedMedication = item),
key: key, key: key,
suggestions: model.allMedicationList, suggestions: model.allMedicationList,
itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description + '/' + suggestion.genericName), padding: EdgeInsets.all(8.0)), itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description! + '/' + suggestion.genericName!), padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1, itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) => itemFilter: (suggestion, input) =>
suggestion.genericName.toLowerCase().startsWith(input.toLowerCase()) || suggestion.genericName!.toLowerCase().startsWith(input.toLowerCase()) ||
suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || suggestion.description!.toLowerCase().startsWith(input.toLowerCase()) ||
suggestion.keywords.toLowerCase().startsWith(input.toLowerCase()), suggestion.keywords!.toLowerCase().startsWith(input.toLowerCase()),
), ),
) )
: AppTextFieldCustom( : AppTextFieldCustom(
height: Utils.getTextFieldHeight(), height: Utils.getTextFieldHeight(),
hintText: _selectedMedication != null hintText: _selectedMedication != null
? _selectedMedication.description + (' (${_selectedMedication.genericName} )') ? _selectedMedication.description! + (' (${_selectedMedication.genericName} )')
: TranslationBase.of(context).searchMedicineNameHere, : TranslationBase.of(context).searchMedicineNameHere,
minLines: 1, minLines: 1,
maxLines: 1, maxLines: 1,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
suffixIcon: IconButton( suffixIcon: IconButton(
icon: Icon( icon: Icon(
Icons.search, Icons.search,
color: Colors.grey.shade600, color: Colors.grey.shade600,
)), ),
onPressed: () {},
),
enabled: false, enabled: false,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
), ),
), ),
@ -133,7 +137,7 @@ class _AddMedicationState extends State<AddMedication> {
Container( Container(
width: MediaQuery.of(context).size.width * 0.7, width: MediaQuery.of(context).size.width * 0.7,
child: AppText( child: AppText(
_selectedMedication.description + (' (${_selectedMedication.genericName} )'), _selectedMedication.description! + (' (${_selectedMedication.genericName} )'),
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -158,7 +162,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() { setState(() {
_selectedMedicationDose = selectedValue; _selectedMedicationDose = selectedValue;
doseController.text = projectViewModel.isArabic ? _selectedMedicationDose.nameAr : _selectedMedicationDose.nameEn; doseController.text = projectViewModel.isArabic ? _selectedMedicationDose.nameAr! : _selectedMedicationDose.nameEn!;
}); });
}, },
); );
@ -177,6 +181,8 @@ class _AddMedicationState extends State<AddMedication> {
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
controller: doseController, controller: doseController,
validationError: isFormSubmitted && _selectedMedicationDose == null ? TranslationBase.of(context).emptyMessage : null, validationError: isFormSubmitted && _selectedMedicationDose == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -195,7 +201,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() { setState(() {
_selectedMedicationStrength = selectedValue; _selectedMedicationStrength = selectedValue;
strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength.nameAr : _selectedMedicationStrength.nameEn; strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength.nameAr! : _selectedMedicationStrength.nameEn!;
}); });
}, },
); );
@ -213,6 +219,8 @@ class _AddMedicationState extends State<AddMedication> {
minLines: 1, minLines: 1,
controller: strengthController, controller: strengthController,
validationError: isFormSubmitted && _selectedMedicationStrength == null ? TranslationBase.of(context).emptyMessage : null, validationError: isFormSubmitted && _selectedMedicationStrength == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -234,7 +242,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() { setState(() {
_selectedMedicationRoute = selectedValue; _selectedMedicationRoute = selectedValue;
routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute.nameAr : _selectedMedicationRoute.nameEn; routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute.nameAr! : _selectedMedicationRoute.nameEn!;
}); });
}, },
); );
@ -252,6 +260,8 @@ class _AddMedicationState extends State<AddMedication> {
minLines: 1, minLines: 1,
controller: routeController, controller: routeController,
validationError: isFormSubmitted && _selectedMedicationRoute == null ? TranslationBase.of(context).emptyMessage : null, validationError: isFormSubmitted && _selectedMedicationRoute == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -271,7 +281,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() { setState(() {
_selectedMedicationFrequency = selectedValue; _selectedMedicationFrequency = selectedValue;
frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency.nameAr : _selectedMedicationFrequency.nameEn; frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency.nameAr! : _selectedMedicationFrequency.nameEn!;
}); });
}, },
); );
@ -291,9 +301,11 @@ class _AddMedicationState extends State<AddMedication> {
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
controller: frequencyController, controller: frequencyController,
validationError: isFormSubmitted && _selectedMedicationFrequency == null ? TranslationBase.of(context).emptyMessage : null, validationError: isFormSubmitted && _selectedMedicationFrequency == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort (SizeConfig.isHeightVeryShort
? 20 ? 20
: SizeConfig.isHeightShort : SizeConfig.isHeightShort

@ -44,7 +44,7 @@ class _UpdateMedicationWidgetState extends State<UpdateMedicationWidget> {
builder: (context) { builder: (context) {
return AddMedication( return AddMedication(
addMedicationFun: (MySelectedAllergy mySelectedAllergy) {}, addMedicationFun: (MySelectedAllergy mySelectedAllergy) {},
medicationController: widget.medicationController, medicationController: widget.medicationController!,
); );
}); });
} }

@ -1,15 +1,15 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -25,7 +25,7 @@ class UpdateSubjectivePage extends StatefulWidget {
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final int currentIndex; final int currentIndex;
UpdateSubjectivePage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); UpdateSubjectivePage({Key? key, required this.changePageViewIndex, required this.patientInfo, required this.changeLoadingState, required this.currentIndex});
@override @override
_UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState();
@ -40,15 +40,15 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
TextEditingController medicationController = TextEditingController(); TextEditingController medicationController = TextEditingController();
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
List<MySelectedAllergy> myAllergiesList = List(); List<MySelectedAllergy> myAllergiesList = [];
List<MySelectedHistory> myHistoryList = List(); List<MySelectedHistory> myHistoryList = [];
getHistory(SOAPViewModel model) async { getHistory(SOAPViewModel model) async {
widget.changeLoadingState(true); widget.changeLoadingState(true);
if (model.patientHistoryList.isNotEmpty) { if (model.patientHistoryList.isNotEmpty) {
model.patientHistoryList.forEach((element) { model.patientHistoryList.forEach((element) {
if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey( MasterKeyModel? history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryFamily, masterKeys: MasterKeysService.HistoryFamily,
id: element.historyId, id: element.historyId,
); );
@ -58,7 +58,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
} }
} }
if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey( MasterKeyModel? history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryMedical, masterKeys: MasterKeysService.HistoryMedical,
id: element.historyId, id: element.historyId,
); );
@ -68,7 +68,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
} }
} }
if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey( MasterKeyModel? history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySports, masterKeys: MasterKeysService.HistorySports,
id: element.historyId, id: element.historyId,
); );
@ -78,7 +78,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
} }
} }
if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey( MasterKeyModel? history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySurgical, masterKeys: MasterKeysService.HistorySurgical,
id: element.historyId, id: element.historyId,
); );
@ -94,7 +94,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
getAllergies(SOAPViewModel model) async { getAllergies(SOAPViewModel model) async {
if (model.patientAllergiesList.isNotEmpty) { if (model.patientAllergiesList.isNotEmpty) {
model.patientAllergiesList.forEach((element) { 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; MasterKeyModel selectedAllergySeverity;
if (element.severity == 0) { if (element.severity == 0) {
selectedAllergySeverity = MasterKeyModel(id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); selectedAllergySeverity = MasterKeyModel(id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: '');
@ -102,11 +102,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
selectedAllergySeverity = model.getOneMasterKey( selectedAllergySeverity = model.getOneMasterKey(
masterKeys: MasterKeysService.AllergySeverity, masterKeys: MasterKeysService.AllergySeverity,
id: element.severity, id: element.severity,
); )!;
} }
MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy( MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy(
allergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy, remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity); allergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy!, remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
}); });
@ -124,11 +124,13 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
if (model.patientChiefComplaintList.isNotEmpty) { if (model.patientChiefComplaintList.isNotEmpty) {
isChiefExpand = true; isChiefExpand = true;
complaintsController.text = Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint); complaintsController.text = Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint!);
illnessController.text = model.patientChiefComplaintList[0].hopi; illnessController.text = model.patientChiefComplaintList[0].hopi!;
medicationController.text = model.patientChiefComplaintList[0].currentMedication != null ? !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty medicationController.text = model.patientChiefComplaintList[0].currentMedication != null
? model.patientChiefComplaintList[0].currentMedication + '\n \n' ? !(model.patientChiefComplaintList[0].currentMedication!).isNotEmpty
: model.patientChiefComplaintList[0].currentMedication : ""; ? model.patientChiefComplaintList[0].currentMedication! + '\n \n'
: model.patientChiefComplaintList[0].currentMedication!
: "";
} }
if (widget.patientInfo.admissionNo == null) { if (widget.patientInfo.admissionNo == null) {
await getHistory(model); await getHistory(model);
@ -174,7 +176,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
isExpanded: isChiefExpand, isExpanded: isChiefExpand,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 4 : 2),
), ),
if (widget.patientInfo.admissionNo == null) if (widget.patientInfo.admissionNo == null)
ExpandableSOAPWidget( ExpandableSOAPWidget(
@ -191,7 +193,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
isExpanded: isHistoryExpand, isExpanded: isHistoryExpand,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 4 : 2),
), ),
if (widget.patientInfo.admissionNo == null) if (widget.patientInfo.admissionNo == null)
ExpandableSOAPWidget( ExpandableSOAPWidget(
@ -215,7 +217,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
isExpanded: isAllergiesExpand, isExpanded: isAllergiesExpand,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 20 : 10),
), ),
], ],
), ),
@ -226,11 +228,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
); );
} }
addSubjectiveInfo({SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async { addSubjectiveInfo({required SOAPViewModel model, required List<MySelectedAllergy> myAllergiesList, required List<MySelectedHistory> myHistoryList}) async {
if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus();
widget.changeLoadingState(true); widget.changeLoadingState(true);
formKey.currentState.save(); formKey.currentState!.save();
formKey.currentState.validate(); formKey.currentState!.validate();
model.complaintsControllerError = ''; model.complaintsControllerError = '';
model.medicationControllerError = ''; model.medicationControllerError = '';
@ -270,6 +272,6 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
@override @override
Function nextFunction(model) { Function nextFunction(model) {
addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList.where((i) => i.isChecked).toList(), myHistoryList: myHistoryList); return addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList.where((i) => i.isChecked).toList(), myHistoryList: myHistoryList);
} }
} }

@ -4,16 +4,16 @@ import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class LineChartCurvedBloodPressureNew extends StatelessWidget { class LineChartCurvedBloodPressureNew extends StatelessWidget {
final String title; final String? title;
final List<TimeSeriesSales2> timeSeries1; final List<TimeSeriesSales2>? timeSeries1;
final List<TimeSeriesSales2> timeSeries2; final List<TimeSeriesSales2>? timeSeries2;
final int indexes; final int? indexes;
final bool isOX; final bool? isOX;
LineChartCurvedBloodPressureNew({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX = false}); LineChartCurvedBloodPressureNew({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX = false});
List<int> xAxixs = List(); List<int> xAxixs = [];
List<double> yAxixs = List(); List<double> yAxixs = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -39,7 +39,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
right: 20, right: 20,
), ),
child: Text( child: Text(
title, title!,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 16, fontSize: 16,
@ -57,7 +57,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
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( child: LineChart(
sampleData1(context), sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250), duration: const Duration(milliseconds: 250),
), ),
), ),
), ),
@ -127,9 +127,9 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
} }
getXaxix() { getXaxix() {
for (int index = 0; index < timeSeries1.length; index++) { for (int index = 0; index < timeSeries1!.length; index++) {
int mIndex = indexes * index; int mIndex = indexes! * index;
if (mIndex < timeSeries1.length) { if (mIndex < timeSeries1!.length) {
xAxixs.add(mIndex); xAxixs.add(mIndex);
} }
} }
@ -141,50 +141,70 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
touchCallback: (touchEvent, LineTouchResponse touchResponse) {}, touchCallback: (touchEvent, LineTouchResponse? touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: AxisTitles(
showTitles: true, sideTitles: SideTitles(
getTextStyles: (cxt, value) => const TextStyle( showTitles: true,
color: Colors.black, // rotateAngle: -65,
fontSize: 10, reservedSize: 22,
), getTitlesWidget: (value, meta) {
rotateAngle: -65, if (timeSeries1!.length < 15) {
margin: 22, if (timeSeries1!.length > value.toInt()) {
getTitles: (value) { return Text(
if (timeSeries1.length < 15) { '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
if (timeSeries1.length > value.toInt()) { style: TextStyle(
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; color: Colors.black,
} else fontSize: 10,
return ''; ),
} else { );
if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; } else
if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; return Text("");
if (xAxixs.contains(value.toInt())) { } else {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; if (value.toInt() == 0)
} return Text(
} '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
return ''; style: TextStyle(
}, color: Colors.black,
), fontSize: 10,
leftTitles: SideTitles( ),
showTitles: true, );
getTextStyles: (cxt, value) => const TextStyle( if (value.toInt() == timeSeries1!.length - 1)
color: Colors.black, return Text(
fontWeight: FontWeight.bold, '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
fontSize: 10, style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (xAxixs.contains(value.toInt())) {
return Text(
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
}
}
return Text("");
},
),
), ),
interval: getMaxY() - getMinY() <= 500 leftTitles: AxisTitles(
? 50 sideTitles: SideTitles(
: getMaxY() - getMinY() <= 1000 showTitles: true,
? 100 interval: getMaxY() - getMinY() <= 500
: 200, ? 50
margin: 12, : getMaxY() - getMinY() <= 1000
), ? 100
), : 200,
reservedSize: 12,
),
)),
borderData: FlBorderData( borderData: FlBorderData(
show: true, show: true,
border: const Border( border: const Border(
@ -204,7 +224,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
), ),
), ),
minX: 0, minX: 0,
maxX: (timeSeries1.length - 1).toDouble(), maxX: (timeSeries1!.length - 1).toDouble(),
maxY: getMaxY() + 15, maxY: getMaxY() + 15,
minY: getMinY() - 15, minY: getMinY() - 15,
lineBarsData: getData(context), lineBarsData: getData(context),
@ -213,12 +233,12 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
double getMaxY() { double getMaxY() {
double max = 0; double max = 0;
timeSeries1.forEach((element) { timeSeries1!.forEach((element) {
double resultValueDouble = element.sales; double resultValueDouble = element.sales!;
if (resultValueDouble > max) max = resultValueDouble; if (resultValueDouble > max) max = resultValueDouble;
}); });
timeSeries2.forEach((element) { timeSeries2!.forEach((element) {
double resultValueDouble = element.sales; double resultValueDouble = element.sales!;
if (resultValueDouble > max) max = resultValueDouble; if (resultValueDouble > max) max = resultValueDouble;
}); });
@ -226,13 +246,13 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
} }
double getMinY() { double getMinY() {
double min = timeSeries1[0].sales; double min = timeSeries1![0].sales!;
timeSeries1.forEach((element) { timeSeries1!.forEach((element) {
double resultValueDouble = element.sales; double resultValueDouble = element.sales!;
if (resultValueDouble < min) min = resultValueDouble; if (resultValueDouble < min) min = resultValueDouble;
}); });
timeSeries2.forEach((element) { timeSeries2!.forEach((element) {
double resultValueDouble = element.sales; double resultValueDouble = element.sales!;
if (resultValueDouble < min) min = resultValueDouble; if (resultValueDouble < min) min = resultValueDouble;
}); });
@ -242,20 +262,20 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
} }
List<LineChartBarData> getData(context) { List<LineChartBarData> getData(context) {
List<FlSpot> spots = List(); List<FlSpot> spots = [];
for (int index = 0; index < timeSeries1.length; index++) { for (int index = 0; index < timeSeries1!.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); spots.add(FlSpot(index.toDouble(), timeSeries1![index].sales!));
} }
List<FlSpot> spots2 = List(); List<FlSpot> spots2 = [];
for (int index = 0; index < timeSeries2.length; index++) { for (int index = 0; index < timeSeries2!.length; index++) {
spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); spots2.add(FlSpot(index.toDouble(), timeSeries2![index].sales!));
} }
final LineChartBarData lineChartBarData1 = LineChartBarData( final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots, spots: spots,
isCurved: true, isCurved: true,
colors: [Colors.red], color: Colors.red,
barWidth: 1.5, barWidth: 1.5,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData( dotData: FlDotData(
@ -268,7 +288,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
final LineChartBarData lineChartBarData2 = LineChartBarData( final LineChartBarData lineChartBarData2 = LineChartBarData(
spots: spots2, spots: spots2,
isCurved: true, isCurved: true,
colors: [Theme.of(context).primaryColor], color: Theme.of(context).primaryColor,
barWidth: 1.5, barWidth: 1.5,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData( dotData: FlDotData(
@ -288,9 +308,8 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
border: Border.all( border: Border.all(
width: 1, // width: 1, //
color: background // <--- border width here color: background // <--- border width here
), ),
borderRadius: BorderRadius.circular(radius), borderRadius: BorderRadius.circular(radius),
); );
} }
} }

@ -7,13 +7,13 @@ import 'package:intl/intl.dart';
class LineChartCurved extends StatelessWidget { class LineChartCurved extends StatelessWidget {
final String title; final String title;
final List<TimeSeriesSales2> timeSeries; final List<TimeSeriesSales2>? timeSeries;
final int indexes; final int indexes;
LineChartCurved({this.title, this.timeSeries, this.indexes}); LineChartCurved({this.title = '', this.timeSeries, this.indexes = 0});
List<int> xAxixs = List(); List<int> xAxixs = [];
List<double> yAxixs = List(); List<double> yAxixs = [];
// DateFormat format = DateFormat("yyyy-MM-dd"); // DateFormat format = DateFormat("yyyy-MM-dd");
DateFormat yearFormat = DateFormat("yyyy/MMM/dd"); DateFormat yearFormat = DateFormat("yyyy/MMM/dd");
@ -46,7 +46,7 @@ class LineChartCurved extends StatelessWidget {
children: [ children: [
AppText( AppText(
title, title,
fontSize: SizeConfig.textMultiplier * 2.1, fontSize: SizeConfig.textMultiplier! * 2.1,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -62,7 +62,7 @@ class LineChartCurved extends StatelessWidget {
padding: const EdgeInsets.only(right: 18.0, left: 16.0), padding: const EdgeInsets.only(right: 18.0, left: 16.0),
child: LineChart( child: LineChart(
sampleData1(context), sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250), duration: const Duration(milliseconds: 250),
), ),
), ),
), ),
@ -78,20 +78,20 @@ class LineChartCurved extends StatelessWidget {
} }
getXaxix() { getXaxix() {
for (int index = 0; index < timeSeries.length; index++) { for (int index = 0; index < timeSeries!.length; index++) {
int mIndex = indexes * index; int mIndex = indexes * index;
if (mIndex < timeSeries.length) { if (mIndex < timeSeries!.length) {
xAxixs.add(mIndex); xAxixs.add(mIndex);
} }
} }
} }
getYaxix() { getYaxix() {
int indexess = (timeSeries.length * 0.30).toInt(); int indexess = (timeSeries!.length * 0.30).toInt();
for (int index = 0; index < timeSeries.length; index++) { for (int index = 0; index < timeSeries!.length; index++) {
int mIndex = indexess * index; int mIndex = indexess * index;
if (mIndex < timeSeries.length) { if (mIndex < timeSeries!.length) {
yAxixs.add(timeSeries[mIndex].sales); yAxixs.add(timeSeries![mIndex].sales!);
} }
} }
} }
@ -102,82 +102,73 @@ class LineChartCurved extends StatelessWidget {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
//touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (event, LineTouchResponse? touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: AxisTitles(
showTitles: true, sideTitles: SideTitles(
getTextStyles: (context, value) { showTitles: true,
return TextStyle( //rotateAngle: -65,
color: Colors.black, //rotateAngle:-65,
fontSize: 10, reservedSize: 22,
); getTitlesWidget: (value, meta) {
}, if (timeSeries!.length < 15) {
rotateAngle: -65, if (timeSeries!.length > value.toInt()) {
//rotateAngle:-65, DateTime dateTime = timeSeries![value.toInt()].time;
margin: 22, if (isDatesSameYear) {
getTitles: (value) { return Text(
if (timeSeries.length < 15) { monthFormat.format(dateTime),
if (timeSeries.length > value.toInt()) { style: TextStyle(
DateTime dateTime = timeSeries[value.toInt()].time; color: Colors.black,
if (isDatesSameYear) { fontSize: 10,
return monthFormat.format(dateTime); ),
);
} else {
return Text(
yearFormat.format(dateTime),
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
}
} else { } else {
return yearFormat.format(dateTime); return Text('');
} }
} else { } else {
return ''; if (value.toInt() == 0 || value.toInt() == timeSeries!.length - 1 || xAxixs.contains(value.toInt())) {
} DateTime dateTime = timeSeries![value.toInt()].time;
} else { if (isDatesSameYear) {
if (value.toInt() == 0 || value.toInt() == timeSeries.length - 1 || xAxixs.contains(value.toInt())) { return Text(
DateTime dateTime = timeSeries[value.toInt()].time; monthFormat.format(dateTime),
if (isDatesSameYear) { style: TextStyle(
return monthFormat.format(dateTime); color: Colors.black,
} else { fontSize: 10,
return yearFormat.format(dateTime); ),
);
} else {
return Text(
yearFormat.format(dateTime),
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
}
} }
} }
} return Text('');
},
/*if (timeSeries.length < 15) { ),
if (timeSeries.length > value.toInt()) {
DateTime dateTime = timeSeries[value.toInt()].time;
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
} else
return '';
} else {
if (value.toInt() == 0)
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (value.toInt() == timeSeries.length - 1)
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
}
}*/
return '';
},
), ),
leftTitles: SideTitles( leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
interval: getInterval(), interval: getInterval(),
reservedSize: 12,
// getTitles: (value) { )),
// if (value.toInt() == 0)
// return '${value.toInt()}';
// else if (value.toInt() % horizontalInterval == 0)
// return '${value.toInt()}';
// else
// return '';
// },
margin: 12,
),
), ),
borderData: FlBorderData( borderData: FlBorderData(
show: true, show: true,
@ -198,7 +189,7 @@ class LineChartCurved extends StatelessWidget {
), ),
), ),
minX: 0, minX: 0,
maxX: (timeSeries.length - 1).toDouble(), maxX: (timeSeries!.length - 1).toDouble(),
maxY: getMaxY() + getInterval(), maxY: getMaxY() + getInterval(),
minY: 0, minY: 0,
lineBarsData: getData(context), lineBarsData: getData(context),
@ -236,8 +227,8 @@ class LineChartCurved extends StatelessWidget {
double getMaxY() { double getMaxY() {
double max = 0; double max = 0;
timeSeries.forEach((element) { timeSeries!.forEach((element) {
double resultValueDouble = element.sales; double resultValueDouble = element.sales!;
if (resultValueDouble > max) max = resultValueDouble; if (resultValueDouble > max) max = resultValueDouble;
}); });
@ -245,9 +236,9 @@ class LineChartCurved extends StatelessWidget {
} }
double getMinY() { double getMinY() {
double min = timeSeries[0].sales; double min = timeSeries![0].sales!;
timeSeries.forEach((element) { timeSeries!.forEach((element) {
double resultValueDouble = element.sales; double resultValueDouble = element.sales!;
if (resultValueDouble < min) min = resultValueDouble; if (resultValueDouble < min) min = resultValueDouble;
}); });
int value = min.toInt(); int value = min.toInt();
@ -256,21 +247,21 @@ class LineChartCurved extends StatelessWidget {
} }
List<LineChartBarData> getData(context) { List<LineChartBarData> getData(context) {
List<FlSpot> spots = List(); List<FlSpot> spots = [];
isDatesSameYear = true; isDatesSameYear = true;
int previousDateYear = 0; int previousDateYear = 0;
for (int index = 0; index < timeSeries.length; index++) { for (int index = 0; index < timeSeries!.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); 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; isDatesSameYear = false;
} }
previousDateYear = timeSeries[index].time.year; previousDateYear = timeSeries![index].time.year;
} }
final LineChartBarData lineChartBarData1 = LineChartBarData( final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots, spots: spots,
isCurved: true, isCurved: true,
colors: [Colors.red] /*[Theme.of(context).primaryColor]*/, color: Colors.red /*[Theme.of(context).primaryColor]*/,
barWidth: 5, barWidth: 5,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData( dotData: FlDotData(

@ -7,15 +7,15 @@ import 'package:flutter/material.dart';
class LineChartCurvedBloodPressure extends StatelessWidget { class LineChartCurvedBloodPressure extends StatelessWidget {
final String title; final String title;
final List<TimeSeriesSales2> timeSeries1; final List<TimeSeriesSales2>? timeSeries1;
final List<TimeSeriesSales2> timeSeries2; final List<TimeSeriesSales2>? timeSeries2;
final int indexes; final int indexes;
final bool isOX; final bool isOX;
LineChartCurvedBloodPressure({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX = false}); LineChartCurvedBloodPressure({this.title = '', this.timeSeries1, this.indexes = 0, this.timeSeries2, this.isOX = false});
List<int> xAxixs = List(); List<int> xAxixs = [];
List<double> yAxixs = List(); List<double> yAxixs = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -40,7 +40,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
children: [ children: [
AppText( AppText(
title, title,
fontSize: SizeConfig.textMultiplier * 2.1, fontSize: SizeConfig.textMultiplier! * 2.1,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -56,7 +56,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
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( child: LineChart(
sampleData1(context), sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250), duration: const Duration(milliseconds: 250),
), ),
), ),
), ),
@ -107,9 +107,9 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
} }
getXaxix() { getXaxix() {
for (int index = 0; index < timeSeries1.length; index++) { for (int index = 0; index < timeSeries1!.length; index++) {
int mIndex = indexes * index; int mIndex = indexes * index;
if (mIndex < timeSeries1.length) { if (mIndex < timeSeries1!.length) {
xAxixs.add(mIndex); xAxixs.add(mIndex);
} }
} }
@ -121,51 +121,73 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
// touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (event, LineTouchResponse? touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (context, value) { //rotateAngle: -65,
return TextStyle(
color: Colors.black,
fontSize: 10,
);
},
rotateAngle: -65,
//rotateAngle:-65, //rotateAngle:-65,
margin: 22, reservedSize: 22,
getTitles: (value) { getTitlesWidget: (value, meta) {
if (timeSeries1.length < 15) { if (timeSeries1!.length < 15) {
if (timeSeries1.length > value.toInt()) { if (timeSeries1!.length > value.toInt()) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; return Text(
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} else } else
return ''; return Text("");
} else { } else {
if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; if (value.toInt() == 0)
if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; return Text(
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (value.toInt() == timeSeries1!.length - 1)
return Text('${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
));
if (xAxixs.contains(value.toInt())) { if (xAxixs.contains(value.toInt())) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; return Text(
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} }
} }
return ''; return Text("");
}, },
), )),
leftTitles: SideTitles( leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
interval: getInterval(), interval: getInterval(),
getTitles: (value) { getTitlesWidget: (value, meta) {
return '${value.toInt()}'; return Text(
'${value.toInt()}',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
);
}, },
margin: 12, reservedSize: 12,
), )),
), ),
borderData: FlBorderData( borderData: FlBorderData(
show: true, show: true,
@ -203,8 +225,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
double getMaxY() { double getMaxY() {
double max = 0; double max = 0;
timeSeries1.forEach((element) { timeSeries1!.forEach((element) {
double resultValueDouble = element.sales; double resultValueDouble = element.sales!;
if (resultValueDouble > max) max = resultValueDouble; if (resultValueDouble > max) max = resultValueDouble;
}); });
@ -212,15 +234,16 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
} }
double getMinY() { double getMinY() {
double min = timeSeries1[0].sales; double min = timeSeries1![0].sales!;
timeSeries1.forEach((element) { timeSeries1!.forEach((element) {
double resultValueDouble = element.sales; double resultValueDouble = element.sales!;
if (resultValueDouble < min) min = resultValueDouble; if (resultValueDouble < min) min = resultValueDouble;
}); });
int value = min.toInt(); int value = min.toInt();
return value.toDouble(); return value.toDouble();
} }
// double getMaxY() { // double getMaxY() {
// double max = 0; // double max = 0;
// timeSeries1.forEach((element) { // timeSeries1.forEach((element) {
@ -252,20 +275,20 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
// } // }
List<LineChartBarData> getData(context) { List<LineChartBarData> getData(context) {
List<FlSpot> spots = List(); List<FlSpot> spots = [];
for (int index = 0; index < timeSeries1.length; index++) { for (int index = 0; index < timeSeries1!.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); spots.add(FlSpot(index.toDouble(), timeSeries1![index].sales!));
} }
List<FlSpot> spots2 = List(); List<FlSpot> spots2 = [];
for (int index = 0; index < timeSeries2.length; index++) { for (int index = 0; index < timeSeries2!.length; index++) {
spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); spots2.add(FlSpot(index.toDouble(), timeSeries2![index].sales!));
} }
final LineChartBarData lineChartBarData1 = LineChartBarData( final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots, spots: spots,
isCurved: true, isCurved: true,
colors: [Theme.of(context).primaryColor], color: Theme.of(context).primaryColor,
barWidth: 5, barWidth: 5,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData( dotData: FlDotData(
@ -278,7 +301,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
final LineChartBarData lineChartBarData2 = LineChartBarData( final LineChartBarData lineChartBarData2 = LineChartBarData(
spots: spots2, spots: spots2,
isCurved: true, isCurved: true,
colors: [Colors.red], color: Colors.red,
barWidth: 5, barWidth: 5,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData( dotData: FlDotData(
@ -289,7 +312,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
), ),
); );
List<LineChartBarData> lineChartData = List(); List<LineChartBarData> lineChartData = [];
if (spots.isNotEmpty) { if (spots.isNotEmpty) {
lineChartData.add(lineChartBarData1); lineChartData.add(lineChartBarData1);
} }

@ -16,15 +16,15 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class VitalSignDetailsScreen extends StatelessWidget { class VitalSignDetailsScreen extends StatelessWidget {
int appointmentNo; int? appointmentNo;
int projectID; int? projectID;
bool isNotOneAppointment; bool isNotOneAppointment;
VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true});
@override @override
Widget build(BuildContext context) { 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']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
@ -56,14 +56,14 @@ class VitalSignDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s",
fontSize: SizeConfig.textMultiplier * 1.6, fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
), ),
AppText( AppText(
TranslationBase.of(context).vitalSign, TranslationBase.of(context).vitalSign,
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
) )
@ -90,7 +90,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText( AppText(
"${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}",
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier! * 2.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
Row( Row(
@ -110,15 +110,15 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText( AppText(
"${TranslationBase.of(context).bmiUnderWeight}", "${TranslationBase.of(context).bmiUnderWeight}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize: SizeConfig.textMultiplier! * 1.15,
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : Colors.transparent,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
AppText( AppText(
"(<18.5)", "(<18.5)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize: SizeConfig.textMultiplier! * 1.15,
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : Colors.transparent,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
], ],
@ -138,17 +138,17 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText( child: AppText(
"${TranslationBase.of(context).normal}", "${TranslationBase.of(context).normal}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : Colors.transparent,
), ),
), ),
AppText( AppText(
"(18.5-24.9)", "(18.5-24.9)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : Colors.transparent,
), ),
], ],
)), )),
@ -166,16 +166,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText( AppText(
"${TranslationBase.of(context).bmiOverWeight}", "${TranslationBase.of(context).bmiOverWeight}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.155, fontSize: SizeConfig.textMultiplier! * 1.155,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : Colors.transparent,
), ),
AppText( AppText(
"(25-29.9)", "(25-29.9)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.155, fontSize: SizeConfig.textMultiplier! * 1.155,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : Colors.transparent,
), ),
], ],
)), )),
@ -193,16 +193,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText( AppText(
"${TranslationBase.of(context).bmiObese}", "${TranslationBase.of(context).bmiObese}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : Colors.transparent,
), ),
AppText( AppText(
"(30-34.9)", "(30-34.9)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : Colors.transparent,
), ),
], ],
)), )),
@ -222,17 +222,17 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText( child: AppText(
"${TranslationBase.of(context).bmiObeseExtreme}", "${TranslationBase.of(context).bmiObeseExtreme}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : Colors.transparent,
), ),
), ),
AppText( AppText(
"(35<)", "(35<)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : Colors.transparent,
), ),
], ],
)), )),

@ -7,7 +7,6 @@ import 'package:doctor_app_flutter/lookups/patient_lookup.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_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_and_detials.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -18,18 +17,18 @@ import 'package:provider/provider.dart';
class VitalSignItemDetailsScreen extends StatelessWidget { class VitalSignItemDetailsScreen extends StatelessWidget {
final vitalSignDetails pageKey; final vitalSignDetails pageKey;
final String pageTitle; final String pageTitle;
List<Map> VSchart; List<Map>? VSchart;
PatiantInformtion patient; PatiantInformtion patient;
String patientType; String? patientType;
String arrivalType; String? arrivalType;
List<TimeSeriesSales2> timeSeriesData1 = []; List<TimeSeriesSales2> timeSeriesData1 = [];
List<TimeSeriesSales2> timeSeriesData2 = []; List<TimeSeriesSales2> timeSeriesData2 = [];
final String viewKey1; final String? viewKey1;
final String viewKey2; final String? viewKey2;
VitalSignItemDetailsScreen({this.vitalList, this.pageKey, @required this.viewKey1, @required this.viewKey2, this.pageTitle, this.patient, this.patientType, this.arrivalType}); VitalSignItemDetailsScreen({required this.vitalList, required this.pageKey, this.viewKey1, this.viewKey2, required this.pageTitle, required this.patient, this.patientType, this.arrivalType});
final List<VitalSignHistory> vitalList; final List<VitalSignHistory> vitalList;
@ -205,15 +204,15 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6, fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
AppText( AppText(
TranslationBase.of(context).vitalSign, TranslationBase.of(context).vitalSign,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )
], ],
@ -223,7 +222,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
child: ListView( child: ListView(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: VSchart.map((chartInfo) { children: VSchart!.map((chartInfo) {
var vitalListTemp = vitalList.where( var vitalListTemp = vitalList.where(
(element) => element.toJson()[chartInfo['viewKey']] != null, (element) => element.toJson()[chartInfo['viewKey']] != null,
); );

@ -3,11 +3,11 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -55,10 +55,10 @@ class _DrugToDrug extends State<DrugToDrug> {
? BaseView<PrescriptionViewModel>( ? BaseView<PrescriptionViewModel>(
onModelReady: (prescriptionViewModel) => onModelReady: (prescriptionViewModel) =>
prescriptionViewModel.getDrugToDrug(vitalSignsViewModel.patientVitalSigns, widget.listAssessment, soapViewModel.patientAllergiesList, widget.patient, widget.prescription), prescriptionViewModel.getDrugToDrug(vitalSignsViewModel.patientVitalSigns, widget.listAssessment, soapViewModel.patientAllergiesList, widget.patient, widget.prescription),
builder: (BuildContext context, PrescriptionViewModel prescriptionViewModel, Widget child) => NetworkBaseView( builder: (BuildContext context, PrescriptionViewModel prescriptionViewModel, Widget? child) => NetworkBaseView(
baseViewModel: prescriptionViewModel, baseViewModel: prescriptionViewModel,
child: Container( child: Container(
height: SizeConfig.realScreenHeight * .9, height: SizeConfig.realScreenHeight! * .9,
child: new ListView.builder( child: new ListView.builder(
itemCount: expandableList.length, itemCount: expandableList.length,
itemBuilder: (context, i) { itemBuilder: (context, i) {
@ -73,11 +73,11 @@ class _DrugToDrug extends State<DrugToDrug> {
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppText( child: AppText(
item['comment'], item['comment'],
color: Colors.red[900], color: Colors.red[900]!,
)); ));
}).toList()); }).toList());
})))) }))))
: Container(height: SizeConfig.realScreenHeight * .45, child: GifLoaderContainer()); : Container(height: SizeConfig.realScreenHeight! * .45, child: GifLoaderContainer());
} }
getTypeID() async { getTypeID() async {

@ -13,18 +13,18 @@ import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../widgets/transitions/slide_up_page.dart'; import '../../../widgets/transitions/slide_up_page.dart';
import 'add_drug/add_drug_widget.dart'; import 'add_drug/add_drug_widget.dart';
@ -35,21 +35,22 @@ class PrescriptionFormWidget extends StatefulWidget {
final MedicineViewModel medicineViewModel; final MedicineViewModel medicineViewModel;
final GetMedicationResponseModel selectedMedication; final GetMedicationResponseModel selectedMedication;
const PrescriptionFormWidget({Key key, this.patient, this.prescriptionList, this.prescriptionViewModel, this.medicineViewModel, this.selectedMedication}); const PrescriptionFormWidget(
{Key? key, required this.patient, required this.prescriptionList, required this.prescriptionViewModel, required this.medicineViewModel, required this.selectedMedication});
@override @override
_PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState(); _PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState();
} }
class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> { class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
String routeError; String? routeError;
String frequencyError; String? frequencyError;
String doseTimeError; String? doseTimeError;
String durationError; String? durationError;
String unitError; String? unitError;
String strengthError; String? strengthError;
int selectedType; int? selectedType;
TextEditingController strengthController = TextEditingController(); TextEditingController strengthController = TextEditingController();
TextEditingController unitController = TextEditingController(); TextEditingController unitController = TextEditingController();
@ -60,7 +61,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
bool visibilitySearch = true; bool visibilitySearch = true;
DateTime selectedDate = DateTime.now(); DateTime selectedDate = DateTime.now();
int strengthChar; int? strengthChar;
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
TextEditingController drugIdController = TextEditingController(); TextEditingController drugIdController = TextEditingController();
@ -140,7 +141,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column( child: Column(
children: [ children: [
AppText( AppText(
widget.selectedMedication?.description ?? "", widget.selectedMedication.description ?? "",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
SizedBox( SizedBox(
@ -165,7 +166,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
value: 1, value: 1,
groupValue: selectedType, groupValue: selectedType,
onChanged: (value) { onChanged: (value) {
setSelectedType(value); setSelectedType(value!);
}, },
), ),
Text(TranslationBase.of(context).regular), Text(TranslationBase.of(context).regular),
@ -186,7 +187,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
setState(() { setState(() {
strengthChar = value.length; strengthChar = value.length;
}); });
if (strengthChar >= 5) { if (strengthChar! >= 5) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context).only5DigitsAllowedForStrength, TranslationBase.of(context).only5DigitsAllowedForStrength,
); );
@ -195,6 +196,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
inputType: TextInputType.numberWithOptions( inputType: TextInputType.numberWithOptions(
decimal: true, decimal: true,
), ),
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
@ -279,6 +281,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: widget.medicineViewModel.patientAssessmentList[0].icdCode10ID.toString(), hintText: widget.medicineViewModel.patientAssessmentList[0].icdCode10ID.toString(),
enabled: true, enabled: true,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
), ),
Container( Container(
@ -288,6 +292,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
maxLines: 5, maxLines: 5,
hintText: widget.medicineViewModel.patientAssessmentList[0].asciiDesc.toString(), hintText: widget.medicineViewModel.patientAssessmentList[0].asciiDesc.toString(),
enabled: true, enabled: true,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
), ),
], ],
@ -307,9 +313,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Icons.calendar_today, Icons.calendar_today,
color: Colors.black, color: Colors.black,
), ),
onPressed: () {},
), ),
dropDownText: selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, dropDownText: selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null,
enabled: false, enabled: false,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
), ),
), ),
@ -339,6 +348,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
dropDownText: uom != null ? uom : null, dropDownText: uom != null ? uom : null,
enabled: false, enabled: false,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox(height: spaceBetweenTextFields), SizedBox(height: spaceBetweenTextFields),
@ -349,6 +360,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
dropDownText: box != null ? widget.medicineViewModel.boxQuintity.toString() : null, dropDownText: box != null ? widget.medicineViewModel.boxQuintity.toString() : null,
enabled: false, enabled: false,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox(height: spaceBetweenTextFields), SizedBox(height: spaceBetweenTextFields),
@ -381,7 +394,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
SizedBox(height: spaceBetweenTextFields), SizedBox(height: spaceBetweenTextFields),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
@ -405,7 +418,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Utils.hideKeyboard(context); Utils.hideKeyboard(context);
DateTime selectedDate; DateTime selectedDate;
selectedDate = DateTime.now(); selectedDate = DateTime.now();
final DateTime picked = await showDatePicker( final DateTime? picked = await showDatePicker(
context: context, context: context,
initialDate: selectedDate, initialDate: selectedDate,
firstDate: DateTime.now(), firstDate: DateTime.now(),
@ -440,7 +453,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
return; return;
} }
if (formKey.currentState.validate()) { if (formKey.currentState!.validate()) {
Navigator.push( Navigator.push(
context, context,
SlideUpPageRoute( SlideUpPageRoute(
@ -501,6 +514,6 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
} }
}); });
} }
formKey.currentState.save(); formKey.currentState!.save();
} }
} }

@ -13,7 +13,6 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../utils/utils.dart'; import '../../utils/utils.dart';
@ -22,7 +21,7 @@ import '../../widgets/shared/errors/error_message.dart';
class OldPrescriptionsPage extends StatelessWidget { class OldPrescriptionsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { 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']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
@ -35,7 +34,7 @@ class OldPrescriptionsPage extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100]!,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient,
isInpatient: isInpatient, isInpatient: isInpatient,
@ -81,13 +80,13 @@ class OldPrescriptionsPage extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
DoctorCard( DoctorCard(
doctorName: Utils.convertToTitleCase(model.prescriptionsList[index].doctorName), doctorName: Utils.convertToTitleCase(model.prescriptionsList[index].doctorName!),
profileUrl: model.prescriptionsList[index].doctorImageURL, profileUrl: model.prescriptionsList[index].doctorImageURL,
branch: model.prescriptionsList[index].name, branch: model.prescriptionsList[index].name,
clinic: model.prescriptionsList[index].clinicDescription, clinic: model.prescriptionsList[index].clinicDescription,
isPrescriptions: true, isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat( appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
model.prescriptionsList[index].appointmentDate, model.prescriptionsList[index].appointmentDate!,
), ),
), ),
], ],
@ -135,7 +134,7 @@ class OldPrescriptionsPage extends StatelessWidget {
children: [ children: [
CustomRow( CustomRow(
label: "", label: "",
value: Utils.convertToTitleCase(model.medicationForInPatient[index].pHRItemDescription), value: Utils.convertToTitleCase(model.medicationForInPatient[index].pHRItemDescription!),
valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
), ),
SizedBox( SizedBox(
@ -170,10 +169,10 @@ class OldPrescriptionsPage extends StatelessWidget {
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
startOn: AppDateUtils.getDateTimeFromServerFormat( startOn: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].startDatetime, model.medicationForInPatient[index].startDatetime!,
), ),
stopOn: AppDateUtils.getDateTimeFromServerFormat( stopOn: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].stopDatetime, model.medicationForInPatient[index].stopDatetime!,
), ),
), ),
), ),

@ -4,26 +4,26 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -34,10 +34,10 @@ import 'package:speech_to_text/speech_to_text.dart' as stt;
class PrescriptionCheckOutScreen extends StatefulWidget { class PrescriptionCheckOutScreen extends StatefulWidget {
final PrescriptionViewModel model; final PrescriptionViewModel model;
final PatiantInformtion patient; final PatiantInformtion patient;
final List<PrescriptionModel> prescriptionList; final List<PrescriptionModel>? prescriptionList;
final ProcedureTempleteDetailsModel groupProcedures; final ProcedureTempleteDetailsModel groupProcedures;
const PrescriptionCheckOutScreen({Key key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) : super(key: key); const PrescriptionCheckOutScreen({Key? key, required this.model, required this.patient, this.prescriptionList, required this.groupProcedures}) : super(key: key);
@override @override
_PrescriptionCheckOutScreenState createState() => _PrescriptionCheckOutScreenState(); _PrescriptionCheckOutScreenState createState() => _PrescriptionCheckOutScreenState();
@ -45,44 +45,44 @@ class PrescriptionCheckOutScreen extends StatefulWidget {
class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen> { class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen> {
postPrescription( postPrescription(
{String duration, {String? duration,
String doseTimeIn, String? doseTimeIn,
String dose, String? dose,
String drugId, String? drugId,
String strength, String? strength,
String route, String? route,
String frequency, String? frequency,
String indication, String? indication,
String instruction, String? instruction,
PrescriptionViewModel model, PrescriptionViewModel? model,
DateTime doseTime, DateTime? doseTime,
String doseUnit, String? doseUnit,
String icdCode, String? icdCode,
PatiantInformtion patient, PatiantInformtion? patient,
String patientType}) async { String? patientType}) async {
PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel();
List<PrescriptionRequestModel> prescriptionList = List(); List<PrescriptionRequestModel> prescriptionList = [];
postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.appointmentNo = patient!.appointmentNo;
postProcedureReqModel.clinicID = patient.clinicId; postProcedureReqModel.clinicID = patient.clinicId;
postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN; postProcedureReqModel.patientMRN = patient.patientMRN;
prescriptionList.add(PrescriptionRequestModel( prescriptionList.add(PrescriptionRequestModel(
covered: true, covered: true,
dose: double.parse(dose), dose: double.parse(dose!),
itemId: drugId.isEmpty ? 1 : int.parse(drugId), itemId: drugId!.isEmpty ? 1 : int.parse(drugId),
doseUnitId: int.parse(doseUnit), doseUnitId: int.parse(doseUnit!),
route: route.isEmpty ? 1 : int.parse(route), route: route!.isEmpty ? 1 : int.parse(route),
frequency: frequency.isEmpty ? 1 : int.parse(frequency), frequency: frequency!.isEmpty ? 1 : int.parse(frequency),
remarks: instruction, remarks: instruction,
approvalRequired: true, approvalRequired: true,
icdcode10Id: icdCode.toString(), icdcode10Id: icdCode.toString(),
doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), doseTime: doseTimeIn!.isEmpty ? 1 : int.parse(doseTimeIn),
duration: duration.isEmpty ? 1 : int.parse(duration), duration: duration!.isEmpty ? 1 : int.parse(duration),
doseStartDate: doseTime.toIso8601String())); doseStartDate: doseTime!.toIso8601String()));
postProcedureReqModel.prescriptionRequestModel = prescriptionList; postProcedureReqModel.prescriptionRequestModel = prescriptionList;
await model.postPrescription(postProcedureReqModel, patient.patientMRN); await model!.postPrescription(postProcedureReqModel, patient.patientMRN!);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
@ -92,14 +92,14 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
} }
} }
String routeError; String? routeError;
String frequencyError; String? frequencyError;
String doseTimeError; String? doseTimeError;
String durationError; String? durationError;
String unitError; String? unitError;
String strengthError; String? strengthError;
int selectedType; int selectedType = 0;
TextEditingController strengthController = TextEditingController(); TextEditingController strengthController = TextEditingController();
TextEditingController indicationController = TextEditingController(); TextEditingController indicationController = TextEditingController();
@ -109,10 +109,10 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
bool visibilitySearch = true; bool visibilitySearch = true;
final myController = TextEditingController(); final myController = TextEditingController();
DateTime selectedDate; DateTime? selectedDate;
int strengthChar; int strengthChar = 0;
GetMedicationResponseModel _selectedMedication; GetMedicationResponseModel _selectedMedication = GetMedicationResponseModel();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
TextEditingController drugIdController = TextEditingController(); TextEditingController drugIdController = TextEditingController();
TextEditingController doseController = TextEditingController(); TextEditingController doseController = TextEditingController();
@ -210,7 +210,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
// TODO Elham* move this logic to the model // TODO Elham* move this logic to the model
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) { x = model.patientAssessmentList.map((element) {
return element.icdCode10ID; return element.icdCode10ID;
@ -231,7 +231,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
builder: ( builder: (
BuildContext context, BuildContext context,
MedicineViewModel model, MedicineViewModel model,
Widget child, Widget? child,
) => ) =>
AppScaffold( AppScaffold(
backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), backgroundColor: Color(0xffF8F8F8).withOpacity(0.9),
@ -320,7 +320,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
value: 1, value: 1,
groupValue: selectedType, groupValue: selectedType,
onChanged: (value) { onChanged: (value) {
setSelectedType(value); setSelectedType(value!);
}, },
), ),
Text(TranslationBase.of(context).regular), Text(TranslationBase.of(context).regular),
@ -354,6 +354,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
inputType: TextInputType.numberWithOptions( inputType: TextInputType.numberWithOptions(
decimal: true, decimal: true,
), ),
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
@ -461,8 +462,8 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
child: InkWell( child: InkWell(
onTap: () => selectDate(context, widget.model), onTap: () => selectDate(context, widget.model),
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration(TranslationBase.of(context).date, decoration: textFieldSelectorDecoration(
selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, true, TranslationBase.of(context).date, selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : "", true,
suffixIcon: Icon( suffixIcon: Icon(
Icons.calendar_today, Icons.calendar_today,
color: Colors.black, color: Colors.black,
@ -529,7 +530,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
), ),
SizedBox(height: spaceBetweenTextFields), SizedBox(height: spaceBetweenTextFields),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
@ -557,12 +558,12 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
); );
return; return;
} }
if (formKey.currentState.validate()) { if (formKey.currentState!.validate()) {
Navigator.pop(context); Navigator.pop(context);
{ {
postPrescription( postPrescription(
icdCode: model.patientAssessmentList.isNotEmpty icdCode: model.patientAssessmentList.isNotEmpty
? model.patientAssessmentList[0].icdCode10ID.isEmpty ? model.patientAssessmentList[0].icdCode10ID!.isEmpty
? "test" ? "test"
: model.patientAssessmentList[0].icdCode10ID.toString() : model.patientAssessmentList[0].icdCode10ID.toString()
: "test", : "test",
@ -575,7 +576,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
duration: duration['id'].toString(), duration: duration['id'].toString(),
frequency: model.itemMedicineList.length == 1 ? model.itemMedicineList[0]['parameterCode'].toString() : frequency['parameterCode'].toString(), frequency: model.itemMedicineList.length == 1 ? model.itemMedicineList[0]['parameterCode'].toString() : frequency['parameterCode'].toString(),
route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(),
drugId: (widget.groupProcedures.aliasN.replaceAll("item code ;", "")), drugId: (widget.groupProcedures.aliasN!.replaceAll("item code ;", "")),
strength: strengthController.text, strength: strengthController.text,
indication: indicationController.text, indication: indicationController.text,
instruction: instructionController.text, instruction: instructionController.text,
@ -618,7 +619,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
}); });
} }
formKey.currentState.save(); formKey.currentState!.save();
}, },
), ),
], ],
@ -647,7 +648,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
Utils.hideKeyboard(context); Utils.hideKeyboard(context);
DateTime selectedDate; DateTime selectedDate;
selectedDate = DateTime.now(); selectedDate = DateTime.now();
final DateTime picked = await showDatePicker( final DateTime? picked = await showDatePicker(
context: context, context: context,
initialDate: selectedDate, initialDate: selectedDate,
firstDate: DateTime.now(), firstDate: DateTime.now(),
@ -663,7 +664,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
/// TODO Elham* Use it from the textfeild utils /// TODO Elham* Use it from the textfeild utils
InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon? suffixIcon}) {
return InputDecoration( return InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),

@ -21,27 +21,25 @@ class AddProcedurePage extends StatefulWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final ProcedureType procedureType; final ProcedureType procedureType;
const AddProcedurePage( const AddProcedurePage({Key? key, required this.model, required this.patient, required this.procedureType}) : super(key: key);
{Key key, this.model, this.patient, @required this.procedureType})
: super(key: key);
@override @override
_AddProcedurePageState createState() => _AddProcedurePageState( _AddProcedurePageState createState() => _AddProcedurePageState(patient: patient, model: model, procedureType: this.procedureType);
patient: patient, model: model, procedureType: this.procedureType);
} }
class _AddProcedurePageState extends State<AddProcedurePage> { class _AddProcedurePageState extends State<AddProcedurePage> {
String selectedType; String? selectedType;
ProcedureViewModel model; ProcedureViewModel model;
PatiantInformtion patient; PatiantInformtion patient;
ProcedureType procedureType; ProcedureType procedureType;
_AddProcedurePageState({this.patient, this.model, this.procedureType}); _AddProcedurePageState({required this.patient, required this.model, required this.procedureType});
TextEditingController procedureController = TextEditingController(); TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController(); TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List(); List<EntityList> entityList = [];
List<EntityList> entityListProcedure = List();
List<EntityList> entityListProcedure = [];
TextEditingController procedureName = TextEditingController(); TextEditingController procedureName = TextEditingController();
dynamic selectedCategory; dynamic selectedCategory;
@ -56,13 +54,9 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getProcedureCategory( 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) => builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold(
AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: FractionallySizedBox( child: FractionallySizedBox(
@ -85,62 +79,49 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
Column( Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).pleaseEnterProcedure,
.pleaseEnterProcedure,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 20, fontSize: 20,
), ),
], ],
), ),
SizedBox( SizedBox(
height: height: MediaQuery.of(context).size.height * 0.02,
MediaQuery.of(context).size.height * 0.02,
), ),
Row( Row(
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * width: MediaQuery.of(context).size.width * 0.79,
0.79,
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).searchProcedureHere,
.searchProcedureHere,
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
controller: procedureName, controller: procedureName,
onChanged: (String value) {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * width: MediaQuery.of(context).size.width * 0.02,
0.02,
), ),
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
if (procedureName.text.isNotEmpty && if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) {
procedureName.text.length >= 3) { GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog( await model.getProcedureCategory(patientId: patient.patientId, categoryName: procedureName.text, isLocalBusy: true);
context); if (model.state == ViewState.ErrorLocal) {
await model.getProcedureCategory( DrAppToastMsg.showErrorToast(model.error);
patientId: patient.patientId,
categoryName: procedureName.text,
isLocalBusy: true);
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} }
GifLoaderDialogUtils.hideDialog( GifLoaderDialogUtils.hideDialog(context);
context);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context) TranslationBase.of(context).atLeastThreeCharacters,
.atLeastThreeCharacters,
); );
} }
}, },
@ -154,15 +135,12 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
), ),
], ],
), ),
if ((procedureType == ProcedureType.PROCEDURE if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) && model.categoriesList.length != 0)
? procedureName.text.isNotEmpty
: true) &&
model.categoriesList.length != 0)
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: EntityListCheckboxSearchWidget( child: EntityListCheckboxSearchWidget(
model: widget.model, model: widget.model,
masterList: model.categoriesList[0].entityList, masterList: model.categoriesList[0].entityList!,
removeProcedure: (item) { removeProcedure: (item) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(item);
@ -174,8 +152,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
}); });
}, },
addSelectedHistories: () {}, addSelectedHistories: () {},
isEntityListSelected: (master) => widget.model isEntityListSelected: (master) => widget.model.isEntityListSelected(master, entityList),
.isEntityListSelected(master, entityList),
)), )),
SizedBox( SizedBox(
height: 10, height: 10,
@ -201,8 +178,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (entityList.isEmpty == true) { if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context) TranslationBase.of(context).fillTheMandatoryProcedureDetails,
.fillTheMandatoryProcedureDetails,
); );
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
return; return;

@ -18,21 +18,13 @@ class BaseAddProcedureTabPage extends StatefulWidget {
final PatiantInformtion? patient; final PatiantInformtion? patient;
final ProcedureType procedureType; final ProcedureType procedureType;
const BaseAddProcedureTabPage( const BaseAddProcedureTabPage({Key? key, this.previousProcedureViewModel, this.prescriptionModel, this.patient, required this.procedureType}) : super(key: key);
{Key? key,
this.previousProcedureViewModel,
this.prescriptionModel,
this.patient,
required this.procedureType})
: super(key: key);
@override @override
_BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState( _BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState(patient: patient, procedureType: procedureType);
patient: patient, procedureType: procedureType);
} }
class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage> class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
final PatiantInformtion? patient; final PatiantInformtion? patient;
final ProcedureType? procedureType; final ProcedureType? procedureType;
@ -67,12 +59,10 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (widget.previousProcedureViewModel == null) { if (widget.previousProcedureViewModel == null) {
await model.getProcedureTemplate( await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId());
categoryID: widget.procedureType.getCategoryId());
} }
}, },
builder: (BuildContext context, ProcedureViewModel model, Widget? child) => builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold(
AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: BottomSheetTitle( appBar: BottomSheetTitle(
@ -83,8 +73,7 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
child: Scaffold( child: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
preferredSize: preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070),
Size.fromHeight(MediaQuery.of(context).size.height * 0.070),
child: TabBar( child: TabBar(
isScrollable: false, isScrollable: false,
controller: _tabController, controller: _tabController,
@ -92,16 +81,11 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
indicatorWeight: 1.0, indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0),
EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
TabWidget.tabWidget(screenSize, _activeTab == 0, TabWidget.tabWidget(screenSize, _activeTab == 0, procedureType!.getFavouriteTabName(context), isFirst: true, context: context),
procedureType!.getFavouriteTabName(context), TabWidget.tabWidget(screenSize, _activeTab == 1, procedureType!.getAllLabelName(context), isLast: true, context: context),
isFirst: true, context: context),
TabWidget.tabWidget(screenSize, _activeTab == 1,
procedureType!.getAllLabelName(context),
isLast: true, context: context),
], ],
), ),
), ),
@ -113,8 +97,7 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
controller: _tabController, controller: _tabController,
children: [ children: [
AddFavouriteProcedure( AddFavouriteProcedure(
previousProcedureViewModel: previousProcedureViewModel: widget.previousProcedureViewModel ?? model,
widget.previousProcedureViewModel ?? model,
prescriptionModel: widget.prescriptionModel, prescriptionModel: widget.prescriptionModel,
patient: patient, patient: patient,
procedureType: procedureType, procedureType: procedureType,
@ -128,7 +111,7 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
else else
AddProcedurePage( AddProcedurePage(
model: widget.previousProcedureViewModel ?? model, model: widget.previousProcedureViewModel ?? model,
patient: patient, patient: patient!,
procedureType: procedureType!, procedureType: procedureType!,
), ),
], ],

@ -7,7 +7,6 @@ import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dar
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../config/config.dart'; import '../../config/config.dart';
@ -21,25 +20,23 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
final List<EntityList> masterList; final List<EntityList> masterList;
EntityListCheckboxSearchWidget({ EntityListCheckboxSearchWidget({
Key key, Key? key,
this.model, required this.model,
this.addSelectedHistories, required this.addSelectedHistories,
this.removeProcedure, required this.removeProcedure,
this.masterList, required this.masterList,
this.addProcedure, required this.addProcedure,
this.isEntityListSelected, required this.isEntityListSelected,
}) : super(key: key); }) : super(key: key);
@override @override
_EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState();
_EntityListCheckboxSearchWidgetState();
} }
class _EntityListCheckboxSearchWidgetState class _EntityListCheckboxSearchWidgetState extends State<EntityListCheckboxSearchWidget> {
extends State<EntityListCheckboxSearchWidget> {
String selectedType = '0'; String selectedType = '0';
int typeUrgent; int typeUrgent = 0;
int typeRegular; int typeRegular = 0;
setSelectedType(String val) { setSelectedType(String val) {
setState(() { setState(() {
@ -47,9 +44,9 @@ class _EntityListCheckboxSearchWidgetState
}); });
} }
List<EntityList> items = List(); List<EntityList> items = [];
List<String> remarksList = List(); List<String> remarksList = [];
List<int> typeList = List(); List<int> typeList = [];
@override @override
void initState() { void initState() {
@ -71,9 +68,7 @@ class _EntityListCheckboxSearchWidgetState
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white),
borderRadius: BorderRadius.circular(8),
color: Colors.white),
child: ListView( child: ListView(
children: [ children: [
TextFields( TextFields(
@ -81,8 +76,7 @@ class _EntityListCheckboxSearchWidgetState
suffixIcon: EvaIcons.search, suffixIcon: EvaIcons.search,
suffixIconColor: Color(0xff2B353E), suffixIconColor: Color(0xff2B353E),
onChanged: (value) { onChanged: (value) {
widget.model.filterSearchResults( widget.model.filterSearchResults(value, widget.masterList, items);
value, widget.masterList, items);
}, },
hasBorder: false, hasBorder: false,
), ),
@ -98,31 +92,21 @@ class _EntityListCheckboxSearchWidgetState
title: Row( title: Row(
children: [ children: [
Checkbox( Checkbox(
value: widget.isEntityListSelected( value: widget.isEntityListSelected(historyInfo),
historyInfo),
activeColor: Color(0xffD02127), activeColor: Color(0xffD02127),
onChanged: (bool newValue) { onChanged: (bool? newValue) {
setState(() { setState(() {
if (widget.isEntityListSelected( if (widget.isEntityListSelected(historyInfo)) {
historyInfo)) { widget.removeProcedure(historyInfo);
widget.removeProcedure(
historyInfo);
} else { } else {
widget.addProcedure( widget.addProcedure(historyInfo);
historyInfo);
} }
}); });
}), }),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0),
horizontal: 10, vertical: 0), child: AppText(Utils.convertToTitleCase(historyInfo.procedureName!), fontSize: 14.0, variant: "bodyText", bold: true, color: Color(0xff575757)),
child: AppText(
Utils.convertToTitleCase( historyInfo.procedureName),
fontSize: 14.0,
variant: "bodyText",
bold: true,
color: Color(0xff575757)),
), ),
), ),
], ],
@ -130,24 +114,17 @@ class _EntityListCheckboxSearchWidgetState
children: [ children: [
Container( Container(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 12),
horizontal: 12),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets padding: const EdgeInsets.symmetric(horizontal: 11),
.symmetric(
horizontal: 11),
child: AppText( child: AppText(
TranslationBase.of( TranslationBase.of(context).orderType,
context) fontWeight: FontWeight.w700,
.orderType,
fontWeight:
FontWeight.w700,
color: Color(0xff2B353E), color: Color(0xff2B353E),
), ),
), ),
@ -156,17 +133,13 @@ class _EntityListCheckboxSearchWidgetState
Row( Row(
children: [ children: [
Radio( Radio(
activeColor: activeColor: Color(0xFFD02127),
Color(0xFFD02127),
value: '0', value: '0',
groupValue: historyInfo.type, groupValue: historyInfo.type,
onChanged: (value) { onChanged: (value) {
historyInfo.type = historyInfo.type = setSelectedType(value!).toString();
setSelectedType(value)
.toString();
historyInfo.type = historyInfo.type = value.toString();
value.toString();
}, },
), ),
AppText( AppText(
@ -175,22 +148,17 @@ class _EntityListCheckboxSearchWidgetState
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
Radio( Radio(
activeColor: activeColor: Color(0xFFD02127),
Color(0xFFD02127),
groupValue: historyInfo.type, groupValue: historyInfo.type,
value: '1', value: '1',
onChanged: (value) { onChanged: (value) {
historyInfo.type = historyInfo.type = setSelectedType(value!).toString();
setSelectedType(value)
.toString();
historyInfo.type = historyInfo.type = value.toString();
value.toString();
}, },
), ),
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).urgent,
.urgent,
color: Color(0xff575757), color: Color(0xff575757),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
@ -204,11 +172,9 @@ class _EntityListCheckboxSearchWidgetState
height: 2.0, height: 2.0,
), ),
Padding( Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 12, vertical: 12.0),
horizontal: 12, vertical: 12.0),
child: TextFields( child: TextFields(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).remarks,
.remarks,
//controller: remarksController, //controller: remarksController,
onChanged: (value) { onChanged: (value) {
historyInfo.remarks = value; historyInfo.remarks = value;
@ -216,7 +182,7 @@ class _EntityListCheckboxSearchWidgetState
minLines: 3, minLines: 3,
maxLines: 5, maxLines: 5,
borderWidth: 0.5, borderWidth: 0.5,
borderColor: Colors.grey[500], borderColor: Colors.grey[500]!,
), ),
), ),
DividerWithSpacesAround(), DividerWithSpacesAround(),
@ -228,8 +194,7 @@ class _EntityListCheckboxSearchWidgetState
) )
: Center( : Center(
child: Container( child: Container(
child: AppText("Sorry , No Match", child: AppText("Sorry , No Match", color: AppGlobal.appRedColor),
color: AppGlobal.appRedColor),
), ),
) )
], ],

@ -12,7 +12,6 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class AddFavouriteProcedure extends StatefulWidget { class AddFavouriteProcedure extends StatefulWidget {
@ -94,8 +93,8 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => PrescriptionCheckOutScreen( builder: (context) => PrescriptionCheckOutScreen(
patient: widget.patient, patient: widget.patient!,
model: widget.prescriptionModel, model: widget.prescriptionModel!,
groupProcedures: groupProcedures, groupProcedures: groupProcedures,
), ),
settings: RouteSettings(name: 'PrescriptionCheckOutScreen')), settings: RouteSettings(name: 'PrescriptionCheckOutScreen')),

@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/screens/procedures/expansion_procedure.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -91,7 +90,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State<EntityList
AppTextFieldCustomSearch( AppTextFieldCustomSearch(
searchController: patientFileInfoController, searchController: patientFileInfoController,
onChangeFun: (value) { onChangeFun: (value) {
widget.model!.filterProcedureSearchResults(value, widget.masterList, items); widget.model!.filterProcedureSearchResults(value, widget.masterList!, items);
}, },
marginTop: 5, marginTop: 5,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))], inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))],

@ -60,17 +60,7 @@ class UpdateProcedureWidget extends StatefulWidget {
final int? limetNo; final int? limetNo;
int? selectedType; int? selectedType;
UpdateProcedureWidget( UpdateProcedureWidget({this.previousModel, this.procedureName, this.remarks, this.remarksController, this.patient, this.procedureId, this.categoryId, this.orderNo, this.limetNo, this.selectedType});
{this.previousModel,
this.procedureName,
this.remarks,
this.remarksController,
this.patient,
this.procedureId,
this.categoryId,
this.orderNo,
this.limetNo,
this.selectedType});
@override @override
_UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState();
@ -96,9 +86,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(), onModelReady: (model) => model.getCategory(),
builder: builder: (BuildContext context, ProcedureViewModel _model, Widget? child) => AppScaffold(
(BuildContext context, ProcedureViewModel _model, Widget? child) =>
AppScaffold(
baseViewModel: widget.previousModel!, baseViewModel: widget.previousModel!,
isShowAppBar: true, isShowAppBar: true,
appBar: BottomSheetTitle(title: "Update Procedure"), appBar: BottomSheetTitle(title: "Update Procedure"),
@ -107,8 +95,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
height: MediaQuery.of(context).size.height * 0.9, height: MediaQuery.of(context).size.height * 0.9,
child: Form( child: Form(
child: Padding( child: Padding(
padding: padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -148,17 +135,11 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
height: 12.0, height: 12.0,
), ),
Container( Container(
decoration: BoxDecoration( 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( child: TextFields(
fontSize: 15.0, fontSize: 15.0,
controller: widget.remarksController!, controller: widget.remarksController!,
hintText: widget.remarksController!.text.isEmpty hintText: widget.remarksController!.text.isEmpty ? 'No Remarks Added' : '',
? 'No Remarks Added'
: '',
maxLines: 3, maxLines: 3,
minLines: 2, minLines: 2,
onChanged: (value) {}, onChanged: (value) {},
@ -201,8 +182,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
required String procedureId, required String procedureId,
required PatiantInformtion patient, required PatiantInformtion patient,
required String categoryId}) async { required String categoryId}) async {
UpdateProcedureRequestModel updateProcedureReqModel = UpdateProcedureRequestModel updateProcedureReqModel = new UpdateProcedureRequestModel();
new UpdateProcedureRequestModel();
List<Controls> controls = []; List<Controls> controls = [];
ProcedureDetail controlsProcedure = ProcedureDetail(); ProcedureDetail controlsProcedure = ProcedureDetail();
@ -215,8 +195,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
{ {
controls.add( controls.add(
Controls( Controls(code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""),
code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""),
); );
controls.add( controls.add(
Controls(code: "ordertype", controlValue: orderType), Controls(code: "ordertype", controlValue: orderType),
@ -229,17 +208,13 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
} }
updateProcedureReqModel.procedureDetail = controlsProcedure; updateProcedureReqModel.procedureDetail = controlsProcedure;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.previousModel!.updateProcedure( await widget.previousModel!.updateProcedure(updateProcedureRequestModel: updateProcedureReqModel, mrn: patient.patientMRN, isLocalBusy: true);
updateProcedureRequestModel: updateProcedureReqModel,
mrn: patient.patientMRN,
isLocalBusy: true);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been updated'); DrAppToastMsg.showSuccesToast('procedure has been updated');
await widget.previousModel! await widget.previousModel!.getProcedure(mrn: patient.patientMRN!, isLocalBusy: true);
.getProcedure(mrn: patient.patientMRN, isLocalBusy: true);
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -10,15 +10,15 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/reschedule_leaves/add_reschedule_leave.dart'; import 'package:doctor_app_flutter/screens/reschedule_leaves/add_reschedule_leave.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:dropdown_search/dropdown_search.dart'; import 'package:dropdown_search/dropdown_search.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker_plus/flutter_datetime_picker_plus.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -39,8 +39,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController = new TextEditingController();
TextEditingController _toDateController2 = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController();
ProjectViewModel projectsProvider; late ProjectViewModel projectsProvider;
SickLeaveViewModel sickLeaveViewModel; late SickLeaveViewModel sickLeaveViewModel;
Map profile = {}; Map profile = {};
var offTime = '1'; var offTime = '1';
var date; var date;
@ -49,8 +49,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
dynamic fromDate; dynamic fromDate;
dynamic toDate; dynamic toDate;
var clinicID; var clinicID;
String fromTime; String? fromTime;
String toTime; String? toTime;
TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller4 = new TextEditingController();
TextEditingController _controller5 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController();
@ -124,7 +124,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), top: SizeConfig.widthMultiplier! * 0.9,
bottom: SizeConfig.widthMultiplier! * 0.9,
right: SizeConfig.widthMultiplier! * 3,
left: SizeConfig.widthMultiplier! * 3),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -149,7 +152,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
AppText( AppText(
item['description'], item['description'],
fontSize: SizeConfig.textMultiplier * 2.1, fontSize: SizeConfig.textMultiplier! * 2.1,
// color: // color:
// Colors.grey, // Colors.grey,
), ),
@ -159,7 +162,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
}, },
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
offTime = newValue; offTime = newValue.toString();
}); });
if (offTime == '1') { if (offTime == '1') {
model2.getReasons(18); model2.getReasons(18);
@ -168,7 +171,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
} else if (offTime == '3' || offTime == '5') { } else if (offTime == '3' || offTime == '5') {
model2.getReasons(102); model2.getReasons(102);
setState(() { setState(() {
offTime = newValue; offTime = newValue.toString();
}); });
} }
}, },
@ -202,7 +205,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
AppTextFormField( AppTextFormField(
hintText: TranslationBase.of(context).fromDate, hintText: TranslationBase.of(context).fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton(icon: Icon(Icons.calendar_today)), prefix: IconButton(
icon: Icon(Icons.calendar_today),
onPressed: () {},
),
textInputType: TextInputType.number, textInputType: TextInputType.number,
controller: _toDateController, controller: _toDateController,
onTap: () { onTap: () {
@ -224,19 +230,19 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
DateTimePicker( // DateTimePicker(
timeHintText: TranslationBase.of(context).fromTime, // timeHintText: TranslationBase.of(context).fromTime,
type: DateTimePickerType.time, // type: DateTimePickerType.time,
controller: _controller4, // controller: _controller4,
onChanged: (val) => fromTime = val, // onChanged: (val) => fromTime = val,
validator: (val) { // validator: (val) {
print(val); // print(val);
// setState( // // setState(
// () => _valueToValidate4 = val); // // () => _valueToValidate4 = val);
return null; // return null;
}, // },
onSaved: (val) => fromTime = val, // onSaved: (val) => fromTime = val,
) // ),
], ],
), ),
), ),
@ -282,7 +288,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
AppTextFormField( AppTextFormField(
hintText: TranslationBase.of(context).fromDate, hintText: TranslationBase.of(context).fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton(icon: Icon(Icons.calendar_today)), prefix: IconButton(
icon: Icon(Icons.calendar_today),
onPressed: () {},
),
textInputType: TextInputType.number, textInputType: TextInputType.number,
readOnly: true, readOnly: true,
controller: _toDateController, controller: _toDateController,
@ -308,7 +317,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
hintText: TranslationBase.of(context).toDate, hintText: TranslationBase.of(context).toDate,
readOnly: true, readOnly: true,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton(icon: Icon(Icons.calendar_today)), prefix: IconButton(
icon: Icon(Icons.calendar_today),
onPressed: () {},
),
textInputType: TextInputType.number, textInputType: TextInputType.number,
controller: _toDateController2, controller: _toDateController2,
onTap: () { onTap: () {
@ -330,7 +342,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), top: SizeConfig.widthMultiplier! * 0.9,
bottom: SizeConfig.widthMultiplier! * 0.9,
right: SizeConfig.widthMultiplier! * 3,
left: SizeConfig.widthMultiplier! * 3),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -354,7 +369,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
children: <Widget>[ children: <Widget>[
AppText( AppText(
projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], projectsProvider.isArabic ? item['nameAr'] : item['nameEn'],
fontSize: SizeConfig.textMultiplier * 2.1, fontSize: SizeConfig.textMultiplier! * 2.1,
// color: // color:
// Colors.grey, // Colors.grey,
), ),
@ -391,7 +406,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), top: SizeConfig.widthMultiplier! * 0.9,
bottom: SizeConfig.widthMultiplier! * 0.9,
right: SizeConfig.widthMultiplier! * 3,
left: SizeConfig.widthMultiplier! * 3),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -402,9 +420,11 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
? Expanded( ? Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownSearch( child: DropdownSearch(
mode: Mode.BOTTOM_SHEET, dropdownButtonProps: DropdownButtonProps(),
dropdownDecoratorProps: DropDownDecoratorProps(
dropdownSearchDecoration: InputDecoration(contentPadding: EdgeInsets.all(0), border: InputBorder.none),
),
dropdownSearchDecoration: InputDecoration(contentPadding: EdgeInsets.all(0), border: InputBorder.none),
//maxHeight: 300, //maxHeight: 300,
items: model2.coveringDoctors.map((item) { items: model2.coveringDoctors.map((item) {
return projectsProvider.isArabic ? item['doctorNameN'] : item['doctorName']; return projectsProvider.isArabic ? item['doctorNameN'] : item['doctorName'];
@ -414,33 +434,36 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2.coveringDoctors.forEach((newVal) => {if (newVal['doctorName'] == item) doctorID = newVal['DoctorID']}); model2.coveringDoctors.forEach((newVal) => {if (newVal['doctorName'] == item) doctorID = newVal['DoctorID']});
}, },
selectedItem: getSelectedDoctor(model2), selectedItem: getSelectedDoctor(model2),
showSearchBox: true, popupProps: PopupProps.bottomSheet(
popupTitle: Container( bottomSheetProps: BottomSheetProps(
height: 50, shape: RoundedRectangleBorder(
decoration: BoxDecoration( borderRadius: BorderRadius.only(
color: Theme.of(context).primaryColorDark, topLeft: Radius.circular(24),
borderRadius: BorderRadius.only( topRight: Radius.circular(24),
topLeft: Radius.circular(20), ),
topRight: Radius.circular(20), ),
), ),
), title: Container(
child: Center( height: 50,
child: Text( decoration: BoxDecoration(
'', color: Theme.of(context).primaryColorDark,
style: TextStyle( borderRadius: BorderRadius.only(
fontSize: 24, topLeft: Radius.circular(20),
fontWeight: FontWeight.bold, topRight: Radius.circular(20),
color: Colors.white, ),
),
child: Center(
child: Text(
'',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
), ),
), ),
), showSearchBox: true),
),
popupShape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(24),
topRight: Radius.circular(24),
),
),
), ),
) )
: SizedBox(), : SizedBox(),
@ -449,9 +472,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
], ],
), ),
)), )),
SizedBox(height: SizeConfig.screenHeight * .3), SizedBox(height: SizeConfig.screenHeight! * .3),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
@ -502,12 +525,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
_toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); _toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom));
//df.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom));
this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom)); this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom));
this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); this.fromTime = this.fromTime!.substring(0, this.fromTime!.length - 3);
this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo));
this.toTime = this.toTime.substring(0, this.toTime.length - 3); this.toTime = this.toTime!.substring(0, this.toTime!.length - 3);
_toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); _toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo));
_controller5.text = toTime; _controller5.text = toTime!;
_controller4.text = fromTime; _controller4.text = fromTime!;
toDate = _toDateController2.text; toDate = _toDateController2.text;
fromDate = _toDateController.text; fromDate = _toDateController.text;
this.reason = widget.updateData.reasonId.toString(); this.reason = widget.updateData.reasonId.toString();
@ -528,8 +551,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
var fromDates = fromDate; var fromDates = fromDate;
var toDates = toDate; var toDates = toDate;
if (offTime == '1') { if (offTime == '1') {
fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime + ':' + DateTime.now().second.toString())); fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime! + ':' + DateTime.now().second.toString()));
toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime + ':' + DateTime.now().second.toString())); toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime! + ':' + DateTime.now().second.toString()));
} else { } else {
fromDate = df.format(fromDates); fromDate = df.format(fromDates);
toDate = df.format(toDates); toDate = df.format(toDates);
@ -573,8 +596,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
dynamic fromDates = fromDate; dynamic fromDates = fromDate;
dynamic toDates = toDate; dynamic toDates = toDate;
if (offTime == '1') { if (offTime == '1') {
fromDate = df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString(); fromDate = df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime! + ':' + DateTime.now().second.toString();
toDate = df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime + ':' + DateTime.now().second.toString(); toDate = df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime! + ':' + DateTime.now().second.toString();
} else { } else {
fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates)); fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates));
toDate = df.format(toDates is DateTime ? toDates : DateTime.parse(toDates)); toDate = df.format(toDates is DateTime ? toDates : DateTime.parse(toDates));

File diff suppressed because it is too large Load Diff

@ -1,9 +1,9 @@
import 'package:connectivity/connectivity.dart'; import 'package:connectivity/connectivity.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.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/service/NavigationService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -13,11 +13,11 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:html/parser.dart'; import 'package:html/parser.dart';
import '../update_page.dart';
import '../config/size_config.dart'; import '../config/size_config.dart';
import '../locator.dart'; import '../locator.dart';
import '../update_page.dart';
import '../utils/dr_app_toast_msg.dart'; import '../utils/dr_app_toast_msg.dart';
import 'dr_app_shared_pref.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -42,7 +42,7 @@ class Utils {
), ),
actions: [ actions: [
AppButton( AppButton(
onPressed: okFunction, onPressed: okFunction(),
title: TranslationBase.of(context).noteConfirm, title: TranslationBase.of(context).noteConfirm,
fontColor: Colors.white, fontColor: Colors.white,
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
@ -70,7 +70,7 @@ class Utils {
builder: (BuildContext builder) { builder: (BuildContext builder) {
return Container( return Container(
// height: 500, // height: 500,
height: SizeConfig.realScreenHeight * 0.4, height: SizeConfig.realScreenHeight! * 0.4,
color: Color(0xfff7f7f7), color: Color(0xfff7f7f7),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
@ -99,7 +99,7 @@ class Utils {
], ],
), ),
), ),
Container(height: SizeConfig.realScreenHeight * 0.3, color: Color(0xfff7f7f7), child: buildPickerItems(context, items, decKey, onSelectFun, model)) Container(height: SizeConfig.realScreenHeight! * 0.3, color: Color(0xfff7f7f7), child: buildPickerItems(context, items, decKey, onSelectFun, model))
], ],
), ),
); );
@ -115,7 +115,7 @@ class Utils {
children: items.map((item) { children: items.map((item) {
return Text( return Text(
'${item.facilityName}', '${item.facilityName}',
style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), style: TextStyle(fontSize: SizeConfig.textMultiplier! * 2),
); );
}).toList(), }).toList(),
itemExtent: 25, itemExtent: 25,
@ -214,12 +214,12 @@ class Utils {
static String parseHtmlString(String htmlString) { static String parseHtmlString(String htmlString) {
final document = parse(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; 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( return InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
@ -279,7 +279,7 @@ class Utils {
return htmlRegex.hasMatch(text); return htmlRegex.hasMatch(text);
} }
static String timeFrom({Duration duration}) { static String timeFrom({required Duration duration}) {
String twoDigits(int n) => n.toString().padLeft(2, "0"); String 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)); String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60));
@ -287,7 +287,7 @@ class Utils {
} }
static double getTextFieldHeight() { static double getTextFieldHeight() {
return SizeConfig.heightMultiplier * return SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort (SizeConfig.isHeightVeryShort
? 10 ? 10
: SizeConfig.isHeightShort : SizeConfig.isHeightShort
@ -309,9 +309,9 @@ class Utils {
return kpi; return kpi;
} }
static String convertToTitleCase(String text) { static String convertToTitleCase(String? text) {
if (text == null) { if (text == null) {
return null; return "";
} }
if (text.length <= 1) { if (text.length <= 1) {

@ -1,11 +1,11 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_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/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -14,27 +14,27 @@ import 'package:url_launcher/url_launcher.dart';
import '../large_avatar.dart'; import '../large_avatar.dart';
import 'header_row.dart'; import 'header_row.dart';
class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final double height; final double height;
final bool isInpatient; final bool isInpatient;
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isFromLiveCare; final bool isFromLiveCare;
final String doctorName; final String? doctorName;
final String branch; final String? branch;
final DateTime appointmentDate; final DateTime? appointmentDate;
final String profileUrl; final String? profileUrl;
final String invoiceNO; final String? invoiceNO;
final String orderNo; final String? orderNo;
final bool isPrescriptions; final bool isPrescriptions;
final bool isMedicalFile; final bool isMedicalFile;
final String episode; final String? episode;
final String visitDate; final String? visitDate;
final String clinic; final String? clinic;
final bool isAppointmentHeader; final bool isAppointmentHeader;
final bool isFromLabResult; final bool isFromLabResult;
final VoidCallback onPressed; final VoidCallback? onPressed;
PatientProfileAppBar(this.patient, PatientProfileAppBar(this.patient,
{this.height = 0.0, {this.height = 0.0,
@ -62,9 +62,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
int gender = 1; int gender = 1;
if (patient.patientDetails != null) { if (patient.patientDetails != null) {
gender = patient.patientDetails.gender; gender = patient.patientDetails!.gender!;
} else { } else {
gender = patient.gender; gender = patient.gender!;
} }
return Container( return Container(
@ -86,7 +86,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
color: Color(0xFF2B353E), //Colors.black, color: Color(0xFF2B353E), //Colors.black,
onPressed: () { onPressed: () {
if (onPressed != null) onPressed(); if (onPressed != null) onPressed!();
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
@ -94,8 +94,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
child: AppText( child: AppText(
patient.firstName != null patient.firstName != null
? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName)) ? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName))
: Utils.capitalize(patient.fullName ?? patient.patientDetails.fullName), : Utils.capitalize(patient.fullName ?? patient.patientDetails!.fullName),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
@ -115,7 +115,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
margin: EdgeInsets.symmetric(horizontal: 4), margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
launch("tel://" + patient.mobileNumber); launch("tel://" + patient.mobileNumber!);
}, },
child: Icon( child: Icon(
Icons.phone, Icons.phone,
@ -159,13 +159,13 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
) )
: AppText( : AppText(
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived,
color: Colors.red[800], color: Colors.red[800]!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
), ),
patient.startTime != null patient.startTime != null
? AppText(patient.startTime != null ? patient.startTime : '', ? AppText(patient.startTime != null ? patient.startTime! : '',
fontWeight: FontWeight.w700, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A)) fontWeight: FontWeight.w700, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A))
: SizedBox() : SizedBox()
], ],
@ -206,10 +206,10 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
patient.nationalityFlagURL, patient.nationalityFlagURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -222,24 +222,24 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
HeaderRow( HeaderRow(
label: TranslationBase.of(context).age + " : ", label: TranslationBase.of(context).age + " : ",
value: 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 (patient.appointmentDate != null && patient.appointmentDate.isNotEmpty && !isFromLabResult) if (patient.appointmentDate != null && patient.appointmentDate!.isNotEmpty && !isFromLabResult)
HeaderRow( HeaderRow(
label: TranslationBase.of(context).appointmentDate + " : ", label: TranslationBase.of(context).appointmentDate + " : ",
value: AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.appointmentDate)), value: AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.appointmentDate!)),
), ),
if (isFromLabResult) if (isFromLabResult)
HeaderRow( HeaderRow(
label: "Result Date: ", label: "Result Date: ",
value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
), ),
// if(isInpatient) // if(isInpatient)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (patient.admissionDate != null && patient.admissionDate.isNotEmpty) if (patient.admissionDate != null && patient.admissionDate!.isNotEmpty)
HeaderRow( HeaderRow(
label: patient.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ", label: patient.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ",
value: patient.admissionDate == null ? "" : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", value: patient.admissionDate == null ? "" : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}",
@ -248,8 +248,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
HeaderRow( HeaderRow(
label: "${TranslationBase.of(context).numOfDays}: ", label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient && patient.dischargeDate != null value: isDischargedPatient && patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).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}", : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}",
) )
], ],
), ),
@ -268,8 +268,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border( border: Border(
bottom: BorderSide(color: Colors.grey[400], width: 2.5), bottom: BorderSide(color: Colors.grey[400]!, width: 2.5),
left: BorderSide(color: Colors.grey[400], width: 2.5), left: BorderSide(color: Colors.grey[400]!, width: 2.5),
)), )),
), ),
Expanded( Expanded(
@ -332,7 +332,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
if (!isMedicalFile) if (!isMedicalFile)
HeaderRow( HeaderRow(
label: !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ', label: !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ',
value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
), ),
]), ]),
), ),
@ -361,6 +361,6 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
? 137 ? 137
: SizeConfig.isHeightShort : SizeConfig.isHeightShort
? 190 ? 190
: SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge ? 25 : 20) : SizeConfig.heightMultiplier! * (SizeConfig.isWidthLarge ? 25 : 20)
: height); : height);
} }

@ -15,7 +15,7 @@ import 'package:url_launcher/url_launcher.dart';
import 'header_row.dart'; import 'header_row.dart';
class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { class PatientProfileHeaderNewDesignAppBar extends StatelessWidget implements PreferredSizeWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
@ -27,15 +27,15 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
final Stream<String> videoCallDurationStream; final Stream<String> videoCallDurationStream;
PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType, PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType,
{this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, this.videoCallDurationStream}); {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, required this.videoCallDurationStream});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
int gender = 1; int gender = 1;
if (patient.patientDetails != null) { if (patient.patientDetails != null) {
gender = patient.patientDetails.gender; gender = patient.patientDetails!.gender!;
} else { } else {
gender = patient.gender; gender = patient.gender!;
} }
return Container( return Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -68,8 +68,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
child: AppText( child: AppText(
patient.firstName != null patient.firstName != null
? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName)) ? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName))
: Utils.capitalize(patient.fullName ?? patient.patientDetails.fullName), : Utils.capitalize(patient.fullName ?? patient.patientDetails!.fullName),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
@ -91,7 +91,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
eventCategory: "Patient Profile Header", eventCategory: "Patient Profile Header",
eventAction: "Call Patient", eventAction: "Call Patient",
); );
launch("tel://" + patient.mobileNumber); launch("tel://" + patient.mobileNumber!);
}, },
child: Icon( child: Icon(
Icons.phone, Icons.phone,
@ -109,7 +109,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10),
child: Text( child: Text(
snapshot.data, snapshot.data!,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
), ),
@ -155,19 +155,19 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
) )
: AppText( : AppText(
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived,
color: Colors.red[800], color: Colors.red[800]!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
), ),
arrivalType == '1' || patient.arrivedOn == null arrivalType == '1' || patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != null ? patient.startTime : '', patient.startTime != null ? patient.startTime! : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
) )
: AppText( : AppText(
patient.arrivedOn != null ? AppDateUtils.convertStringToDateFormat(patient.arrivedOn, 'MM-dd-yyyy HH:mm') : '', patient.arrivedOn != null ? AppDateUtils.convertStringToDateFormat(patient.arrivedOn!, 'MM-dd-yyyy HH:mm') : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
) )
@ -194,7 +194,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
child: AppText( child: AppText(
patient.startTime ?? "", patient.startTime ?? "",
color: Colors.white, color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize: 1.5 * SizeConfig.textMultiplier!,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -206,7 +206,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
Container( Container(
child: AppText( child: AppText(
convertDateFormat2(patient.appointmentDate ?? ''), convertDateFormat2(patient.appointmentDate ?? ''),
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize: 1.5 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
@ -245,10 +245,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
patient.nationalityFlagURL, patient.nationalityFlagURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text(''); return Text('');
}, },
)) ))
@ -261,7 +261,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
HeaderRow( HeaderRow(
label: TranslationBase.of(context).age + " : ", label: TranslationBase.of(context).age + " : ",
value: 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) if (isInpatient)
Column( Column(
@ -274,8 +274,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
HeaderRow( HeaderRow(
label: "${TranslationBase.of(context).numOfDays}: ", label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient && patient.dischargeDate != null value: isDischargedPatient && patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).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}", : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}",
) )
], ],
) )
@ -290,7 +290,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
} }
convertDateFormat2(String str) { convertDateFormat2(String str) {
String newDate; String? newDate;
const start = "/Date("; const start = "/Date(";
if (str.isNotEmpty) { if (str.isNotEmpty) {
const end = "+0300)"; const end = "+0300)";

@ -12,19 +12,20 @@ import 'network_base_view.dart';
class AppScaffold extends StatelessWidget { class AppScaffold extends StatelessWidget {
final String appBarTitle; final String appBarTitle;
final Widget body; final Widget? body;
final bool isLoading; final bool isLoading;
final bool isShowAppBar; final bool isShowAppBar;
final BaseViewModel baseViewModel; final BaseViewModel? baseViewModel;
final Widget bottomSheet; final Widget? bottomSheet;
final Color backgroundColor; final Color? backgroundColor;
final Widget appBar; final PreferredSizeWidget? appBar;
final Widget drawer; final Widget? drawer;
final Widget bottomNavigationBar; final Widget? bottomNavigationBar;
final String subtitle; final String? subtitle;
final bool isHomeIcon; final bool isHomeIcon;
final bool extendBody; final bool extendBody;
final Widget actionButton; final Widget? actionButton;
AppScaffold( AppScaffold(
{this.appBarTitle = '', {this.appBarTitle = '',
this.body, this.body,
@ -36,7 +37,8 @@ class AppScaffold extends StatelessWidget {
this.isHomeIcon = true, this.isHomeIcon = true,
this.appBar, this.appBar,
this.subtitle, this.subtitle,
this.drawer, this.actionButton, this.drawer,
this.actionButton,
this.extendBody = false, this.extendBody = false,
this.bottomNavigationBar}); this.bottomNavigationBar});
@ -49,8 +51,7 @@ class AppScaffold extends StatelessWidget {
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(new FocusNode());
}, },
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
,
drawer: drawer, drawer: drawer,
extendBody: extendBody, extendBody: extendBody,
bottomNavigationBar: bottomNavigationBar, bottomNavigationBar: bottomNavigationBar,
@ -60,18 +61,23 @@ class AppScaffold extends StatelessWidget {
elevation: 0, elevation: 0,
backgroundColor: Colors.white, backgroundColor: Colors.white,
//HexColor('#515B5D'), //HexColor('#515B5D'),
textTheme: TextTheme( toolbarTextStyle: TextStyle(
headline6: TextStyle(
color: Colors.black87, color: Colors.black87,
fontSize: 16.8, fontSize: 16.8,
)), ),
//TextTheme(
// headline6: TextStyle(
// color: Colors.black87,
// fontSize: 16.8,
// ))
title: Column( title: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text(appBarTitle.toUpperCase()), Text(appBarTitle.toUpperCase()),
if (subtitle != null) if (subtitle != null)
Text( Text(
subtitle, subtitle!,
style: TextStyle(fontSize: 12, color: Colors.red), style: TextStyle(fontSize: 12, color: Colors.red),
), ),
], ],
@ -89,10 +95,11 @@ class AppScaffold extends StatelessWidget {
? IconButton( ? IconButton(
icon: Icon(DoctorApp.home_icon_active), icon: Icon(DoctorApp.home_icon_active),
color: Colors.black, //Colors.black, color: Colors.black, //Colors.black,
onPressed: () => Navigator.pushNamedAndRemoveUntil( onPressed: () => Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false),
context, HOME, (r) => false),
) )
: actionButton !=null ? actionButton :SizedBox() : actionButton != null
? actionButton!
: SizedBox()
], ],
) )
: null, : null,
@ -100,11 +107,10 @@ class AppScaffold extends StatelessWidget {
body: projectProvider.isInternetConnection body: projectProvider.isInternetConnection
? baseViewModel != null ? baseViewModel != null
? NetworkBaseView( ? NetworkBaseView(
baseViewModel: baseViewModel, baseViewModel: baseViewModel!,
child: body, child: body!,
) )
: Stack( : Stack(children: <Widget>[body!, buildAppLoaderWidget(isLoading)])
children: <Widget>[body, buildAppLoaderWidget(isLoading)])
: Center( : Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

@ -1,35 +1,34 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class AppText extends StatefulWidget { class AppText extends StatefulWidget {
final String text; final String text;
final String variant; final String? variant;
final Color color; final Color color;
final FontWeight fontWeight; final FontWeight? fontWeight;
final double fontSize; final double? fontSize;
final double fontHeight; final double? fontHeight;
final String fontFamily; final String fontFamily;
final int maxLength; final int maxLength;
final bool italic; final bool italic;
final double margin; final double? margin;
final double marginTop; final double marginTop;
final double marginRight; final double marginRight;
final double marginBottom; final double marginBottom;
final double marginLeft; final double marginLeft;
final double letterSpacing; final double? letterSpacing;
final TextAlign textAlign; final TextAlign? textAlign;
final bool bold; final bool? bold;
final bool regular; final bool? regular;
final bool medium; final bool? medium;
final int maxLines; final int? maxLines;
final bool readMore; final bool readMore;
final String style; final String? style;
final bool allowExpand; final bool allowExpand;
final bool visibility; final bool visibility;
final TextOverflow textOverflow; final TextOverflow? textOverflow;
final TextDecoration textDecoration; final TextDecoration? textDecoration;
final bool isCopyable; final bool isCopyable;
AppText( AppText(
@ -97,7 +96,7 @@ class _AppTextState extends State<AppText> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
child: Container( child: Container(
margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), margin: widget.margin != null ? EdgeInsets.all(widget.margin!) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -131,7 +130,7 @@ class _AppTextState extends State<AppText> {
}); });
}, },
child: Text(hidden ? "Read More" : "Read less", child: Text(hidden ? "Read More" : "Read less",
style: _getFontStyle().copyWith( style: _getFontStyle()!.copyWith(
color: HexColor('#FF0000'), color: HexColor('#FF0000'),
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontFamily: "Poppins", fontFamily: "Poppins",
@ -167,7 +166,7 @@ class _AppTextState extends State<AppText> {
// : null, // : null,
maxLines: widget.maxLines ?? null, maxLines: widget.maxLines ?? null,
style: widget.style != null style: widget.style != null
? _getFontStyle().copyWith(fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) ? _getFontStyle()!.copyWith(fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight)
: TextStyle( : TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Color(0xff2E303A), color: widget.color != null ? widget.color : Color(0xff2E303A),
@ -184,10 +183,10 @@ class _AppTextState extends State<AppText> {
return Text( 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, 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, maxLines: widget.maxLines ?? null,
style: widget.style != null style: widget.style != null
? _getFontStyle().copyWith(fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) ? _getFontStyle()!.copyWith(fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight)
: TextStyle( : TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black, color: widget.color != null ? widget.color : Colors.black,
@ -201,7 +200,7 @@ class _AppTextState extends State<AppText> {
} }
} }
TextStyle _getFontStyle() { TextStyle? _getFontStyle() {
switch (widget.style) { switch (widget.style) {
case "headline2": case "headline2":
return Theme.of(context).textTheme.headline2; return Theme.of(context).textTheme.headline2;
@ -216,7 +215,7 @@ class _AppTextState extends State<AppText> {
case "bodyText2": case "bodyText2":
return Theme.of(context).textTheme.bodyText2; return Theme.of(context).textTheme.bodyText2;
case "bodyText_15": 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": case "bodyText1":
return Theme.of(context).textTheme.bodyText1; return Theme.of(context).textTheme.bodyText1;
case "caption": case "caption":
@ -263,7 +262,7 @@ class _AppTextState extends State<AppText> {
case "date": case "date":
return 24.0; return 24.0;
default: default:
return SizeConfig.textMultiplier * 2; return SizeConfig.textMultiplier! * 2;
} }
} }
@ -309,7 +308,7 @@ class _AppTextState extends State<AppText> {
return FontWeight.w500; return FontWeight.w500;
} }
} else { } else {
return null; return FontWeight.normal;
} }
} }
} }

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../config/config.dart'; import '../../../config/config.dart';
@ -11,16 +11,16 @@ class ListSelectDialog extends StatefulWidget {
final okText; final okText;
final Function(dynamic) okFunction; final Function(dynamic) okFunction;
dynamic selectedValue; dynamic selectedValue;
final Widget searchWidget; final Widget? searchWidget;
final bool usingSearch; final bool usingSearch;
final String hintSearchText; final String? hintSearchText;
ListSelectDialog({ ListSelectDialog({
@required this.list, required this.list,
@required this.attributeName, required this.attributeName,
@required this.attributeValueId, required this.attributeValueId,
@required this.okText, required this.okText,
@required this.okFunction, required this.okFunction,
this.searchWidget, this.searchWidget,
this.usingSearch = false, this.usingSearch = false,
this.hintSearchText, this.hintSearchText,
@ -31,7 +31,7 @@ class ListSelectDialog extends StatefulWidget {
} }
class _ListSelectDialogState extends State<ListSelectDialog> { class _ListSelectDialogState extends State<ListSelectDialog> {
List<dynamic> items = List(); List<dynamic> items = [];
@override @override
void initState() { void initState() {
@ -72,12 +72,12 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
height: MediaQuery.of(context).size.height * 0.5, height: MediaQuery.of(context).size.height * 0.5,
child: Column( child: Column(
children: [ children: [
if (widget.searchWidget != null) widget.searchWidget, if (widget.searchWidget != null) widget.searchWidget!,
if (widget.usingSearch) if (widget.usingSearch)
Container( Container(
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
child: TextField( child: TextField(
decoration: Utils.textFieldSelectorDecoration(widget.hintSearchText ?? TranslationBase.of(context).search, null, false, decoration: Utils.textFieldSelectorDecoration(widget.hintSearchText ?? TranslationBase.of(context).search, "", false,
suffixIcon: Icon( suffixIcon: Icon(
Icons.search, Icons.search,
)), )),
@ -119,10 +119,10 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
} }
void filterSearchResults(String query) { void filterSearchResults(String query) {
List<dynamic> dummySearchList = List(); List<dynamic> dummySearchList = [];
dummySearchList.addAll(widget.list); dummySearchList.addAll(widget.list);
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<dynamic> dummyListData = List(); List<dynamic> dummyListData = [];
dummySearchList.forEach((item) { dummySearchList.forEach((item) {
if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) { if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item); dummyListData.add(item);

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -12,10 +12,10 @@ class MasterKeyDailog extends StatefulWidget {
final List<MasterKeyModel> list; final List<MasterKeyModel> list;
final okText; final okText;
final Function(MasterKeyModel) okFunction; final Function(MasterKeyModel) okFunction;
MasterKeyModel selectedValue; MasterKeyModel? selectedValue;
final bool isICD; final bool isICD;
MasterKeyDailog({@required this.list, @required this.okText, @required this.okFunction, this.selectedValue, this.isICD = false}); MasterKeyDailog({required this.list, required this.okText, required this.okFunction, this.selectedValue, this.isICD = false});
@override @override
_MasterKeyDailogState createState() => _MasterKeyDailogState(); _MasterKeyDailogState createState() => _MasterKeyDailogState();
@ -52,7 +52,7 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3.5 : 5), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3.5 : 5),
), ),
onPressed: () { onPressed: () {
this.widget.okFunction(widget.selectedValue); this.widget.okFunction(widget.selectedValue!);
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
// set up the AlertDialog // set up the AlertDialog
@ -78,10 +78,10 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
title: AppText( title: AppText(
'${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + (widget.isICD ? '/${item.code}' : ''), '${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + (widget.isICD ? '/${item.code}' : ''),
), ),
groupValue: widget.isICD ? widget.selectedValue.code.toString() : widget.selectedValue.id.toString(), groupValue: widget.isICD ? widget.selectedValue!.code.toString() : widget.selectedValue!.id.toString(),
value: widget.isICD ? widget.selectedValue.code.toString() : item.id.toString(), value: widget.isICD ? widget.selectedValue!.code.toString() : item.id.toString(),
activeColor: Colors.blue.shade700, activeColor: Colors.blue.shade700,
selected: widget.isICD ? item.code.toString() == widget.selectedValue.code.toString() : item.id.toString() == widget.selectedValue.id.toString(), selected: widget.isICD ? item.code.toString() == widget.selectedValue!.code.toString() : item.id.toString() == widget.selectedValue!.id.toString(),
onChanged: (val) { onChanged: (val) {
setState(() { setState(() {
widget.selectedValue = item; widget.selectedValue = item;

@ -9,7 +9,7 @@ class ListSelectDialog extends StatefulWidget {
final Function(dynamic) okFunction; final Function(dynamic) okFunction;
dynamic selectedValue; dynamic selectedValue;
ListSelectDialog({@required this.list, @required this.attributeName, @required this.attributeValueId, @required this.okText, @required this.okFunction}); ListSelectDialog({required this.list, required this.attributeName, required this.attributeValueId, required this.okText, required this.okFunction});
@override @override
_ListSelectDialogState createState() => _ListSelectDialogState(); _ListSelectDialogState createState() => _ListSelectDialogState();

@ -38,7 +38,7 @@ final _mobileFormatter = NumberTextInputFormatter();
class TextFields extends StatefulWidget { class TextFields extends StatefulWidget {
TextFields({ TextFields({
Key key, Key? key,
this.type, this.type,
this.hintText, this.hintText,
this.suffixIcon, this.suffixIcon,
@ -62,7 +62,7 @@ class TextFields extends StatefulWidget {
this.borderOnlyError = false, this.borderOnlyError = false,
this.onSaved, this.onSaved,
this.onSuffixTap, this.onSuffixTap,
this.readOnly: false, this.readOnly = false,
this.maxLength, this.maxLength,
this.prefixIcon, this.prefixIcon,
this.bare = false, this.bare = false,
@ -81,26 +81,26 @@ class TextFields extends StatefulWidget {
this.borderWidth = 1, this.borderWidth = 1,
}) : super(key: key); }) : super(key: key);
final String hintText; final String? hintText;
final String initialValue; final String? initialValue;
final String type; final String? type;
final bool autoFocus; final bool? autoFocus;
final IconData suffixIcon; final IconData? suffixIcon;
final Color suffixIconColor; final Color? suffixIconColor;
final Icon prefixIcon; final Icon? prefixIcon;
final VoidCallback onTap; final VoidCallback? onTap;
final Function onTapTextFields; final Function? onTapTextFields;
final TextEditingController controller; final TextEditingController? controller;
final TextInputType keyboardType; final TextInputType? keyboardType;
final FormFieldValidator validator; final FormFieldValidator? validator;
final Function onSaved; final Function? onSaved;
final Function onSuffixTap; final Function? onSuffixTap;
final Function onChanged; final Function? onChanged;
final Function onSubmit; final Function? onSubmit;
final bool readOnly; final bool? readOnly;
final int maxLength; final int? maxLength;
final int minLines; final int? minLines;
final int maxLines; final int? maxLines;
final bool maxLengthEnforced; final bool maxLengthEnforced;
final bool bare; final bool bare;
final TextInputAction inputAction; final TextInputAction inputAction;
@ -108,16 +108,16 @@ class TextFields extends StatefulWidget {
final FontWeight fontWeight; final FontWeight fontWeight;
final bool keepPadding; final bool keepPadding;
final TextCapitalization textCapitalization; final TextCapitalization textCapitalization;
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter>? inputFormatters;
final bool autoValidate; final bool autoValidate;
final EdgeInsets padding; final EdgeInsets? padding;
final bool focus; final bool focus;
final bool borderOnlyError; final bool borderOnlyError;
final Color hintColor; final Color? hintColor;
final Color fillColor; final Color? fillColor;
final bool hasBorder; final bool hasBorder;
final bool showLabelText; final bool showLabelText;
Color borderColor; Color? borderColor;
final double borderRadius; final double borderRadius;
final double borderWidth; final double borderWidth;
bool hasLabelText; bool hasLabelText;
@ -179,14 +179,14 @@ class _TextFieldsState extends State<TextFields> {
break; break;
default: default:
if (widget.suffixIcon != null) if (widget.suffixIcon != null)
return InkWell(onTap: widget.onSuffixTap, child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); return InkWell(onTap: widget.onSuffixTap!(), child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500]));
else else
return null; return SizedBox();
} }
} }
bool _determineReadOnly() { bool _determineReadOnly() {
if (widget.readOnly != null && widget.readOnly) { if (widget.readOnly != null && widget.readOnly!) {
_focusNode.unfocus(); _focusNode.unfocus();
return true; return true;
} else { } else {
@ -211,14 +211,14 @@ class _TextFieldsState extends State<TextFields> {
child: Column( child: Column(
children: [ children: [
TextFormField( TextFormField(
onTap: widget.onTapTextFields, onTap: widget.onTapTextFields!(),
keyboardAppearance: Theme.of(context).brightness, keyboardAppearance: Theme.of(context).brightness,
scrollPhysics: BouncingScrollPhysics(), scrollPhysics: BouncingScrollPhysics(),
// autovalidate: widget.autoValidate, // autovalidate: widget.autoValidate,
textCapitalization: widget.textCapitalization, textCapitalization: widget.textCapitalization,
onFieldSubmitted: widget.inputAction == TextInputAction.next onFieldSubmitted: widget.inputAction == TextInputAction.next
? (widget.onSubmit != null ? (widget.onSubmit != null
? widget.onSubmit ? widget.onSubmit!()
: (val) { : (val) {
_focusNode.nextFocus(); _focusNode.nextFocus();
}) })
@ -240,7 +240,7 @@ class _TextFieldsState extends State<TextFields> {
}); });
} }
} }
if (widget.onChanged != null) widget.onChanged(value); if (widget.onChanged != null) widget.onChanged!(value);
}, },
focusNode: _focusNode, focusNode: _focusNode,
maxLength: widget.maxLength ?? null, maxLength: widget.maxLength ?? null,
@ -250,8 +250,8 @@ class _TextFieldsState extends State<TextFields> {
obscureText: widget.type == "password" && !view ? true : false, obscureText: widget.type == "password" && !view ? true : false,
autofocus: widget.autoFocus ?? false, autofocus: widget.autoFocus ?? false,
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved, 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 inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[
// WhitelistingTextInputFormatter.digitsOnly, // WhitelistingTextInputFormatter.digitsOnly,
@ -286,14 +286,14 @@ class _TextFieldsState extends State<TextFields> {
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), 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: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide(color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), 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.circular(0.0), borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0),
), ),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide(color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), 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.circular(0.0)), borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0)),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide(color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), 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.circular(0.0), borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0),
), ),
), ),

@ -14,13 +14,13 @@ import '../speech-text-popup.dart';
class HtmlRichEditor extends StatefulWidget { class HtmlRichEditor extends StatefulWidget {
final String hint; final String hint;
final String initialText; final String? initialText;
final double height; final double height;
final BoxDecoration decoration; final BoxDecoration? decoration;
final bool darkMode; final bool darkMode;
final bool showBottomToolbar; final bool showBottomToolbar;
final List<Toolbar> toolbar; final List<Toolbar>? toolbar;
final HtmlEditorController controller; final HtmlEditorController? controller;
HtmlRichEditor({ HtmlRichEditor({
key, key,
@ -39,7 +39,7 @@ class HtmlRichEditor extends StatefulWidget {
} }
class _HtmlRichEditorState extends State<HtmlRichEditor> { class _HtmlRichEditorState extends State<HtmlRichEditor> {
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
@ -64,7 +64,7 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
return Stack( return Stack(
children: [ children: [
HtmlEditor( HtmlEditor(
controller: widget.controller, controller: widget.controller!,
htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [ htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [
StyleButtons(), StyleButtons(),
FontSettingButtons(), FontSettingButtons(),
@ -88,19 +88,16 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(30.0), Radius.circular(30.0),
), ),
border: Border.all(color: Colors.grey[200], width: 0.5), border: Border.all(color: Colors.grey[200]!, width: 0.5),
), ),
)), )),
Positioned( Positioned(
top: 50, //MediaQuery.of(context).size.height * 0, top: 50, //MediaQuery.of(context).size.height * 0,
right: projectViewModel.isArabic right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15,
? MediaQuery.of(context).size.width * 0.75
: 15,
child: Column( child: Column(
children: [ children: [
IconButton( IconButton(
icon: Icon(DoctorApp.speechtotext, icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35),
color: Colors.black, size: 35),
onPressed: () { onPressed: () {
initSpeechState().then((value) => {onVoiceText()}); initSpeechState().then((value) => {onVoiceText()});
}, },
@ -114,8 +111,7 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
onVoiceText() async { onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context); new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize( bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
onStatus: statusListener, onError: errorListener);
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,
@ -146,13 +142,12 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
void resultListener(result) async { void resultListener(result) async {
recognizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
event.setValue({"searchText": recognizedWord}); event.setValue({"searchText": recognizedWord});
String txt = await widget.controller.getText(); String txt = await widget.controller!.getText();
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
widget.controller.setText(txt + recognizedWord); widget.controller!.setText(txt + recognizedWord);
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
// speech.stop(); // speech.stop();
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);
@ -160,8 +155,7 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
} }
Future<void> initSpeechState() async { Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize( bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
onError: errorListener, onStatus: statusListener);
print(hasSpeech); print(hasSpeech);
if (!mounted) return; if (!mounted) return;
} }

@ -11,11 +11,11 @@ description: A new Flutter project.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.3.9+19 version: 4.3.5+1
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=3.0.0 <3.13.0"
#dependency_overrides: #dependency_overrides:
@ -28,104 +28,122 @@ dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
hexcolor: ^3.0.1 hexcolor: ^3.0.1
flutter_localizations:
sdk: flutter
flutter_device_type: ^0.4.0 flutter_device_type: ^0.4.0
intl: ^0.17.0 http: ^1.1.2
http: ^0.13.0 provider: ^6.1.1
provider: ^6.0.1 shared_preferences: ^2.2.2
shared_preferences: ^2.0.6
# imei_plugin: ^1.2.0 # imei_plugin: ^1.2.0
# flutter_flexible_toast: ^0.1.4 # flutter_flexible_toast: ^0.1.4
fluttertoast: ^8.0.8 fluttertoast: ^8.2.4
local_auth: 1.1.8 local_auth: ^2.1.7
http_interceptor: ^1.0.2 http_interceptor: any
connectivity: ^3.0.6 connectivity: ^3.0.6
maps_launcher: ^2.0.0 maps_launcher: ^2.2.0
url_launcher: ^6.0.6 url_launcher: ^6.2.1
charts_flutter: ^0.12.0 charts_flutter: ^0.12.0
flutter_swiper: ^1.1.6 #flutter_charts: ^0.5.2
#gelin: ^0.1.6
#flutter_swiper: ^1.1.6
flutter_swiper_view: ^1.1.8
#Icons #Icons
eva_icons_flutter: ^3.0.0 eva_icons_flutter: ^3.1.0
font_awesome_flutter: ^10.3.0 font_awesome_flutter: ^10.6.0
dropdown_search: ^3.0.1 dropdown_search: ^5.0.6
flutter_staggered_grid_view: ^0.4.0 flutter_staggered_grid_view: ^0.7.0
expandable: ^5.0.1 expandable: ^5.0.1
# Qr code Scanner # Qr code Scanner
barcode_scan2: ^4.1.4 barcode_scan2: ^4.3.0
# permissions # permissions
permission_handler: ^10.2.0 permission_handler: ^11.1.0
device_info: ^2.0.2 device_info: ^2.0.2
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.3 cupertino_icons: ^1.0.6
# SVG # SVG
#flutter_svg: ^1.0.0 #flutter_svg: ^1.0.0
percent_indicator: ^4.2.2 percent_indicator: ^4.2.3
#Dependency Injection #Dependency Injection
get_it: ^7.1.3 get_it: ^7.6.4
#chart #chart
fl_chart: ^0.45.0 fl_chart: ^0.65.0
# Firebase # Firebase
firebase_messaging: ^14.2.1 firebase_messaging: ^14.7.5
firebase_analytics : ^10.1.0 firebase_analytics : ^10.7.1
#GIF image #GIF image
flutter_gifimage: ^1.0.1 # flutter_gifimage: ^1.0.1
flutter_gif: ^0.0.4
gif: ^2.3.0
#Autocomplete TextField #Autocomplete TextField
autocomplete_textfield: ^2.0.1 autocomplete_textfield: ^2.0.1
date_time_picker: ^2.0.0 date_time_picker: ^2.0.0
flutter_datetime_picker_plus: ^2.1.0
# Html # Html
html: ^0.15.0 html: ^0.15.4
# Flutter Html View # Flutter Html View
flutter_html: ^2.1.0 flutter_html: ^3.0.0-beta.2
sticky_headers: ^0.3.0+2 sticky_headers: ^0.3.0+2
file_picker: ^4.6.1 file_picker: 5.2.0+1
#speech to text #speech to text
# speech_to_text: # speech_to_text:
# path: speech_to_text # path: speech_to_text
speech_to_text: ^6.1.1
quiver: ^3.0.0 speech_to_text: ^6.4.1
quiver: ^3.2.1
flutter_colorpicker: ^1.0.3 flutter_colorpicker: ^1.0.3
# Html Editor Enhanced # Html Editor Enhanced
html_editor_enhanced: ^2.1.1 #html_editor_enhanced: any
html_editor_enhanced: ^2.5.1
jhijri_picker: ^1.0.1
jhijri: ^1.0.0
#Network Image #Network Image
cached_network_image: ^3.1.0+1 cached_network_image: ^3.3.0
# Badges # Badges
badges: ^2.0.1 badges: ^3.1.2
# Hijri # Hijri
# hijri: ^2.0.3 # hijri: ^2.0.3
hijri_picker: ^3.0.0 hijri_picker: ^3.0.0
flutter_datetime_picker: ^1.5.1
#flutter_datetime_picker: ^1.5.1
localization: ^2.1.1
# flutter_math_fork: ^0.6.0 # flutter_math_fork: ^0.6.0
# flutter_math_fork: ^0.6.0 # flutter_math_fork: ^0.6.0
flutter_math_fork: ^0.7.2
dependency_overrides:
flutter_localizations:
sdk: flutter
intl: ^0.18.1
#hijri_picker: ^3.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
build_runner: any build_runner: any
build_web_compilers: any build_web_compilers: any
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
@ -188,3 +206,4 @@ flutter:
# #
# For details regarding fonts from package dependencies, # For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages # see https://flutter.dev/custom-fonts/#from-packages

Loading…
Cancel
Save