Merge branch 'flutter_2_developemt' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into hussam_flutter_2

 Conflicts:
	pubspec.lock
merge-requests/892/head
hussam al-habibeh 4 years ago
commit a8adacfc5c

@ -346,7 +346,6 @@ const GET_MEDICATION_FOR_IN_PATIENT =
const GET_EPISODE_FOR_INPATIENT =
"/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient";
///Operation Details Services
const GET_RESERVATIONS =
@ -377,12 +376,15 @@ const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION =
"Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration";
const CHECK_ACTIVATION_CODE_FOR_PATIENT =
"Services/Authentication.svc/REST/CheckActivationCode";
const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration";
const GET_PATIENT_INFO= "Services/NHIC.svc/REST/GetPatientInfo";
const PATIENT_REGISTRATION =
"Services/Authentication.svc/REST/PatientRegistration";
const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo";
/// Discharge Summary
const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary";
const GET_PENDING_DISCHARGE_SUMMARY =
"Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary";
const GET_ALL_DISCHARGE_SUMMARY =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary";
var selectedPatientType = 1;

@ -76,7 +76,7 @@ class SizeConfig {
}
static getTextMultiplierBasedOnWidth({double width}) {
static getTextMultiplierBasedOnWidth({double? width}) {
// TODO handel LandScape case
if (width != null) {
return width / 100;
@ -84,7 +84,7 @@ class SizeConfig {
return widthMultiplier;
}
static getWidthMultiplier({double width}) {
static getWidthMultiplier({double? width}) {
// TODO handel LandScape case
if (width != null) {
return width / 100;

@ -7,7 +7,7 @@ class AnalyticsService {
FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: _analytics);
Future logEvent({@required String eventCategory, @required String eventAction}) async {
Future logEvent({required String eventCategory, required String eventAction}) async {
await _analytics.logEvent(name: 'event', parameters: {
"eventCategory": eventCategory,
"eventAction": eventAction,

@ -17,10 +17,10 @@ class NavigationService {
}
Future<dynamic> pushAndRemoveUntil(Route newRoute) {
return navigatorKey.currentState.pushAndRemoveUntil(newRoute,(asd)=>false);
return navigatorKey.currentState!.pushAndRemoveUntil(newRoute,(asd)=>false);
}
pop() {
return navigatorKey.currentState.pop();
return navigatorKey.currentState!.pop();
}
}

@ -9,8 +9,8 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
class PatientRegistrationService extends BaseService {
GetPatientInfoResponseModel getPatientInfoResponseModel;
String logInTokenID;
late GetPatientInfoResponseModel getPatientInfoResponseModel;
late String logInTokenID;
checkPatientForRegistration(
CheckPatientForRegistrationModel registrationModel) async {
@ -39,13 +39,12 @@ class PatientRegistrationService extends BaseService {
}
sendActivationCodeByOTPNotificationType(
{SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel,
int otpType,
PatientRegistrationViewModel model,
CheckPatientForRegistrationModel
{
required int otpType,
required PatientRegistrationViewModel model,
required CheckPatientForRegistrationModel
checkPatientForRegistrationModel}) async {
registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel(
oTPSendType: otpType,
patientIdentificationID: checkPatientForRegistrationModel

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';

@ -47,7 +47,7 @@ class LiveCarePatientServices extends BaseService {
/// add new items.
localPatientList.forEach((element) {
if ((_patientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) {
if ((_patientList.singleWhere((it) => it.patientId == element.patientId)) == null) {
_patientList.add(element);
}
});
@ -55,7 +55,7 @@ class LiveCarePatientServices extends BaseService {
/// remove items.
List<PatiantInformtion> removedPatientList = [];
_patientList.forEach((element) {
if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) {
if ((localPatientList.singleWhere((it) => it.patientId == element.patientId)) == null) {
removedPatientList.add(element);
}
});
@ -155,12 +155,12 @@ class LiveCarePatientServices extends BaseService {
}, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive);
}
Future addPatientToDoctorList({int vcID}) async {
Future addPatientToDoctorList({required int vcID}) async {
hasError = false;
await getDoctorProfile();
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel();
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID;
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile!.doctorID!;
addPatientToDoctorListRequestModel.vCID = vcID;
addPatientToDoctorListRequestModel.isOutKsa = false;
addPatientToDoctorListRequestModel.generalid = GENERAL_ID;
@ -173,11 +173,11 @@ class LiveCarePatientServices extends BaseService {
}, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive);
}
Future removePatientFromDoctorList({int vcID}) async {
Future removePatientFromDoctorList({required int vcID}) async {
hasError = false;
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel();
await getDoctorProfile();
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID;
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile!.doctorID!;
addPatientToDoctorListRequestModel.vCID = vcID;
addPatientToDoctorListRequestModel.isOutKsa = false;
addPatientToDoctorListRequestModel.generalid = GENERAL_ID;

@ -10,18 +10,40 @@ import 'package:doctor_app_flutter/models/operation_report/get_reservations_requ
class DischargeSummaryService extends BaseService {
List<GetDischargeSummaryResModel> _pendingDischargeSummaryList = [];
List<GetDischargeSummaryResModel> get pendingDischargeSummaryList => _pendingDischargeSummaryList;
List<GetDischargeSummaryResModel> get pendingDischargeSummaryList =>
_pendingDischargeSummaryList;
Future getPendingDischargeSummary(
{GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async {
List<GetDischargeSummaryResModel> _allDischargeSummaryList = [];
List<GetDischargeSummaryResModel> get allDischargeSummaryList =>
_allDischargeSummaryList;
Future getPendingDischargeSummary(
{required GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async {
hasError = false;
await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY,
onSuccess: (dynamic response, int statusCode) {
_pendingDischargeSummaryList.clear();
response['List_PendingDischargeSummary'].forEach(
(v) {
_pendingDischargeSummaryList.add(GetDischargeSummaryResModel.fromJson(v));
_pendingDischargeSummaryList
.add(GetDischargeSummaryResModel.fromJson(v));
},
);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getDischargeSummaryReqModel.toJson());
}
Future getAllDischargeSummary(
{GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async {
hasError = false;
await baseAppClient.post(GET_ALL_DISCHARGE_SUMMARY,
onSuccess: (dynamic response, int statusCode) {
_allDischargeSummaryList.clear();
response['List_DischargeSummary'].forEach(
(v) {
_allDischargeSummaryList.add(GetDischargeSummaryResModel.fromJson(v));
},
);
}, onFailure: (String error, int statusCode) {

@ -14,8 +14,8 @@ class OperationReportService extends BaseService {
List<GetOperationDetailsResponseModel> get operationDetailsList => _operationDetailsList;
Future getReservations(
{GetReservationsRequestModel getReservationsRequestModel,
int patientId}) async {
{
required int patientId}) async {
getReservationsRequestModel =
GetReservationsRequestModel(patientID: patientId, doctorID: "");
@ -36,7 +36,7 @@ class OperationReportService extends BaseService {
}
Future getOperationReportDetails(
{GetOperationDetailsRequestModel getOperationReportRequestModel,
{required GetOperationDetailsRequestModel getOperationReportRequestModel,
}) async {
hasError = false;

@ -179,7 +179,7 @@ class LabsService extends BaseService {
}
Future getPatientLabOrdersResultHistoryByDescription(
{PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async {
{required PatientLabOrders patientLabOrder, required String procedureDescription, required PatiantInformtion patient}) async {
hasError = false;
Map<String, dynamic> body = Map();
if (patientLabOrder != null) {
@ -201,7 +201,7 @@ class LabsService extends BaseService {
}, body: body);
}
Future getAllSpecialLabResult({int mrn}) async {
Future getAllSpecialLabResult({required int mrn}) async {
_allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel(
patientID: mrn,
patientType: 1,

@ -94,7 +94,7 @@ class PatientMedicalReportService extends BaseService {
? body['SetupID']
: SETUP_ID
: SETUP_ID;
body['AdmissionNo'] = int.parse(patient.admissionNo);
body['AdmissionNo'] = int.parse(patient!.admissionNo!);
body['MedicalReportHTML'] = htmlText;
if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID;

@ -192,9 +192,9 @@ class PrescriptionsService extends BaseService {
hasError = false;
_getMedicationForInPatientRequestModel = GetMedicationForInPatientRequestModel(
isDentalAllowedBackend: false,
admissionNo: int.parse(patient.admissionNo),
admissionNo: int.parse(patient!.admissionNo!),
tokenID: "@dm!n",
projectID: patient.projectId,
projectID: patient!.projectId!,
);
await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, patient: patient,
onSuccess: (dynamic response, int statusCode) {

@ -104,7 +104,7 @@ class ProcedureService extends BaseService {
}, body: _procedureTempleteDetailsRequestModel.toJson());
}
Future getProcedure({int? mrn, int appointmentNo}) async {
Future getProcedure({int? mrn, required int appointmentNo}) async {
_getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(
patientMRN: mrn,
);

@ -83,7 +83,7 @@ class SOAPService extends LookupService {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = super.error+ "\n"+error;
super.error = super.error!+ "\n"+error;
}, body: postAllergyRequestModel.toJson());
}
@ -93,7 +93,7 @@ class SOAPService extends LookupService {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error =super.error + "\n"+error;
super.error =super.error! + "\n"+error;
}, body: postHistoriesRequestModel.toJson());
}
@ -155,7 +155,7 @@ class SOAPService extends LookupService {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = super.error +"\n"+error;
super.error = super.error! +"\n"+error;
}, body: patchHistoriesRequestModel.toJson());
}

@ -8,8 +8,8 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart';
class UcafService extends LookupService {
List<GetChiefComplaintResModel> patientChiefComplaintList;
List<VitalSignHistory> patientVitalSignsHistory;
late List<GetChiefComplaintResModel> patientChiefComplaintList;
late List<VitalSignHistory> patientVitalSignsHistory;
List<GetAssessmentResModel> patientAssessmentList = [];
List<OrderProcedure> orderProcedureList = [];
PrescriptionModel? prescriptionList;
@ -22,13 +22,13 @@ class UcafService extends LookupService {
body['EpisodeID'] = patient.episodeNo;
body['DoctorID'] = "";
patientChiefComplaintList = null;
patientChiefComplaintList = [];
await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) {
print("Success");
if (patientChiefComplaintList != null) {
patientChiefComplaintList.clear();
} else {
patientChiefComplaintList = new List();
patientChiefComplaintList = [];
}
response['List_ChiefComplaint']['entityList'].forEach((v) {
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
@ -50,14 +50,14 @@ class UcafService extends LookupService {
body['InOutPatientType'] = 2;
}
patientVitalSignsHistory = null;
patientVitalSignsHistory = [];
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) {
if (patientVitalSignsHistory != null) {
patientVitalSignsHistory.clear();
} else {
patientVitalSignsHistory = new List();
patientVitalSignsHistory = [];
}
if (response['List_DoctorPatientVitalSign'] != null) {
response['List_DoctorPatientVitalSign'].forEach((v) {
@ -86,14 +86,14 @@ class UcafService extends LookupService {
body['From'] = fromDate;
body['To'] = toDate;
patientVitalSignsHistory = null;
patientVitalSignsHistory = [];
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN_DATA,
onSuccess: (dynamic response, int statusCode) {
if (patientVitalSignsHistory != null) {
patientVitalSignsHistory.clear();
} else {
patientVitalSignsHistory = new List();
patientVitalSignsHistory = [];
}
if (response['VitalSignsHistory'] != null) {
response['VitalSignsHistory'].forEach((v) {

@ -13,10 +13,10 @@ class PendingOrderService extends BaseService {
List<AdmissionOrdersModel> get admissionOrderList => _admissionOrderList;
Future getPendingOrders(
{PendingOrderRequestModel pendingOrderRequestModel,
int patientId,
int admissionNo}) async {
pendingOrderRequestModel = PendingOrderRequestModel(
{
required int patientId,
required int admissionNo}) async {
PendingOrderRequestModel pendingOrderRequestModel = PendingOrderRequestModel(
patientID: patientId,
admissionNo: admissionNo,
patientTypeID: 1,
@ -40,10 +40,10 @@ class PendingOrderService extends BaseService {
}
Future getAdmissionOrders(
{AdmissionOrdersRequestModel admissionOrdersRequestModel,
int patientId,
int admissionNo}) async {
admissionOrdersRequestModel = AdmissionOrdersRequestModel(
{
required int patientId,
required int admissionNo}) async {
AdmissionOrdersRequestModel admissionOrdersRequestModel = AdmissionOrdersRequestModel(
patientID: patientId,
admissionNo: admissionNo,
patientTypeID: 1,

@ -235,7 +235,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
);
}
updateInCallPatient({PatiantInformtion patient, appointmentNo}) {
updateInCallPatient({required PatiantInformtion patient, appointmentNo}) {
_liveCarePatientServices.patientList.forEach((e) {
if (e.patientId == patient.patientId) {
e.episodeNo = 0;

@ -68,9 +68,9 @@ class PatientMedicalReportViewModel extends BaseViewModel {
}
}
Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async {
Future updateMedicalReport(PatiantInformtion patient, String htmlText, int? limitNumber, String? invoiceNumber) async {
setState(ViewState.Busy);
await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber);
await _service.updateMedicalReport(patient, htmlText, limitNumber!, invoiceNumber!);
if (_service.hasError) {
error = _service.error!;
await getMedicalReportList(patient);

@ -18,7 +18,7 @@ class PatientRegistrationViewModel extends BaseViewModel {
GetPatientInfoResponseModel get getPatientInfoResponseModel =>
_patientRegistrationService.getPatientInfoResponseModel;
CheckPatientForRegistrationModel checkPatientForRegistrationModel;
late CheckPatientForRegistrationModel checkPatientForRegistrationModel;
Future checkPatientForRegistration(
CheckPatientForRegistrationModel registrationModel) async {
@ -142,10 +142,10 @@ class PatientRegistrationViewModel extends BaseViewModel {
}
Future sendActivationCodeByOTPNotificationType(
{SendActivationCodeByOTPNotificationTypeForRegistrationModel
{required SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel,
int otpType,
PatientRegistrationViewModel user}) async {
required int otpType,
required PatientRegistrationViewModel user}) async {
setState(ViewState.BusyLocal);
print(checkPatientForRegistrationModel);
print(checkPatientForRegistrationModel);

@ -169,7 +169,7 @@ class PatientSearchViewModel extends BaseViewModel {
}
}
sortInPatient({bool isDes = false, bool isAllClinic, bool isMyInPatient}) {
sortInPatient({bool isDes = false, required bool isAllClinic, required bool isMyInPatient}) {
if (isMyInPatient
? myIinPatientList.length > 0
: isAllClinic
@ -232,7 +232,7 @@ class PatientSearchViewModel extends BaseViewModel {
InpatientClinicList.clear();
inPatientList.forEach((element) {
if (!InpatientClinicList.contains(element.clinicDescription)) {
InpatientClinicList.add(element.clinicDescription);
InpatientClinicList.add(element!.clinicDescription!);
}
});
}
@ -260,7 +260,7 @@ class PatientSearchViewModel extends BaseViewModel {
}
}
filterByHospital({int hospitalId}) {
filterByHospital({required int hospitalId}) {
filteredInPatientItems = [];
for (var i = 0; i < inPatientList.length; i++) {
if (inPatientList[i].projectId == hospitalId) {
@ -270,7 +270,7 @@ class PatientSearchViewModel extends BaseViewModel {
notifyListeners();
}
filterByClinic({String clinicName}) {
filterByClinic({required String clinicName}) {
filteredInPatientItems = [];
for (var i = 0; i < inPatientList.length; i++) {
if (inPatientList[i].clinicDescription == clinicName) {
@ -286,7 +286,7 @@ class PatientSearchViewModel extends BaseViewModel {
}
void filterSearchResults(String query,
{bool isAllClinic, bool isMyInPatient}) {
{required bool isAllClinic, required bool isMyInPatient}) {
var strExist = query.length > 0 ? true : false;
if (isMyInPatient) {
@ -298,13 +298,13 @@ class PatientSearchViewModel extends BaseViewModel {
filteredMyInPatientItems.clear();
for (var i = 0; i < localFilteredMyInPatientItems.length; i++) {
String firstName =
localFilteredMyInPatientItems[i].firstName.toUpperCase();
localFilteredMyInPatientItems[i].firstName!.toUpperCase();
String lastName =
localFilteredMyInPatientItems[i].lastName.toUpperCase();
localFilteredMyInPatientItems[i].lastName!.toUpperCase();
String mobile =
localFilteredMyInPatientItems[i].mobileNumber.toUpperCase();
localFilteredMyInPatientItems[i].mobileNumber!.toUpperCase();
String patientID =
localFilteredMyInPatientItems[i].patientId.toString();
localFilteredMyInPatientItems[i].patientId!.toString();
if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) ||
@ -351,11 +351,11 @@ class PatientSearchViewModel extends BaseViewModel {
filteredInPatientItems.clear();
for (var i = 0; i < localFilteredInPatientItems.length; i++) {
String firstName =
localFilteredInPatientItems[i].firstName.toUpperCase();
localFilteredInPatientItems[i].firstName!.toUpperCase();
String lastName =
localFilteredInPatientItems[i].lastName.toUpperCase();
localFilteredInPatientItems[i].lastName!.toUpperCase();
String mobile =
localFilteredInPatientItems[i].mobileNumber.toUpperCase();
localFilteredInPatientItems[i].mobileNumber!.toUpperCase();
String patientID =
localFilteredInPatientItems[i].patientId.toString();

@ -100,7 +100,7 @@ class SOAPViewModel extends BaseViewModel {
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList;
SubjectiveCallBack subjectiveCallBack;
late SubjectiveCallBack subjectiveCallBack;
setSubjectiveCallBack(SubjectiveCallBack callBack) {
this.subjectiveCallBack = callBack;
@ -110,7 +110,7 @@ class SOAPViewModel extends BaseViewModel {
subjectiveCallBack.nextFunction(model);
}
ObjectiveCallBack objectiveCallBack;
late ObjectiveCallBack objectiveCallBack;
setObjectiveCallBack(ObjectiveCallBack callBack) {
this.objectiveCallBack = callBack;
@ -120,7 +120,7 @@ class SOAPViewModel extends BaseViewModel {
objectiveCallBack.nextFunction(model);
}
AssessmentCallBack assessmentCallBack;
late AssessmentCallBack assessmentCallBack;
setAssessmentCallBack(AssessmentCallBack callBack) {
this.assessmentCallBack = callBack;
@ -130,7 +130,7 @@ class SOAPViewModel extends BaseViewModel {
assessmentCallBack.nextFunction(model);
}
PlanCallBack planCallBack;
late PlanCallBack planCallBack;
setPlanCallBack(PlanCallBack callBack) {
this.planCallBack = callBack;
@ -299,8 +299,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);
@ -350,7 +350,7 @@ class SOAPViewModel extends BaseViewModel {
GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel =
GetEpisodeForInpatientReqModel(
patientID: patient.patientId,
admissionNo: int.parse(patient.admissionNo),
admissionNo: int.parse(patient!.admissionNo!),
patientTypeID: 1);
await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel);
if (_SOAPService.hasError) {
@ -480,10 +480,9 @@ class SOAPViewModel extends BaseViewModel {
GetChiefComplaintReqModel getChiefComplaintReqModel =
GetChiefComplaintReqModel(
admissionNo:
patientInfo
.admissionNo !=
patientInfo!.admissionNo !=
null
? int.parse(patientInfo.admissionNo)
? int.parse(patientInfo!.admissionNo!)
: null,
patientMRN: patientInfo.patientMRN,
appointmentNo: patientInfo.appointmentNo != null
@ -644,7 +643,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);
@ -716,11 +715,11 @@ class SOAPViewModel extends BaseViewModel {
postSubjectServices(
{patientInfo,
String complaintsText,
String medicationText,
String illnessText,
List<MySelectedHistory> myHistoryList,
List<MySelectedAllergy> myAllergiesList}) async {
required String complaintsText,
required String medicationText,
required String illnessText,
required List<MySelectedHistory> myHistoryList,
required List<MySelectedAllergy> myAllergiesList}) async {
var services;
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
@ -774,9 +773,9 @@ class SOAPViewModel extends BaseViewModel {
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel(
{patientInfo,
String complaintsText,
String medicationText,
String illnessText}) {
required String complaintsText,
required String medicationText,
required String illnessText}) {
return new PostChiefComplaintRequestModel(
admissionNo: patientInfo.admissionNo != null
? int.parse(patientInfo.admissionNo)
@ -794,13 +793,13 @@ class SOAPViewModel extends BaseViewModel {
}
PostHistoriesRequestModel createPostHistoriesRequestModel(
{patientInfo, List<MySelectedHistory> myHistoryList}) {
{patientInfo, required List<MySelectedHistory> myHistoryList}) {
PostHistoriesRequestModel postHistoriesRequestModel =
new PostHistoriesRequestModel(doctorID: '');
myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM(
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo,
@ -822,7 +821,7 @@ class SOAPViewModel extends BaseViewModel {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(
ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
@ -831,9 +830,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));

@ -86,7 +86,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'];
@ -95,8 +95,8 @@ class AuthenticationViewModel extends BaseViewModel {
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;
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;
@ -133,7 +133,7 @@ class AuthenticationViewModel extends BaseViewModel {
iMEI: user!.iMEI,
facilityId: user!.projectID,
memberID: user!.doctorID,
loginDoctorID: int.parse(user.editedBy.toString()),
loginDoctorID: int.parse(user!.editedBy.toString()),
zipCode: user!.outSA == true ? '971' : '966',
mobileNumber: user!.mobile,
oTPSendType: authMethodType.getTypeIdService(),
@ -154,8 +154,8 @@ class AuthenticationViewModel extends BaseViewModel {
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 _authService.sendActivationCodeForDoctorApp(activationCodeModel);
@ -164,7 +164,7 @@ class AuthenticationViewModel extends BaseViewModel {
setState(ViewState.ErrorLocal);
} else {
await sharedPref.setString(TOKEN,
_authService.activationCodeForDoctorAppRes.logInTokenID);
_authService.activationCodeForDoctorAppRes.logInTokenID!);
setState(ViewState.Idle);
}
}
@ -178,12 +178,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,
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(),
facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user!.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken,
loginDoctorID:userInfo.userID!=null? int.parse(userInfo.userID):user.editedBy,// loggedUser.listMemberInformation[0].employeeID,
loginDoctorID:userInfo.userID!=null? int.parse(userInfo!.userID!):user!.editedBy,// loggedUser.listMemberInformation[0].employeeID,
isForSilentLogin:isSilentLogin,
generalid: "Cs2020@2016\$2958");
await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp);
@ -237,7 +237,7 @@ class AuthenticationViewModel extends BaseViewModel {
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
await sharedPref.setString(TOKEN,
sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);
sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!);
}
saveObjToString(String key, value) async {
@ -323,12 +323,12 @@ class AuthenticationViewModel extends BaseViewModel {
getDeviceInfoFromFirebase() async {
_firebaseMessaging.setAutoInitEnabled(true);
if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions();
_firebaseMessaging.requestPermission();
}
setState(ViewState.Busy);
var token = await _firebaseMessaging.getToken();
if (localToken == "") {
localToken = token;
localToken = token!;
await _authService.selectDeviceImei(localToken);
if (_authService.hasError) {
@ -340,9 +340,9 @@ class AuthenticationViewModel extends BaseViewModel {
sharedPref.setObj(
LAST_LOGIN_USER, _authService.dashboardItemsList[0]);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID,
user.vidaRefreshTokenID);
user!.vidaRefreshTokenID!);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID,
user.vidaAuthTokenID);
user!.vidaAuthTokenID!);
this.unverified = true;
}
setState(ViewState.Idle);

@ -81,7 +81,7 @@ List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList =>
// setState(ViewState.Idle);
}
Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async {
Future changeClinic(var clinicId, AuthenticationViewModel authProvider) async {
setState(ViewState.BusyLocal);
await getDoctorProfile();
ClinicModel clinicModel = ClinicModel(

@ -52,8 +52,8 @@ class DoctorReplayViewModel extends BaseViewModel {
transactionNo: model.transactionNo.toString(),
doctorResponse: response,
infoStatus: 6,
createdBy: this.doctorProfile.doctorID,
infoEnteredBy: this.doctorProfile.doctorID,
createdBy: this.doctorProfile!.doctorID!,
infoEnteredBy: this.doctorProfile!.doctorID!,
setupID: "010266");
setState(ViewState.BusyLocal);
await _doctorReplyService.createDoctorResponse(createDoctorResponseModel);

@ -158,7 +158,7 @@ class LabsViewModel extends BaseViewModel {
}
getPatientLabResultHistoryByDescription(
{PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async {
{required PatientLabOrders patientLabOrder, required String procedureDescription, required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _labsService.getPatientLabOrdersResultHistoryByDescription(
patientLabOrder: patientLabOrder, procedureDescription: procedureDescription, patient: patient);
@ -178,7 +178,7 @@ class LabsViewModel extends BaseViewModel {
DrAppToastMsg.showSuccesToast(mes);
}
Future getAllSpecialLabResult({int patientId}) async {
Future getAllSpecialLabResult({required int patientId}) async {
setState(ViewState.Busy);
await _labsService.getAllSpecialLabResult(mrn: patientId);
if (_labsService.hasError) {

@ -32,9 +32,9 @@ class UcafViewModel extends BaseViewModel {
List<OrderProcedure> get orderProcedures => _ucafService.orderProcedureList;
Function saveUCAFOnTap;
late Function saveUCAFOnTap;
String selectedLanguage;
late String selectedLanguage;
String heightCm = "0";
String weightKg = "0";
String bodyMax = "0";
@ -45,8 +45,8 @@ class UcafViewModel extends BaseViewModel {
resetDataInFirst({bool firstPage = true}) {
if(firstPage){
_ucafService.patientVitalSignsHistory = null;
_ucafService.patientChiefComplaintList = null;
_ucafService.patientVitalSignsHistory = [];
_ucafService.patientChiefComplaintList = [];
}
_ucafService.patientAssessmentList = [];
_ucafService.orderProcedureList = [];

@ -355,7 +355,7 @@ class PatientViewModel extends BaseViewModel {
GetDiabeticChartValuesRequestModel requestModel =
GetDiabeticChartValuesRequestModel(
patientID: patient.patientId,
admissionNo: int.parse(patient.admissionNo),
admissionNo: int.parse(patient!.admissionNo!),
patientTypeID: 1,
patientType: 1,
resultType: resultType,

@ -15,7 +15,7 @@ class PendingOrdersViewModel extends BaseViewModel {
List<AdmissionOrdersModel> get admissionOrderList =>
_pendingOrderService.admissionOrderList;
Future getPendingOrders({int patientId, int admissionNo}) async {
Future getPendingOrders({required int patientId, required int admissionNo}) async {
hasError = false;
setState(ViewState.Busy);
await _pendingOrderService.getPendingOrders(
@ -28,7 +28,7 @@ class PendingOrdersViewModel extends BaseViewModel {
}
}
Future getAdmissionOrders({int patientId, int admissionNo}) async {
Future getAdmissionOrders({required int patientId, required int admissionNo}) async {
hasError = false;
setState(ViewState.Busy);
await _pendingOrderService.getAdmissionOrders(

@ -60,13 +60,13 @@ class ProcedureViewModel extends BaseViewModel {
List<PatientLabOrdersList> _patientLabOrdersListClinic = [];
List<PatientLabOrdersList> _patientLabOrdersListHospital = [];
Future getProcedure({int? mrn, String? patientType, int appointmentNo}) async {
Future getProcedure({int? mrn, String? patientType, int? appointmentNo}) async {
hasError = false;
await getDoctorProfile();
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo);
await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo!);
if (_procedureService.hasError) {
error = _procedureService.error!;
if (patientType == "7")
@ -155,7 +155,7 @@ class ProcedureViewModel extends BaseViewModel {
error = _procedureService.error!;
setState(ViewState.ErrorLocal);
} else {
await getProcedure(mrn: mrn);
await getProcedure(mrn: mrn, appointmentNo: null);
setState(ViewState.Idle);
}
}

@ -15,7 +15,11 @@ class DischargeSummaryViewModel extends BaseViewModel {
_dischargeSummaryService.pendingDischargeSummaryList;
Future getPendingDischargeSummary({int patientId, int admissionNo, }) async {
List<GetDischargeSummaryResModel> get allDisChargeSummaryList =>
_dischargeSummaryService.allDischargeSummaryList;
Future getPendingDischargeSummary({required int patientId, required int admissionNo, }) async {
GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId );
hasError = false;
setState(ViewState.Busy);
@ -28,4 +32,19 @@ class DischargeSummaryViewModel extends BaseViewModel {
}
}
Future getAllDischargeSummary({int patientId, int admissionNo, }) async {
GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId );
hasError = false;
setState(ViewState.Busy);
await _dischargeSummaryService.getAllDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel);
if (_dischargeSummaryService.hasError) {
error = _dischargeSummaryService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}

@ -4,7 +4,7 @@ class GetChiefComplaintReqModel {
int? episodeId;
int? episodeID;
dynamic doctorID;
int admissionNo;
int? admissionNo;
GetChiefComplaintReqModel({this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo});

@ -2,7 +2,7 @@ class PostChiefComplaintRequestModel {
int? appointmentNo;
int? episodeID;
int? patientMRN;
int admissionNo;
int? admissionNo;
String? chiefComplaint;
String? hopi;
String? currentMedication;

File diff suppressed because it is too large Load Diff

@ -28,69 +28,73 @@ class GetDischargeSummaryResModel {
int editedBy;
String editedOn;
bool isPatientDied;
Null isMedicineApproved;
Null isOpenBillDischarge;
Null activatedDate;
Null activatedBy;
Null lAMA;
Null patientCodition;
Null others;
Null reconciliationInstruction;
dynamic isMedicineApproved;
dynamic isOpenBillDischarge;
dynamic activatedDate;
dynamic activatedBy;
dynamic lAMA;
dynamic patientCodition;
dynamic others;
dynamic reconciliationInstruction;
String dischargeInstructions;
String reason;
Null dischargeDisposition;
Null hospitalID;
dynamic dischargeDisposition;
dynamic hospitalID;
String createdByName;
Null createdByNameN;
dynamic createdByNameN;
String editedByName;
Null editedByNameN;
dynamic editedByNameN;
String clinicName;
String projectName;
GetDischargeSummaryResModel(
{this.setupID,
this.projectID,
this.dischargeNo,
this.dischargeDate,
this.admissionNo,
this.assessmentNo,
this.patientType,
this.patientID,
this.clinicID,
this.doctorID,
this.finalDiagnosis,
this.persentation,
this.pastHistory,
this.planOfCare,
this.investigations,
this.followupPlan,
this.conditionOnDischarge,
this.significantFindings,
this.planedProcedure,
this.daysStayed,
this.remarks,
this.eRCare,
this.status,
this.isActive,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn,
this.isPatientDied,
this.isMedicineApproved,
this.isOpenBillDischarge,
this.activatedDate,
this.activatedBy,
this.lAMA,
this.patientCodition,
this.others,
this.reconciliationInstruction,
this.dischargeInstructions,
this.reason,
this.dischargeDisposition,
this.hospitalID,
this.createdByName,
this.createdByNameN,
this.editedByName,
this.editedByNameN});
this.projectID,
this.dischargeNo,
this.dischargeDate,
this.admissionNo,
this.assessmentNo,
this.patientType,
this.patientID,
this.clinicID,
this.doctorID,
this.finalDiagnosis,
this.persentation,
this.pastHistory,
this.planOfCare,
this.investigations,
this.followupPlan,
this.conditionOnDischarge,
this.significantFindings,
this.planedProcedure,
this.daysStayed,
this.remarks,
this.eRCare,
this.status,
this.isActive,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn,
this.isPatientDied,
this.isMedicineApproved,
this.isOpenBillDischarge,
this.activatedDate,
this.activatedBy,
this.lAMA,
this.patientCodition,
this.others,
this.reconciliationInstruction,
this.dischargeInstructions,
this.reason,
this.dischargeDisposition,
this.hospitalID,
this.createdByName,
this.createdByNameN,
this.editedByName,
this.editedByNameN,
this.clinicName,
this.projectName});
GetDischargeSummaryResModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
@ -138,6 +142,8 @@ class GetDischargeSummaryResModel {
createdByNameN = json['CreatedByNameN'];
editedByName = json['EditedByName'];
editedByNameN = json['EditedByNameN'];
clinicName = json['ClinicDescription'];
projectName = json['ProjectName'];
}
Map<String, dynamic> toJson() {
@ -187,6 +193,9 @@ class GetDischargeSummaryResModel {
data['CreatedByNameN'] = this.createdByNameN;
data['EditedByName'] = this.editedByName;
data['EditedByNameN'] = this.editedByNameN;
data['ClinicDescription'] = this.clinicName;
data['ProjectName'] = this.projectName;
return data;
}
}

@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
@ -25,6 +26,7 @@ import '../../widgets/auth/verification_methods_list.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers();
///TODO Elham* check if this still in user or not
class VerificationMethodsScreen extends StatefulWidget {
final password;
@ -339,7 +341,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
SecondaryButton(
label: TranslationBase
.of(context)
.useAnotherAccount,
.useAnotherAccount??'',
color: Color(0xFFD02127),
//fontWeight: FontWeight.w700,
onTap: () {
@ -387,7 +389,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Helpers.showErrorToast(authenticationViewModel.error);
} else {
await sharedPref.setString(TOKEN,
authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID);
authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!);
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType,isSilentLogin: true);
@ -470,8 +472,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
}
}
checkActivationCode({String value,bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value,isSilentLogin: isSilentLogin);
checkActivationCode({String? value,bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value!,isSilentLogin: isSilentLogin);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context);
Helpers.showErrorToast(authenticationViewModel.error);

@ -12,9 +12,8 @@ import 'package:flutter/material.dart';
import 'doctor_repaly_chat.dart';
class AllDoctorQuestions extends StatefulWidget {
final Function changeCurrentTab;
const AllDoctorQuestions({Key? key, this.changeCurrentTab}) : super(key: key);
const AllDoctorQuestions({Key? key}) : super(key: key);
@override
_AllDoctorQuestionsState createState() => _AllDoctorQuestionsState();
@ -31,10 +30,9 @@ class _AllDoctorQuestionsState extends State<AllDoctorQuestions> {
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2,
isShowAppBar: false,
body: model.listDoctorWorkingHoursTable.isEmpty
?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem!)
: Column(
children: [
Expanded(
@ -82,7 +80,7 @@ class _AllDoctorQuestionsState extends State<AllDoctorQuestions> {
});
model.getDoctorReply(pageIndex: pageIndex);
}
return;
return false;
},
),
),

@ -7,11 +7,11 @@ import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -24,7 +24,7 @@ class DoctorReplayChat extends StatefulWidget {
final DoctorReplayViewModel previousModel;
bool showMsgBox = false;
DoctorReplayChat(
{Key? key, this.reply, this.previousModel,
{Key? key, required this.reply, required this.previousModel,
});
@override
@ -37,8 +37,8 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
@override
Widget build(BuildContext context) {
if(widget.reply.doctorResponse.isNotEmpty){
msgController.text = widget.reply.doctorResponse;
if(widget.reply.doctorResponse!.isNotEmpty){
msgController.text = widget.reply.doctorResponse!;
} else {
widget.showMsgBox = true;
@ -172,7 +172,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
margin: EdgeInsets.symmetric(horizontal: 0),
child: InkWell(
onTap: () {
launch("tel://" +widget.reply.mobileNumber);
launch("tel://" +widget.reply.mobileNumber!);
},
child: Icon(
Icons.phone,
@ -194,7 +194,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
),
AppText(
widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()),
widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!)):AppDateUtils.getHour(DateTime.now()),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
fontFamily: 'Poppins',
color: Colors.white,
@ -236,7 +236,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
SizedBox(height: 30,),
SizedBox(height: 30,),
if(widget.reply.doctorResponse != null && widget.reply.doctorResponse.isNotEmpty)
if(widget.reply.doctorResponse != null && widget.reply.doctorResponse!.isNotEmpty)
Align(
alignment: Alignment.centerRight,
child: Container(
@ -269,7 +269,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
width: 50,
height: 50,
child: Image.asset(
widget.previousModel.doctorProfile.gender == 0
widget.previousModel.doctorProfile!.gender == 0
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
@ -280,7 +280,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: AppText(
widget.previousModel.doctorProfile.doctorName,
widget.previousModel.doctorProfile!.doctorName,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontFamily: 'Poppins',
color: Color(0xFF2B353E),

@ -28,7 +28,7 @@ import 'not_replaied_Doctor_Questions.dart';
class DoctorReplyScreen extends StatefulWidget {
final Function changeCurrentTab;
const DoctorReplyScreen({Key? key, this.changeCurrentTab}) : super(key: key);
const DoctorReplyScreen({Key? key, required this.changeCurrentTab}) : super(key: key);
@override
_DoctorReplyScreenState createState() => _DoctorReplyScreenState();
@ -36,7 +36,7 @@ class DoctorReplyScreen extends StatefulWidget {
class _DoctorReplyScreenState extends State<DoctorReplyScreen>
with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
int _activeTab = 0;
int pageIndex = 1;
@ -69,7 +69,7 @@ class _DoctorReplyScreenState extends State<DoctorReplyScreen>
return false;
},
child: AppScaffold(
appBarTitle: TranslationBase.of(context).replay2,
appBarTitle: TranslationBase.of(context).replay2!,
isShowAppBar: false,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -109,7 +109,7 @@ class _DoctorReplyScreenState extends State<DoctorReplyScreen>
tabWidget(
screenSize,
_activeTab == 1,
TranslationBase.of(context).all,
TranslationBase.of(context).all!,
),
],
),

@ -188,10 +188,10 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
isCopyable:false,
),
CustomRow(
label: TranslationBase.of(context).age + " : ",
label: TranslationBase.of(context).age! + " : ",
isCopyable:false,
value:
"${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}",
"${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}",
),
SizedBox(
height: 8,
@ -213,7 +213,7 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(context).requestType +
TranslationBase.of(context).requestType! +
": ",
style: TextStyle(
fontSize: SizeConfig

@ -14,7 +14,7 @@ import 'doctor_repaly_chat.dart';
class NotRepliedDoctorQuestions extends StatefulWidget {
final Function changeCurrentTab;
const NotRepliedDoctorQuestions({Key? key, this.changeCurrentTab})
const NotRepliedDoctorQuestions({Key? key, required this.changeCurrentTab})
: super(key: key);
@override
@ -33,10 +33,10 @@ class _NotRepliedDoctorQuestionsState extends State<NotRepliedDoctorQuestions> {
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2,
appBarTitle: TranslationBase.of(context).replay2!,
isShowAppBar: false,
body: model.listDoctorNotRepliedQuestions.isEmpty
? ErrorMessage(error: TranslationBase.of(context).noItem)
? ErrorMessage(error: TranslationBase.of(context).noItem!)
: Column(
children: [
Expanded(
@ -91,7 +91,7 @@ class _NotRepliedDoctorQuestionsState extends State<NotRepliedDoctorQuestions> {
});
model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true);
}
return;
return false;
},
),
),

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class HomePatientCard extends StatelessWidget {
final Color backgroundColor;
final IconData cardIcon;
final String cardIconImage;
final String? cardIconImage;
final Color backgroundIconColor;
final String text;
final Color textColor;
@ -17,7 +17,7 @@ class HomePatientCard extends StatelessWidget {
required this.backgroundColor,
required this.backgroundIconColor,
required this.cardIcon,
required this.cardIconImage,
this.cardIconImage,
required this.text,
required this.textColor,
required this.onTap,
@ -75,7 +75,7 @@ class HomePatientCard extends StatelessWidget {
color: textColor,
)
: Image.asset(
cardIconImage,
cardIconImage!,
height: iconSize,
width: iconSize,
),

@ -21,6 +21,7 @@ import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterPat
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
@ -29,6 +30,7 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:sticky_headers/sticky_headers/widget.dart';
import '../../routes.dart';
import 'home_screen_header.dart';
@ -51,7 +53,7 @@ class _HomeScreenState extends State<HomeScreen> {
bool isExpanded = false;
bool isInpatient = false;
int sliderActiveIndex = 0;
String? clinicId;
var clinicId;
late AuthenticationViewModel authenticationViewModel;
int colorIndex = 0;
final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
@ -328,22 +330,6 @@ class _HomeScreenState extends State<HomeScreen> {
DashboardViewModel model, projectsProvider) {
colorIndex = 0;
// List<Color> backgroundColors = List(3);
// backgroundColors[0] = Color(0xffD02127);
// backgroundColors[1] = Colors.grey[300];
// backgroundColors[2] = Color(0xff2B353E);
// List<Color> backgroundIconColors = List(3);
// backgroundIconColors[0] = Colors.white12;
// backgroundIconColors[1] = Colors.white38;
// backgroundIconColors[2] = Colors.white10;
// List<Color> textColors = List(3);
// textColors[0] = Colors.white;
// textColors[1] = Color(0xFF353E47);
// textColors[2] = Colors.white;
//
// List<HomePatientCard> patientCards = [];
//
List<Color> backgroundColors = [];
backgroundColors.add(Color(0xffD02127));
backgroundColors.add(Colors.grey[300]!);
@ -407,7 +393,7 @@ class _HomeScreenState extends State<HomeScreen> {
context,
FadePage(
page: InPatientScreen(
specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!),
specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!)!,
),
),
);
@ -421,7 +407,7 @@ class _HomeScreenState extends State<HomeScreen> {
//TODO Elham* match the of the icon
cardIcon: DoctorApp.arrival_patients,
textColor: textColors[colorIndex],
text: TranslationBase.of(context).registerNewPatient,
text: TranslationBase.of(context).registerNewPatient!,
onTap: () {
Navigator.push(
context,

@ -189,19 +189,20 @@ class _EndCallScreenState extends State<EndCallScreen> {
.of(context)
.scaffoldBackgroundColor,
isShowAppBar: true,
appBar: PatientProfileAppBar(patientProfileAppBarModel :PatientProfileAppBarModel(patient: patient!,isInpatient: isInpatient,
isDischargedPatient: isDischargedPatient,
height: (patient!.patientStatusType != null && patient!.patientStatusType == 43)
? 210
: isDischargedPatient
? 240
: 0,
),
appBar: PatientProfileAppBar(
patient,
onPressed: (){
Navigator.pop(context);
},
),
isInpatient: isInpatient,
height: (patient!.patientStatusType != null &&
patient!.patientStatusType == 43)
? 210
: isDischargedPatient
? 240
: 0,
isDischargedPatient: isDischargedPatient),
body: Container(
height: !isSearchAndOut
? isDischargedPatient

@ -38,7 +38,7 @@ class AddPatientSickLeaveScreen extends StatefulWidget {
AddPatientSickLeaveScreen(
{this.appointmentNo,
this.patientMRN,
this.patient, this.previousModel});
required this.patient, required this.previousModel});
@override
_AddPatientSickLeaveScreenState createState() =>
@ -52,7 +52,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
TextEditingController _clinicController = new TextEditingController();
TextEditingController _doctorController = new TextEditingController();
TextEditingController _remarkController = new TextEditingController();
DateTime currentDate;
late DateTime currentDate;
AddSickLeaveRequest addSickLeave = AddSickLeaveRequest();
bool isFormSubmitted = false;
@ -85,8 +85,8 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
return BaseView<SickLeaveViewModel>(
onModelReady: (model) async {
await model.getDoctorProfile();
_clinicController.text = model.doctorProfile.clinicDescription;
_doctorController.text = model.doctorProfile.doctorName;
_clinicController.text = model.doctorProfile!.clinicDescription!;
_doctorController.text = model.doctorProfile!.doctorName!;
await model.preSickLeaveStatistics(
widget.appointmentNo, widget.patientMRN);
},
@ -97,7 +97,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
child: AppScaffold(
baseViewModel: model,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addSickLeave,
title: TranslationBase.of(context).addSickLeave!,
),
isShowAppBar: true,
body: Center(
@ -112,9 +112,9 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
),
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
hintText: TranslationBase.of(context).sickLeave +
hintText: TranslationBase.of(context).sickLeave! +
' ' +
TranslationBase.of(context).days,
TranslationBase.of(context).days!,
maxLines: 1,
minLines: 1,
dropDownColor: Colors.white,
@ -154,7 +154,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
minLines: 1,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(Icons.calendar_today)),
icon: Icon(Icons.calendar_today), onPressed: () { },),
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))

@ -23,13 +23,13 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PatientSickLeaveScreen extends StatelessWidget {
PatiantInformtion patient;
late PatiantInformtion patient;
@override
Widget build(BuildContext context) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<SickLeaveViewModel>(
@ -84,7 +84,7 @@ class PatientSickLeaveScreen extends StatelessWidget {
),
),
AddNewOrder(
label: TranslationBase.of(context).noSickLeaveApplied,
label: TranslationBase.of(context).noSickLeaveApplied!,
onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Add Sick Leave Screen"
@ -193,7 +193,7 @@ class PatientSickLeaveScreen extends StatelessWidget {
CustomRow(
label: TranslationBase.of(
context)
.startDate +
.startDate! +
' ' ??
"",
labelSize: SizeConfig
@ -217,7 +217,7 @@ class PatientSickLeaveScreen extends StatelessWidget {
CustomRow(
label: TranslationBase.of(
context)
.endDate +
.endDate! +
' ' ??
"",
labelSize: SizeConfig
@ -269,7 +269,7 @@ class PatientSickLeaveScreen extends StatelessWidget {
)
: patient.patientStatusType != 43
? ErrorMessage(
error: TranslationBase.of(context).noSickLeave,
error: TranslationBase.of(context).noSickLeave!,
)
: SizedBox(),
SizedBox(

@ -10,8 +10,8 @@ import 'package:provider/provider.dart';
class InPatientHeader extends StatelessWidget with PreferredSizeWidget {
InPatientHeader(
{this.model,
this.specialClinic,
{required this.model,
required this.specialClinic,
this.activeTab,
this.selectedMapId,
this.onChangeFunc})

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
class NoData extends StatelessWidget {
const NoData({
Key key,
Key? key,
}) : super(key: key);
@override
@ -13,7 +13,7 @@ class NoData extends StatelessWidget {
child: SingleChildScrollView(
child: Container(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable)),
error: TranslationBase.of(context).noDataAvailable!)),
),
);
}

@ -25,12 +25,12 @@ class InPatientListPage extends StatefulWidget {
final Function onChangeValue;
InPatientListPage(
{this.isMyInPatient,
this.patientSearchViewModel,
this.selectedClinicName,
this.onChangeValue,
this.isAllClinic,
this.showBottomSheet});
{required this.isMyInPatient,
required this.patientSearchViewModel,
required this.selectedClinicName,
required this.onChangeValue,
required this.isAllClinic,
required this.showBottomSheet});
@override
_InPatientListPageState createState() => _InPatientListPageState();
@ -279,7 +279,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
.patientSearchViewModel
.InpatientClinicList[index]);
widget.patientSearchViewModel
.filterByClinic(clinicName: value);
.filterByClinic(clinicName: value.toString());
});
},
activeColor: Colors.red,

@ -24,8 +24,8 @@ class InPatientScreen extends StatefulWidget {
bool isAllClinic = true;
bool showBottomSheet = false;
String selectedClinicName;
InPatientScreen({Key? key, this.specialClinic});
late String selectedClinicName;
InPatientScreen({Key? key, required this.specialClinic});
@override
_InPatientScreenState createState() => _InPatientScreenState();
@ -33,9 +33,9 @@ class InPatientScreen extends StatefulWidget {
class _InPatientScreenState extends State<InPatientScreen>
with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
int _activeTab = 0;
int selectedMapId;
late int selectedMapId;
@override
void initState() {
@ -79,7 +79,7 @@ class _InPatientScreenState extends State<InPatientScreen>
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: InPatientHeader(
appBar: InPatientHeader(
model: model,
selectedMapId: selectedMapId,
specialClinic: widget.specialClinic,
@ -136,13 +136,13 @@ class _InPatientScreenState extends State<InPatientScreen>
unselectedLabelColor: Colors.grey[800],
tabs: [
tabWidget(screenSize, _activeTab == 0,
TranslationBase.of(context).inPatientAll,
TranslationBase.of(context).inPatientAll!,
counter: model.inPatientList.length),
tabWidget(screenSize, _activeTab == 1,
TranslationBase.of(context).myInPatientTitle,
TranslationBase.of(context).myInPatientTitle!,
counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2,
TranslationBase.of(context).discharged),
TranslationBase.of(context).discharged!),
],
),
),

@ -7,10 +7,10 @@ import 'NoData.dart';
class ListOfAllInPatient extends StatelessWidget {
const ListOfAllInPatient({
Key key,
@required this.isAllClinic,
@required this.hasQuery,
this.patientSearchViewModel,
Key? key,
required this.isAllClinic,
required this.hasQuery,
required this.patientSearchViewModel,
}) : super(key: key);
final bool isAllClinic;
@ -42,7 +42,7 @@ class ListOfAllInPatient extends StatelessWidget {
isInpatient: true,
isMyPatient: patientSearchViewModel
.filteredInPatientItems[index].doctorId ==
patientSearchViewModel.doctorProfile.doctorID,
patientSearchViewModel.doctorProfile!.doctorID,
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
@ -61,7 +61,7 @@ class ListOfAllInPatient extends StatelessWidget {
"arrivalType": "1",
"isMyPatient": patientSearchViewModel
.filteredInPatientItems[index].doctorId ==
patientSearchViewModel.doctorProfile.doctorID,
patientSearchViewModel.doctorProfile!.doctorID,
});
},
);
@ -77,7 +77,7 @@ class ListOfAllInPatient extends StatelessWidget {
patientSearchViewModel.removeOnFilteredList();
}
}
return;
return false;
},
),
),

@ -6,10 +6,10 @@ import '../../../routes.dart';
import 'NoData.dart';
class ListOfMyInpatient extends StatelessWidget {
const ListOfMyInpatient({
Key key,
@required this.isAllClinic,
@required this.hasQuery,
this.patientSearchViewModel,
Key? key,
required this.isAllClinic,
required this.hasQuery,
required this.patientSearchViewModel,
}) : super(key: key);
final bool isAllClinic;
@ -56,9 +56,6 @@ class ListOfMyInpatient extends StatelessWidget {
},
);
}),
onNotification: (t) {
return;
},
),
),
);

@ -53,7 +53,7 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];

@ -23,22 +23,22 @@ class AdmissionOrdersScreen extends StatefulWidget {
class _AdmissionOrdersScreenState extends State<AdmissionOrdersScreen> {
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel;
late AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PendingOrdersViewModel>(
onModelReady: (model) => model.getAdmissionOrders(
admissionNo: 2014005178, patientId: patient.patientMRN),
admissionNo: 2014005178, patientId: patient!.patientMRN!),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
@ -50,7 +50,7 @@ class _AdmissionOrdersScreenState extends State<AdmissionOrdersScreen> {
body: model.admissionOrderList == null ||
model.admissionOrderList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).noDataAvailable)
error: TranslationBase.of(context).noDataAvailable!)
: Container(
color: Colors.grey[200],
child: Column(
@ -257,21 +257,6 @@ class _AdmissionOrdersScreenState extends State<AdmissionOrdersScreen> {
SizedBox(
height: 8,
),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.start,
// children: [
// Expanded(
// child: AppText(
// model
// .admissionOrderList[
// index]
// .notes,
// fontSize: 10,
// isCopyable: true,
// ),
// ),
// ])
],
),
SizedBox(

@ -26,7 +26,7 @@ import 'diabetic_details_blood_pressurewideget.dart';
class DiabeticChart extends StatefulWidget {
DiabeticChart({
Key key,
Key? key,
}) : super(key: key);
@override
@ -45,11 +45,11 @@ class _DiabeticChartState extends State<DiabeticChart> {
DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4)
];
DiabeticType selectedDiabeticType;
late DiabeticType selectedDiabeticType;
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
ProjectViewModel projectsProvider = Provider.of(context);
return BaseView<PatientViewModel>(
@ -199,7 +199,7 @@ class _DiabeticChartState extends State<DiabeticChart> {
],
),
)
: ErrorMessage(error: TranslationBase.of(context).noItem),
: ErrorMessage(error: TranslationBase.of(context).noItem!),
],
),
)),

@ -13,7 +13,7 @@ class DiabeticDetails extends StatefulWidget {
final List<GetDiabeticChartValuesResponseModel> diabeticDetailsList;
DiabeticDetails(
{Key? key, this.diabeticDetailsList,});
{Key? key, required this.diabeticDetailsList,});
@override
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
@ -70,7 +70,7 @@ class _VitalSignDetailsWidgetState extends State<DiabeticDetails> {
),
Table(
border: TableBorder(
horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]),
horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!),
),
children: fullData(projectViewModel),
),

@ -12,7 +12,7 @@ class LineChartForDiabetic extends StatelessWidget {
final bool isOX;
LineChartForDiabetic(
{this.title, this.timeSeries1, this.indexes, this.isOX= false});
{required this.title, required this.timeSeries1, required this.indexes, this.isOX= false});
List<int> xAxixs = [];
List<double> yAxixs = [];
@ -93,7 +93,7 @@ class LineChartForDiabetic extends StatelessWidget {
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
getTextStyles: (value) => TextStyle(
color: Colors.black,
fontSize: 10,
),

@ -39,20 +39,20 @@ class DiagnosisScreen extends StatefulWidget {
class _ProgressNoteState extends State<DiagnosisScreen> {
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
late AuthenticationViewModel authenticationViewModel;
late ProjectViewModel projectViewModel;
getDiagnosisForInPatient(BuildContext context, PatientViewModel model,
{bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
print(type);
GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel =
GetDiagnosisForInPatientRequestModel(
admissionNo: int.parse(patient.admissionNo),
patientTypeID: patient.patientType,
admissionNo: int.parse(patient!.admissionNo!),
patientTypeID: patient!.patientType!,
patientID: patient.patientId, setupID: "010266");
model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel);
}
@ -61,7 +61,7 @@ class _ProgressNoteState extends State<DiagnosisScreen> {
Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
@ -77,7 +77,7 @@ class _ProgressNoteState extends State<DiagnosisScreen> {
body: model.diagnosisForInPatientList == null ||
model.diagnosisForInPatientList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).noItem)
error: TranslationBase.of(context).noItem!)
: Container(
color: Colors.grey[200],
child: Column(
@ -209,7 +209,7 @@ class _ProgressNoteState extends State<DiagnosisScreen> {
AppText(
TranslationBase.of(
context)
.icd + " : ",
.icd! + " : ",
fontSize: 12,
),
Expanded(

@ -1,66 +1,91 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.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:flutter/material.dart';
import 'discharge_Summary_widget.dart';
class AllDischargeSummary extends StatefulWidget {
final Function changeCurrentTab;
final PatiantInformtion patient;
const AllDischargeSummary({Key? key, this.changeCurrentTab}) : super(key: key);
const AllDischargeSummary({ required this.patient});
@override
_AllDischargeSummaryState createState() => _AllDischargeSummaryState();
}
class _AllDischargeSummaryState extends State<AllDischargeSummary> {
int pageIndex = 1;
@override
Widget build(BuildContext context) {
return BaseView<DischargeSummaryViewModel>(
onModelReady: (model) {
model.getPendingDischargeSummary();
model.getAllDischargeSummary(
patientId: widget.patient.patientId,
admissionNo: int.parse(widget.patient.admissionNo!),
);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: model.pendingDischargeSummaryList.isEmpty
?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
: Column(
children: [
Expanded(
child: Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: ListView.builder(
scrollDirection: Axis.vertical,
itemCount: model.pendingDischargeSummaryList.length,
shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) {
return Column(
children: [
InkWell(
child: DischargeSummaryWidget(
dischargeSummary: model
.pendingDischargeSummaryList[index]),
),
],
);
}),
),
),
],
),
body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
model.allDisChargeSummaryList.isEmpty
? ErrorMessage(
error: TranslationBase.of(context).noDataAvailable!)
: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
AppText(
TranslationBase.of(context).discharge,
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).summary,
fontSize: 25.0,
fontWeight: FontWeight.w700,
),
],
),
],
),
),
Expanded(
child: Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: ListView.builder(
scrollDirection: Axis.vertical,
itemCount: model.allDisChargeSummaryList.length,
shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) {
return Column(
children: [
InkWell(
child: DischargeSummaryWidget(
dischargeSummary: model
.allDisChargeSummaryList[index]),
),
],
);
}),
),
),
],
),
),
);
}

@ -1,52 +1,78 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
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/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class DischargeSummaryWidget extends StatefulWidget {
final GetDischargeSummaryResModel dischargeSummary;
bool isShowMore = false;
DischargeSummaryWidget({Key? key, this.dischargeSummary});
DischargeSummaryWidget({Key? key, required this.dischargeSummary});
@override
_DischargeSummaryWidgetState createState() => _DischargeSummaryWidgetState();
}
class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
bool isCardExpanded = false;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
child: CardWithBgWidget(
bgColor:Colors.transparent,
hasBorder: false,
widget: Container(
child: InkWell(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
return Column(
children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200]!, width: 0.5),
),
child: Padding(
padding: EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
AppDateUtils.getDateTimeFromServerFormat(
CustomRow(
label: TranslationBase.of(context).doctorName! + ": ",
value:
widget.dischargeSummary.createdByName.toString() ??
"".toString(),
isCopyable: false,
),
CustomRow(
label: TranslationBase.of(context).branch! + ": ",
value: widget.dischargeSummary.projectName.toString() ??
"".toString(),
isCopyable: false,
),
CustomRow(
label: TranslationBase.of(context).clinicName! + ": ",
value: widget.dischargeSummary.clinicName.toString() ??
"".toString(),
isCopyable: false,
),
CustomRow(
label: TranslationBase.of(context).dischargeDate! + ": ",
value: AppDateUtils.getDateTimeFromServerFormat(
widget.dischargeSummary.createdOn)
.day
.toString() +
@ -62,61 +88,149 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
widget.dischargeSummary.createdOn)
.year
.toString(),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
isCopyable: false,
),
AppText(
AppDateUtils.getDateTimeFromServerFormat(
widget.dischargeSummary.createdOn)
.hour
.toString() +
":" +
AppDateUtils.getDateTimeFromServerFormat(
widget.dischargeSummary.createdOn)
.minute
.toString(),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
InkWell(
onTap: () {
setState(() {
isCardExpanded = !isCardExpanded;
});
},
child: Icon(isCardExpanded
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
],
),
],
),
SizedBox(
height: 20,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
bodyWidget: Row(
children: [
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// SizedBox(height: 10,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomRow(
label: TranslationBase.of(context).fileNumber,
value: widget.dischargeSummary.patientID.toString(),
isCopyable:false,
),
SizedBox(
height: 8,
),
SizedBox(
height: 15.0,
),
AppText("More Details"),
SizedBox(
height: 15.0,
),
Container(
width: MediaQuery.of(context).size.width * 0.5,
child: RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
text: new TextSpan(
style: new TextStyle(
fontSize: 1.3 * SizeConfig.textMultiplier,
color: Color(0xFF575757)),
children: <TextSpan>[
new TextSpan(
text: "Past History" + ": ",
style: TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
2.8,
color: Color(0xFF575757),
//TranslationBase.of(context).doctorResponse + " : ",
)),
new TextSpan(
text: Helpers.parseHtmlString(
widget.dischargeSummary.pastHistory),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
)),
],
),
],
),
),
SizedBox(
height: 5.0,
),
Container(
width: MediaQuery.of(context).size.width * 0.5,
child: RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
text: new TextSpan(
style: new TextStyle(
fontSize: 1.3 * SizeConfig.textMultiplier,
color: Color(0xFF575757)),
children: <TextSpan>[
new TextSpan(
text: "Investigations" + ": ",
style: TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
2.8,
color: Color(0xFF575757),
//TranslationBase.of(context).doctorResponse + " : ",
)),
new TextSpan(
text: Helpers.parseHtmlString(
widget.dischargeSummary.investigations ??
""),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
)),
],
),
),
),
SizedBox(
height: 5.0,
),
Container(
width: MediaQuery.of(context).size.width * 0.5,
child: RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
text: new TextSpan(
style: new TextStyle(
fontSize: 1.3 * SizeConfig.textMultiplier,
color: Color(0xFF575757)),
children: <TextSpan>[
new TextSpan(
text: "Condition On Discharge" + ": ",
style: TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
2.8,
color: Color(0xFF575757),
//TranslationBase.of(context).doctorResponse + " : ",
)),
new TextSpan(
text: Helpers.parseHtmlString(widget
.dischargeSummary.conditionOnDischarge),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
)),
],
),
),
),
SizedBox(
height: 5.0,
),
Container(
width: MediaQuery.of(context).size.width * 0.5,
child: RichText(
@ -128,9 +242,7 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
color: Color(0xFF575757)),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(context).requestType +
": ",
text: "Planed Procedure" + ": ",
style: TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
@ -139,8 +251,8 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
//TranslationBase.of(context).doctorResponse + " : ",
)),
new TextSpan(
text:
"${widget.dischargeSummary.dischargeInstructions}",
text: Helpers.parseHtmlString(
widget.dischargeSummary.planedProcedure),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig
@ -157,15 +269,11 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
)
],
),
// Container(
// alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight,
// child: Icon(FontAwesomeIcons.arrowRight,
// size: 20, color: Colors.black),)
],
isExpand: isCardExpanded,
),
),
// onTap: onTap,
)),
),
),
],
);
}
}

@ -1,18 +1,9 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_repaly_chat.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -21,9 +12,9 @@ import 'all_discharge_summary.dart';
import 'pending_discharge_summary.dart';
class DischargeSummaryPage extends StatefulWidget {
final Function changeCurrentTab;
const DischargeSummaryPage({Key? key, this.changeCurrentTab}) : super(key: key);
const DischargeSummaryPage({Key? key, })
: super(key: key);
@override
_DoctorReplyScreenState createState() => _DoctorReplyScreenState();
@ -31,7 +22,7 @@ class DischargeSummaryPage extends StatefulWidget {
class _DoctorReplyScreenState extends State<DischargeSummaryPage>
with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
int _activeTab = 0;
int pageIndex = 1;
@ -57,16 +48,15 @@ class _DoctorReplyScreenState extends State<DischargeSummaryPage>
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
return WillPopScope(
onWillPop: () async {
widget.changeCurrentTab();
return false;
},
child: AppScaffold(
appBarTitle: TranslationBase.of(context).replay2,
appBarTitle: TranslationBase.of(context).replay2!,
isShowAppBar: true,
// appBarTitle: TranslationBase.of(context).progressNote,
appBar: PatientProfileAppBar(
@ -111,7 +101,7 @@ class _DoctorReplyScreenState extends State<DischargeSummaryPage>
tabWidget(
screenSize,
_activeTab == 1,
TranslationBase.of(context).all,
TranslationBase.of(context).all!,
),
],
),
@ -125,8 +115,10 @@ class _DoctorReplyScreenState extends State<DischargeSummaryPage>
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [
PendingDischargeSummary(patient:patient ,),
AllDischargeSummary(),
PendingDischargeSummary(
patient: patient,
),
AllDischargeSummary(patient: patient),
],
),
),

@ -1,23 +1,17 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.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:flutter/material.dart';
import 'discharge_Summary_widget.dart';
class PendingDischargeSummary extends StatefulWidget {
final Function changeCurrentTab;
final PatiantInformtion patient;
const PendingDischargeSummary({Key? key, this.changeCurrentTab, this.patient})
const PendingDischargeSummary({Key? key, required this.patient})
: super(key: key);
@override
@ -33,9 +27,8 @@ class _PendingDischargeSummaryState extends State<PendingDischargeSummary> {
return BaseView<DischargeSummaryViewModel>(
onModelReady: (model) {
model.getPendingDischargeSummary(
patientId: widget.patient.patientId,
admissionNo: int.parse(widget.patient.admissionNo),
patientId: widget.patient.patientId,
admissionNo: int.parse(widget.patient.admissionNo!),
);
},
builder: (_, model, w) => AppScaffold(
@ -44,9 +37,35 @@ class _PendingDischargeSummaryState extends State<PendingDischargeSummary> {
body: model.pendingDischargeSummaryList.isEmpty
? ErrorMessage(
error: TranslationBase.of(context)
.noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
.noDataAvailable!) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!)
: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
AppText(
TranslationBase.of(context).discharge,
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).summary,
fontSize: 25.0,
fontWeight: FontWeight.w700,
),
],
),
],
),
),
Expanded(
child: Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),

@ -20,7 +20,7 @@ class FlowChartPage extends StatelessWidget {
final bool isInpatient;
FlowChartPage(
{this.patientLabOrder, this.filterName, this.patient, this.isInpatient});
{required this.patientLabOrder, required this.filterName, required this.patient, required this.isInpatient});
@override
Widget build(BuildContext context) {

@ -14,7 +14,7 @@ class LabResultHistoryPage extends StatelessWidget {
final String filterName;
final PatiantInformtion patient;
LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient});
LabResultHistoryPage({required this.patientLabOrder, required this.filterName, required this.patient});
// TODO mosa UI changes
@override
Widget build(BuildContext context) {

@ -220,7 +220,7 @@ class LabResultWidget extends StatelessWidget {
FadePage(
page: FlowChartPage(
filterName:
patientLabResultList[index].description,
patientLabResultList[index].description!,
patientLabOrder: patientLabOrder,
patient: patient,
isInpatient: isInpatient,

@ -12,7 +12,7 @@ class LabResultHistoryDetailsWidget extends StatefulWidget {
final List<LabResultHistory> labResultHistory;
LabResultHistoryDetailsWidget({
this.labResultHistory,
required this.labResultHistory,
});
@override
@ -72,7 +72,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultHistoryDetailsWidget>
),
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 1.0, color: Colors.grey[300]),
inside: BorderSide(width: 1.0, color: Colors.grey[300]!),
),
children: fullData(projectViewModel),
),

@ -9,14 +9,14 @@ 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;
late bool isShowingMainData;
List<int> xAxixs = [];
int indexes = 0;

@ -21,17 +21,17 @@ class AllLabSpecialResult extends StatefulWidget {
}
class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
String patientType;
late String patientType;
String arrivalType;
PatiantInformtion patient;
bool isInpatient;
bool isFromLiveCare;
late String arrivalType;
late PatiantInformtion patient;
late bool isInpatient;
late bool isFromLiveCare;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
@ -46,7 +46,7 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>(
onModelReady: (model) =>
model.getAllSpecialLabResult(patientId: patient.patientMRN),
model.getAllSpecialLabResult(patientId: patient!.patientMRN!),
builder: (context, LabsViewModel model, widget) => AppScaffold(
baseViewModel: model,
backgroundColor: Colors.grey[100],
@ -71,9 +71,9 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).special +
TranslationBase.of(context).special! +
" " +
TranslationBase.of(context).lab,
TranslationBase.of(context).lab!,
style: "caption2",
color: Colors.black,
fontSize: 13,
@ -137,15 +137,15 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
model.allSpecialLabList[index]
.isLiveCareAppointment
? TranslationBase.of(context)
.liveCare
.liveCare!
.toUpperCase()
: !model.allSpecialLabList[index]
.isInOutPatient
? TranslationBase.of(context)
.inPatientLabel
.inPatientLabel!
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.outpatient!
.toUpperCase(),
style: TextStyle(color: Colors.white),
),

@ -9,9 +9,9 @@ import 'LineChartCurvedLabHistory.dart';
class LabResultHistoryChartAndDetails extends StatelessWidget {
LabResultHistoryChartAndDetails({
Key key,
@required this.labResultHistory,
@required this.name,
Key? key,
required this.labResultHistory,
required this.name,
}) : super(key: key);
final List<LabResultHistory> labResultHistory;

@ -151,7 +151,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
else if (widget.details == null)
Container(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,
error: TranslationBase.of(context).noDataAvailable!,
),
),
SizedBox(

@ -13,7 +13,7 @@ class SpecialLabResultDetailsPage extends StatelessWidget {
final String resultData;
final PatiantInformtion patient;
const SpecialLabResultDetailsPage({Key? key, this.resultData, this.patient}) : super(key: key);
const SpecialLabResultDetailsPage({Key? key, required this.resultData, required this.patient}) : super(key: key);
@override
Widget build(BuildContext context) {

@ -15,20 +15,20 @@ import 'package:permission_handler/permission_handler.dart';
class AddVerifyMedicalReport extends StatefulWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final MedicalReportModel medicalReport;
final String?patientType;
final String? arrivalType;
final MedicalReportModel? medicalReport;
final PatientMedicalReportViewModel model;
final MedicalReportStatus status;
final String medicalNote;
final MedicalReportStatus? status;
final String? medicalNote;
const AddVerifyMedicalReport(
{Key? key,
this.patient,
required this.patient,
this.patientType,
this.arrivalType,
this.medicalReport,
this.model,
required this.model,
this.status,
this.medicalNote})
: super(key: key);
@ -71,11 +71,11 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
HtmlRichEditor(
initialText: (widget.medicalReport != null
? widget.medicalNote
: widget.model.medicalReportTemplate[0].templateText.length > 0
: widget.model.medicalReportTemplate[0].templateText!.length > 0
? widget.model.medicalReportTemplate[0].templateText
: ""),
hint: "Write the medical report ",
height: MediaQuery.of(context).size.height * 0.75,
height: MediaQuery.of(context).size.height * 0.75, controller: _controller,
),
],
),
@ -101,7 +101,7 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
// disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700,
onPressed: () async {
txtOfMedicalReport = await HtmlEditor.getText();
txtOfMedicalReport = await _controller.getText();
if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
@ -109,8 +109,8 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
?await widget.model.updateMedicalReport(
widget.patient,
txtOfMedicalReport,
widget.medicalReport != null ? widget.medicalReport.lineItemNo : null,
widget.medicalReport != null ? widget.medicalReport.invoiceNo : null)
widget.medicalReport != null ? widget.medicalReport!.lineItemNo : null,
widget.medicalReport != null ? widget.medicalReport!.invoiceNo : null)
: await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport);
//model.getMedicalReportList(patient);
@ -138,10 +138,10 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () async {
txtOfMedicalReport = await HtmlEditor.getText();
txtOfMedicalReport = await _controller.getText();
if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport);
await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport!);
GifLoaderDialogUtils.hideDialog(context);
Navigator.pop(context);
if (widget.model.state == ViewState.ErrorLocal) {

@ -87,7 +87,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
body: model.patientProgressNoteList == null ||
model.patientProgressNoteList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoProgressNote)
error: TranslationBase.of(context).errorNoProgressNote!)
: Container(
color: Colors.grey[200],
child: Column(
@ -113,8 +113,8 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
);
},
label: widget.visitType == 3
? TranslationBase.of(context).addNewOrderSheet
: TranslationBase.of(context).addProgressNote,
? TranslationBase.of(context).addNewOrderSheet!
: TranslationBase.of(context).addProgressNote!,
),
Expanded(
child: Container(
@ -129,7 +129,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
.status ==
1 &&
authenticationViewModel
.doctorProfile.doctorID !=
.doctorProfile!.doctorID !=
model
.patientProgressNoteList[
index]
@ -156,7 +156,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
.status ==
1 &&
authenticationViewModel
.doctorProfile.doctorID !=
.doctorProfile!.doctorID !=
model
.patientProgressNoteList[
index]
@ -201,7 +201,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
.status !=
4 &&
authenticationViewModel
.doctorProfile.doctorID ==
.doctorProfile!.doctorID ==
model
.patientProgressNoteList[
index]

@ -37,23 +37,23 @@ class NursingProgressNoteScreen extends StatefulWidget {
}
class _ProgressNoteState extends State<NursingProgressNoteScreen> {
List<NoteModel> notesList;
late 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 type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
print(type);
GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel =
GetNursingProgressNoteRequestModel(
admissionNo: int.parse(patient.admissionNo),
patientTypeID: patient.patientType,
admissionNo: int.parse(patient!.admissionNo!),
patientTypeID: patient!.patientType!,
patientID: patient.patientId, setupID: "010266");
model.getNursingProgressNote(getNursingProgressNoteRequestModel);
}
@ -62,7 +62,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
@ -79,7 +79,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
body: model.patientNursingProgressNoteList == null ||
model.patientNursingProgressNoteList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoProgressNote)
error: TranslationBase.of(context).errorNoProgressNote!)
: Container(
color: Colors.grey[200],
child: Column(

@ -31,7 +31,7 @@ import '../../../../widgets/shared/app_texts_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class OperationReportScreen extends StatefulWidget {
final int visitType;
final int? visitType;
const OperationReportScreen({Key? key, this.visitType}) : super(key: key);
@ -40,22 +40,22 @@ class OperationReportScreen extends StatefulWidget {
}
class _ProgressNoteState extends State<OperationReportScreen> {
List<NoteModel> notesList;
late List<NoteModel> notesList;
var filteredNotesList;
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
late AuthenticationViewModel authenticationViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<OperationReportViewModel>(
onModelReady: (model) => model.getReservations(patient.patientMRN),
onModelReady: (model) => model.getReservations(patient!.patientMRN!),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
@ -71,7 +71,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
model.reservationList == null ||
model.reservationList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoProgressNote)
error: TranslationBase.of(context).errorNoProgressNote!)
: Expanded(
child: Container(
child: ListView.builder(

@ -36,16 +36,16 @@ class UpdateOperationReport extends StatefulWidget {
final GetReservationsResponseModel reservation;
// final OperationReportViewModel operationReportViewModel;
final PatiantInformtion patient;
final int visitType;
final int? visitType;
final bool isUpdate;
const UpdateOperationReport(
{Key? key,
// this.operationReportViewModel,
this.patient,
required this.patient,
this.visitType,
this.isUpdate,
this.reservation})
required this.isUpdate,
required this.reservation})
: super(key: key);
@override
@ -53,12 +53,12 @@ class UpdateOperationReport extends StatefulWidget {
}
class _UpdateOperationReportState extends State<UpdateOperationReport> {
int selectedType;
late int selectedType;
bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord;
var event = RobotProvider();
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
TextEditingController preOpDiagmosisController = TextEditingController();
TextEditingController postOpDiagmosisNoteController = TextEditingController();
@ -135,7 +135,7 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
baseViewModel: model,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).operationReports,
title: TranslationBase.of(context).operationReports!,
),
body: SingleChildScrollView(
child: Container(
@ -540,8 +540,8 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
child: AppButton(
title: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).operationReports,
: TranslationBase.of(context).noteAdd)! +
TranslationBase.of(context).operationReports!,
color: Color(0xff359846),
// disabled: operationReportsController.text.isEmpty,
fontWeight: FontWeight.w700,
@ -590,9 +590,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
bloodLossDetailController.text,
patientID: widget.patient.patientId,
admissionNo:
int.parse(widget.patient.admissionNo),
int.parse(widget.patient.admissionNo!),
createdBy: model
.doctorProfile.doctorID,
.doctorProfile!.doctorID!,
setupID: "010266");
await model
.updateOperationReport(

@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d
import 'package:flutter/material.dart';
class PendingOrdersScreen extends StatelessWidget {
const PendingOrdersScreen({Key? key}) : super(key: key);
const PendingOrdersScreen({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -24,41 +24,73 @@ class PendingOrdersScreen extends StatelessWidget {
admissionNo: int.parse(patient.admissionNo)),
builder:
(BuildContext context, PendingOrdersViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileAppBar(
patient,
isInpatient: isInpatient,
),
isShowAppBar: true,
baseViewModel: model,
appBarTitle: "Pending Orders",
body: model.pendingOrdersList == null ||
AppScaffold(
appBar: PatientProfileAppBar(
patient,
isInpatient: isInpatient,
),
isShowAppBar: true,
baseViewModel: model,
appBarTitle: "Pending Orders",
body: model.pendingOrdersList == null ||
model.pendingOrdersList.length == 0
? DrAppEmbeddedError(
? DrAppEmbeddedError(
error: TranslationBase.of(context).noDataAvailable)
: Container(
child: ListView.builder(
itemCount: model.pendingOrdersList.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(
color: Color(0xFF707070), width: 0.30),
: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
AppText(
TranslationBase.of(context).pending,
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
child: Padding(
padding: EdgeInsets.all(8.0),
child:
AppText(model.pendingOrdersList[index].notes),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).orders,
fontSize: 25.0,
fontWeight: FontWeight.w700,
),
),
);
})),
),
],
),
],
),
),
Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.pendingOrdersList.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(
color: Color(0xFF707070), width: 0.30),
),
child: Padding(
padding: EdgeInsets.all(8.0),
child: AppText(
model.pendingOrdersList[index].notes),
),
),
);
})),
],
),
),
);
}
}

@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
class CustomEditableText extends StatefulWidget {
CustomEditableText({
Key key,
@required this.controller,
required this.controller,
this.hint,
this.isEditable = false, this.isSubmitted,
}) : super(key: key);

@ -501,15 +501,15 @@ class _ActivationPageState extends State<ActivationPage> {
counterText: " ",
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.grey[300]),
borderSide: BorderSide(color: Colors.grey[300]!),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Colors.grey[300]),
borderSide: BorderSide(color: Colors.grey[300]!),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Colors.grey[300]),
borderSide: BorderSide(color: Colors.grey[300]!),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),

@ -21,7 +21,7 @@ class BaseAddProcedureTabPage extends StatefulWidget {
final ProcedureType? procedureType;
const BaseAddProcedureTabPage(
{Key? key, this.model, this.prescriptionModel, this.patient, @required this.procedureType})
{Key? key, this.model, this.prescriptionModel, this.patient, required this.procedureType})
: super(key: key);
@override

@ -91,8 +91,8 @@ class TranslationBase {
String? get inPatient => localizedValues['inPatient']![locale.languageCode];
String? get myInPatient => localizedValues['myInPatient']![locale.languageCode];
String? get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode];
String get inPatientLabel => localizedValues['inPatientLabel']![locale.languageCode];
String? get myInPatientTitle => localizedValues['myInPatientTitle']![locale.languageCode];
String? get inPatientLabel => localizedValues['inPatientLabel']![locale.languageCode];
String? get inPatientAll => localizedValues['inPatientAll']![locale.languageCode];
@ -211,8 +211,8 @@ class TranslationBase {
String? get replay => localizedValues['replay']![locale.languageCode];
String? get progressNote =>localizedValues['progressNote'][locale.languageCode];
String get operationReports => localizedValues['operationReports']![locale.languageCode];
String? get progressNote =>localizedValues['progressNote']![locale.languageCode];
String? get operationReports => localizedValues['operationReports']![locale.languageCode];
String? get progress => localizedValues['progress']![locale.languageCode];
@ -294,10 +294,10 @@ class TranslationBase {
String? get age => localizedValues['age']![locale.languageCode];
String? get nationality => localizedValues['nationality']![locale.languageCode];
String get occupation => localizedValues['occupation'][locale.languageCode];
String get healthID => localizedValues['healthID'][locale.languageCode];
String get identityNumber => localizedValues['identityNumber'][locale.languageCode];
String get maritalStatus => localizedValues['maritalStatus'][locale.languageCode];
String? get occupation => localizedValues['occupation']![locale.languageCode];
String? get healthID => localizedValues['healthID']![locale.languageCode];
String? get identityNumber => localizedValues['identityNumber']![locale.languageCode];
String? get maritalStatus => localizedValues['maritalStatus']![locale.languageCode];
String? get today => localizedValues['today']![locale.languageCode];
@ -482,7 +482,7 @@ class TranslationBase {
String? get noPrescription => localizedValues['no-priscription-listed']![locale.languageCode];
String? get next => localizedValues['next']![locale.languageCode];
String get finish => localizedValues['finish'][locale.languageCode];
String? get finish => localizedValues['finish']![locale.languageCode];
String? get previous => localizedValues['previous']![locale.languageCode];
@ -991,9 +991,9 @@ class TranslationBase {
String? get typeHereToReply => localizedValues['typeHereToReply']![locale.languageCode];
String? get searchHere => localizedValues['searchHere']![locale.languageCode];
String? get remove => localizedValues['remove']![locale.languageCode];
String get inProgress => localizedValues['inProgress'][locale.languageCode];
String get completed => localizedValues['Completed'][locale.languageCode];
String get locked => localizedValues['Locked'][locale.languageCode];
String? get inProgress => localizedValues['inProgress']![locale.languageCode];
String? get completed => localizedValues['Completed']![locale.languageCode];
String? get locked => localizedValues['Locked']![locale.languageCode];
String? get step => localizedValues['step']![locale.languageCode];
String? get fieldRequired => localizedValues['fieldRequired']![locale.languageCode];
@ -1097,21 +1097,21 @@ class TranslationBase {
String? get addPrescription => localizedValues['addPrescription']![locale.languageCode];
String? get edit => localizedValues['edit']![locale.languageCode];
String? get summeryReply => localizedValues['summeryReply']![locale.languageCode];
String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode];
String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode];
String get roomNo => localizedValues['roomNo'][locale.languageCode];
String get seeMore => localizedValues['seeMore'][locale.languageCode];
String get replayCallStatus => localizedValues['replayCallStatus'][locale.languageCode];
String get patientArrived => localizedValues['patientArrived'][locale.languageCode];
String get calledAndNoResponse => localizedValues['calledAndNoResponse'][locale.languageCode];
String get underProcess => localizedValues['underProcess'][locale.languageCode];
String get textResponse => localizedValues['textResponse'][locale.languageCode];
String get special => localizedValues['special'][locale.languageCode];
String get requestType => localizedValues['requestType'][locale.languageCode];
String get allClinic => localizedValues['allClinic'][locale.languageCode];
String get notReplied => localizedValues['notReplied'][locale.languageCode];
String get registerNewPatient => localizedValues['registerNewPatient'][locale.languageCode];
String get registeraPatient => localizedValues['registeraPatient'][locale.languageCode];
String? get severityValidationError => localizedValues['severityValidationError']![locale.languageCode];
String? get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully']![locale.languageCode];
String? get roomNo => localizedValues['roomNo']![locale.languageCode];
String? get seeMore => localizedValues['seeMore']![locale.languageCode];
String? get replayCallStatus => localizedValues['replayCallStatus']![locale.languageCode];
String? get patientArrived => localizedValues['patientArrived']![locale.languageCode];
String? get calledAndNoResponse => localizedValues['calledAndNoResponse']![locale.languageCode];
String? get underProcess => localizedValues['underProcess']![locale.languageCode];
String? get textResponse => localizedValues['textResponse']![locale.languageCode];
String? get special => localizedValues['special']![locale.languageCode];
String? get requestType => localizedValues['requestType']![locale.languageCode];
String? get allClinic => localizedValues['allClinic']![locale.languageCode];
String? get notReplied => localizedValues['notReplied']![locale.languageCode];
String? get registerNewPatient => localizedValues['registerNewPatient']![locale.languageCode];
String? get registeraPatient => localizedValues['registeraPatient']![locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -38,10 +38,10 @@ class PatientCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
String nationalityName = patientInfo.nationalityName != null
? patientInfo.nationalityName.trim()
String? nationalityName = patientInfo.nationalityName != null
? patientInfo.nationalityName!.trim()
: patientInfo.nationality != null
? patientInfo.nationality.trim()
? patientInfo.nationality!.trim()
: patientInfo.nationalityId !=
null
? patientInfo.nationalityId
@ -283,7 +283,7 @@ class PatientCard extends StatelessWidget {
child: Container(
alignment: Alignment.centerRight,
child: AppText(
nationalityName.truncate(14),
nationalityName!.truncate(14),
fontWeight: FontWeight.bold,
fontSize: 14,
textOverflow: TextOverflow.ellipsis,
@ -352,16 +352,16 @@ class PatientCard extends StatelessWidget {
),
CustomRow(
label:
TranslationBase.of(context).age + " : ",
TranslationBase.of(context).age! + " : ",
value:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
"${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}",
),
if (isInpatient)
CustomRow(
label: patientInfo.admissionDate == null
? ""
: TranslationBase.of(context)
.admissionDate +
.admissionDate! +
" : ",
value: patientInfo.admissionDate == null
? ""
@ -370,22 +370,22 @@ class PatientCard extends StatelessWidget {
if (patientInfo.admissionDate != null)
CustomRow(
label: TranslationBase.of(context)
.numOfDays +
.numOfDays! +
" : ",
value:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label: TranslationBase.of(context)
.clinicName +
.clinicName! +
" : ",
value: "${patientInfo.clinicDescription}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label:
TranslationBase.of(context).roomNo +
TranslationBase.of(context).roomNo! +
" : ",
value: "${patientInfo.roomId}",
),
@ -394,9 +394,9 @@ class PatientCard extends StatelessWidget {
children: [
CustomRow(
label: TranslationBase.of(context)
.clinic +
.clinic! +
" : ",
value: patientInfo.clinicName,
value: patientInfo!.clinicName!,
),
],
),

@ -9,8 +9,8 @@ import 'package:provider/provider.dart';
// ignore: must_be_immutable
class PatientProfileButton extends StatelessWidget {
final String nameLine1;
final String nameLine2;
final String? nameLine1;
final String? nameLine2;
final String icon;
final dynamic route;
final PatiantInformtion patient;
@ -35,8 +35,8 @@ class PatientProfileButton extends StatelessWidget {
required this.patient,
required this.patientType,
required this.arrivalType,
required this.nameLine1,
required this.nameLine2,
this.nameLine1,
this.nameLine2,
required this.icon,
this.route,
this.isDisable = false,

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
@ -13,21 +14,64 @@ import 'package:url_launcher/url_launcher.dart';
import 'large_avatar.dart';
class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
final PatientProfileAppBarModel patientProfileAppBarModel;
final bool isFromLabResult;
final PatiantInformtion? patient;
final PatientProfileAppBarModel? patientProfileAppBarModel;
final double? height;
final bool isInpatient;
final bool isDischargedPatient;
final bool isFromLiveCare;
final String? doctorName;
final String? branch;
final DateTime? appointmentDate;
final String? profileUrl;
final String? invoiceNO;
final String? orderNo;
final bool? isPrescriptions;
final bool? isMedicalFile;
final String? episode;
final String? visitDate;
final String? clinic;
final bool? isAppointmentHeader;
final bool? isFromLabResult;
final VoidCallback? onPressed;
PatientProfileAppBar({required this.patientProfileAppBarModel, this.isFromLabResult = false, this.onPressed});
PatientProfileAppBar(this.patient,
{ this.patientProfileAppBarModel,
this.isFromLabResult = false,
this.onPressed,
this.height,
this.isInpatient = false,
this.isDischargedPatient = false,
this.isFromLiveCare = false,
this.doctorName,
this.branch,
this.appointmentDate,
this.profileUrl,
this.invoiceNO,
this.orderNo,
this.isPrescriptions,
this.isMedicalFile,
this.episode,
this.visitDate,
this.clinic,
this.isAppointmentHeader});
late PatiantInformtion localPatient;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
if (patient == null) {
localPatient = patientProfileAppBarModel!.patient!;
} else {
localPatient = patient!;
}
int gender = 1;
if (patientProfileAppBarModel.patient!.patientDetails != null) {
gender = patientProfileAppBarModel.patient!.patientDetails!.gender!;
if (localPatient!.patientDetails != null) {
gender = localPatient!.patientDetails!.gender!;
} else {
gender = patientProfileAppBarModel.patient!.gender!;
gender = localPatient!.gender!;
}
return Container(
@ -58,12 +102,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
),
Expanded(
child: AppText(
patientProfileAppBarModel.patient!.firstName != null
? (Helpers.capitalize(patientProfileAppBarModel.patient!.firstName) +
localPatient!.firstName != null
? (Helpers.capitalize(localPatient!.firstName) +
" " +
Helpers.capitalize(patientProfileAppBarModel.patient!.lastName))
: Helpers.capitalize(patientProfileAppBarModel.patient!.fullName ??
patientProfileAppBarModel.patient!.patientDetails!.fullName!),
Helpers.capitalize(localPatient!.lastName))
: Helpers.capitalize(localPatient!.fullName ??
localPatient!.patientDetails!.fullName!),
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
@ -84,7 +128,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" + patientProfileAppBarModel.patient!.mobileNumber!);
launch("tel://" + localPatient!.mobileNumber!);
},
child: Icon(
Icons.phone,
@ -92,24 +136,30 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
),
),
),
if(patientProfileAppBarModel.videoCallDurationStream != null)
StreamBuilder(
stream: patientProfileAppBarModel.videoCallDurationStream,
builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
if(snapshot.hasData && snapshot.data != null)
return InkWell(
onTap: (){
},
child: Container(
decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10),
child: Text(snapshot.data!, style: TextStyle(color: Colors.white),),
),
);
else
return Container();
},
),
if (patientProfileAppBarModel!.videoCallDurationStream != null)
StreamBuilder(
stream: patientProfileAppBarModel!.videoCallDurationStream,
builder:
(BuildContext context, AsyncSnapshot<String> snapshot) {
if (snapshot.hasData && snapshot.data != null)
return InkWell(
onTap: () {},
child: Container(
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.symmetric(
vertical: 2, horizontal: 10),
child: Text(
snapshot.data!,
style: TextStyle(color: Colors.white),
),
),
);
else
return Container();
},
),
]),
),
Row(children: [
@ -120,7 +170,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
width: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
height: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
child: Image.asset(
gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
@ -132,12 +184,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
patientProfileAppBarModel.patient!.patientStatusType != null
localPatient!.patientStatusType != null
? Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
patientProfileAppBarModel.patient!.patientStatusType == 43
localPatient!.patientStatusType == 43
? AppText(
TranslationBase.of(context).arrivedP,
color: Colors.green,
@ -156,8 +208,11 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
.getTextMultiplierBasedOnWidth() *
3.5,
),
patientProfileAppBarModel.patient!.startTime != null
? AppText(patientProfileAppBarModel.patient!.startTime != null ? patientProfileAppBarModel.patient!.startTime : '',
localPatient!.startTime != null
? AppText(
localPatient!.startTime != null
? localPatient!.startTime
: '',
fontWeight: FontWeight.w700,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
@ -185,7 +240,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
width: 1,
),
AppText(
patient.patientId.toString(),
localPatient!.patientId.toString(),
fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
@ -198,23 +253,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
Row(
children: [
AppText(
patientProfileAppBarModel.patient!.nationalityName ??
patientProfileAppBarModel.patient!.nationality ??
patientProfileAppBarModel.patient!.nationalityId ??
localPatient!.nationalityName ??
localPatient!.nationality ??
localPatient!.nationalityId ??
'',
fontWeight: FontWeight.bold,
fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
),
patientProfileAppBarModel.patient!.nationalityFlagURL != null
localPatient!.nationalityFlagURL != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patientProfileAppBarModel.patient!.nationalityFlagURL!,
localPatient!.nationalityFlagURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
errorBuilder: (BuildContext context,
Object exception,
StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -225,49 +282,48 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
),
HeaderRow(
label: TranslationBase.of(context).age + " : ",
label: TranslationBase.of(context).age! + " : ",
value:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
),if (patientProfileAppBarModel.patient!.appointmentDate != null &&
patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty &&
!isFromLabResult)
"${AppDateUtils.getAgeByBirthday(localPatient!.patientDetails != null ? localPatient!.patientDetails!.dateofBirth ?? "" : localPatient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
),
if (localPatient!.appointmentDate != null &&
localPatient!.appointmentDate!.isNotEmpty &&
!isFromLabResult!)
HeaderRow(
label:
TranslationBase.of(context).appointmentDate! + " : ",
value:
AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(patientProfileAppBarModel.patient!.appointmentDate!)),
label: TranslationBase.of(context).appointmentDate! +
" : ",
value: AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
localPatient!.appointmentDate!)),
),
if (patientProfileAppBarModel.isFromLabResult!)
HeaderRow(
label: "Result Date: ",
value:
'${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}',
if (patientProfileAppBarModel!.isFromLabResult!)
HeaderRow(
label: "Result Date: ",
value:
'${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel!.appointmentDate!, isArabic: projectViewModel.isArabic)}',
),
// if(isInpatient)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (patient.admissionDate != null &&
patient.admissionDate.isNotEmpty)
if (localPatient!.admissionDate != null &&
localPatient!.admissionDate!.isNotEmpty)
HeaderRow(
label: patient.admissionDate == null
label: localPatient!.admissionDate == null
? ""
: TranslationBase.of(context).admissionDate +
: TranslationBase.of(context).admissionDate! +
" : ",
value: patient.admissionDate == null
value: localPatient!.admissionDate == null
? ""
: "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}",
: "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate.toString())))}",
),
if (patient.admissionDate != null)
if (localPatient!.admissionDate != null)
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}",
localPatient!.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(localPatient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}",
)
],
),
@ -275,7 +331,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
),
),
]),
if (patientProfileAppBarModel.isAppointmentHeader!)
if (patientProfileAppBarModel!.isAppointmentHeader!)
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -283,12 +339,16 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
width: 30,
height: 30,
margin: EdgeInsets.only(
left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5),
left: projectViewModel.isArabic ? 10 : 85,
right: projectViewModel.isArabic ? 85 : 10,
top: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border(
bottom: BorderSide(color: Colors.grey[400]!, width: 2.5),
left: BorderSide(color: Colors.grey[400]!, width: 2.5),
bottom:
BorderSide(color: Colors.grey[400]!, width: 2.5),
left:
BorderSide(color: Colors.grey[400]!, width: 2.5),
)),
),
Expanded(
@ -299,8 +359,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
children: <Widget>[
Container(
child: LargeAvatar(
name: patientProfileAppBarModel.doctorName ?? "",
url: patientProfileAppBarModel.profileUrl,
name: patientProfileAppBarModel!.doctorName ?? "",
url: patientProfileAppBarModel!.profileUrl,
),
width: 25,
height: 25,
@ -322,14 +382,14 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
3.5,
isCopyable: true,
),
if (orderNo != null && !isPrescriptions)
if (orderNo != null && !isPrescriptions!)
HeaderRow(
label: 'Order No: ',
value: orderNo ?? '',
),
if (invoiceNO != null && !isPrescriptions)
if (invoiceNO != null && !isPrescriptions!)
HeaderRow(
label: 'Invoice: ',
label: 'Invoice: ',
value: invoiceNO ?? "",
),
if (branch != null)
@ -342,25 +402,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
label: 'Clinic: ',
value: clinic ?? '',
),
if (isMedicalFile && episode != null)
if (isMedicalFile! && episode != null)
HeaderRow(
label: 'Episode: ',
value: episode ?? '',
),
if (isMedicalFile && visitDate != null)
if (isMedicalFile! && visitDate != null)
HeaderRow(
label: 'Visit Date: ',
value: visitDate ?? '',
),
if (!isMedicalFile)
if (!isMedicalFile!)
HeaderRow(
label: !isPrescriptions
label: !isPrescriptions!
? 'Result Date:'
: 'Prescriptions Date ',
value:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
),
]),
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
),
]),
),
),
],
@ -378,26 +438,26 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
@override
Size get preferredSize => Size(
double.maxFinite,
patientProfileAppBarModel.height == 0
? patientProfileAppBarModel.isAppointmentHeader!
patientProfileAppBarModel!.height == 0
? patientProfileAppBarModel!.isAppointmentHeader!
? 270
: ((patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty)
? patientProfileAppBarModel.isFromLabResult!
: ((localPatient!.appointmentDate!.isNotEmpty)
? patientProfileAppBarModel!.isFromLabResult!
? 190
: 170
: patientProfileAppBarModel.patient!.admissionDate != null
? patientProfileAppBarModel.isFromLabResult!
: localPatient!.admissionDate != null
? patientProfileAppBarModel!.isFromLabResult!
? 190
: 170
: patientProfileAppBarModel.isDischargedPatient!
: patientProfileAppBarModel!.isDischargedPatient!
? 240
: 130)
: patientProfileAppBarModel.height!);
: patientProfileAppBarModel!.height!);
}
class HeaderRow extends StatelessWidget {
final String label;
final String value;
final String? label;
final String? value;
const HeaderRow({Key? key, this.label, this.value}) : super(key: key);

@ -24,7 +24,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
final bool isDischargedPatient;
final bool isFromLiveCare;
final Stream<String> videoCallDurationStream;
final Stream<String>? videoCallDurationStream;
PatientProfileHeaderNewDesignAppBar(
this.patient, this.patientType, this.arrivalType,
@ -38,9 +38,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
Widget build(BuildContext context) {
int gender = 1;
if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
gender = patient.patientDetails!.gender!;
} else {
gender = patient.gender;
gender = patient!.gender!;
}
return Container(
padding: EdgeInsets.only(
@ -76,7 +76,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
" " +
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.fullName ??
patient.patientDetails.fullName),
patient.patientDetails!.fullName),
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
@ -99,7 +99,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
eventCategory: "Patient Profile Header",
eventAction: "Call Patient",
);
launch("tel://" + patient.mobileNumber);
launch("tel://" + patient!.mobileNumber!);
},
child: Icon(
Icons.phone,
@ -121,7 +121,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
padding:
EdgeInsets.symmetric(vertical: 2, horizontal: 10),
child: Text(
snapshot.data,
snapshot!.data!,
style: TextStyle(color: Colors.white),
),
),
@ -186,7 +186,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
patient.arrivedOn != null
? AppDateUtils
.convertStringToDateFormat(
patient.arrivedOn,
patient!.arrivedOn!,
'MM-dd-yyyy HH:mm')
: '',
fontFamily: 'Poppins',
@ -203,7 +203,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).appointmentDate +
TranslationBase.of(context).appointmentDate! +
" : ",
fontSize: 14,
),
@ -273,12 +273,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patient.nationalityFlagURL,
patient!.nationalityFlagURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
errorBuilder: (BuildContext? context,
Object? exception,
StackTrace? stackTrace) {
return Text('');
},
))
@ -289,9 +289,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
],
),
HeaderRow(
label: TranslationBase.of(context).age + " : ",
label: TranslationBase.of(context).age! + " : ",
value:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
),
if (isInpatient)
Column(
@ -300,7 +300,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
HeaderRow(
label: patient.admissionDate == null
? ""
: TranslationBase.of(context).admissionDate +
: TranslationBase.of(context).admissionDate! +
" : ",
value: patient.admissionDate == null
? ""
@ -310,8 +310,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient &&
patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
? "${AppDateUtils.getDateTimeFromServerFormat(patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient!.admissionDate!)).inDays + 1}",
)
],
)
@ -326,7 +326,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
}
convertDateFormat2(String str) {
String newDate;
late String newDate;
const start = "/Date(";
if (str.isNotEmpty) {
const end = "+0300)";
@ -343,7 +343,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
date.day.toString().padLeft(2, '0');
}
return newDate ?? '';
return newDate??'';
}
isToday(date) {

@ -16,7 +16,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
final bool isInpatient;
ProfileMedicalInfoWidget(
{Key? key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient});
{Key? key, required this.patient, required this.patientType, required this.arrivalType, required this.from, required this.to, this.isInpatient = false});
@override
Widget build(BuildContext context) {
@ -57,7 +57,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patientType: patientType,
arrivalType: arrivalType,
route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab,
nameLine1: TranslationBase.of(context).lab??'',
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
PatientProfileButton(

@ -56,7 +56,7 @@ class AppScaffold extends StatelessWidget {
extendBody: extendBody,
bottomNavigationBar: bottomNavigationBar,
appBar: isShowAppBar
? patientProfileAppBarModel != null ? PatientProfileAppBar(
? patientProfileAppBarModel != null ? PatientProfileAppBar(patientProfileAppBarModel!.patient!,
patientProfileAppBarModel: patientProfileAppBarModel!,) : appBar ??
AppBar(
elevation: 0,

@ -101,7 +101,7 @@ class _AppTextState extends State<AppText> {
return GestureDetector(
child: Container(
margin: widget.margin != null
? EdgeInsets.all(widget.margin)
? EdgeInsets.all(widget.margin!)
: EdgeInsets.only(
top: widget.marginTop!, right: widget.marginRight!, bottom: widget.marginBottom!, left: widget.marginLeft!),
child: Column(
@ -111,7 +111,7 @@ class _AppTextState extends State<AppText> {
Stack(
children: [
_textWidget(),
if (widget.readMore && text.length > widget.maxLength && hidden)
if (widget.readMore! && text.length > widget.maxLength! && hidden)
Positioned(
bottom: 0,
left: 0,
@ -127,7 +127,7 @@ class _AppTextState extends State<AppText> {
)
],
),
if (widget.allowExpand && widget.readMore && text.length > widget.maxLength)
if (widget.allowExpand! && widget.readMore! && text.length > widget.maxLength!)
Padding(
padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0),
child: InkWell(
@ -157,14 +157,14 @@ class _AppTextState extends State<AppText> {
}
Widget _textWidget() {
if (widget.isCopyable) {
if (widget.isCopyable!) {
return Theme(
data: ThemeData(
textSelectionColor: Colors.lightBlueAccent,
),
child: Container(
child: SelectableText(
!hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)),
!hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)),
textAlign: widget.textAlign,
// overflow: widget.maxLines != null
// ? ((widget.maxLines > 1)
@ -174,12 +174,12 @@ class _AppTextState extends State<AppText> {
maxLines: widget.maxLines ?? null,
style: widget.style != null
? _getFontStyle().copyWith(
fontStyle: widget.italic ? FontStyle.italic : null,
fontStyle: widget.italic! ? FontStyle.italic : null,
color: widget.color,
fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight)
: TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null,
fontStyle: widget.italic! ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black,
fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
@ -192,18 +192,18 @@ class _AppTextState extends State<AppText> {
);
} else {
return Text(
!hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)),
!hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)),
textAlign: widget.textAlign,
overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null,
overflow: widget.maxLines != null ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null,
maxLines: widget.maxLines ?? null,
style: widget.style != null
? _getFontStyle().copyWith(
fontStyle: widget.italic ? FontStyle.italic : null,
fontStyle: widget.italic! ? FontStyle.italic : null,
color: widget.color,
fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight)
: TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null,
fontStyle: widget.italic! ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black,
fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),

@ -65,7 +65,7 @@ class BottomNavigationItem extends StatelessWidget {
),
],
),
if(currentIndex == 3 && dashboardViewModel.notRepliedCount != 0)
if(currentIndex == 3 && dashboardViewModel!.notRepliedCount != 0)
Positioned(
right: 18.0,
bottom: 40.0,
@ -77,7 +77,7 @@ class BottomNavigationItem extends StatelessWidget {
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
// padding: EdgeInsets.all(2.0),
child: Text(dashboardViewModel.notRepliedCount.toString(),
child: Text(dashboardViewModel!.notRepliedCount.toString(),
style: TextStyle(
color: Colors.white, fontSize: 12.0)),
),

@ -50,7 +50,6 @@ class _AppButtonState extends State<AppButton> {
@override
Widget build(BuildContext context) {
return Container(
height: widget.height,
height: widget.height,
child: IgnorePointer(
ignoring: widget.loading! || widget.disabled!,

@ -4,7 +4,7 @@ import 'package:provider/provider.dart';
class CardWithBgWidget extends StatelessWidget {
final Widget widget;
final Color bgColor;
final Color? bgColor;
final bool hasBorder;
final double padding;
final double marginLeft;
@ -12,7 +12,7 @@ class CardWithBgWidget extends StatelessWidget {
CardWithBgWidget(
{required this.widget,
required this.bgColor,
this.bgColor,
this.hasBorder = true,
this.padding = 15.0,
this.marginLeft = 10.0,

@ -24,7 +24,7 @@ class AppTextFieldCustom extends StatefulWidget {
final int? maxLines;
final List<TextInputFormatter>? inputFormatters;
final Function(String)? onChanged;
final Function onFieldSubmitted;
final Function? onFieldSubmitted;
final String? validationError;
final bool? isPrscription;
@ -152,7 +152,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
widget.onChanged!(value);
}
},
onFieldSubmitted: widget.onFieldSubmitted,
onFieldSubmitted: widget.onFieldSubmitted!(),
obscureText: widget.isSecure!),
)
: AppText(
@ -170,7 +170,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
? Container(
margin: EdgeInsets.only(
bottom: widget.isSearchTextField
? (widget.controller.text.isEmpty ||
? (widget.controller!.text.isEmpty ||
widget.controller == null)
? 10
: 25
@ -187,7 +187,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
),
),
),
if (widget.validationError != null && widget.validationError.isNotEmpty) TextFieldsError(error: widget.validationError!),
if (widget.validationError != null && widget.validationError!.isNotEmpty) TextFieldsError(error: widget.validationError!),
],
);
}

@ -7,7 +7,7 @@ import 'app-textfield-custom.dart';
class AppTextFieldCustomSearch extends StatelessWidget {
const AppTextFieldCustomSearch({
Key key,
Key? key,
this.onChangeFun,
this.positionedChild,
this.marginTop,
@ -20,23 +20,23 @@ class AppTextFieldCustomSearch extends StatelessWidget {
this.hintText,
});
final TextEditingController searchController;
final TextEditingController? searchController;
final Function onChangeFun;
final Function onFieldSubmitted;
final Function? onChangeFun;
final Function? onFieldSubmitted;
final Widget positionedChild;
final IconButton suffixIcon;
final double marginTop;
final String validationError;
final String hintText;
final Widget ?positionedChild;
final IconButton? suffixIcon;
final double? marginTop;
final String? validationError;
final String? hintText;
final TextInputType inputType;
final List<TextInputFormatter> inputFormatters;
final TextInputType? inputType;
final List<TextInputFormatter>? inputFormatters;
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop),
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop!),
child: Stack(
children: [
AppTextFieldCustom(
@ -54,11 +54,11 @@ class AppTextFieldCustomSearch extends StatelessWidget {
onPressed: () {},
),
controller: searchController,
onChanged: onChangeFun,
onChanged: onChangeFun!(),
onFieldSubmitted: onFieldSubmitted,
validationError: validationError),
if (positionedChild != null)
Positioned(right: 35, top: 5, child: positionedChild)
Positioned(right: 35, top: 5, child: positionedChild!)
],
),
);

@ -13,7 +13,7 @@ class CountryTextField extends StatefulWidget {
final String? keyId;
final String? hintText;
final double? width;
final Function(dynamic) okFunction;
final Function(dynamic)? okFunction;
CountryTextField(
{Key? key,
@ -41,14 +41,14 @@ class _CountryTextfieldState extends State<CountryTextField> {
? () {
Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog(
list: widget.elementList,
list: widget.elementList!,
attributeName: '${widget.keyName}',
attributeValueId: widget.elementList.length == 1
? widget.elementList[0]['${widget.keyId}']
attributeValueId: widget.elementList!.length == 1
? widget.elementList![0]['${widget.keyId}']
: '${widget.keyId}',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) =>
widget.okFunction(selectedValue),
widget.okFunction!(selectedValue),
);
showDialog(
barrierDismissible: false,
@ -61,14 +61,14 @@ class _CountryTextfieldState extends State<CountryTextField> {
: null,
child: AppTextFieldCustom(
hintText: widget.hintText,
dropDownText: widget.elementList.length == 1
? widget.elementList[0]['${widget.keyName}']
dropDownText: widget.elementList!.length == 1
? widget.elementList![0]['${widget.keyName}']
: widget.element != null
? widget.element['${widget.keyName}']
: null,
isTextFieldHasSuffix: true,
validationError:
widget.elementList.length != 1 ? widget.elementError : null,
widget.elementList!.length != 1 ? widget.elementError : null,
enabled: false,
),
),

@ -5,17 +5,17 @@ import '../app_texts_widget.dart';
class CustomRow extends StatelessWidget {
const CustomRow({
Key key,
this.label,
this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true,
Key? key,
this.label,
required this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true,
}) : super(key: key);
final String label;
final String? label;
final String value;
final double labelSize;
final double valueSize;
final double width;
final bool isCopyable;
final double? labelSize;
final double? valueSize;
final double? width;
final bool? isCopyable;
@override
Widget build(BuildContext context) {

@ -9,9 +9,9 @@ class SlideUpPageRoute extends PageRouteBuilder {
final Widget widget;
final bool fullscreenDialog;
final bool opaque;
final String settingRoute;
final String? settingRoute;
SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute})
SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute})
: super(
pageBuilder: (
BuildContext context,

File diff suppressed because it is too large Load Diff

@ -71,6 +71,7 @@ dependencies:
# Firebase
firebase_messaging: ^10.0.1
firebase_analytics : ^8.3.4
#GIF image
flutter_gifimage: ^1.0.1

Loading…
Cancel
Save