Null Safety

main
Aamir Muhammad 3 years ago
parent dc802e2bda
commit d4cb4d7ad3

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -48,7 +48,7 @@ class AuthenticationService extends BaseService {
}, body: {"IMEI": imei});
} catch (error) {
hasError = true;
super.error = error;
super.error = error.toString();
}
}
@ -64,7 +64,7 @@ class AuthenticationService extends BaseService {
}, body: userInfo.toJson());
} catch (error) {
hasError = true;
super.error = error;
super.error = error.toString();
}
}
@ -80,7 +80,7 @@ class AuthenticationService extends BaseService {
}, body: activationCodeModel.toJson());
} catch (error) {
hasError = true;
super.error = error;
super.error = error.toString();
}
}
@ -96,7 +96,7 @@ class AuthenticationService extends BaseService {
}, body: activationCodeModel.toJson());
} catch (error) {
hasError = true;
super.error = error;
super.error = error.toString();
}
}
@ -112,7 +112,7 @@ class AuthenticationService extends BaseService {
}, body: checkActivationCodeRequestModel.toJson());
} catch (error) {
hasError = true;
super.error = error;
super.error = error.toString();
}
}
@ -128,7 +128,7 @@ class AuthenticationService extends BaseService {
}, body: insertIMEIDetailsModel.toJson());
} catch (error) {
hasError = true;
super.error = error;
super.error = error.toString();
}
}
@ -146,7 +146,7 @@ class AuthenticationService extends BaseService {
}, body: profileReqModel.toJson());
} catch (error) {
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';
class HospitalsService extends BaseService {
List<GetHospitalsResponseModel> hospitals = List();
List<VidaPlusProjectListModel> vidaPlusProjectListModel = List();
List<GetHospitalsResponseModel> hospitals = [];
List<VidaPlusProjectListModel> vidaPlusProjectListModel = [];
Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async {
hasError = false;

@ -1,46 +1,13 @@
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/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/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 {
Future signInERPatient({DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async {
Future signInERPatient({required DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async {
hasError = false;
await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: doctorErSignAssessmentReqModel.toJson());
}
}

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

@ -1,16 +1,15 @@
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/radiology/final_radiology.dart';
import 'package:flutter/cupertino.dart';
import '../../base/base_service.dart';
class RadiologyService extends BaseService {
List<FinalRadiology> finalRadiologyList = List();
List<FinalRadiology> finalRadiologyList = [];
String url = '';
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;
final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo;

@ -1,33 +1,29 @@
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_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/service/base/base_service.dart';
class PendingOrderService extends BaseService {
List<PendingOrderModel> _pendingOrderList = List();
List<PendingOrderModel> _pendingOrderList = [];
List<PendingOrderModel> get pendingOrderList => _pendingOrderList;
List<AdmissionOrdersModel> _admissionOrderList = List();
List<AdmissionOrdersModel> _admissionOrderList = [];
List<AdmissionOrdersModel> get admissionOrderList => _admissionOrderList;
Future getPendingOrders(
{PendingOrderRequestModel pendingOrderRequestModel,
int patientId,
int admissionNo}) async {
Future getPendingOrders({PendingOrderRequestModel? pendingOrderRequestModel, int? patientId, int? admissionNo}) async {
pendingOrderRequestModel = PendingOrderRequestModel(
patientID: patientId,
admissionNo: admissionNo,
patientTypeID: 1,
patientType: 1,
);
patientID: patientId,
admissionNo: admissionNo,
patientTypeID: 1,
patientType: 1,
);
hasError = false;
await baseAppClient.post(GET_PENDING_ORDERS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_PENDING_ORDERS, onSuccess: (dynamic response, int statusCode) {
print("Success");
_pendingOrderList.clear();
response['List_PendingOrders'].forEach(
@ -41,20 +37,16 @@ class PendingOrderService extends BaseService {
}, body: pendingOrderRequestModel.toJson());
}
Future getAdmissionOrders(
{AdmissionOrdersRequestModel admissionOrdersRequestModel,
int patientId,
int admissionNo}) async {
Future getAdmissionOrders({AdmissionOrdersRequestModel? admissionOrdersRequestModel, int? patientId, int? admissionNo}) async {
admissionOrdersRequestModel = AdmissionOrdersRequestModel(
patientID: patientId,
admissionNo: admissionNo,
patientTypeID: 1,
patientType: 1,
);
patientID: patientId,
admissionNo: admissionNo,
patientTypeID: 1,
patientType: 1,
);
hasError = false;
await baseAppClient.post(GET_ADMISSION_ORDERS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_ADMISSION_ORDERS, onSuccess: (dynamic response, int statusCode) {
print("Success");
//admissionOrderList.clear();
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/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/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:flutter/cupertino.dart';
class ERSignInViewModel extends BaseViewModel {
bool hasError = false;
ERSignInService _ERSignInService = locator<ERSignInService>();
Future signInERPatient({int patientId, int signInType}) async {
Future signInERPatient({required int patientId, required int signInType}) async {
hasError = false;
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);
await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel);
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/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/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/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_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/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_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_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/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/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/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_examination.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/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/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/subjective/subjective_call_back.dart';
import 'package:flutter/material.dart';
import '../../locator.dart';
import 'base_view_model.dart';
@ -79,7 +78,7 @@ class SOAPViewModel extends BaseViewModel {
List<GetAssessmentResModel> get patientAssessmentList => _SOAPService.patientAssessmentList;
int get episodeID => _SOAPService.episodeID;
int get episodeID => _SOAPService.episodeID!;
bool isAddProgress = true;
bool isAddExamInProgress = true;
@ -98,7 +97,7 @@ class SOAPViewModel extends BaseViewModel {
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList;
SubjectiveCallBack subjectiveCallBack;
late SubjectiveCallBack subjectiveCallBack;
setSubjectiveCallBack(SubjectiveCallBack callBack) {
this.subjectiveCallBack = callBack;
@ -108,7 +107,7 @@ class SOAPViewModel extends BaseViewModel {
subjectiveCallBack.nextFunction(model);
}
ObjectiveCallBack objectiveCallBack;
late ObjectiveCallBack objectiveCallBack;
setObjectiveCallBack(ObjectiveCallBack callBack) {
this.objectiveCallBack = callBack;
@ -118,7 +117,7 @@ class SOAPViewModel extends BaseViewModel {
objectiveCallBack.nextFunction(model);
}
AssessmentCallBack assessmentCallBack;
late AssessmentCallBack assessmentCallBack;
setAssessmentCallBack(AssessmentCallBack callBack) {
this.assessmentCallBack = callBack;
@ -128,7 +127,7 @@ class SOAPViewModel extends BaseViewModel {
assessmentCallBack.nextFunction(model);
}
PlanCallBack planCallBack;
late PlanCallBack planCallBack;
setPlanCallBack(PlanCallBack callBack) {
this.planCallBack = callBack;
@ -250,8 +249,8 @@ class SOAPViewModel extends BaseViewModel {
String getAllergicNames(isArabic) {
String allergiesString = '';
patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
if (selectedAllergy != null && element.isChecked) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + ' , ';
MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType!)!;
if (selectedAllergy != null && element.isChecked!) allergiesString += ((isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , ')!;
});
return allergiesString;
}
@ -268,8 +267,8 @@ class SOAPViewModel extends BaseViewModel {
patientInfo.appointmentNo.toString(),
),
);
if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty)
getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo);
if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty)
getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo!);
else
getPhysicalExamReqModel.admissionNo = 0;
setState(ViewState.Busy);
@ -303,7 +302,7 @@ class SOAPViewModel extends BaseViewModel {
Future getEpisodeForInpatient(PatiantInformtion patient) async {
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);
if (_SOAPService.hasError) {
error = _SOAPService.error;
@ -315,7 +314,7 @@ class SOAPViewModel extends BaseViewModel {
}
// ignore: missing_return
MasterKeyModel getOneMasterKey({@required MasterKeysService masterKeys, dynamic id, int typeId}) {
MasterKeyModel? getOneMasterKey({required MasterKeysService masterKeys, dynamic id, int? typeId}) {
switch (masterKeys) {
case MasterKeysService.Allergies:
List<MasterKeyModel> result = allergiesList.where((element) {
@ -406,7 +405,28 @@ class SOAPViewModel extends BaseViewModel {
return result.first;
}
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 {
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo!) : null,
patientMRN: patientInfo.patientMRN,
appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null,
episodeId: patientInfo.episodeNo,
@ -541,7 +561,7 @@ class SOAPViewModel extends BaseViewModel {
final results = await Future.wait(services ?? []);
if (_SOAPService.hasError || _prescriptionService.hasError) {
error = _SOAPService.error + _prescriptionService.error;
error = _SOAPService.error! + _prescriptionService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -601,11 +621,11 @@ class SOAPViewModel extends BaseViewModel {
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;
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText, medicationText: medicationText, complaintsText: complaintsText);
createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText!, medicationText: medicationText!, complaintsText: complaintsText!);
if (patientChiefComplaintList.isEmpty) {
postChiefComplaintRequestModel.editedBy = '';
services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)];
@ -614,7 +634,7 @@ class SOAPViewModel extends BaseViewModel {
services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)];
}
if (myHistoryList.length != 0) {
if (myHistoryList!.length != 0) {
PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList);
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);
if (patientAllergiesList.isEmpty) {
services.add(_SOAPService.postAllergy(postAllergyRequestModel));
@ -642,7 +662,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String complaintsText, String medicationText, String illnessText}) {
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String? complaintsText, String? medicationText, String? illnessText}) {
return new PostChiefComplaintRequestModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
patientMRN: patientInfo.patientMRN,
@ -657,17 +677,17 @@ class SOAPViewModel extends BaseViewModel {
numberOfWeeks: 0);
}
PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List<MySelectedHistory> myHistoryList}) {
PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List<MySelectedHistory>? myHistoryList}) {
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
myHistoryList.forEach((history) {
myHistoryList!.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM(
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo,
remarks: "",
historyId: history.selectedHistory.id,
historyType: history.selectedHistory.typeId,
historyId: history.selectedHistory!.id,
historyType: history.selectedHistory!.typeId,
isChecked: history.isChecked,
));
});
@ -679,7 +699,7 @@ class SOAPViewModel extends BaseViewModel {
PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel();
myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM(
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: patientInfo.patientMRN,
@ -687,9 +707,9 @@ class SOAPViewModel extends BaseViewModel {
appointmentNo: patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile.doctorID,
createdBy: allergy.createdBy ?? doctorProfile!.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedBy: doctorProfile!.doctorID,
editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked,
isUpdatedByNurse: false));

@ -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:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/services.dart';
import 'package:local_auth/auth_strings.dart';
// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
// import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart';
import 'package:local_auth_ios/local_auth_ios.dart';
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED }
@ -55,12 +54,12 @@ class AuthenticationViewModel extends BaseViewModel {
List<VidaPlusProjectListModel> get vidaPlusProjectList => _hospitalsService.vidaPlusProjectListModel;
NewLoginInformationModel loggedUser;
GetIMEIDetailsModel user;
NewLoginInformationModel loggedUser = NewLoginInformationModel();
GetIMEIDetailsModel user = GetIMEIDetailsModel();
UserModel userInfo = UserModel();
final LocalAuthentication auth = LocalAuthentication();
List<BiometricType> _availableBiometrics;
List<BiometricType> _availableBiometrics = [];
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
bool isLogin = false;
@ -88,7 +87,7 @@ class AuthenticationViewModel extends BaseViewModel {
profileInfo['IMEI'] = token;
profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE);
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.genderDescription = profileInfo['Gender_Description'];
insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN'];
@ -96,12 +95,12 @@ class AuthenticationViewModel extends BaseViewModel {
insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description'];
insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN'];
insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID);
insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID;
insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA;
insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user!.doctorID;
insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA;
insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
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);
if (_authService.hasError) {
@ -119,11 +118,11 @@ class AuthenticationViewModel extends BaseViewModel {
error = _authService.error;
setState(ViewState.ErrorLocal);
} else {
sharedPref.setInt(PROJECT_ID, userInfo.projectID);
sharedPref.setInt(PROJECT_ID, userInfo.projectID!);
loggedUser = loginInfo;
saveObjToString(LOGGED_IN_USER, loginInfo);
sharedPref.remove(LAST_LOGIN_USER);
sharedPref.setString(TOKEN, loginInfo.logInTokenID);
sharedPref.setString(TOKEN, loginInfo.logInTokenID!);
setState(ViewState.Idle);
}
}
@ -132,17 +131,17 @@ class AuthenticationViewModel extends BaseViewModel {
Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async {
setState(ViewState.BusyLocal);
ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel(
iMEI: user.iMEI,
facilityId: user.projectID,
memberID: user.doctorID,
loginDoctorID: int.parse(user.editedBy.toString()),
zipCode: user.outSA == true ? '971' : '966',
mobileNumber: user.mobile,
iMEI: user!.iMEI,
facilityId: user!.projectID,
memberID: user!.doctorID,
loginDoctorID: int.parse(user!.editedBy.toString()),
zipCode: user!.outSA == true ? '971' : '966',
mobileNumber: user!.mobile,
oTPSendType: authMethodType.getTypeIdService(),
isMobileFingerPrint: 1,
vidaAuthTokenID: user.vidaAuthTokenID,
vidaRefreshTokenID: user.vidaRefreshTokenID);
await sharedPref.setString(DOCTOR_ID, user.editedBy.toString());
vidaAuthTokenID: user!.vidaAuthTokenID,
vidaRefreshTokenID: user!.vidaRefreshTokenID);
await sharedPref.setString(DOCTOR_ID, user!.editedBy.toString());
await _authService.sendActivationCodeVerificationScreen(activationCodeModel);
if (_authService.hasError) {
@ -153,28 +152,28 @@ class AuthenticationViewModel extends BaseViewModel {
}
/// send activation code for silent login
Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password}) async {
Future sendActivationCodeForDoctorApp({required AuthMethodTypes authMethodType, required String password}) async {
setState(ViewState.BusyLocal);
int projectID = await sharedPref.getInt(PROJECT_ID);
ActivationCodeModel activationCodeModel = ActivationCodeModel(
facilityId: projectID,
memberID: loggedUser.listMemberInformation[0].memberID,
loginDoctorID: loggedUser.listMemberInformation[0].employeeID,
memberID: loggedUser.listMemberInformation![0].memberID,
loginDoctorID: loggedUser.listMemberInformation![0].employeeID,
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);
if (_authService.hasError) {
error = _authService.error;
setState(ViewState.ErrorLocal);
} else {
await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID);
await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID!);
setState(ViewState.Idle);
}
}
/// check activation code for sms and whats app
Future checkActivationCodeForDoctorApp({String activationCode, bool isSilentLogin = false}) async {
Future checkActivationCodeForDoctorApp({String? activationCode, bool isSilentLogin = false}) async {
setState(ViewState.BusyLocal);
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,
logInTokenID: await sharedPref.getString(TOKEN),
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,
facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE),
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,
@ -242,10 +241,10 @@ class AuthenticationViewModel extends BaseViewModel {
setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async {
// print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
await sharedPref.setString(
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_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);
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_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!);
await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!);
}
saveObjToString(String key, value) async {
@ -254,10 +253,16 @@ class AuthenticationViewModel extends BaseViewModel {
/// ask user to add his biometric
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 {
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) {
DrAppToastMsg.showErrorToast(e.toString());
}
@ -285,12 +290,12 @@ class AuthenticationViewModel extends BaseViewModel {
/// add some logic in case of check activation code is success
onCheckActivationCodeSuccess({bool isSilentLogin = false}) async {
sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID);
if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) {
localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile[0]);
sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!);
if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) {
localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile![0]);
} else {
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);
}
}
@ -350,8 +355,8 @@ class AuthenticationViewModel extends BaseViewModel {
if (_authService.dashboardItemsList.length > 0) {
user = _authService.dashboardItemsList[0];
sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID!);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID!);
this.unverified = true;
}
setState(ViewState.Idle);
@ -405,7 +410,7 @@ class AuthenticationViewModel extends BaseViewModel {
}
deleteUser() {
user = null;
user = GetIMEIDetailsModel();
unverified = false;
isLogin = false;
}

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

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

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

@ -7,8 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import '../../locator.dart';
class AdmissionRequestViewModel extends BaseViewModel {
AdmissionRequestService _admissionRequestService =
locator<AdmissionRequestService>();
AdmissionRequestService _admissionRequestService = locator<AdmissionRequestService>();
List<dynamic> get clinicList => _admissionRequestService.clinicList;
@ -20,26 +19,21 @@ class AdmissionRequestViewModel extends BaseViewModel {
List<dynamic> get wardList => _admissionRequestService.wardList;
List<dynamic> get roomCategoryList =>
_admissionRequestService.roomCategoryList;
List<dynamic> get roomCategoryList => _admissionRequestService.roomCategoryList;
List<dynamic> get admissionTypeList =>
_admissionRequestService.listOfAdmissionType;
List<dynamic> get admissionTypeList => _admissionRequestService.listOfAdmissionType;
List<dynamic> get diagnosisTypesList =>
_admissionRequestService.diagnosisTypesList;
List<dynamic> get diagnosisTypesList => _admissionRequestService.diagnosisTypesList;
List<dynamic> get allergiesList =>
_admissionRequestService.allergiesLookupList;
List<dynamic> get allergiesList => _admissionRequestService.allergiesLookupList;
List<dynamic> get dietTypesList => _admissionRequestService.dietTypesList;
List<dynamic> get icdCodes => _admissionRequestService.icdCodes;
List<dynamic> get listOfDiagnosisSelectionTypes =>
_admissionRequestService.listOfDiagnosisSelectionTypes;
List<dynamic> get listOfDiagnosisSelectionTypes => _admissionRequestService.listOfDiagnosisSelectionTypes;
AdmissionRequest? admissionRequestData;
AdmissionRequest admissionRequestData = AdmissionRequest();
Future getSpecialityList() async {
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/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/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/procedure/order-procedure.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/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:flutter/material.dart';
import '../../locator.dart';
class UcafViewModel extends BaseViewModel {
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;
@ -28,13 +27,13 @@ class UcafViewModel extends BaseViewModel {
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 weightKg = "0";
String bodyMax = "0";
@ -60,8 +59,8 @@ class UcafViewModel extends BaseViewModel {
Future getUCAFData(PatiantInformtion patient) async {
// setState(ViewState.Busy);
String from;
String to;
String? from;
String? to;
if (from == null || from == "0") {
from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
@ -77,7 +76,7 @@ class UcafViewModel extends BaseViewModel {
error = _ucafService.error;
setState(ViewState.Error);
} else {
patientVitalSignsHistory.forEach((element) {
patientVitalSignsHistory!.forEach((element) {
if (heightCm == "0" || heightCm == null || heightCm == 'null') {
heightCm = element.heightCm.toString();
}
@ -132,7 +131,7 @@ class UcafViewModel extends BaseViewModel {
}
Future getOrderProcedures(PatiantInformtion patient) async {
if (orderProcedures.isEmpty) {
if (orderProcedures!.isEmpty) {
// setState(ViewState.Busy);
await _ucafService.getOrderProcedures(patient);
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) {
case MasterKeysService.DiagnosisCondition:
List<MasterKeyModel> result = diagnosisConditions.where((element) {
@ -166,7 +165,7 @@ class UcafViewModel extends BaseViewModel {
if (result.isNotEmpty) {
return result.first;
}
return null;
return MasterKeyModel();
case MasterKeysService.DiagnosisType:
List<MasterKeyModel> result = diagnosisTypes.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
@ -174,9 +173,9 @@ class UcafViewModel extends BaseViewModel {
if (result.isNotEmpty) {
return result.first;
}
return null;
return MasterKeyModel();
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/patient_lab_orders.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/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';
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/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/viewModel/base_view_model.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/utils/dr_app_toast_msg.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';
class ProcedureViewModel extends BaseViewModel {
@ -44,8 +43,8 @@ class ProcedureViewModel extends BaseViewModel {
List<dynamic> get categoryList => _procedureService.categoryList;
RadiologyService _radiologyService = locator<RadiologyService>();
LabsService _labsService = locator<LabsService>();
List<FinalRadiologyList> _finalRadiologyListClinic = List();
List<FinalRadiologyList> _finalRadiologyListHospital = List();
List<FinalRadiologyList> _finalRadiologyListClinic = [];
List<FinalRadiologyList> _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<ProcedureTempleteDetailsModel> get procedureTemplate => _procedureService.templateList;
List<ProcedureTempleteDetailsModelList> templateList = List();
List<ProcedureTempleteDetailsModelList> templateList = [];
List<ProcedureTempleteDetailsModel> get procedureTemplateDetails => _procedureService.templateDetailsList;
@ -64,7 +63,7 @@ class ProcedureViewModel extends BaseViewModel {
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;
await getDoctorProfile();
if (isLocalBusy)
@ -82,7 +81,7 @@ class ProcedureViewModel extends BaseViewModel {
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;
hasError = false;
if (isLocalBusy)
@ -109,7 +108,7 @@ class ProcedureViewModel extends BaseViewModel {
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) {
setState(ViewState.BusyLocal);
} else {
@ -140,7 +139,7 @@ class ProcedureViewModel extends BaseViewModel {
int tempId = 0;
Future getProcedureTemplateDetails({int templateId}) async {
Future getProcedureTemplateDetails({required int templateId}) async {
tempId = templateId;
hasError = false;
//_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;
if (isLocalBusy)
setState(ViewState.BusyLocal);
@ -200,7 +199,7 @@ class ProcedureViewModel extends BaseViewModel {
//await getProcedure(mrn: mrn);
}
void getPatientRadOrders(PatiantInformtion patient, {String patientType, bool isInPatient = false}) async {
void getPatientRadOrders(PatiantInformtion patient, {String? patientType, bool isInPatient = false}) async {
setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient);
_isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus;
@ -240,7 +239,7 @@ class ProcedureViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url;
getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async {
getRadImageURL({int? invoiceNo, int lineItem = 0, int projectId = 0, required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient);
if (_radiologyService.hasError) {
@ -259,7 +258,7 @@ class ProcedureViewModel extends BaseViewModel {
List<LabResult> get labResultList => _labsService.labResultList;
List<LabResultList> labResultLists = List();
List<LabResultList> labResultLists = [];
List<LabResultList> get labResultListsCoustom {
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);
await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient);
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);
await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, patient: patient);
if (_labsService.hasError) {
@ -297,7 +296,7 @@ class ProcedureViewModel extends BaseViewModel {
bool isShouldClear = false;
if (_labsService.labOrdersResultsList.length == 1) {
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();
@ -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);
if (_labsService.hasError) {
error = _labsService.error;
@ -314,11 +313,11 @@ class ProcedureViewModel extends BaseViewModel {
}
Future preparePostProcedure({
String remarks,
String orderType,
PatiantInformtion patient,
List<cpe.EntityList> entityList,
ProcedureType procedureType,
String? remarks,
String? orderType,
required PatiantInformtion patient,
List<cpe.EntityList>? entityList,
ProcedureType? procedureType,
bool isLocalBusy = false,
}) async {
///TODO Roaa Move it to function
@ -333,15 +332,15 @@ class ProcedureViewModel extends BaseViewModel {
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
List<Procedures> controlsProcedure = List();
List<Procedures> controlsProcedure = [];
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = List();
entityList!.forEach((element) {
procedureValadteRequestModel.procedure = [element.procedureId!];
List<Controls> controls = [];
controls.add(
Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""),
);
@ -354,12 +353,12 @@ class ProcedureViewModel extends BaseViewModel {
postProcedureReqModel.procedures = controlsProcedure;
await validationProcedure(procedureValadteRequestModel, isLocalBusy: isLocalBusy);
if (state == ViewState.Idle) {
if (valadteProcedureList[0].entityList.length == 0) {
await postProcedure(postProcedureReqModel, patient.patientMRN, isLocalBusy: isLocalBusy);
if (valadteProcedureList[0].entityList!.length == 0) {
await postProcedure(postProcedureReqModel, patient.patientMRN!, isLocalBusy: isLocalBusy);
if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error);
getProcedure(mrn: patient.patientMRN, isLocalBusy: isLocalBusy);
getProcedure(mrn: patient.patientMRN!, isLocalBusy: isLocalBusy);
} else if (state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX);
@ -368,9 +367,9 @@ class ProcedureViewModel extends BaseViewModel {
} else {
if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error);
getProcedure(mrn: patient.patientMRN);
getProcedure(mrn: patient.patientMRN!);
} else if (state == ViewState.Idle) {
Utils.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages);
Utils.showErrorToast(valadteProcedureList[0].entityList![0].warringMessages);
}
}
} else {
@ -400,7 +399,7 @@ class ProcedureViewModel extends BaseViewModel {
} else {
setState(ViewState.Busy);
}
List<cpe.EntityList> entityList = List();
List<cpe.EntityList> entityList = [];
items.forEach((element) {
entityList.add(
cpe.EntityList(
@ -419,12 +418,12 @@ class ProcedureViewModel extends BaseViewModel {
}
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);
if (query.isNotEmpty) {
List<cpe.EntityList> dummyListData = List();
List<cpe.EntityList> dummyListData = [];
dummySearchList.forEach((item) {
if (item.procedureName.toLowerCase().contains(query.toLowerCase())) {
if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});
@ -437,12 +436,12 @@ class ProcedureViewModel extends BaseViewModel {
}
void filterProcedureSearchResults(String query, List<ProcedureTempleteModel> masterList, List<ProcedureTempleteModel> items) {
List<ProcedureTempleteModel> dummySearchList = List();
List<ProcedureTempleteModel> dummySearchList = [];
if (masterList != null) dummySearchList.addAll(masterList);
if (query.isNotEmpty) {
List<ProcedureTempleteModel> dummyListData = List();
List<ProcedureTempleteModel> dummyListData = [];
dummySearchList.forEach((item) {
if (item.templateName.toLowerCase().contains(query.toLowerCase())) {
if (item.templateName!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});

@ -35,7 +35,7 @@ class ProjectViewModel with ChangeNotifier {
bool get isArabic => _isArabic;
late StreamSubscription subscription;
List<VidaPlusProjectListModel> _vidaPlusProjectListModel = List();
List<VidaPlusProjectListModel> _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/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/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 'base_view_model.dart';
@ -12,8 +11,8 @@ class RadiologyViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic;
RadiologyService _radiologyService = locator<RadiologyService>();
List<FinalRadiologyList> _finalRadiologyListClinic = List();
List<FinalRadiologyList> _finalRadiologyListHospital = List();
List<FinalRadiologyList> _finalRadiologyListClinic = [];
List<FinalRadiologyList> _finalRadiologyListHospital = [];
List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
@ -53,7 +52,7 @@ class RadiologyViewModel extends BaseViewModel {
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);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, patient: patient, invoiceType: invoiceType);
if (_radiologyService.hasError) {

@ -1,26 +1,22 @@
import 'package:barcode_scan2/barcode_scan2.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/model/patient_muse/PatientSearchRequestModel.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/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/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/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_texts_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/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../routes.dart';
import '../base/base_view.dart';
Utils helpers = Utils();
@ -31,7 +27,7 @@ class ErSignInScreen extends StatefulWidget {
}
class _ErSignInScreenState extends State<ErSignInScreen> {
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
@ -45,7 +41,7 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
),
body: Center(
child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight! / 7),
child: FractionallySizedBox(
widthFactor: 0.9,
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);
await model.signInERPatient(patientId: patientId, signInType: signInType);
if (model.state == ViewState.ErrorLocal) {
@ -126,9 +122,9 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
/// TODO Elham* Make this as custom Dialog
showMyDialog({
BuildContext context,
Function firstAction,
Function secondAction,
required BuildContext context,
required Function firstAction,
required Function secondAction,
}) {
showDialog(
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/viewModel/authentication_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/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
@ -21,7 +21,7 @@ class LoginScreen extends StatefulWidget {
}
class _LoginScreenState extends State<LoginScreen> {
String platformImei;
String? platformImei;
bool allowCallApi = true;
//TODO change AppTextFormField to AppTextFormFieldCustom
@ -32,8 +32,8 @@ class _LoginScreenState extends State<LoginScreen> {
List<GetHospitalsResponseModel> projectsList = [];
FocusNode focusPass = FocusNode();
FocusNode focusProject = FocusNode();
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
late AuthenticationViewModel authenticationViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -74,11 +74,11 @@ class _LoginScreenState extends State<LoginScreen> {
),
Text(
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(
"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,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * 0.90,
height: SizeConfig.realScreenHeight * 0.65,
width: SizeConfig.realScreenWidth! * 0.90,
height: SizeConfig.realScreenHeight! * 0.65,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
buildSizedBox(),
AppTextFieldCustom(
@ -106,6 +106,7 @@ class _LoginScreenState extends State<LoginScreen> {
authenticationViewModel.userInfo.userID = value.trim();
});
},
onFieldSubmitted: () {},
),
buildSizedBox(),
AppTextFieldCustom(
@ -126,6 +127,7 @@ class _LoginScreenState extends State<LoginScreen> {
// }
},
onClick: () {},
onFieldSubmitted: () {},
),
buildSizedBox(),
AppTextFieldCustom(
@ -137,6 +139,8 @@ class _LoginScreenState extends State<LoginScreen> {
onClick: () {
Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel);
},
onChanged: (String value) {},
onFieldSubmitted: () {},
),
buildSizedBox()
]),
@ -187,8 +191,8 @@ class _LoginScreenState extends State<LoginScreen> {
login(
context,
) async {
if (loginFormKey.currentState.validate()) {
loginFormKey.currentState.save();
if (loginFormKey.currentState!.validate()) {
loginFormKey.currentState!.save();
GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.login(authenticationViewModel.userInfo);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
@ -213,10 +217,10 @@ class _LoginScreenState extends State<LoginScreen> {
onSelectProject(index) {
setState(() {
authenticationViewModel.userInfo.projectID = projectsList[index].facilityId;
projectIdController.text = projectsList[index].facilityName;
projectIdController.text = projectsList[index].facilityName!;
});
primaryFocus.unfocus();
primaryFocus!.unfocus();
}
String memberID = "";
@ -231,7 +235,7 @@ class _LoginScreenState extends State<LoginScreen> {
setState(() {
projectViewModel.setVidaPlusProjectList(authenticationViewModel.vidaPlusProjectList);
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> {
ProjectViewModel projectsProvider;
late ProjectViewModel projectsProvider;
bool isMoreOption = false;
bool onlySMSBox = false;
AuthMethodTypes fingerPrintBefore;
AuthMethodTypes selectedOption;
AuthenticationViewModel authenticationViewModel;
AuthMethodTypes? fingerPrintBefore;
AuthMethodTypes? selectedOption;
late AuthenticationViewModel authenticationViewModel;
@override
Widget build(BuildContext context) {
@ -63,7 +63,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4),
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 6 : 4),
),
if (authenticationViewModel.isFromLogin)
InkWell(
@ -78,7 +78,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Column(
children: <Widget>[
SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4),
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 3 : 4),
),
authenticationViewModel.user != null && isMoreOption == false
? Column(
@ -93,14 +93,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
letterSpacing: -0.72,
),
AppText(
Utils.convertToTitleCase(authenticationViewModel.user.doctorName),
Utils.convertToTitleCase(authenticationViewModel.user.doctorName!),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.bold,
letterSpacing: -1.44,
),
SizedBox(
height: SizeConfig.heightMultiplier * 4,
height: SizeConfig.heightMultiplier! * 4,
),
AppText(
TranslationBase.of(context).accountInfo,
@ -109,7 +109,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
SizedBox(height: SizeConfig.heightMultiplier * 4),
SizedBox(height: SizeConfig.heightMultiplier! * 4),
Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
@ -124,7 +124,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * .5,
width: SizeConfig.realScreenWidth! * .5,
padding: EdgeInsets.all(0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -172,9 +172,9 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
children: [
AppText(
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
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn), isMonthShort: true)
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn!), isMonthShort: true)
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
@ -184,9 +184,9 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
),
AppText(
authenticationViewModel.user.editedOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn))
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn!))
: authenticationViewModel.user.createdOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn))
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn!))
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
@ -201,7 +201,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
),
),
SizedBox(
height: SizeConfig.heightMultiplier * 3,
height: SizeConfig.heightMultiplier! * 3,
),
Row(
children: [
@ -216,7 +216,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
],
),
SizedBox(
height: SizeConfig.heightMultiplier * 2,
height: SizeConfig.heightMultiplier! * 2,
),
],
)
@ -250,7 +250,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
},
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID),
authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID!),
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
)),
),
@ -351,7 +351,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password);
await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password!);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(authenticationViewModel.error);
GifLoaderDialogUtils.hideDialog(context);
@ -375,7 +375,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
GifLoaderDialogUtils.hideDialog(context);
Utils.showErrorToast(authenticationViewModel.error);
} else {
await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID);
await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!);
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType, isSilentLogin: true);
@ -407,7 +407,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
default:
break;
}
sharedPref.setInt(OTP_TYPE, selectedOption.getTypeIdService());
sharedPref.setInt(OTP_TYPE, selectedOption!.getTypeIdService());
}
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(
context,
type,
@ -443,8 +443,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
await authenticationViewModel.showIOSAuthMessages();
if (!mounted) return;
if (authenticationViewModel.user != null &&
(SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) {
(SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID!) == AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID!) == AuthMethodTypes.FaceID)) {
this.sendActivationCode(authMethodTypes);
} else {
setState(() {
@ -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);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context);

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

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

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

@ -1,4 +1,5 @@
import 'dart:math';
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/config.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/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/utils/extenstions_utils.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/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/utils.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_texts_widget.dart';
@ -25,10 +26,10 @@ import 'package:speech_to_text/speech_to_text.dart';
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg {
class MedicineSearchScreen extends StatefulWidget implements DrAppToastMsg {
MedicineSearchScreen({this.changeLoadingState});
final Function changeLoadingState;
final Function? changeLoadingState;
@override
_MedicineSearchState createState() => _MedicineSearchState();
@ -42,27 +43,22 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
String _currentLocaleId = "";
final SpeechToText speech = SpeechToText();
String lastStatus = '';
GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
String lastError;
String? lastError;
double level = 0.0;
double minSoundLevel = 50000;
double maxSoundLevel = -50000;
String recognizedWord;
String recognizedWord = '';
@override
void didChangeDependencies() {
super.didChangeDependencies();
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
_currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en'
? 'en-GB'
: 'ar-SA'; // systemLocale.localeId;
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
_currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId;
if (!mounted) return;
setState(() {
@ -70,54 +66,51 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
});
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return BaseView<MedicineViewModel>(onModelReady: (model) async {
}, builder: (_, model, w) {
// myController.text = model.searchText;
return AppScaffold(
// baseViewModel: model,
isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).searchMedicine,
),
body: SingleChildScrollView(
child: Column(
return BaseView<MedicineViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) {
// myController.text = model.searchText;
return AppScaffold(
// baseViewModel: model,
isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).searchMedicine,
),
body: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 10,
),
AppTextFieldCustomSearch(
hintText:
TranslationBase.of(context).searchMedicineNameHere,
hintText: TranslationBase.of(context).searchMedicineNameHere,
searchController: myController,
onFieldSubmitted: (value) {
searchMedicine(context, model);
},
marginTop: 5,
onChangeFun: (String val) {},
),
Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: AppText(
TranslationBase.of(context).youCanFind +
(myController.text != ''
? model.pharmacyItemsList.length.toString()
: '0') +
(myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') +
" " +
TranslationBase.of(context).medicineSearchResult +" '${myController.text}'",
TranslationBase.of(context).medicineSearchResult +
" '${myController.text}'",
fontHeight: 1.4,
color: AppGlobal.appTextColor,
textAlign: TextAlign.start,
@ -134,33 +127,23 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
if (myController.text != '')
Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0),
height: MediaQuery.of(context).size.height * 0.6,
child: ListView.builder(
padding: const EdgeInsets.only(top: 20),
scrollDirection: Axis.vertical,
itemCount: model.pharmacyItemsList == null
? 0
: model.pharmacyItemsList.length,
itemCount: model.pharmacyItemsList == null ? 0 : model.pharmacyItemsList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
child: MedicineItemWidget(
label: model.pharmacyItemsList[index]
["ItemDescription"],
url: model.pharmacyItemsList[index]
["ImageSRCUrl"],
label: model.pharmacyItemsList[index]["ItemDescription"],
url: model.pharmacyItemsList[index]["ImageSRCUrl"],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PharmaciesListScreen(
itemID: model.pharmacyItemsList[index]
["ItemID"],
url: model.pharmacyItemsList[index]
["ImageSRCUrl"]),
settings: RouteSettings(
name: 'PharmaciesListScreen'),
builder: (context) => PharmaciesListScreen(itemID: model.pharmacyItemsList[index]["ItemID"], url: model.pharmacyItemsList[index]["ImageSRCUrl"]),
settings: RouteSettings(name: 'PharmaciesListScreen'),
),
);
},
@ -170,45 +153,44 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
),
],
)),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.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,
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
fontWeight: FontWeight.w700,
title: TranslationBase.of(context).search,
onPressed: () async {
await searchMedicine(context, model);
},
color: AppGlobal.appRedColor,
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
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 {
@ -247,8 +229,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
recognizedWord = result.recognizedWords;
lastStatus = '';
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) {
minSoundLevel = min(minSoundLevel, 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/screens/base/base_view.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/utils.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/text_fields/app_text_field_custom_serach.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../routes.dart';
@ -29,7 +28,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
builder: (_, model, w) => AppScaffold(
//appBarTitle: 'Discharged Patient',
//subtitle: "Last Three Months",
backgroundColor: Colors.grey[200],
backgroundColor: Colors.grey[200]!,
isShowAppBar: false,
baseViewModel: model,
body: model.myDischargedPatient.isEmpty
@ -59,7 +58,9 @@ class _DischargedPatientState extends State<DischargedPatient> {
color: Colors.black,
),
iconSize: 20,
onPressed: () {},
),
onFieldSubmitted: () {},
),
SizedBox(
height: 5,
@ -115,11 +116,11 @@ class _DischargedPatientState extends State<DischargedPatient> {
children: [
AppText(
model.filterData[index].nationalityName != null
? model.filterData[index].nationalityName.trim()
? model.filterData[index].nationalityName!.trim()
: model.filterData[index].nationality != null
? model.filterData[index].nationality.trim()
? model.filterData[index].nationality!.trim()
: model.filterData[index].nationalityId != null
? model.filterData[index].nationalityId
? model.filterData[index].nationalityId!
: "",
fontWeight: FontWeight.bold,
fontSize: 14,
@ -129,10 +130,10 @@ class _DischargedPatientState extends State<DischargedPatient> {
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL : '',
model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL! : '',
height: 25,
width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return AppText(
'',
fontSize: 10,
@ -172,7 +173,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black),
style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier!, color: Colors.black),
children: <TextSpan>[
new TextSpan(text: TranslationBase.of(context).fileNumber, style: TextStyle(fontSize: 14, fontFamily: 'Poppins')),
new TextSpan(
@ -186,7 +187,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier,
fontSize: 2.0 * SizeConfig.textMultiplier!,
color: Colors.black,
fontFamily: 'Poppins',
),
@ -207,7 +208,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier,
fontSize: 2.0 * SizeConfig.textMultiplier!,
color: Colors.black,
fontFamily: 'Poppins',
),
@ -230,7 +231,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
fontWeight: FontWeight.w300,
),
AppText(
"${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}",
"${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate!)).inDays + 1}",
fontSize: 15,
fontWeight: FontWeight.w700),
],

@ -1,8 +1,8 @@
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/project_view_model.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/utils/date-utils.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/shared/app_scaffold_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:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
@ -18,7 +17,7 @@ import 'package:url_launcher/url_launcher.dart';
class ECGPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patient-type'];
String arrivalType = routeArgs['arrival-type'];
@ -57,7 +56,7 @@ class ECGPage extends StatelessWidget {
model.patientMuseResultsModelList.length,
(index) => InkWell(
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 launchUrl(ecgImageURL);
}).catchError((err) {
@ -92,7 +91,7 @@ class ECGPage extends StatelessWidget {
SizedBox(height: 3),
RichText(
text: TextSpan(
style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black),
style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier!, color: Colors.black),
children: <TextSpan>[
new TextSpan(text: TranslationBase.of(context).orderNo, style: TextStyle(fontSize: 12, fontFamily: 'Poppins')),
new TextSpan(
@ -109,15 +108,15 @@ class ECGPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime, isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime!, isArabic: projectViewModel.isArabic)}',
color: Colors.black,
fontWeight: FontWeight.w600,
fontSize: 14,
),
AppText(
'${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',
'${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime!)}',
fontWeight: FontWeight.w600,
color: Colors.grey[700],
color: Colors.grey[700]!,
fontSize: 14,
),
],

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

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

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

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

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

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

@ -9,22 +9,20 @@ class LineChartCurvedLabHistory extends StatefulWidget {
final String title;
final List<LabResultHistory> labResultHistory;
LineChartCurvedLabHistory({this.title, this.labResultHistory});
LineChartCurvedLabHistory({required this.title, required this.labResultHistory});
@override
State<StatefulWidget> createState() => LineChartCurvedLabHistoryState();
}
class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
bool isShowingMainData;
List<int> xAxixs = List();
List<int> xAxixs = [];
int indexes = 0;
@override
void initState() {
super.initState();
getXaxix();
isShowingMainData = true;
}
getXaxix() {
@ -56,7 +54,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
),
AppText(
widget.title,
fontSize: SizeConfig.textMultiplier * 2.1,
fontSize: SizeConfig.textMultiplier! * 2.1,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
textAlign: TextAlign.center,
@ -69,7 +67,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
padding: const EdgeInsets.only(right: 16.0, left: 8.0),
child: LineChart(
sampleData1(),
swapAnimationDuration: const Duration(milliseconds: 250),
duration: const Duration(milliseconds: 250),
),
),
),
@ -90,53 +88,73 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
// touchCallback: (LineTouchResponse touchResponse) {},
touchCallback: (event, touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
getTextStyles: (context, value) {
return TextStyle(
color: Colors.black,
fontSize: 10,
);
},
margin: 28,
rotateAngle: -65,
getTitles: (value) {
print(value);
DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime);
reservedSize: 28,
// rotateAngle: -65,
getTitlesWidget: (value, meta) {
DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime!);
if (widget.labResultHistory.length < 8) {
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
return '';
return Text("");
} else {
if (value.toInt() == 0) return '${date.day}/ ${date.year}';
if (value.toInt() == widget.labResultHistory.length - 1) return '${date.day}/ ${date.year}';
if (value.toInt() == 0)
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())) {
return '${date.day}/ ${date.year}';
return Text(
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
}
}
return '';
return Text("");
},
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (context, value) {
return TextStyle(
color: Colors.black,
fontSize: 10,
);
},
getTitles: (value) {
return '${value.toInt()}';
},
margin: 8,
//reservedSize: 30,
)),
leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
getTitlesWidget: (value, meta) {
return Text('${value.toInt()}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
));
},
reservedSize: 8,
//reservedSize: 30,
),
),
),
borderData: FlBorderData(
@ -169,7 +187,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
double max = 0;
widget.labResultHistory.forEach((element) {
try {
double resultValueDouble = double.parse(element.resultValue);
double resultValueDouble = double.parse(element.resultValue!);
if (resultValueDouble > max) max = resultValueDouble;
} catch (e) {
print(e);
@ -182,10 +200,10 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
double getMinY() {
double min = 0;
try {
min = double.parse(widget.labResultHistory[0].resultValue);
min = double.parse(widget.labResultHistory[0].resultValue!);
widget.labResultHistory.forEach((element) {
double resultValueDouble = double.parse(element.resultValue);
double resultValueDouble = double.parse(element.resultValue!);
if (resultValueDouble < min) min = resultValueDouble;
});
} catch (e) {
@ -197,10 +215,10 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
}
List<LineChartBarData> getData() {
List<FlSpot> spots = List();
List<FlSpot> spots = [];
for (int index = 0; index < widget.labResultHistory.length; index++) {
try {
var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue);
var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue!);
spots.add(FlSpot(index.toDouble(), resultValueDouble));
} catch (e) {
print(e);
@ -211,7 +229,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots,
isCurved: true,
colors: [Colors.red],
color: Colors.red,
barWidth: 3,
isStrokeCapRound: true,
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/viewModel/labs_view_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/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -16,13 +16,7 @@ class LaboratoryResultPage extends StatefulWidget {
final String arrivalType;
final bool isInpatient;
LaboratoryResultPage(
{Key? key,
required this.patientLabOrders,
required this.patient,
required this.patientType,
required this.arrivalType,
required this.isInpatient});
LaboratoryResultPage({Key? key, required this.patientLabOrders, required this.patient, required this.patientType, required this.arrivalType, required this.isInpatient});
@override
_LaboratoryResultPageState createState() => _LaboratoryResultPageState();
@ -32,10 +26,7 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
@override
Widget build(BuildContext context) {
return BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabResult(
patientLabOrder: widget.patientLabOrders,
patient: widget.patient,
isInpatient: true),
onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: true),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBar: PatientProfileAppBar(
@ -49,17 +40,14 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
isShowAppBar: false,
body: SingleChildScrollView(
child: LaboratoryResultWidget(
onTap: () async {},
billNo: widget.patientLabOrders.invoiceNo!,
details: model.patientLabSpecialResult.length > 0
? model.patientLabSpecialResult[0].resultDataHTML!
: "",
orderNo: widget.patientLabOrders.orderNo!,
patientLabOrder: widget.patientLabOrders,
patient: widget.patient,
isInpatient: widget.patientType == "1",
invoiceType:widget.patientLabOrders.invoiceType
),
onTap: () async {},
billNo: widget.patientLabOrders.invoiceNo!,
details: model.patientLabSpecialResult.length > 0 ? model.patientLabSpecialResult[0].resultDataHTML! : "",
orderNo: widget.patientLabOrders.orderNo!,
patientLabOrder: widget.patientLabOrders,
patient: widget.patient,
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/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/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/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/utils.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/network_base_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:provider/provider.dart';
class LaboratoryResultWidget extends StatefulWidget {
final GestureTapCallback onTap;
final String billNo;
final String details;
final String orderNo;
final PatientLabOrders patientLabOrder;
final PatiantInformtion patient;
final bool isInpatient;
final String invoiceType;
const LaboratoryResultWidget(
{Key key,
this.onTap,
this.billNo,
this.details,
this.orderNo,
this.patientLabOrder,
this.patient,
this.isInpatient,
this.invoiceType
})
: super(key: key);
final GestureTapCallback? onTap;
final String? billNo;
final String? details;
final String? orderNo;
final PatientLabOrders? patientLabOrder;
final PatiantInformtion? patient;
final bool? isInpatient;
final String? invoiceType;
const LaboratoryResultWidget({Key? key, this.onTap, this.billNo, this.details, this.orderNo, this.patientLabOrder, this.patient, this.isInpatient, this.invoiceType}) : super(key: key);
@override
_LaboratoryResultWidgetState createState() => _LaboratoryResultWidgetState();
@ -44,7 +33,7 @@ class LaboratoryResultWidget extends StatefulWidget {
class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
bool _isShowMoreGeneral = true;
bool _isShowMore = true;
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -93,22 +82,17 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
children: <Widget>[
Expanded(
child: Container(
margin: EdgeInsets.only(
left: 0, right: 0),
margin: EdgeInsets.only(left: 0, right: 0),
child: AppText(
TranslationBase.of(context)
.generalResult,
fontSize:
SizeConfig.textMultiplier * 2.3,
TranslationBase.of(context).generalResult,
fontSize: SizeConfig.textMultiplier! * 2.3,
bold: false,
))),
Container(
width: 25,
height: 25,
child: Icon(
_isShowMoreGeneral
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
_isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
color: Colors.grey[800],
size: 22,
),
@ -142,16 +126,11 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
shrinkWrap: true,
itemBuilder: (context, index) {
return LabResultWidget(
patientLabOrder:
widget.patientLabOrder,
filterName: model
.labResultLists[index]
.filterName,
patientLabResultList: model
.labResultLists[index]
.patientLabResultList,
patient: widget.patient,
isInpatient: widget.isInpatient,
patientLabOrder: widget.patientLabOrder!,
filterName: model.labResultLists[index].filterName,
patientLabResultList: model.labResultLists[index].patientLabResultList,
patient: widget.patient!,
isInpatient: widget.isInpatient!,
);
}),
],
@ -170,7 +149,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
SizedBox(
height: 15,
),
if (widget.details != null && widget.details.isNotEmpty)
if (widget.details != null && widget.details!.isNotEmpty)
Column(
children: [
InkWell(
@ -192,22 +171,17 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
children: <Widget>[
Expanded(
child: Container(
margin:
EdgeInsets.only(left: 0, right: 0),
margin: EdgeInsets.only(left: 0, right: 0),
child: AppText(
TranslationBase.of(context)
.specialResult,
fontSize:
SizeConfig.textMultiplier * 2.3,
TranslationBase.of(context).specialResult,
fontSize: SizeConfig.textMultiplier! * 2.3,
bold: false,
))),
Container(
width: 25,
height: 25,
child: Icon(
_isShowMore
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
_isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
color: Colors.grey[800],
size: 22,
),
@ -230,16 +204,12 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
duration: Duration(milliseconds: 7000),
child: Container(
width: double.infinity,
child: !Utils.isTextHtml(widget.details)
child: !Utils.isTextHtml(widget.details!)
? AppText(
widget.details ??
TranslationBase.of(context)
.noDataAvailable,
widget.details ?? TranslationBase.of(context).noDataAvailable,
)
: Html(
data: widget.details ??
TranslationBase.of(context)
.noDataAvailable,
data: widget.details ?? TranslationBase.of(context).noDataAvailable,
),
),
),

@ -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/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/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/viewModel/authentication_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/icons_app/doctor_app_icons.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/patients/profile/notes/note/update_note.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/card_with_bg_widget.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:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -32,21 +31,21 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class ProgressNoteScreen extends StatefulWidget {
final int visitType;
const ProgressNoteScreen({Key key, this.visitType}) : super(key: key);
const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key);
@override
_ProgressNoteState createState() => _ProgressNoteState();
}
class _ProgressNoteState extends State<ProgressNoteScreen> {
List<NoteModel> notesList;
List<NoteModel> notesList = [];
var filteredNotesList;
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
late AuthenticationViewModel authenticationViewModel;
late ProjectViewModel projectViewModel;
getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
@ -55,7 +54,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo: int.parse(patient.admissionNo),
admissionNo: int.parse(patient.admissionNo!),
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType,
@ -69,7 +68,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType'];
if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
@ -118,7 +117,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
widthFactor: 0.95,
child: CardWithBgWidget(
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)
: model.patientProgressNoteList[index].status == 4
? Colors.red.shade700
@ -130,7 +129,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
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(
TranslationBase.of(context).notePending,
fontWeight: FontWeight.bold,
@ -153,7 +152,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
),
if (model.patientProgressNoteList[index].status != 2 &&
model.patientProgressNoteList[index].status != 4 &&
authenticationViewModel.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy)
authenticationViewModel.doctorProfile!.doctorID == model.patientProgressNoteList[index].createdBy)
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -209,7 +208,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
confirmFun: () async {
GifLoaderDialogUtils.showMyDialog(context);
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(patient.admissionNo),
admissionNo: int.parse(patient.admissionNo!),
cancelledNote: false,
lineItemNo: model.patientProgressNoteList[index].lineItemNo,
conditionId: model.patientProgressNoteList[index].condition,
@ -264,7 +263,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
context,
);
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(patient.admissionNo),
admissionNo: int.parse(patient.admissionNo!),
conditionId: model.patientProgressNoteList[index].condition,
cancelledNote: true,
lineItemNo: model.patientProgressNoteList[index].lineItemNo,
@ -364,7 +363,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
children: [
AppText(
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)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic),
fontWeight: FontWeight.w600,
@ -373,7 +372,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
),
AppText(
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()),
fontWeight: FontWeight.w600,
fontSize: 14,
@ -390,7 +389,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Row(mainAxisAlignment: MainAxisAlignment.start, children: [
Expanded(
child: AppText(
model.patientProgressNoteList[index].notes,
model.patientProgressNoteList[index].notes!,
fontSize: 10,
isCopyable: true,
),
@ -416,7 +415,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
}
/// 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(
context: context,
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/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/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/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -27,28 +26,20 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../../../widgets/shared/dialogs/dailog-list-select.dart';
import '../../../../base/base_view.dart';
class UpdateNoteOrder extends StatefulWidget {
final NoteModel note;
final NoteModel? note;
final PatientViewModel patientModel;
final PatiantInformtion patient;
final int visitType;
final int? visitType;
final bool isUpdate;
final List<dynamic> elementList;
final Function(dynamic) okFunction;
final List<dynamic>? elementList;
final Function(dynamic)? okFunction;
const UpdateNoteOrder(
{Key key,
this.note,
this.patientModel,
this.patient,
this.visitType,
this.isUpdate,
this.elementList,
this.okFunction})
: super(key: key);
const UpdateNoteOrder({Key? key, this.note, required this.patientModel, required this.patient, this.visitType, required this.isUpdate, this.elementList, this.okFunction}) : super(key: key);
@override
_UpdateNoteOrderState createState() => _UpdateNoteOrderState();
@ -56,12 +47,12 @@ class UpdateNoteOrder extends StatefulWidget {
class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
dynamic selectValue;
int selectedType;
int selectedType = 0;
bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord;
var event = RobotProvider();
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
TextEditingController progressNoteController = TextEditingController();
@ -91,12 +82,10 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
projectViewModel = Provider.of(context);
if (widget.note != null) {
progressNoteController.text = widget.note.notes;
if(selectValue==null)
selectValue={};
selectValue[keyId] = widget.note.condition;
selectValue['Description'] = widget.note.conditionDescription;
progressNoteController.text = widget.note!.notes!;
if (selectValue == null) selectValue = {};
selectValue[keyId] = widget.note!.condition;
selectValue['Description'] = widget.note!.conditionDescription;
}
return BaseView<PatientViewModel>(
@ -116,14 +105,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [
BottomSheetTitle(
title: widget.visitType == 3
? (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).progressNote,
? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet
: (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote,
),
SizedBox(
height: 10.0,
@ -137,11 +120,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
ListSelectDialog dialog = ListSelectDialog(
list: model.stpMasterList,
attributeName: 'Description',
attributeValueId:
model.stpMasterList.length == 1
? model.stpMasterList[0]['${keyId}']
.toString()
: '${keyId}',
attributeValueId: model.stpMasterList.length == 1 ? model.stpMasterList[0]['${keyId}'].toString() : '${keyId}',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) => {
setState(() {
@ -160,14 +139,14 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
}
: null,
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).selectCondition,//'Select Condition',
hintText: TranslationBase.of(context).selectCondition, //'Select Condition',
dropDownText: model.stpMasterList.length == 1
? model.stpMasterList[0]['Description']
: selectValue == null
? null
: selectValue['Description'],
enabled: false,
isTextFieldHasSuffix: true,
isTextFieldHasSuffix: true, onChanged: (String value) {}, onFieldSubmitted: () {},
),
),
),
@ -183,19 +162,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [
AppTextFieldCustom(
hintText: widget.visitType == 3
? (widget.isUpdate
? TranslationBase.of(context)
.noteUpdate
: TranslationBase.of(context)
.noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context)
.noteUpdate
: TranslationBase.of(context)
.noteAdd) +
TranslationBase.of(context)
.progressNote,
? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet
: (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote,
//TranslationBase.of(context).addProgressNote,
controller: progressNoteController,
maxLines: 40,
@ -203,26 +171,19 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: progressNoteController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
: null,
validationError: progressNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, onChanged: (String value) {},
onFieldSubmitted: () {},
),
Positioned(
top: -2,
//MediaQuery.of(context).size.height * 0,
right: projectViewModel.isArabic
? MediaQuery.of(context).size.width * 0.75
: 15,
right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15,
child: Column(
children: [
IconButton(
icon: Icon(DoctorApp.speechtotext,
color: Colors.black, size: 35),
icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35),
onPressed: () {
initSpeechState()
.then((value) => {onVoiceText()});
initSpeechState().then((value) => {onVoiceText()});
},
),
],
@ -240,7 +201,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
),
bottomSheet: Container(
height: progressNoteController.text.isNotEmpty ? 130 : 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5),
child: Column(
children: <Widget>[
if (progressNoteController.text.isNotEmpty)
@ -259,14 +220,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
margin: EdgeInsets.all(5),
child: AppButton(
title: widget.visitType == 3
? (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).progressNote,
? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet
: (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote,
color: AppGlobal.appGreenColor,
// disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700,
@ -276,29 +231,25 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
});
if (progressNoteController.text.trim().isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
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);
if (widget.isUpdate) {
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo:
int.parse(widget.patient.admissionNo),
admissionNo: int.parse(widget.patient.admissionNo!),
cancelledNote: false,
lineItemNo: widget.note.lineItemNo,
createdBy: widget.note.createdBy,
lineItemNo: widget.note!.lineItemNo,
createdBy: widget.note!.createdBy,
notes: progressNoteController.text,
verifiedNote: false,
patientTypeID: widget.patient.patientType,
patientOutSA: false,
conditionId: selectValue['ParameterCode']);
await widget.patientModel
.updatePatientProgressNote(reqModel);
await widget.patientModel.updatePatientProgressNote(reqModel);
} else {
CreateNoteModel reqModel = CreateNoteModel(
admissionNo:
int.parse(widget.patient.admissionNo),
admissionNo: int.parse(widget.patient.admissionNo!),
createdBy: doctorProfile.doctorID,
visitType: widget.visitType,
patientID: widget.patient.patientId,
@ -308,29 +259,23 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
notes: progressNoteController.text,
conditionId: selectValue['ParameterCode']);
await widget.patientModel
.createPatientProgressNote(reqModel);
await widget.patientModel.createPatientProgressNote(reqModel);
}
if (widget.patientModel.state ==
ViewState.ErrorLocal) {
if (widget.patientModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.patientModel.error);
} else {
ProgressNoteRequest progressNoteRequest =
ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo:
int.parse(widget.patient.admissionNo),
projectID: widget.patient.projectId,
patientTypeID: widget.patient.patientType,
languageID: 2);
await widget.patientModel.getPatientProgressNote(
progressNoteRequest.toJson());
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo: int.parse(widget.patient.admissionNo!),
projectID: widget.patient.projectId,
patientTypeID: widget.patient.patientType,
languageID: 2);
await widget.patientModel.getPatientProgressNote(progressNoteRequest.toJson());
}
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).yourOrderAddedSuccessfully);
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).yourOrderAddedSuccessfully);
Navigator.of(context).pop();
} else {
Utils.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces);
@ -346,8 +291,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
@ -378,14 +322,13 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
void resultListener(result) {
recognizedWord = result.recognizedWords;
event.setValue({"searchText": recognizedWord});
if (result.finalResult ==true) {
if (result.finalResult == true) {
setState(() {
if (mounted) {
// speech.stop();
// speech.stop();
progressNoteController.text += recognizedWord + '\n';
SpeechToText.closeAlertDialog(context);
}
}
});
} else {
print(result.finalResult);
@ -393,8 +336,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}

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

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

@ -11,16 +11,18 @@ import '../../../../routes.dart';
// ignore: must_be_immutable
class ProfileGridForOther extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final double height;
final String? patientType;
final String? arrivalType;
final double? height;
final bool isInpatient;
final bool isFromLiveCare;
String from;
String to;
String? from;
String? to;
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
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',
isInPatient: isInpatient,
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(
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_texts_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:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
import '../../../../locator.dart';
class RadiologyDetailsPage extends StatelessWidget {
final FinalRadiology finalRadiology;
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final String? patientType;
final String? arrivalType;
final bool isInpatient;
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
Widget build(BuildContext context) {
@ -35,16 +34,17 @@ class RadiologyDetailsPage extends StatelessWidget {
patient: patient,
projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo,
invoiceType:finalRadiology.invoiceType,
invoiceType: finalRadiology.invoiceType!,
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(
appBar: PatientProfileAppBar(
patient,
appointmentDate: finalRadiology.orderDate,
appointmentDate: finalRadiology.orderDate!,
doctorName: finalRadiology.doctorName,
clinic: finalRadiology.clinicDescription,
branch: finalRadiology.projectName,
@ -111,13 +111,13 @@ class RadiologyDetailsPage extends StatelessWidget {
eventCategory: "RadiologyDetailsPage",
eventAction: "Open Radiology Image",
);
launch(model.radImageURL);
launchUrlString(model.radImageURL);
},
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/transitions/fade_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:provider/provider.dart';
@ -26,16 +25,16 @@ class RadiologyHomePage extends StatefulWidget {
}
class _RadiologyHomePageState extends State<RadiologyHomePage> {
String patientType;
PatiantInformtion patient;
String arrivalType;
bool isInpatient;
bool isFromLiveCare;
String? patientType;
late PatiantInformtion patient;
String? arrivalType;
bool isInpatient = false;
bool isFromLiveCare = false;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
@ -51,7 +50,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
backgroundColor: Colors.grey[100],
backgroundColor: Colors.grey[100]!,
// appBarTitle: TranslationBase.of(context).radiology,
appBar: PatientProfileAppBar(
patient,
@ -114,9 +113,9 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
height: 160,
decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545)
color: model.radiologyList[index].isLiveCareAppodynamicment
color: model.radiologyList[index].isLiveCareAppodynamicment!
? Colors.red[900]
: !model.radiologyList[index].isInOutPatient
: !model.radiologyList[index].isInOutPatient!
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
@ -129,9 +128,9 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
quarterTurns: 3,
child: Center(
child: Text(
model.radiologyList[index].isLiveCareAppodynamicment
model.radiologyList[index].isLiveCareAppodynamicment!
? TranslationBase.of(context).liveCare.toUpperCase()
: !model.radiologyList[index].isInOutPatient
: !model.radiologyList[index].isInOutPatient!
? TranslationBase.of(context).inPatientLabel.toUpperCase()
: TranslationBase.of(context).outpatient.toUpperCase(),
style: TextStyle(color: Colors.white),

@ -54,7 +54,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
Expanded(
child: AppText(
(Utils.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier * 2.5,
fontSize: SizeConfig.textMultiplier! * 2.5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -121,8 +121,8 @@ class ReferredPatientDetailScreen extends StatelessWidget {
AppText(
TranslationBase.of(context).viewProfile,
fontWeight: FontWeight.w700,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Colors.red[700],
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Colors.red[700]!,
)
],
),
@ -137,21 +137,21 @@ class ReferredPatientDetailScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
referredPatient.referralStatusDesc,
referredPatient.referralStatusDesc!,
fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier,
fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.w700,
color: referredPatient.referralStatus == 1
? AppGlobal.inProgressColor
: referredPatient.referralStatus == 46
? AppGlobal.appGreenColor
: Colors.red[700],
: Colors.red[700]!,
),
AppText(
AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "dd MMM,yyyy"),
AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate!, "dd MMM,yyyy"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier,
fontSize: 2.0 * SizeConfig.textMultiplier!,
color: Color(0XFF28353E),
)
],
@ -166,7 +166,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).fileNumber,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
AppText(
@ -179,10 +179,10 @@ class ReferredPatientDetailScreen extends StatelessWidget {
],
),
AppText(
AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "hh:mm a"),
AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate!, "hh:mm a"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
)
],
@ -201,12 +201,12 @@ class ReferredPatientDetailScreen extends StatelessWidget {
"${TranslationBase.of(context).refClinic}: ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.referralClinicDescription,
referredPatient.referralClinicDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 13,
@ -224,12 +224,12 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).frequency + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.frequencyDescription,
referredPatient.frequencyDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 14,
@ -244,19 +244,19 @@ class ReferredPatientDetailScreen extends StatelessWidget {
Row(
children: [
AppText(
referredPatient.nationalityName != null ? referredPatient.nationalityName : "",
referredPatient.nationalityName != null ? referredPatient.nationalityName! : "",
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
fontSize: 1.4 * SizeConfig.textMultiplier,
fontSize: 1.4 * SizeConfig.textMultiplier!,
),
referredPatient.nationalityFlagURL != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
referredPatient.nationalityFlagURL,
referredPatient.nationalityFlagURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -274,11 +274,11 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).priority + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
AppText(
referredPatient.priorityDescription,
referredPatient.priorityDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 14,
@ -295,15 +295,15 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).maxResponseTime + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime, "dd MMM,yyyy") : '',
referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime!, "dd MMM,yyyy") : '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -327,10 +327,10 @@ class ReferredPatientDetailScreen extends StatelessWidget {
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
referredPatient.doctorImageURL,
referredPatient.doctorImageURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -352,14 +352,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
"${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w800,
fontSize: 1.5 * SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier!,
color: Colors.black,
),
AppText(
referredPatient.referralClinicDescription,
referredPatient.referralClinicDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.3 * SizeConfig.textMultiplier,
fontSize: 1.3 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
@ -399,14 +399,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).remarks,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
fontSize: 2.4 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referringDoctorRemarks,
referredPatient.referringDoctorRemarks!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
SizedBox(
@ -422,10 +422,10 @@ class ReferredPatientDetailScreen extends StatelessWidget {
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
referredPatient.doctorImageURL,
referredPatient.doctorImageURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -444,18 +444,18 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).reply,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referredDoctorRemarks == null
? ''
: referredPatient.referredDoctorRemarks.isNotEmpty
? referredPatient.referredDoctorRemarks
: referredPatient.referredDoctorRemarks!.isNotEmpty
? referredPatient.referredDoctorRemarks!
: TranslationBase.of(context).notRepliedYet,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier,
fontSize: 1.6 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
@ -480,7 +480,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
vPadding: 12,
disabled: referredPatient.referredDoctorRemarks == null
? true
: referredPatient.referredDoctorRemarks.isNotEmpty
: referredPatient.referredDoctorRemarks!.isNotEmpty
? false
: true,
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/size_config.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/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/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/doctor/doctor_profile_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/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/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/shared/app_scaffold_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/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/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:provider/provider.dart';
@ -33,7 +31,7 @@ class AddAssessmentDetails extends StatefulWidget {
final PatiantInformtion patientInfo;
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
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
@ -57,12 +55,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString();
if (widget.isUpdate) {
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null)
conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn;
conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr! : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn!;
if (widget.mySelectedAssessment.selectedDiagnosisType != null)
typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr : widget.mySelectedAssessment.selectedDiagnosisType.nameEn;
if (widget.mySelectedAssessment.selectedICD != null) icdNameController.text = widget.mySelectedAssessment.selectedICD.code;
typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType!.nameAr! : widget.mySelectedAssessment.selectedDiagnosisType!.nameEn!;
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(
fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
@ -119,23 +117,25 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
isTextFieldHasSuffix: false,
enabled: false,
controller: appointmentIdController,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
),
SizedBox(
height: 10,
),
Column(
children:[ InkWell(
Column(children: [
InkWell(
onTap: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = null;
icdNameController.text = 'null';
});
}
: null,
child: AppTextFieldCustom(
onChanged: (text){
onChanged: (text) {
setState(() {
icdNameController.text;
});
@ -143,11 +143,11 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: Utils.getTextFieldHeight(),
onClick: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = null;
});
}
setState(() {
widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = 'null';
});
}
: null,
hintText: TranslationBase.of(context).nameOrICD,
maxLines: 1,
@ -169,77 +169,74 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
Icons.search,
color: Colors.grey.shade600,
)),
onFieldSubmitted: () {},
)),
model.listOfICD10.length >0 && icdNameController.text.isNotEmpty ? Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
child:ListView.builder(
shrinkWrap: true,
itemCount: model.listOfICD10.length,
itemBuilder: (context, index) {
return InkWell(child:ListTile(
title: AppText( model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)),
onTap: (){
widget.mySelectedAssessment.selectedICD = model.listOfICD10[index];
icdNameController.text = model.listOfICD10[index].description;
model.listOfICD10.clear();
setState(() {
model.listOfICD10.length > 0 && icdNameController.text.isNotEmpty
? Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
child: ListView.builder(
shrinkWrap: true,
itemCount: model.listOfICD10.length,
itemBuilder: (context, index) {
return InkWell(
child: ListTile(title: AppText(model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)),
onTap: () {
widget.mySelectedAssessment.selectedICD = model.listOfICD10[index];
icdNameController.text = model.listOfICD10[index].description;
model.listOfICD10.clear();
setState(() {});
});
}
);
},
)) :SizedBox()
// CustomAutoCompleteTextField(
// isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisSize: MainAxisSize.min,
// children: [
// AutoCompleteTextField<MasterKeyModel>(
// decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null),
// controller: icdNameController,
// itemSubmitted: (item) => setState(() {
// widget.mySelectedAssessment.selectedICD = item;
// // icdNameController.text = '${item.code.trim()}/${item.description}';
// icdNameController.text = '${item.description}';
// }),
// key: key,
// suggestions: model.listOfICD10,
// suggestionsAmount: model.listOfICD10.length,
// itemBuilder: (context, suggestion) =>
// new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)),
// itemSorter: (a, b) => 1,
// itemFilter: (suggestion, input) =>
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.code.toLowerCase().startsWith(input.toLowerCase()),
// suggestion.description.toLowerCase().contains(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// suggestion.code.toLowerCase().contains(input.toLowerCase()),
//
// ),
// Expanded(
// child: IconButton(
// onPressed: () {
// print(icdNameController.text);
// if (icdNameController.text.length <= 3) {
// DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
// } else {
// model.listOfICD10.clear();
// model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
// }
// },
// icon: Icon(Icons.search),
// ),
// ),
// ],
// ),
// )
},
))
: SizedBox()
// CustomAutoCompleteTextField(
// isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisSize: MainAxisSize.min,
// children: [
// AutoCompleteTextField<MasterKeyModel>(
// decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null),
// controller: icdNameController,
// itemSubmitted: (item) => setState(() {
// widget.mySelectedAssessment.selectedICD = item;
// // icdNameController.text = '${item.code.trim()}/${item.description}';
// icdNameController.text = '${item.description}';
// }),
// key: key,
// suggestions: model.listOfICD10,
// suggestionsAmount: model.listOfICD10.length,
// itemBuilder: (context, suggestion) =>
// new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)),
// itemSorter: (a, b) => 1,
// itemFilter: (suggestion, input) =>
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.code.toLowerCase().startsWith(input.toLowerCase()),
// suggestion.description.toLowerCase().contains(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// suggestion.code.toLowerCase().contains(input.toLowerCase()),
//
// ),
// Expanded(
// child: IconButton(
// onPressed: () {
// print(icdNameController.text);
// if (icdNameController.text.length <= 3) {
// DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
// } else {
// model.listOfICD10.clear();
// model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
// }
// },
// icon: Icon(Icons.search),
// ),
// ),
// ],
// ),
// )
]),
if (widget.mySelectedAssessment.selectedICD != null)
Column(
@ -250,7 +247,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
Container(
width: MediaQuery.of(context).size.width * 0.7,
child: AppText(
widget.mySelectedAssessment.selectedICD.description + (' (${widget.mySelectedAssessment.selectedICD.code} )'),
widget.mySelectedAssessment.selectedICD!.description + (' (${widget.mySelectedAssessment.selectedICD!.code} )'),
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
@ -269,12 +266,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition!,
okFunction: (MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue;
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,
hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 10,
@ -306,11 +305,11 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisType,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisType!,
okFunction: (MasterKeyModel selectedValue) {
setState(() {
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,
hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 10,
@ -346,10 +347,11 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onChanged: (value) {
widget.mySelectedAssessment.remark = remarkController.text;
},
onFieldSubmitted: () {},
),
),
SizedBox(
height: SizeConfig.heightMultiplier *
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
? 20
: 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);
if (isUpdate) {
PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel(
@ -395,14 +397,14 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
appointmentNo: widget.patientInfo.appointmentNo,
remarks: mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: mySelectedAssessment.selectedICD.code,
conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code,
prevIcdCode10ID: mySelectedAssessment.icdCode10ID);
await model.patchAssessment(patchAssessmentReqModel);
} else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel(
patientMRN: widget.patientInfo.patientMRN,
@ -414,9 +416,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
new IcdCodeDetails(
remarks: mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: mySelectedAssessment.selectedICD.code)
conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code)
]);
await model.postAssessment(postAssessmentRequestModel);
}
@ -424,10 +426,10 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code;
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code;
mySelectedAssessment.doctorName = doctorProfile.doctorName;
widget.addSelectedAssessment(mySelectedAssessment, isUpdate);
Navigator.of(context).pop();

@ -1,17 +1,17 @@
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/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/selected_items/my_selected_assement.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/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/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/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
@ -30,7 +30,7 @@ class UpdateAssessmentPage extends StatefulWidget {
final Function changeLoadingState;
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
_UpdateAssessmentPageState createState() => _UpdateAssessmentPageState();
@ -38,7 +38,7 @@ class UpdateAssessmentPage extends StatefulWidget {
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements AssessmentCallBack {
bool isAssessmentExpand = false;
List<MySelectedAssessment> mySelectedAssessmentList = List();
List<MySelectedAssessment> mySelectedAssessmentList = [];
@override
Widget build(BuildContext context) {
@ -53,17 +53,17 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
if (model.patientAssessmentList.isNotEmpty) {
model.patientAssessmentList.forEach((element) {
MasterKeyModel diagnosisType = model.getOneMasterKey(
MasterKeyModel? diagnosisType = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisType,
id: element.diagnosisTypeID,
);
MasterKeyModel selectedICD = model.getOneMasterKey(
MasterKeyModel? selectedICD = model.getOneMasterKey(
masterKeys: MasterKeysService.ICD10,
id: element.icdCode10ID,
);
MasterKeyModel diagnosisCondition = model.getOneMasterKey(
MasterKeyModel? diagnosisCondition = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisCondition,
id: element.conditionID,
id: element.conditionID!,
);
if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) {
MySelectedAssessment temMySelectedAssessment = SoapUtils.generateMySelectedAssessment(
@ -145,7 +145,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
new TextSpan(
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: [
AppText(
assessment.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(assessment.createdOn), isMonthShort: true)
? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(assessment.createdOn!), isMonthShort: true)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
),
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,
color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
@ -191,7 +191,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
),
children: <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(),
),
],
@ -239,7 +239,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
),
),
new TextSpan(
text: projectViewModel.isArabic ? assessment.selectedDiagnosisCondition.nameAr : assessment.selectedDiagnosisCondition.nameEn,
text: projectViewModel.isArabic ? assessment.selectedDiagnosisCondition!.nameAr : assessment.selectedDiagnosisCondition!.nameEn,
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
letterSpacing: -0.48,
@ -262,7 +262,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
),
),
new TextSpan(
text: projectViewModel.isArabic ? assessment.selectedDiagnosisType.nameAr : assessment.selectedDiagnosisType.nameEn,
text: projectViewModel.isArabic ? assessment.selectedDiagnosisType!.nameAr : assessment.selectedDiagnosisType!.nameEn,
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
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) {
assessment = SoapUtils.generateMySelectedAssessment(remark: '', appointmentNo: widget.patientInfo.appointmentNo);
}
@ -368,7 +368,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
context: context,
builder: (context) {
return AddAssessmentDetails(
mySelectedAssessment: assessment,
mySelectedAssessment: assessment!,
patientInfo: widget.patientInfo,
isUpdate: isUpdate,
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/core/enum/master_lookup_key.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/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/doctor/doctor_profile_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/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/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
@ -31,7 +31,7 @@ class UpdateObjectivePage extends StatefulWidget {
final int currentIndex;
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
_UpdateObjectivePageState createState() => _UpdateObjectivePageState();
@ -39,7 +39,7 @@ class UpdateObjectivePage extends StatefulWidget {
class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements ObjectiveCallBack {
bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = List();
List<MySelectedExamination> mySelectedExamination = [];
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) {
return BoxDecoration(
@ -66,7 +66,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
await model.getMasterLookup(MasterKeysService.PhysicalExamination);
}
model.patientPhysicalExamList.forEach((element) {
MasterKeyModel examMaster = model.getOneMasterKey(
MasterKeyModel? examMaster = model.getOneMasterKey(
masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId,
);
@ -135,7 +135,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
.sublist(0, model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(examination.selectedExamination);
removeExamination(examination.selectedExamination!);
});
}).toList(),
),
@ -155,7 +155,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
.sublist(model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(examination.selectedExamination);
removeExamination(examination.selectedExamination!);
});
}).toList(),
)
@ -164,7 +164,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
isExpanded: isSysExaminationExpand,
),
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 {
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();
} else {
widget.changeLoadingState(true);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
@ -196,8 +196,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
examId: exam.selectedExamination!.id,
examType: exam.selectedExamination!.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
notExamined: exam.notExamined,
@ -213,12 +213,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
: "Not Examined",
isNew: exam.isNew,
);
if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo.admissionNo);
if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo!.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo.admissionNo!);
} else {
listHisProgNotePhysicalExaminationVM.admissionNo = 0;
}
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(listHisProgNotePhysicalExaminationVM);
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!.add(listHisProgNotePhysicalExaminationVM);
});
if (model.patientPhysicalExamList.isEmpty) {
@ -230,12 +230,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
if (model.state == ViewState.ErrorLocal) {
widget.changeLoadingState(false);
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();
model.isAddExamInProgress = false;
}
} else {
if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) {
if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop();
widget.changeLoadingState(false);
model.isAddExamInProgress = false;
@ -251,7 +251,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
}
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) {
setState(() {
@ -276,7 +276,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
setState(() {
{
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);
}
});
@ -284,13 +284,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
/// remove items.
List<MySelectedExamination> removedList = [];
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.forEach((element) {
removeExamination(element.selectedExamination);
removeExamination(element.selectedExamination!);
});
Navigator.of(context).pop();
}

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

@ -9,7 +9,7 @@ class SoapUtils {
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(selectedAllergy: allergy, selectedAllergySeverity: allergySeverity, isChecked: isChecked, remark: remark, isLocal: isLocal, createdBy: createdBy, isExpanded: isExpanded);
return mySelectedAllergy;

@ -1,15 +1,12 @@
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/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/utils/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/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
import '../../shared_soap_widgets/bottom_sheet_title.dart';
@ -77,7 +74,7 @@ class _AddAllergiesState extends State<AddAllergies> {
},
addSelectedAllergy: () {
setState(() {
widget.addAllergiesFun(myAllergiesListLocal);
widget.addAllergiesFun!(myAllergiesListLocal);
});
},
isServiceSelected: (master) => isServiceSelected(master),
@ -105,7 +102,7 @@ class _AddAllergiesState extends State<AddAllergies> {
label: TranslationBase.of(context).addAllergies,
onTap: () {
setState(() {
widget.addAllergiesFun(myAllergiesListLocal);
widget.addAllergiesFun!(myAllergiesListLocal);
});
},
),
@ -114,7 +111,7 @@ class _AddAllergiesState extends State<AddAllergies> {
isServiceSelected(MasterKeyModel masterKey) {
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) {
return true;
}
@ -122,16 +119,16 @@ class _AddAllergiesState extends State<AddAllergies> {
}
removeAllergyFromLocalList(MasterKeyModel masterKey) {
myAllergiesListLocal.removeWhere((element) => element.selectedAllergy.id == masterKey.id);
myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id);
}
MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) {
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) {
return allergy.first;
}
return null;
return MySelectedAllergy();
}
addAllergyLocally(MySelectedAllergy mySelectedAllergy) {
@ -141,7 +138,7 @@ class _AddAllergiesState extends State<AddAllergies> {
setState(() {
List<MySelectedAllergy> allergy =
// 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) {
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/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/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/utils.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'allergies_item.dart';
@ -21,20 +20,20 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
final List<MasterKeyModel> masterList;
final String buttonName;
final String hintSearchText;
final String? buttonName;
final String? hintSearchText;
MasterKeyCheckboxSearchAllergiesWidget(
{Key key,
this.model,
this.addSelectedAllergy,
this.removeAllergy,
this.masterList,
this.addAllergy,
this.isServiceSelected,
{Key? key,
required this.model,
required this.addSelectedAllergy,
required this.removeAllergy,
required this.masterList,
required this.addAllergy,
required this.isServiceSelected,
this.buttonName,
this.hintSearchText,
this.getServiceSelectedAllergy})
required this.getServiceSelectedAllergy})
: super(key: key);
@override
@ -42,7 +41,8 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
}
class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckboxSearchAllergiesWidget> {
List<MasterKeyModel> items = List();
List<MasterKeyModel> items = [];
TextEditingController filteredSearchController = TextEditingController();
@override
@ -72,10 +72,14 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckb
onChanged: (value) {
// filterSearchResults(value);
},
onFieldSubmitted: (value) {
onFieldSubmitted: () {
widget.model.getMasterLookup(MasterKeysService.Allergies, searchKey: filteredSearchController.text);
widget.model.getMasterLookup(MasterKeysService.AllergySeverity, searchKey: "");
},
// onFieldSubmitted: (value) {
// widget.model.getMasterLookup(MasterKeysService.Allergies!, searchKey: filteredSearchController.text!);
// widget.model.getMasterLookup(MasterKeysService.AllergySeverity, searchKey: "");
// },
suffixIcon: IconButton(
icon: Icon(
Icons.search,
@ -131,12 +135,12 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckb
}
void filterSearchResults(String query) {
List<MasterKeyModel> dummySearchList = List();
List<MasterKeyModel> dummySearchList = [];
dummySearchList.addAll(widget.masterList);
if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = List();
List<MasterKeyModel> dummyListData = [];
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);
}
});

@ -2,13 +2,13 @@
import 'package:autocomplete_textfield/autocomplete_textfield.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/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/viewModel/SOAP_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/utils/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/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -26,25 +26,25 @@ class AddMedication extends StatefulWidget {
final Function addMedicationFun;
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
_AddMedicationState createState() => _AddMedicationState();
}
class _AddMedicationState extends State<AddMedication> {
MasterKeyModel _selectedMedicationDose;
MasterKeyModel _selectedMedicationStrength;
MasterKeyModel _selectedMedicationRoute;
MasterKeyModel _selectedMedicationFrequency;
MasterKeyModel _selectedMedicationDose = MasterKeyModel();
MasterKeyModel _selectedMedicationStrength = MasterKeyModel();
MasterKeyModel _selectedMedicationRoute = MasterKeyModel();
MasterKeyModel _selectedMedicationFrequency = MasterKeyModel();
TextEditingController doseController = TextEditingController();
TextEditingController strengthController = TextEditingController();
TextEditingController routeController = 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;
@override
@ -74,7 +74,7 @@ class _AddMedicationState extends State<AddMedication> {
child: Column(
children: [
SizedBox(
height: SizeConfig.heightMultiplier *
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
? 2
: SizeConfig.isHeightShort
@ -87,7 +87,7 @@ class _AddMedicationState extends State<AddMedication> {
onTap: model.allMedicationList != null
? () {
setState(() {
_selectedMedication = null;
_selectedMedication = GetMedicationResponseModel();
});
}
: null,
@ -95,32 +95,36 @@ class _AddMedicationState extends State<AddMedication> {
? CustomAutoCompleteTextField(
isShowError: isFormSubmitted && _selectedMedication == null,
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),
key: key,
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,
itemFilter: (suggestion, input) =>
suggestion.genericName.toLowerCase().startsWith(input.toLowerCase()) ||
suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
suggestion.keywords.toLowerCase().startsWith(input.toLowerCase()),
suggestion.genericName!.toLowerCase().startsWith(input.toLowerCase()) ||
suggestion.description!.toLowerCase().startsWith(input.toLowerCase()) ||
suggestion.keywords!.toLowerCase().startsWith(input.toLowerCase()),
),
)
: AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
hintText: _selectedMedication != null
? _selectedMedication.description + (' (${_selectedMedication.genericName} )')
? _selectedMedication.description! + (' (${_selectedMedication.genericName} )')
: TranslationBase.of(context).searchMedicineNameHere,
minLines: 1,
maxLines: 1,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
)),
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
),
onPressed: () {},
),
enabled: false,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
),
),
@ -133,7 +137,7 @@ class _AddMedicationState extends State<AddMedication> {
Container(
width: MediaQuery.of(context).size.width * 0.7,
child: AppText(
_selectedMedication.description + (' (${_selectedMedication.genericName} )'),
_selectedMedication.description! + (' (${_selectedMedication.genericName} )'),
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
@ -158,7 +162,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() {
_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,
controller: doseController,
validationError: isFormSubmitted && _selectedMedicationDose == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 5,
@ -195,7 +201,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() {
_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,
controller: strengthController,
validationError: isFormSubmitted && _selectedMedicationStrength == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 5,
@ -234,7 +242,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() {
_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,
controller: routeController,
validationError: isFormSubmitted && _selectedMedicationRoute == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 5,
@ -271,7 +281,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() {
_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,
controller: frequencyController,
validationError: isFormSubmitted && _selectedMedicationFrequency == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: SizeConfig.heightMultiplier *
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
? 20
: SizeConfig.isHeightShort

@ -44,7 +44,7 @@ class _UpdateMedicationWidgetState extends State<UpdateMedicationWidget> {
builder: (context) {
return AddMedication(
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/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/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/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/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/utils/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:flutter/material.dart';
@ -25,7 +25,7 @@ class UpdateSubjectivePage extends StatefulWidget {
final PatiantInformtion patientInfo;
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
_UpdateSubjectivePageState createState() => _UpdateSubjectivePageState();
@ -40,15 +40,15 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
TextEditingController medicationController = TextEditingController();
final formKey = GlobalKey<FormState>();
List<MySelectedAllergy> myAllergiesList = List();
List<MySelectedHistory> myHistoryList = List();
List<MySelectedAllergy> myAllergiesList = [];
List<MySelectedHistory> myHistoryList = [];
getHistory(SOAPViewModel model) async {
widget.changeLoadingState(true);
if (model.patientHistoryList.isNotEmpty) {
model.patientHistoryList.forEach((element) {
if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
MasterKeyModel? history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryFamily,
id: element.historyId,
);
@ -58,7 +58,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
}
}
if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
MasterKeyModel? history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryMedical,
id: element.historyId,
);
@ -68,7 +68,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
}
}
if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
MasterKeyModel? history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySports,
id: element.historyId,
);
@ -78,7 +78,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
}
}
if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
MasterKeyModel? history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySurgical,
id: element.historyId,
);
@ -94,7 +94,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
getAllergies(SOAPViewModel model) async {
if (model.patientAllergiesList.isNotEmpty) {
model.patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = model.getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
MasterKeyModel? selectedAllergy = model.getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergySeverity;
if (element.severity == 0) {
selectedAllergySeverity = MasterKeyModel(id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: '');
@ -102,11 +102,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
selectedAllergySeverity = model.getOneMasterKey(
masterKeys: MasterKeysService.AllergySeverity,
id: element.severity,
);
)!;
}
MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy(
allergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy, remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity);
allergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy!, remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
});
@ -124,11 +124,13 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
if (model.patientChiefComplaintList.isNotEmpty) {
isChiefExpand = true;
complaintsController.text = Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint);
illnessController.text = model.patientChiefComplaintList[0].hopi;
medicationController.text = model.patientChiefComplaintList[0].currentMedication != null ? !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty
? model.patientChiefComplaintList[0].currentMedication + '\n \n'
: model.patientChiefComplaintList[0].currentMedication : "";
complaintsController.text = Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint!);
illnessController.text = model.patientChiefComplaintList[0].hopi!;
medicationController.text = model.patientChiefComplaintList[0].currentMedication != null
? !(model.patientChiefComplaintList[0].currentMedication!).isNotEmpty
? model.patientChiefComplaintList[0].currentMedication! + '\n \n'
: model.patientChiefComplaintList[0].currentMedication!
: "";
}
if (widget.patientInfo.admissionNo == null) {
await getHistory(model);
@ -174,7 +176,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
isExpanded: isChiefExpand,
),
SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2),
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 4 : 2),
),
if (widget.patientInfo.admissionNo == null)
ExpandableSOAPWidget(
@ -191,7 +193,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
isExpanded: isHistoryExpand,
),
SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2),
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 4 : 2),
),
if (widget.patientInfo.admissionNo == null)
ExpandableSOAPWidget(
@ -215,7 +217,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
isExpanded: isAllergiesExpand,
),
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();
widget.changeLoadingState(true);
formKey.currentState.save();
formKey.currentState.validate();
formKey.currentState!.save();
formKey.currentState!.validate();
model.complaintsControllerError = '';
model.medicationControllerError = '';
@ -270,6 +272,6 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
@override
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';
class LineChartCurvedBloodPressureNew extends StatelessWidget {
final String title;
final List<TimeSeriesSales2> timeSeries1;
final List<TimeSeriesSales2> timeSeries2;
final int indexes;
final bool isOX;
final String? title;
final List<TimeSeriesSales2>? timeSeries1;
final List<TimeSeriesSales2>? timeSeries2;
final int? indexes;
final bool? isOX;
LineChartCurvedBloodPressureNew({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX = false});
List<int> xAxixs = List();
List<double> yAxixs = List();
List<int> xAxixs = [];
List<double> yAxixs = [];
@override
Widget build(BuildContext context) {
@ -39,7 +39,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
right: 20,
),
child: Text(
title,
title!,
style: TextStyle(
color: Colors.black,
fontSize: 16,
@ -57,7 +57,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
child: LineChart(
sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250),
duration: const Duration(milliseconds: 250),
),
),
),
@ -127,9 +127,9 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
}
getXaxix() {
for (int index = 0; index < timeSeries1.length; index++) {
int mIndex = indexes * index;
if (mIndex < timeSeries1.length) {
for (int index = 0; index < timeSeries1!.length; index++) {
int mIndex = indexes! * index;
if (mIndex < timeSeries1!.length) {
xAxixs.add(mIndex);
}
}
@ -141,50 +141,70 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
touchCallback: (touchEvent, LineTouchResponse? touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black,
fontSize: 10,
),
rotateAngle: -65,
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
return '';
} else {
if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
}
}
return '';
},
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
// rotateAngle: -65,
reservedSize: 22,
getTitlesWidget: (value, meta) {
if (timeSeries1!.length < 15) {
if (timeSeries1!.length > value.toInt()) {
return Text(
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} else
return Text("");
} else {
if (value.toInt() == 0)
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())) {
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
? 50
: getMaxY() - getMinY() <= 1000
? 100
: 200,
margin: 12,
),
),
leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
interval: getMaxY() - getMinY() <= 500
? 50
: getMaxY() - getMinY() <= 1000
? 100
: 200,
reservedSize: 12,
),
)),
borderData: FlBorderData(
show: true,
border: const Border(
@ -204,7 +224,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
),
),
minX: 0,
maxX: (timeSeries1.length - 1).toDouble(),
maxX: (timeSeries1!.length - 1).toDouble(),
maxY: getMaxY() + 15,
minY: getMinY() - 15,
lineBarsData: getData(context),
@ -213,12 +233,12 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
double getMaxY() {
double max = 0;
timeSeries1.forEach((element) {
double resultValueDouble = element.sales;
timeSeries1!.forEach((element) {
double resultValueDouble = element.sales!;
if (resultValueDouble > max) max = resultValueDouble;
});
timeSeries2.forEach((element) {
double resultValueDouble = element.sales;
timeSeries2!.forEach((element) {
double resultValueDouble = element.sales!;
if (resultValueDouble > max) max = resultValueDouble;
});
@ -226,13 +246,13 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
}
double getMinY() {
double min = timeSeries1[0].sales;
timeSeries1.forEach((element) {
double resultValueDouble = element.sales;
double min = timeSeries1![0].sales!;
timeSeries1!.forEach((element) {
double resultValueDouble = element.sales!;
if (resultValueDouble < min) min = resultValueDouble;
});
timeSeries2.forEach((element) {
double resultValueDouble = element.sales;
timeSeries2!.forEach((element) {
double resultValueDouble = element.sales!;
if (resultValueDouble < min) min = resultValueDouble;
});
@ -242,20 +262,20 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
}
List<LineChartBarData> getData(context) {
List<FlSpot> spots = List();
for (int index = 0; index < timeSeries1.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales));
List<FlSpot> spots = [];
for (int index = 0; index < timeSeries1!.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1![index].sales!));
}
List<FlSpot> spots2 = List();
for (int index = 0; index < timeSeries2.length; index++) {
spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales));
List<FlSpot> spots2 = [];
for (int index = 0; index < timeSeries2!.length; index++) {
spots2.add(FlSpot(index.toDouble(), timeSeries2![index].sales!));
}
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots,
isCurved: true,
colors: [Colors.red],
color: Colors.red,
barWidth: 1.5,
isStrokeCapRound: true,
dotData: FlDotData(
@ -268,7 +288,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
final LineChartBarData lineChartBarData2 = LineChartBarData(
spots: spots2,
isCurved: true,
colors: [Theme.of(context).primaryColor],
color: Theme.of(context).primaryColor,
barWidth: 1.5,
isStrokeCapRound: true,
dotData: FlDotData(
@ -288,9 +308,8 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
border: Border.all(
width: 1, //
color: background // <--- border width here
),
),
borderRadius: BorderRadius.circular(radius),
);
}
}

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

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

@ -16,15 +16,15 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
class VitalSignDetailsScreen extends StatelessWidget {
int appointmentNo;
int projectID;
int? appointmentNo;
int? projectID;
bool isNotOneAppointment;
VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true});
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
@ -56,14 +56,14 @@ class VitalSignDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s",
fontSize: SizeConfig.textMultiplier * 1.6,
"${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s",
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),
),
AppText(
TranslationBase.of(context).vitalSign,
fontSize: SizeConfig.textMultiplier * 3,
fontSize: SizeConfig.textMultiplier! * 3,
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
)
@ -90,7 +90,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText(
"${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}",
color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 2.0,
fontSize: SizeConfig.textMultiplier! * 2.0,
fontWeight: FontWeight.w700,
),
Row(
@ -110,15 +110,15 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText(
"${TranslationBase.of(context).bmiUnderWeight}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null,
fontSize: SizeConfig.textMultiplier! * 1.15,
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : Colors.transparent,
fontWeight: FontWeight.w700,
),
AppText(
"(<18.5)",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null,
fontSize: SizeConfig.textMultiplier! * 1.15,
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : Colors.transparent,
fontWeight: FontWeight.w700,
),
],
@ -138,17 +138,17 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText(
"${TranslationBase.of(context).normal}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : Colors.transparent,
),
),
AppText(
"(18.5-24.9)",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier! * 1.15,
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(
"${TranslationBase.of(context).bmiOverWeight}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.155,
fontSize: SizeConfig.textMultiplier! * 1.155,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : Colors.transparent,
),
AppText(
"(25-29.9)",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.155,
fontSize: SizeConfig.textMultiplier! * 1.155,
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(
"${TranslationBase.of(context).bmiObese}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : Colors.transparent,
),
AppText(
"(30-34.9)",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier! * 1.15,
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(
"${TranslationBase.of(context).bmiObeseExtreme}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : Colors.transparent,
),
),
AppText(
"(35<)",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier! * 1.15,
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_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/utils/date-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/shared/app_scaffold_widget.dart';
@ -18,18 +17,18 @@ import 'package:provider/provider.dart';
class VitalSignItemDetailsScreen extends StatelessWidget {
final vitalSignDetails pageKey;
final String pageTitle;
List<Map> VSchart;
List<Map>? VSchart;
PatiantInformtion patient;
String patientType;
String arrivalType;
String? patientType;
String? arrivalType;
List<TimeSeriesSales2> timeSeriesData1 = [];
List<TimeSeriesSales2> timeSeriesData2 = [];
final String viewKey1;
final String viewKey2;
final String? viewKey1;
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;
@ -205,15 +204,15 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s",
"${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.w600,
),
AppText(
TranslationBase.of(context).vitalSign,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontSize: SizeConfig.textMultiplier! * 3,
fontWeight: FontWeight.bold,
)
],
@ -223,7 +222,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
child: ListView(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
children: VSchart.map((chartInfo) {
children: VSchart!.map((chartInfo) {
var vitalListTemp = vitalList.where(
(element) => element.toJson()[chartInfo['viewKey']] != null,
);

@ -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/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/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/patient-vital-sign-viewmodel.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/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -55,10 +55,10 @@ class _DrugToDrug extends State<DrugToDrug> {
? BaseView<PrescriptionViewModel>(
onModelReady: (prescriptionViewModel) =>
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,
child: Container(
height: SizeConfig.realScreenHeight * .9,
height: SizeConfig.realScreenHeight! * .9,
child: new ListView.builder(
itemCount: expandableList.length,
itemBuilder: (context, i) {
@ -73,11 +73,11 @@ class _DrugToDrug extends State<DrugToDrug> {
padding: EdgeInsets.all(10),
child: AppText(
item['comment'],
color: Colors.red[900],
color: Colors.red[900]!,
));
}).toList());
}))))
: Container(height: SizeConfig.realScreenHeight * .45, child: GifLoaderContainer());
: Container(height: SizeConfig.realScreenHeight! * .45, child: GifLoaderContainer());
}
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/utils/date-utils.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/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/buttons/app_buttons_widget.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:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../widgets/transitions/slide_up_page.dart';
import 'add_drug/add_drug_widget.dart';
@ -35,21 +35,22 @@ class PrescriptionFormWidget extends StatefulWidget {
final MedicineViewModel medicineViewModel;
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
_PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState();
}
class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
String routeError;
String frequencyError;
String doseTimeError;
String durationError;
String unitError;
String strengthError;
String? routeError;
String? frequencyError;
String? doseTimeError;
String? durationError;
String? unitError;
String? strengthError;
int selectedType;
int? selectedType;
TextEditingController strengthController = TextEditingController();
TextEditingController unitController = TextEditingController();
@ -60,7 +61,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
bool visibilitySearch = true;
DateTime selectedDate = DateTime.now();
int strengthChar;
int? strengthChar;
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
TextEditingController drugIdController = TextEditingController();
@ -140,7 +141,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column(
children: [
AppText(
widget.selectedMedication?.description ?? "",
widget.selectedMedication.description ?? "",
fontWeight: FontWeight.w600,
),
SizedBox(
@ -165,7 +166,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
value: 1,
groupValue: selectedType,
onChanged: (value) {
setSelectedType(value);
setSelectedType(value!);
},
),
Text(TranslationBase.of(context).regular),
@ -186,7 +187,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
setState(() {
strengthChar = value.length;
});
if (strengthChar >= 5) {
if (strengthChar! >= 5) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).only5DigitsAllowedForStrength,
);
@ -195,6 +196,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
inputType: TextInputType.numberWithOptions(
decimal: true,
),
onFieldSubmitted: () {},
),
),
SizedBox(
@ -279,6 +281,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: AppTextFieldCustom(
hintText: widget.medicineViewModel.patientAssessmentList[0].icdCode10ID.toString(),
enabled: true,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
),
Container(
@ -288,6 +292,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
maxLines: 5,
hintText: widget.medicineViewModel.patientAssessmentList[0].asciiDesc.toString(),
enabled: true,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
),
],
@ -307,9 +313,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Icons.calendar_today,
color: Colors.black,
),
onPressed: () {},
),
dropDownText: selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null,
enabled: false,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
),
),
@ -339,6 +348,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
isTextFieldHasSuffix: false,
dropDownText: uom != null ? uom : null,
enabled: false,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
),
SizedBox(height: spaceBetweenTextFields),
@ -349,6 +360,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
isTextFieldHasSuffix: false,
dropDownText: box != null ? widget.medicineViewModel.boxQuintity.toString() : null,
enabled: false,
onChanged: (String value) {},
onFieldSubmitted: () {},
),
),
SizedBox(height: spaceBetweenTextFields),
@ -381,7 +394,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
),
SizedBox(height: spaceBetweenTextFields),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
@ -405,7 +418,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Utils.hideKeyboard(context);
DateTime selectedDate;
selectedDate = DateTime.now();
final DateTime picked = await showDatePicker(
final DateTime? picked = await showDatePicker(
context: context,
initialDate: selectedDate,
firstDate: DateTime.now(),
@ -440,7 +453,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
return;
}
if (formKey.currentState.validate()) {
if (formKey.currentState!.validate()) {
Navigator.push(
context,
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/user-guid/CusomRow.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../utils/utils.dart';
@ -22,7 +21,7 @@ import '../../widgets/shared/errors/error_message.dart';
class OldPrescriptionsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
@ -35,7 +34,7 @@ class OldPrescriptionsPage extends StatelessWidget {
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Colors.grey[100],
backgroundColor: Colors.grey[100]!,
appBar: PatientProfileAppBar(
patient,
isInpatient: isInpatient,
@ -81,13 +80,13 @@ class OldPrescriptionsPage extends StatelessWidget {
child: Column(
children: [
DoctorCard(
doctorName: Utils.convertToTitleCase(model.prescriptionsList[index].doctorName),
doctorName: Utils.convertToTitleCase(model.prescriptionsList[index].doctorName!),
profileUrl: model.prescriptionsList[index].doctorImageURL,
branch: model.prescriptionsList[index].name,
clinic: model.prescriptionsList[index].clinicDescription,
isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
model.prescriptionsList[index].appointmentDate,
model.prescriptionsList[index].appointmentDate!,
),
),
],
@ -135,7 +134,7 @@ class OldPrescriptionsPage extends StatelessWidget {
children: [
CustomRow(
label: "",
value: Utils.convertToTitleCase(model.medicationForInPatient[index].pHRItemDescription),
value: Utils.convertToTitleCase(model.medicationForInPatient[index].pHRItemDescription!),
valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
),
SizedBox(
@ -170,10 +169,10 @@ class OldPrescriptionsPage extends StatelessWidget {
patientType: patientType,
arrivalType: arrivalType,
startOn: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].startDatetime,
model.medicationForInPatient[index].startDatetime!,
),
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/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/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/search_drug/get_medication_response_model.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/prescription/prescription_view_model.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/prescription/prescription_text_filed.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/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_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package: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:flutter/material.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 {
final PrescriptionViewModel model;
final PatiantInformtion patient;
final List<PrescriptionModel> prescriptionList;
final List<PrescriptionModel>? prescriptionList;
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
_PrescriptionCheckOutScreenState createState() => _PrescriptionCheckOutScreenState();
@ -45,44 +45,44 @@ class PrescriptionCheckOutScreen extends StatefulWidget {
class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen> {
postPrescription(
{String duration,
String doseTimeIn,
String dose,
String drugId,
String strength,
String route,
String frequency,
String indication,
String instruction,
PrescriptionViewModel model,
DateTime doseTime,
String doseUnit,
String icdCode,
PatiantInformtion patient,
String patientType}) async {
{String? duration,
String? doseTimeIn,
String? dose,
String? drugId,
String? strength,
String? route,
String? frequency,
String? indication,
String? instruction,
PrescriptionViewModel? model,
DateTime? doseTime,
String? doseUnit,
String? icdCode,
PatiantInformtion? patient,
String? patientType}) async {
PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel();
List<PrescriptionRequestModel> prescriptionList = List();
List<PrescriptionRequestModel> prescriptionList = [];
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.appointmentNo = patient!.appointmentNo;
postProcedureReqModel.clinicID = patient.clinicId;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
prescriptionList.add(PrescriptionRequestModel(
covered: true,
dose: double.parse(dose),
itemId: drugId.isEmpty ? 1 : int.parse(drugId),
doseUnitId: int.parse(doseUnit),
route: route.isEmpty ? 1 : int.parse(route),
frequency: frequency.isEmpty ? 1 : int.parse(frequency),
dose: double.parse(dose!),
itemId: drugId!.isEmpty ? 1 : int.parse(drugId),
doseUnitId: int.parse(doseUnit!),
route: route!.isEmpty ? 1 : int.parse(route),
frequency: frequency!.isEmpty ? 1 : int.parse(frequency),
remarks: instruction,
approvalRequired: true,
icdcode10Id: icdCode.toString(),
doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn),
duration: duration.isEmpty ? 1 : int.parse(duration),
doseStartDate: doseTime.toIso8601String()));
doseTime: doseTimeIn!.isEmpty ? 1 : int.parse(doseTimeIn),
duration: duration!.isEmpty ? 1 : int.parse(duration),
doseStartDate: doseTime!.toIso8601String()));
postProcedureReqModel.prescriptionRequestModel = prescriptionList;
await model.postPrescription(postProcedureReqModel, patient.patientMRN);
await model!.postPrescription(postProcedureReqModel, patient.patientMRN!);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
@ -92,14 +92,14 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
}
}
String routeError;
String frequencyError;
String doseTimeError;
String durationError;
String unitError;
String strengthError;
String? routeError;
String? frequencyError;
String? doseTimeError;
String? durationError;
String? unitError;
String? strengthError;
int selectedType;
int selectedType = 0;
TextEditingController strengthController = TextEditingController();
TextEditingController indicationController = TextEditingController();
@ -109,10 +109,10 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
bool visibilitySearch = true;
final myController = TextEditingController();
DateTime selectedDate;
int strengthChar;
GetMedicationResponseModel _selectedMedication;
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
DateTime? selectedDate;
int strengthChar = 0;
GetMedicationResponseModel _selectedMedication = GetMedicationResponseModel();
GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
TextEditingController drugIdController = TextEditingController();
TextEditingController doseController = TextEditingController();
@ -210,7 +210,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
return BaseView<MedicineViewModel>(
onModelReady: (model) async {
// 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) {
return element.icdCode10ID;
@ -231,7 +231,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
builder: (
BuildContext context,
MedicineViewModel model,
Widget child,
Widget? child,
) =>
AppScaffold(
backgroundColor: Color(0xffF8F8F8).withOpacity(0.9),
@ -320,7 +320,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
value: 1,
groupValue: selectedType,
onChanged: (value) {
setSelectedType(value);
setSelectedType(value!);
},
),
Text(TranslationBase.of(context).regular),
@ -354,6 +354,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
inputType: TextInputType.numberWithOptions(
decimal: true,
),
onFieldSubmitted: () {},
),
),
SizedBox(
@ -461,8 +462,8 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
child: InkWell(
onTap: () => selectDate(context, widget.model),
child: TextField(
decoration: textFieldSelectorDecoration(TranslationBase.of(context).date,
selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, true,
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).date, selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : "", true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
@ -529,7 +530,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
),
SizedBox(height: spaceBetweenTextFields),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
@ -557,12 +558,12 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
);
return;
}
if (formKey.currentState.validate()) {
if (formKey.currentState!.validate()) {
Navigator.pop(context);
{
postPrescription(
icdCode: model.patientAssessmentList.isNotEmpty
? model.patientAssessmentList[0].icdCode10ID.isEmpty
? model.patientAssessmentList[0].icdCode10ID!.isEmpty
? "test"
: model.patientAssessmentList[0].icdCode10ID.toString()
: "test",
@ -575,7 +576,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
duration: duration['id'].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(),
drugId: (widget.groupProcedures.aliasN.replaceAll("item code ;", "")),
drugId: (widget.groupProcedures.aliasN!.replaceAll("item code ;", "")),
strength: strengthController.text,
indication: indicationController.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);
DateTime selectedDate;
selectedDate = DateTime.now();
final DateTime picked = await showDatePicker(
final DateTime? picked = await showDatePicker(
context: context,
initialDate: selectedDate,
firstDate: DateTime.now(),
@ -663,7 +664,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
/// 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(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),

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

@ -18,21 +18,13 @@ class BaseAddProcedureTabPage extends StatefulWidget {
final PatiantInformtion? patient;
final ProcedureType procedureType;
const BaseAddProcedureTabPage(
{Key? key,
this.previousProcedureViewModel,
this.prescriptionModel,
this.patient,
required this.procedureType})
: super(key: key);
const BaseAddProcedureTabPage({Key? key, this.previousProcedureViewModel, this.prescriptionModel, this.patient, required this.procedureType}) : super(key: key);
@override
_BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState(
patient: patient, procedureType: procedureType);
_BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState(patient: patient, procedureType: procedureType);
}
class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
with SingleTickerProviderStateMixin {
class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage> with SingleTickerProviderStateMixin {
final PatiantInformtion? patient;
final ProcedureType? procedureType;
@ -67,12 +59,10 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
return BaseView<ProcedureViewModel>(
onModelReady: (model) async {
if (widget.previousProcedureViewModel == null) {
await model.getProcedureTemplate(
categoryID: widget.procedureType.getCategoryId());
await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId());
}
},
builder: (BuildContext context, ProcedureViewModel model, Widget? child) =>
AppScaffold(
builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: BottomSheetTitle(
@ -83,8 +73,7 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
child: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize:
Size.fromHeight(MediaQuery.of(context).size.height * 0.070),
preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070),
child: TabBar(
isScrollable: false,
controller: _tabController,
@ -92,16 +81,11 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding:
EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0),
labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800],
tabs: [
TabWidget.tabWidget(screenSize, _activeTab == 0,
procedureType!.getFavouriteTabName(context),
isFirst: true, context: context),
TabWidget.tabWidget(screenSize, _activeTab == 1,
procedureType!.getAllLabelName(context),
isLast: true, context: context),
TabWidget.tabWidget(screenSize, _activeTab == 0, procedureType!.getFavouriteTabName(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,
children: [
AddFavouriteProcedure(
previousProcedureViewModel:
widget.previousProcedureViewModel ?? model,
previousProcedureViewModel: widget.previousProcedureViewModel ?? model,
prescriptionModel: widget.prescriptionModel,
patient: patient,
procedureType: procedureType,
@ -128,7 +111,7 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
else
AddProcedurePage(
model: widget.previousProcedureViewModel ?? model,
patient: patient,
patient: patient!,
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/text_fields/TextFields.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../config/config.dart';
@ -21,25 +20,23 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
final List<EntityList> masterList;
EntityListCheckboxSearchWidget({
Key key,
this.model,
this.addSelectedHistories,
this.removeProcedure,
this.masterList,
this.addProcedure,
this.isEntityListSelected,
Key? key,
required this.model,
required this.addSelectedHistories,
required this.removeProcedure,
required this.masterList,
required this.addProcedure,
required this.isEntityListSelected,
}) : super(key: key);
@override
_EntityListCheckboxSearchWidgetState createState() =>
_EntityListCheckboxSearchWidgetState();
_EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState();
}
class _EntityListCheckboxSearchWidgetState
extends State<EntityListCheckboxSearchWidget> {
class _EntityListCheckboxSearchWidgetState extends State<EntityListCheckboxSearchWidget> {
String selectedType = '0';
int typeUrgent;
int typeRegular;
int typeUrgent = 0;
int typeRegular = 0;
setSelectedType(String val) {
setState(() {
@ -47,9 +44,9 @@ class _EntityListCheckboxSearchWidgetState
});
}
List<EntityList> items = List();
List<String> remarksList = List();
List<int> typeList = List();
List<EntityList> items = [];
List<String> remarksList = [];
List<int> typeList = [];
@override
void initState() {
@ -71,9 +68,7 @@ class _EntityListCheckboxSearchWidgetState
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.white),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white),
child: ListView(
children: [
TextFields(
@ -81,8 +76,7 @@ class _EntityListCheckboxSearchWidgetState
suffixIcon: EvaIcons.search,
suffixIconColor: Color(0xff2B353E),
onChanged: (value) {
widget.model.filterSearchResults(
value, widget.masterList, items);
widget.model.filterSearchResults(value, widget.masterList, items);
},
hasBorder: false,
),
@ -98,31 +92,21 @@ class _EntityListCheckboxSearchWidgetState
title: Row(
children: [
Checkbox(
value: widget.isEntityListSelected(
historyInfo),
value: widget.isEntityListSelected(historyInfo),
activeColor: Color(0xffD02127),
onChanged: (bool newValue) {
onChanged: (bool? newValue) {
setState(() {
if (widget.isEntityListSelected(
historyInfo)) {
widget.removeProcedure(
historyInfo);
if (widget.isEntityListSelected(historyInfo)) {
widget.removeProcedure(historyInfo);
} else {
widget.addProcedure(
historyInfo);
widget.addProcedure(historyInfo);
}
});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: AppText(
Utils.convertToTitleCase( historyInfo.procedureName),
fontSize: 14.0,
variant: "bodyText",
bold: true,
color: Color(0xff575757)),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0),
child: AppText(Utils.convertToTitleCase(historyInfo.procedureName!), fontSize: 14.0, variant: "bodyText", bold: true, color: Color(0xff575757)),
),
),
],
@ -130,24 +114,17 @@ class _EntityListCheckboxSearchWidgetState
children: [
Container(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 12),
padding: EdgeInsets.symmetric(horizontal: 12),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Padding(
padding: const EdgeInsets
.symmetric(
horizontal: 11),
padding: const EdgeInsets.symmetric(horizontal: 11),
child: AppText(
TranslationBase.of(
context)
.orderType,
fontWeight:
FontWeight.w700,
TranslationBase.of(context).orderType,
fontWeight: FontWeight.w700,
color: Color(0xff2B353E),
),
),
@ -156,17 +133,13 @@ class _EntityListCheckboxSearchWidgetState
Row(
children: [
Radio(
activeColor:
Color(0xFFD02127),
activeColor: Color(0xFFD02127),
value: '0',
groupValue: historyInfo.type,
groupValue: historyInfo.type,
onChanged: (value) {
historyInfo.type =
setSelectedType(value)
.toString();
historyInfo.type = setSelectedType(value!).toString();
historyInfo.type =
value.toString();
historyInfo.type = value.toString();
},
),
AppText(
@ -175,22 +148,17 @@ class _EntityListCheckboxSearchWidgetState
fontWeight: FontWeight.w600,
),
Radio(
activeColor:
Color(0xFFD02127),
activeColor: Color(0xFFD02127),
groupValue: historyInfo.type,
value: '1',
onChanged: (value) {
historyInfo.type =
setSelectedType(value)
.toString();
historyInfo.type = setSelectedType(value!).toString();
historyInfo.type =
value.toString();
historyInfo.type = value.toString();
},
),
AppText(
TranslationBase.of(context)
.urgent,
TranslationBase.of(context).urgent,
color: Color(0xff575757),
fontWeight: FontWeight.w600,
),
@ -204,11 +172,9 @@ class _EntityListCheckboxSearchWidgetState
height: 2.0,
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 12, vertical: 12.0),
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 12.0),
child: TextFields(
hintText: TranslationBase.of(context)
.remarks,
hintText: TranslationBase.of(context).remarks,
//controller: remarksController,
onChanged: (value) {
historyInfo.remarks = value;
@ -216,7 +182,7 @@ class _EntityListCheckboxSearchWidgetState
minLines: 3,
maxLines: 5,
borderWidth: 0.5,
borderColor: Colors.grey[500],
borderColor: Colors.grey[500]!,
),
),
DividerWithSpacesAround(),
@ -228,8 +194,7 @@ class _EntityListCheckboxSearchWidgetState
)
: Center(
child: Container(
child: AppText("Sorry , No Match",
color: AppGlobal.appRedColor),
child: AppText("Sorry , No Match", 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/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class AddFavouriteProcedure extends StatefulWidget {
@ -94,8 +93,8 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
context,
MaterialPageRoute(
builder: (context) => PrescriptionCheckOutScreen(
patient: widget.patient,
model: widget.prescriptionModel,
patient: widget.patient!,
model: widget.prescriptionModel!,
groupProcedures: groupProcedures,
),
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/widgets/shared/app_texts_widget.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/services.dart';
@ -91,7 +90,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State<EntityList
AppTextFieldCustomSearch(
searchController: patientFileInfoController,
onChangeFun: (value) {
widget.model!.filterProcedureSearchResults(value, widget.masterList, items);
widget.model!.filterProcedureSearchResults(value, widget.masterList!, items);
},
marginTop: 5,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))],

@ -60,17 +60,7 @@ class UpdateProcedureWidget extends StatefulWidget {
final int? limetNo;
int? selectedType;
UpdateProcedureWidget(
{this.previousModel,
this.procedureName,
this.remarks,
this.remarksController,
this.patient,
this.procedureId,
this.categoryId,
this.orderNo,
this.limetNo,
this.selectedType});
UpdateProcedureWidget({this.previousModel, this.procedureName, this.remarks, this.remarksController, this.patient, this.procedureId, this.categoryId, this.orderNo, this.limetNo, this.selectedType});
@override
_UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState();
@ -96,9 +86,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(),
builder:
(BuildContext context, ProcedureViewModel _model, Widget? child) =>
AppScaffold(
builder: (BuildContext context, ProcedureViewModel _model, Widget? child) => AppScaffold(
baseViewModel: widget.previousModel!,
isShowAppBar: true,
appBar: BottomSheetTitle(title: "Update Procedure"),
@ -107,8 +95,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
height: MediaQuery.of(context).size.height * 0.9,
child: Form(
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -148,17 +135,11 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
child: TextFields(
fontSize: 15.0,
controller: widget.remarksController!,
hintText: widget.remarksController!.text.isEmpty
? 'No Remarks Added'
: '',
hintText: widget.remarksController!.text.isEmpty ? 'No Remarks Added' : '',
maxLines: 3,
minLines: 2,
onChanged: (value) {},
@ -201,8 +182,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
required String procedureId,
required PatiantInformtion patient,
required String categoryId}) async {
UpdateProcedureRequestModel updateProcedureReqModel =
new UpdateProcedureRequestModel();
UpdateProcedureRequestModel updateProcedureReqModel = new UpdateProcedureRequestModel();
List<Controls> controls = [];
ProcedureDetail controlsProcedure = ProcedureDetail();
@ -215,8 +195,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
{
controls.add(
Controls(
code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""),
Controls(code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""),
);
controls.add(
Controls(code: "ordertype", controlValue: orderType),
@ -229,17 +208,13 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
}
updateProcedureReqModel.procedureDetail = controlsProcedure;
GifLoaderDialogUtils.showMyDialog(context);
await widget.previousModel!.updateProcedure(
updateProcedureRequestModel: updateProcedureReqModel,
mrn: patient.patientMRN,
isLocalBusy: true);
await widget.previousModel!.updateProcedure(updateProcedureRequestModel: updateProcedureReqModel, mrn: patient.patientMRN, isLocalBusy: true);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been updated');
await widget.previousModel!
.getProcedure(mrn: patient.patientMRN, isLocalBusy: true);
await widget.previousModel!.getProcedure(mrn: patient.patientMRN!, isLocalBusy: true);
Navigator.of(context).pop();
}
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/utils/dr_app_shared_pref.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/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:dropdown_search/dropdown_search.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker_plus/flutter_datetime_picker_plus.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
@ -39,8 +39,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
TextEditingController _toDateController = new TextEditingController();
TextEditingController _toDateController2 = new TextEditingController();
ProjectViewModel projectsProvider;
SickLeaveViewModel sickLeaveViewModel;
late ProjectViewModel projectsProvider;
late SickLeaveViewModel sickLeaveViewModel;
Map profile = {};
var offTime = '1';
var date;
@ -49,8 +49,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
dynamic fromDate;
dynamic toDate;
var clinicID;
String fromTime;
String toTime;
String? fromTime;
String? toTime;
TextEditingController _controller4 = new TextEditingController();
TextEditingController _controller5 = new TextEditingController();
@ -124,7 +124,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3),
top: SizeConfig.widthMultiplier! * 0.9,
bottom: SizeConfig.widthMultiplier! * 0.9,
right: SizeConfig.widthMultiplier! * 3,
left: SizeConfig.widthMultiplier! * 3),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -149,7 +152,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
AppText(
item['description'],
fontSize: SizeConfig.textMultiplier * 2.1,
fontSize: SizeConfig.textMultiplier! * 2.1,
// color:
// Colors.grey,
),
@ -159,7 +162,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
},
onChanged: (newValue) {
setState(() {
offTime = newValue;
offTime = newValue.toString();
});
if (offTime == '1') {
model2.getReasons(18);
@ -168,7 +171,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
} else if (offTime == '3' || offTime == '5') {
model2.getReasons(102);
setState(() {
offTime = newValue;
offTime = newValue.toString();
});
}
},
@ -202,7 +205,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
AppTextFormField(
hintText: TranslationBase.of(context).fromDate,
borderColor: Colors.white,
prefix: IconButton(icon: Icon(Icons.calendar_today)),
prefix: IconButton(
icon: Icon(Icons.calendar_today),
onPressed: () {},
),
textInputType: TextInputType.number,
controller: _toDateController,
onTap: () {
@ -224,19 +230,19 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DateTimePicker(
timeHintText: TranslationBase.of(context).fromTime,
type: DateTimePickerType.time,
controller: _controller4,
onChanged: (val) => fromTime = val,
validator: (val) {
print(val);
// setState(
// () => _valueToValidate4 = val);
return null;
},
onSaved: (val) => fromTime = val,
)
// DateTimePicker(
// timeHintText: TranslationBase.of(context).fromTime,
// type: DateTimePickerType.time,
// controller: _controller4,
// onChanged: (val) => fromTime = val,
// validator: (val) {
// print(val);
// // setState(
// // () => _valueToValidate4 = val);
// return null;
// },
// onSaved: (val) => fromTime = val,
// ),
],
),
),
@ -282,7 +288,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
AppTextFormField(
hintText: TranslationBase.of(context).fromDate,
borderColor: Colors.white,
prefix: IconButton(icon: Icon(Icons.calendar_today)),
prefix: IconButton(
icon: Icon(Icons.calendar_today),
onPressed: () {},
),
textInputType: TextInputType.number,
readOnly: true,
controller: _toDateController,
@ -308,7 +317,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
hintText: TranslationBase.of(context).toDate,
readOnly: true,
borderColor: Colors.white,
prefix: IconButton(icon: Icon(Icons.calendar_today)),
prefix: IconButton(
icon: Icon(Icons.calendar_today),
onPressed: () {},
),
textInputType: TextInputType.number,
controller: _toDateController2,
onTap: () {
@ -330,7 +342,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3),
top: SizeConfig.widthMultiplier! * 0.9,
bottom: SizeConfig.widthMultiplier! * 0.9,
right: SizeConfig.widthMultiplier! * 3,
left: SizeConfig.widthMultiplier! * 3),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -354,7 +369,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
children: <Widget>[
AppText(
projectsProvider.isArabic ? item['nameAr'] : item['nameEn'],
fontSize: SizeConfig.textMultiplier * 2.1,
fontSize: SizeConfig.textMultiplier! * 2.1,
// color:
// Colors.grey,
),
@ -391,7 +406,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3),
top: SizeConfig.widthMultiplier! * 0.9,
bottom: SizeConfig.widthMultiplier! * 0.9,
right: SizeConfig.widthMultiplier! * 3,
left: SizeConfig.widthMultiplier! * 3),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -402,9 +420,11 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
? Expanded(
// add Expanded to have your dropdown button fill remaining space
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,
items: model2.coveringDoctors.map((item) {
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']});
},
selectedItem: getSelectedDoctor(model2),
showSearchBox: true,
popupTitle: Container(
height: 50,
decoration: BoxDecoration(
color: Theme.of(context).primaryColorDark,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
popupProps: PopupProps.bottomSheet(
bottomSheetProps: BottomSheetProps(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(24),
topRight: Radius.circular(24),
),
),
),
),
child: Center(
child: Text(
'',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.white,
title: Container(
height: 50,
decoration: BoxDecoration(
color: Theme.of(context).primaryColorDark,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
),
),
child: Center(
child: Text(
'',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
),
),
),
popupShape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(24),
topRight: Radius.circular(24),
),
),
showSearchBox: true),
),
)
: SizedBox(),
@ -449,9 +472,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
],
),
)),
SizedBox(height: SizeConfig.screenHeight * .3),
SizedBox(height: SizeConfig.screenHeight! * .3),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
@ -502,12 +525,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
_toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom));
//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 = 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));
_controller5.text = toTime;
_controller4.text = fromTime;
_controller5.text = toTime!;
_controller4.text = fromTime!;
toDate = _toDateController2.text;
fromDate = _toDateController.text;
this.reason = widget.updateData.reasonId.toString();
@ -528,8 +551,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
var fromDates = fromDate;
var toDates = toDate;
if (offTime == '1') {
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()));
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()));
} else {
fromDate = df.format(fromDates);
toDate = df.format(toDates);
@ -573,8 +596,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
dynamic fromDates = fromDate;
dynamic toDates = toDate;
if (offTime == '1') {
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();
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();
} else {
fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates));
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: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/service/NavigationService.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/utils/dr_app_shared_pref.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/material.dart';
import 'package:html/parser.dart';
import '../update_page.dart';
import '../config/size_config.dart';
import '../locator.dart';
import '../update_page.dart';
import '../utils/dr_app_toast_msg.dart';
import 'dr_app_shared_pref.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -42,7 +42,7 @@ class Utils {
),
actions: [
AppButton(
onPressed: okFunction,
onPressed: okFunction(),
title: TranslationBase.of(context).noteConfirm,
fontColor: Colors.white,
color: AppGlobal.appGreenColor,
@ -70,7 +70,7 @@ class Utils {
builder: (BuildContext builder) {
return Container(
// height: 500,
height: SizeConfig.realScreenHeight * 0.4,
height: SizeConfig.realScreenHeight! * 0.4,
color: Color(0xfff7f7f7),
child: Column(
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) {
return Text(
'${item.facilityName}',
style: TextStyle(fontSize: SizeConfig.textMultiplier * 2),
style: TextStyle(fontSize: SizeConfig.textMultiplier! * 2),
);
}).toList(),
itemExtent: 25,
@ -214,12 +214,12 @@ class Utils {
static String parseHtmlString(String htmlString) {
final document = parse(htmlString);
final String parsedString = parse(document.body.text).documentElement.text;
final String parsedString = parse(document.body!.text).documentElement!.text;
return parsedString;
}
static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon, Color dropDownColor}) {
static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon? suffixIcon, Color? dropDownColor}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
@ -279,7 +279,7 @@ class Utils {
return htmlRegex.hasMatch(text);
}
static String timeFrom({Duration duration}) {
static String timeFrom({required Duration duration}) {
String twoDigits(int n) => n.toString().padLeft(2, "0");
String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60));
String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60));
@ -287,7 +287,7 @@ class Utils {
}
static double getTextFieldHeight() {
return SizeConfig.heightMultiplier *
return SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
? 10
: SizeConfig.isHeightShort
@ -309,9 +309,9 @@ class Utils {
return kpi;
}
static String convertToTitleCase(String text) {
static String convertToTitleCase(String? text) {
if (text == null) {
return null;
return "";
}
if (text.length <= 1) {

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

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

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

@ -1,35 +1,34 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class AppText extends StatefulWidget {
final String text;
final String variant;
final String? variant;
final Color color;
final FontWeight fontWeight;
final double fontSize;
final double fontHeight;
final FontWeight? fontWeight;
final double? fontSize;
final double? fontHeight;
final String fontFamily;
final int maxLength;
final bool italic;
final double margin;
final double? margin;
final double marginTop;
final double marginRight;
final double marginBottom;
final double marginLeft;
final double letterSpacing;
final TextAlign textAlign;
final bool bold;
final bool regular;
final bool medium;
final int maxLines;
final double? letterSpacing;
final TextAlign? textAlign;
final bool? bold;
final bool? regular;
final bool? medium;
final int? maxLines;
final bool readMore;
final String style;
final String? style;
final bool allowExpand;
final bool visibility;
final TextOverflow textOverflow;
final TextDecoration textDecoration;
final TextOverflow? textOverflow;
final TextDecoration? textDecoration;
final bool isCopyable;
AppText(
@ -97,7 +96,7 @@ class _AppTextState extends State<AppText> {
Widget build(BuildContext context) {
return GestureDetector(
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(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
@ -131,7 +130,7 @@ class _AppTextState extends State<AppText> {
});
},
child: Text(hidden ? "Read More" : "Read less",
style: _getFontStyle().copyWith(
style: _getFontStyle()!.copyWith(
color: HexColor('#FF0000'),
fontWeight: FontWeight.w800,
fontFamily: "Poppins",
@ -167,7 +166,7 @@ class _AppTextState extends State<AppText> {
// : null,
maxLines: widget.maxLines ?? 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(
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Color(0xff2E303A),
@ -184,10 +183,10 @@ class _AppTextState extends State<AppText> {
return Text(
!hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)),
textAlign: widget.textAlign,
overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null,
overflow: widget.maxLines != null ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null,
maxLines: widget.maxLines ?? null,
style: widget.style != null
? _getFontStyle().copyWith(fontStyle: widget.italic ? FontStyle.italic : null, 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(
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black,
@ -201,7 +200,7 @@ class _AppTextState extends State<AppText> {
}
}
TextStyle _getFontStyle() {
TextStyle? _getFontStyle() {
switch (widget.style) {
case "headline2":
return Theme.of(context).textTheme.headline2;
@ -216,7 +215,7 @@ class _AppTextState extends State<AppText> {
case "bodyText2":
return Theme.of(context).textTheme.bodyText2;
case "bodyText_15":
return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0);
return Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: 15.0);
case "bodyText1":
return Theme.of(context).textTheme.bodyText1;
case "caption":
@ -263,7 +262,7 @@ class _AppTextState extends State<AppText> {
case "date":
return 24.0;
default:
return SizeConfig.textMultiplier * 2;
return SizeConfig.textMultiplier! * 2;
}
}
@ -309,7 +308,7 @@ class _AppTextState extends State<AppText> {
return FontWeight.w500;
}
} 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/utils.dart';
import 'package:flutter/material.dart';
import '../../../config/config.dart';
@ -11,16 +11,16 @@ class ListSelectDialog extends StatefulWidget {
final okText;
final Function(dynamic) okFunction;
dynamic selectedValue;
final Widget searchWidget;
final Widget? searchWidget;
final bool usingSearch;
final String hintSearchText;
final String? hintSearchText;
ListSelectDialog({
@required this.list,
@required this.attributeName,
@required this.attributeValueId,
@required this.okText,
@required this.okFunction,
required this.list,
required this.attributeName,
required this.attributeValueId,
required this.okText,
required this.okFunction,
this.searchWidget,
this.usingSearch = false,
this.hintSearchText,
@ -31,7 +31,7 @@ class ListSelectDialog extends StatefulWidget {
}
class _ListSelectDialogState extends State<ListSelectDialog> {
List<dynamic> items = List();
List<dynamic> items = [];
@override
void initState() {
@ -72,12 +72,12 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
height: MediaQuery.of(context).size.height * 0.5,
child: Column(
children: [
if (widget.searchWidget != null) widget.searchWidget,
if (widget.searchWidget != null) widget.searchWidget!,
if (widget.usingSearch)
Container(
height: MediaQuery.of(context).size.height * 0.070,
child: TextField(
decoration: Utils.textFieldSelectorDecoration(widget.hintSearchText ?? TranslationBase.of(context).search, null, false,
decoration: Utils.textFieldSelectorDecoration(widget.hintSearchText ?? TranslationBase.of(context).search, "", false,
suffixIcon: Icon(
Icons.search,
)),
@ -119,10 +119,10 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
}
void filterSearchResults(String query) {
List<dynamic> dummySearchList = List();
List<dynamic> dummySearchList = [];
dummySearchList.addAll(widget.list);
if (query.isNotEmpty) {
List<dynamic> dummyListData = List();
List<dynamic> dummyListData = [];
dummySearchList.forEach((item) {
if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);

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

@ -9,7 +9,7 @@ class ListSelectDialog extends StatefulWidget {
final Function(dynamic) okFunction;
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
_ListSelectDialogState createState() => _ListSelectDialogState();

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

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

@ -11,11 +11,11 @@ description: A new Flutter project.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.3.9+19
version: 4.3.5+1
environment:
sdk: ">=2.7.0 <3.0.0"
sdk: ">=3.0.0 <3.13.0"
#dependency_overrides:
@ -28,104 +28,122 @@ dependencies:
flutter:
sdk: flutter
hexcolor: ^3.0.1
flutter_localizations:
sdk: flutter
flutter_device_type: ^0.4.0
intl: ^0.17.0
http: ^0.13.0
provider: ^6.0.1
shared_preferences: ^2.0.6
http: ^1.1.2
provider: ^6.1.1
shared_preferences: ^2.2.2
# imei_plugin: ^1.2.0
# flutter_flexible_toast: ^0.1.4
fluttertoast: ^8.0.8
local_auth: 1.1.8
http_interceptor: ^1.0.2
fluttertoast: ^8.2.4
local_auth: ^2.1.7
http_interceptor: any
connectivity: ^3.0.6
maps_launcher: ^2.0.0
url_launcher: ^6.0.6
maps_launcher: ^2.2.0
url_launcher: ^6.2.1
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
eva_icons_flutter: ^3.0.0
font_awesome_flutter: ^10.3.0
dropdown_search: ^3.0.1
flutter_staggered_grid_view: ^0.4.0
eva_icons_flutter: ^3.1.0
font_awesome_flutter: ^10.6.0
dropdown_search: ^5.0.6
flutter_staggered_grid_view: ^0.7.0
expandable: ^5.0.1
# Qr code Scanner
barcode_scan2: ^4.1.4
barcode_scan2: ^4.3.0
# permissions
permission_handler: ^10.2.0
permission_handler: ^11.1.0
device_info: ^2.0.2
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.3
cupertino_icons: ^1.0.6
# SVG
#flutter_svg: ^1.0.0
percent_indicator: ^4.2.2
percent_indicator: ^4.2.3
#Dependency Injection
get_it: ^7.1.3
get_it: ^7.6.4
#chart
fl_chart: ^0.45.0
fl_chart: ^0.65.0
# Firebase
firebase_messaging: ^14.2.1
firebase_analytics : ^10.1.0
firebase_messaging: ^14.7.5
firebase_analytics : ^10.7.1
#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: ^2.0.1
date_time_picker: ^2.0.0
flutter_datetime_picker_plus: ^2.1.0
# Html
html: ^0.15.0
html: ^0.15.4
# Flutter Html View
flutter_html: ^2.1.0
flutter_html: ^3.0.0-beta.2
sticky_headers: ^0.3.0+2
file_picker: ^4.6.1
file_picker: 5.2.0+1
#speech to text
# 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
# 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
cached_network_image: ^3.1.0+1
cached_network_image: ^3.3.0
# Badges
badges: ^2.0.1
badges: ^3.1.2
# Hijri
# hijri: ^2.0.3
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.7.2
dependency_overrides:
flutter_localizations:
sdk: flutter
intl: ^0.18.1
#hijri_picker: ^3.0.0
dev_dependencies:
flutter_test:
sdk: flutter
build_runner: any
build_web_compilers: any
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
@ -187,4 +205,5 @@ flutter:
- asset: assets/fonts/DoctorApp.ttf
#
# 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