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 = const GET_EPISODE_FOR_INPATIENT =
"/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient";
///Operation Details Services ///Operation Details Services
const GET_RESERVATIONS = const GET_RESERVATIONS =
@ -377,12 +376,15 @@ const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION =
"Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration";
const CHECK_ACTIVATION_CODE_FOR_PATIENT = const CHECK_ACTIVATION_CODE_FOR_PATIENT =
"Services/Authentication.svc/REST/CheckActivationCode"; "Services/Authentication.svc/REST/CheckActivationCode";
const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; const PATIENT_REGISTRATION =
"Services/Authentication.svc/REST/PatientRegistration";
const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo"; const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo";
/// Discharge Summary /// 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; var selectedPatientType = 1;

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

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

@ -17,10 +17,10 @@ class NavigationService {
} }
Future<dynamic> pushAndRemoveUntil(Route newRoute) { Future<dynamic> pushAndRemoveUntil(Route newRoute) {
return navigatorKey.currentState.pushAndRemoveUntil(newRoute,(asd)=>false); return navigatorKey.currentState!.pushAndRemoveUntil(newRoute,(asd)=>false);
} }
pop() { 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'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
class PatientRegistrationService extends BaseService { class PatientRegistrationService extends BaseService {
GetPatientInfoResponseModel getPatientInfoResponseModel; late GetPatientInfoResponseModel getPatientInfoResponseModel;
String logInTokenID; late String logInTokenID;
checkPatientForRegistration( checkPatientForRegistration(
CheckPatientForRegistrationModel registrationModel) async { CheckPatientForRegistrationModel registrationModel) async {
@ -39,13 +39,12 @@ class PatientRegistrationService extends BaseService {
} }
sendActivationCodeByOTPNotificationType( sendActivationCodeByOTPNotificationType(
{SendActivationCodeByOTPNotificationTypeForRegistrationModel {
registrationModel, required int otpType,
int otpType, required PatientRegistrationViewModel model,
PatientRegistrationViewModel model, required CheckPatientForRegistrationModel
CheckPatientForRegistrationModel
checkPatientForRegistrationModel}) async { checkPatientForRegistrationModel}) async {
registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel( SendActivationCodeByOTPNotificationTypeForRegistrationModel(
oTPSendType: otpType, oTPSendType: otpType,
patientIdentificationID: checkPatientForRegistrationModel patientIdentificationID: checkPatientForRegistrationModel

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; 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/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';

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

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

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

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

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

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

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

@ -83,7 +83,7 @@ class SOAPService extends LookupService {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = super.error+ "\n"+error; super.error = super.error!+ "\n"+error;
}, body: postAllergyRequestModel.toJson()); }, body: postAllergyRequestModel.toJson());
} }
@ -93,7 +93,7 @@ class SOAPService extends LookupService {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error =super.error + "\n"+error; super.error =super.error! + "\n"+error;
}, body: postHistoriesRequestModel.toJson()); }, body: postHistoriesRequestModel.toJson());
} }
@ -155,7 +155,7 @@ class SOAPService extends LookupService {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = super.error +"\n"+error; super.error = super.error! +"\n"+error;
}, body: patchHistoriesRequestModel.toJson()); }, 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'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart';
class UcafService extends LookupService { class UcafService extends LookupService {
List<GetChiefComplaintResModel> patientChiefComplaintList; late List<GetChiefComplaintResModel> patientChiefComplaintList;
List<VitalSignHistory> patientVitalSignsHistory; late List<VitalSignHistory> patientVitalSignsHistory;
List<GetAssessmentResModel> patientAssessmentList = []; List<GetAssessmentResModel> patientAssessmentList = [];
List<OrderProcedure> orderProcedureList = []; List<OrderProcedure> orderProcedureList = [];
PrescriptionModel? prescriptionList; PrescriptionModel? prescriptionList;
@ -22,13 +22,13 @@ class UcafService extends LookupService {
body['EpisodeID'] = patient.episodeNo; body['EpisodeID'] = patient.episodeNo;
body['DoctorID'] = ""; body['DoctorID'] = "";
patientChiefComplaintList = null; patientChiefComplaintList = [];
await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
if (patientChiefComplaintList != null) { if (patientChiefComplaintList != null) {
patientChiefComplaintList.clear(); patientChiefComplaintList.clear();
} else { } else {
patientChiefComplaintList = new List(); patientChiefComplaintList = [];
} }
response['List_ChiefComplaint']['entityList'].forEach((v) { response['List_ChiefComplaint']['entityList'].forEach((v) {
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
@ -50,14 +50,14 @@ class UcafService extends LookupService {
body['InOutPatientType'] = 2; body['InOutPatientType'] = 2;
} }
patientVitalSignsHistory = null; patientVitalSignsHistory = [];
await baseAppClient.post( await baseAppClient.post(
GET_PATIENT_VITAL_SIGN, GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
if (patientVitalSignsHistory != null) { if (patientVitalSignsHistory != null) {
patientVitalSignsHistory.clear(); patientVitalSignsHistory.clear();
} else { } else {
patientVitalSignsHistory = new List(); patientVitalSignsHistory = [];
} }
if (response['List_DoctorPatientVitalSign'] != null) { if (response['List_DoctorPatientVitalSign'] != null) {
response['List_DoctorPatientVitalSign'].forEach((v) { response['List_DoctorPatientVitalSign'].forEach((v) {
@ -86,14 +86,14 @@ class UcafService extends LookupService {
body['From'] = fromDate; body['From'] = fromDate;
body['To'] = toDate; body['To'] = toDate;
patientVitalSignsHistory = null; patientVitalSignsHistory = [];
await baseAppClient.post( await baseAppClient.post(
GET_PATIENT_VITAL_SIGN_DATA, GET_PATIENT_VITAL_SIGN_DATA,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
if (patientVitalSignsHistory != null) { if (patientVitalSignsHistory != null) {
patientVitalSignsHistory.clear(); patientVitalSignsHistory.clear();
} else { } else {
patientVitalSignsHistory = new List(); patientVitalSignsHistory = [];
} }
if (response['VitalSignsHistory'] != null) { if (response['VitalSignsHistory'] != null) {
response['VitalSignsHistory'].forEach((v) { response['VitalSignsHistory'].forEach((v) {

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

@ -235,7 +235,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
); );
} }
updateInCallPatient({PatiantInformtion patient, appointmentNo}) { updateInCallPatient({required PatiantInformtion patient, appointmentNo}) {
_liveCarePatientServices.patientList.forEach((e) { _liveCarePatientServices.patientList.forEach((e) {
if (e.patientId == patient.patientId) { if (e.patientId == patient.patientId) {
e.episodeNo = 0; 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); setState(ViewState.Busy);
await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber); await _service.updateMedicalReport(patient, htmlText, limitNumber!, invoiceNumber!);
if (_service.hasError) { if (_service.hasError) {
error = _service.error!; error = _service.error!;
await getMedicalReportList(patient); await getMedicalReportList(patient);

@ -18,7 +18,7 @@ class PatientRegistrationViewModel extends BaseViewModel {
GetPatientInfoResponseModel get getPatientInfoResponseModel => GetPatientInfoResponseModel get getPatientInfoResponseModel =>
_patientRegistrationService.getPatientInfoResponseModel; _patientRegistrationService.getPatientInfoResponseModel;
CheckPatientForRegistrationModel checkPatientForRegistrationModel; late CheckPatientForRegistrationModel checkPatientForRegistrationModel;
Future checkPatientForRegistration( Future checkPatientForRegistration(
CheckPatientForRegistrationModel registrationModel) async { CheckPatientForRegistrationModel registrationModel) async {
@ -142,10 +142,10 @@ class PatientRegistrationViewModel extends BaseViewModel {
} }
Future sendActivationCodeByOTPNotificationType( Future sendActivationCodeByOTPNotificationType(
{SendActivationCodeByOTPNotificationTypeForRegistrationModel {required SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel, registrationModel,
int otpType, required int otpType,
PatientRegistrationViewModel user}) async { required PatientRegistrationViewModel user}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
print(checkPatientForRegistrationModel); print(checkPatientForRegistrationModel);
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 if (isMyInPatient
? myIinPatientList.length > 0 ? myIinPatientList.length > 0
: isAllClinic : isAllClinic
@ -232,7 +232,7 @@ class PatientSearchViewModel extends BaseViewModel {
InpatientClinicList.clear(); InpatientClinicList.clear();
inPatientList.forEach((element) { inPatientList.forEach((element) {
if (!InpatientClinicList.contains(element.clinicDescription)) { 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 = []; filteredInPatientItems = [];
for (var i = 0; i < inPatientList.length; i++) { for (var i = 0; i < inPatientList.length; i++) {
if (inPatientList[i].projectId == hospitalId) { if (inPatientList[i].projectId == hospitalId) {
@ -270,7 +270,7 @@ class PatientSearchViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
} }
filterByClinic({String clinicName}) { filterByClinic({required String clinicName}) {
filteredInPatientItems = []; filteredInPatientItems = [];
for (var i = 0; i < inPatientList.length; i++) { for (var i = 0; i < inPatientList.length; i++) {
if (inPatientList[i].clinicDescription == clinicName) { if (inPatientList[i].clinicDescription == clinicName) {
@ -286,7 +286,7 @@ class PatientSearchViewModel extends BaseViewModel {
} }
void filterSearchResults(String query, void filterSearchResults(String query,
{bool isAllClinic, bool isMyInPatient}) { {required bool isAllClinic, required bool isMyInPatient}) {
var strExist = query.length > 0 ? true : false; var strExist = query.length > 0 ? true : false;
if (isMyInPatient) { if (isMyInPatient) {
@ -298,13 +298,13 @@ class PatientSearchViewModel extends BaseViewModel {
filteredMyInPatientItems.clear(); filteredMyInPatientItems.clear();
for (var i = 0; i < localFilteredMyInPatientItems.length; i++) { for (var i = 0; i < localFilteredMyInPatientItems.length; i++) {
String firstName = String firstName =
localFilteredMyInPatientItems[i].firstName.toUpperCase(); localFilteredMyInPatientItems[i].firstName!.toUpperCase();
String lastName = String lastName =
localFilteredMyInPatientItems[i].lastName.toUpperCase(); localFilteredMyInPatientItems[i].lastName!.toUpperCase();
String mobile = String mobile =
localFilteredMyInPatientItems[i].mobileNumber.toUpperCase(); localFilteredMyInPatientItems[i].mobileNumber!.toUpperCase();
String patientID = String patientID =
localFilteredMyInPatientItems[i].patientId.toString(); localFilteredMyInPatientItems[i].patientId!.toString();
if (firstName.contains(query.toUpperCase()) || if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) || lastName.contains(query.toUpperCase()) ||
@ -351,11 +351,11 @@ class PatientSearchViewModel extends BaseViewModel {
filteredInPatientItems.clear(); filteredInPatientItems.clear();
for (var i = 0; i < localFilteredInPatientItems.length; i++) { for (var i = 0; i < localFilteredInPatientItems.length; i++) {
String firstName = String firstName =
localFilteredInPatientItems[i].firstName.toUpperCase(); localFilteredInPatientItems[i].firstName!.toUpperCase();
String lastName = String lastName =
localFilteredInPatientItems[i].lastName.toUpperCase(); localFilteredInPatientItems[i].lastName!.toUpperCase();
String mobile = String mobile =
localFilteredInPatientItems[i].mobileNumber.toUpperCase(); localFilteredInPatientItems[i].mobileNumber!.toUpperCase();
String patientID = String patientID =
localFilteredInPatientItems[i].patientId.toString(); localFilteredInPatientItems[i].patientId.toString();

@ -100,7 +100,7 @@ class SOAPViewModel extends BaseViewModel {
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList; List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList;
SubjectiveCallBack subjectiveCallBack; late SubjectiveCallBack subjectiveCallBack;
setSubjectiveCallBack(SubjectiveCallBack callBack) { setSubjectiveCallBack(SubjectiveCallBack callBack) {
this.subjectiveCallBack = callBack; this.subjectiveCallBack = callBack;
@ -110,7 +110,7 @@ class SOAPViewModel extends BaseViewModel {
subjectiveCallBack.nextFunction(model); subjectiveCallBack.nextFunction(model);
} }
ObjectiveCallBack objectiveCallBack; late ObjectiveCallBack objectiveCallBack;
setObjectiveCallBack(ObjectiveCallBack callBack) { setObjectiveCallBack(ObjectiveCallBack callBack) {
this.objectiveCallBack = callBack; this.objectiveCallBack = callBack;
@ -120,7 +120,7 @@ class SOAPViewModel extends BaseViewModel {
objectiveCallBack.nextFunction(model); objectiveCallBack.nextFunction(model);
} }
AssessmentCallBack assessmentCallBack; late AssessmentCallBack assessmentCallBack;
setAssessmentCallBack(AssessmentCallBack callBack) { setAssessmentCallBack(AssessmentCallBack callBack) {
this.assessmentCallBack = callBack; this.assessmentCallBack = callBack;
@ -130,7 +130,7 @@ class SOAPViewModel extends BaseViewModel {
assessmentCallBack.nextFunction(model); assessmentCallBack.nextFunction(model);
} }
PlanCallBack planCallBack; late PlanCallBack planCallBack;
setPlanCallBack(PlanCallBack callBack) { setPlanCallBack(PlanCallBack callBack) {
this.planCallBack = callBack; this.planCallBack = callBack;
@ -299,8 +299,8 @@ class SOAPViewModel extends BaseViewModel {
patientInfo.appointmentNo.toString(), patientInfo.appointmentNo.toString(),
), ),
); );
if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty) if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty)
getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo); getPhysicalExamReqModel.admissionNo = int.parse(patientInfo!.admissionNo!);
else else
getPhysicalExamReqModel.admissionNo = 0; getPhysicalExamReqModel.admissionNo = 0;
setState(ViewState.Busy); setState(ViewState.Busy);
@ -350,7 +350,7 @@ class SOAPViewModel extends BaseViewModel {
GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel =
GetEpisodeForInpatientReqModel( GetEpisodeForInpatientReqModel(
patientID: patient.patientId, patientID: patient.patientId,
admissionNo: int.parse(patient.admissionNo), admissionNo: int.parse(patient!.admissionNo!),
patientTypeID: 1); patientTypeID: 1);
await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel); await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -480,10 +480,9 @@ class SOAPViewModel extends BaseViewModel {
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel getChiefComplaintReqModel =
GetChiefComplaintReqModel( GetChiefComplaintReqModel(
admissionNo: admissionNo:
patientInfo patientInfo!.admissionNo !=
.admissionNo !=
null null
? int.parse(patientInfo.admissionNo) ? int.parse(patientInfo!.admissionNo!)
: null, : null,
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
appointmentNo: patientInfo.appointmentNo != null appointmentNo: patientInfo.appointmentNo != null
@ -644,7 +643,7 @@ class SOAPViewModel extends BaseViewModel {
final results = await Future.wait(services ?? []); final results = await Future.wait(services ?? []);
if (_SOAPService.hasError || _prescriptionService.hasError) { if (_SOAPService.hasError || _prescriptionService.hasError) {
error = _SOAPService.error + _prescriptionService.error!; error = _SOAPService.error! + _prescriptionService.error!;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
@ -716,11 +715,11 @@ class SOAPViewModel extends BaseViewModel {
postSubjectServices( postSubjectServices(
{patientInfo, {patientInfo,
String complaintsText, required String complaintsText,
String medicationText, required String medicationText,
String illnessText, required String illnessText,
List<MySelectedHistory> myHistoryList, required List<MySelectedHistory> myHistoryList,
List<MySelectedAllergy> myAllergiesList}) async { required List<MySelectedAllergy> myAllergiesList}) async {
var services; var services;
PostChiefComplaintRequestModel postChiefComplaintRequestModel = PostChiefComplaintRequestModel postChiefComplaintRequestModel =
@ -774,9 +773,9 @@ class SOAPViewModel extends BaseViewModel {
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel( PostChiefComplaintRequestModel createPostChiefComplaintRequestModel(
{patientInfo, {patientInfo,
String complaintsText, required String complaintsText,
String medicationText, required String medicationText,
String illnessText}) { required String illnessText}) {
return new PostChiefComplaintRequestModel( return new PostChiefComplaintRequestModel(
admissionNo: patientInfo.admissionNo != null admissionNo: patientInfo.admissionNo != null
? int.parse(patientInfo.admissionNo) ? int.parse(patientInfo.admissionNo)
@ -794,13 +793,13 @@ class SOAPViewModel extends BaseViewModel {
} }
PostHistoriesRequestModel createPostHistoriesRequestModel( PostHistoriesRequestModel createPostHistoriesRequestModel(
{patientInfo, List<MySelectedHistory> myHistoryList}) { {patientInfo, required List<MySelectedHistory> myHistoryList}) {
PostHistoriesRequestModel postHistoriesRequestModel = PostHistoriesRequestModel postHistoriesRequestModel =
new PostHistoriesRequestModel(doctorID: ''); new PostHistoriesRequestModel(doctorID: '');
myHistoryList.forEach((history) { myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) if (postHistoriesRequestModel.listMedicalHistoryVM == null)
postHistoriesRequestModel.listMedicalHistoryVM = []; postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM(
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo, episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo, appointmentNo: patientInfo.appointmentNo,
@ -822,7 +821,7 @@ class SOAPViewModel extends BaseViewModel {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null) null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(
ListHisProgNotePatientAllergyDiseaseVM( ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId, allergyDiseaseType: allergy.selectedAllergy.typeId,
@ -831,9 +830,9 @@ class SOAPViewModel extends BaseViewModel {
appointmentNo: patientInfo.appointmentNo, appointmentNo: patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id, severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark, remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile.doctorID, createdBy: allergy.createdBy ?? doctorProfile!.doctorID,
createdOn: DateTime.now().toIso8601String(), createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID, editedBy: doctorProfile!.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked, isChecked: allergy.isChecked,
isUpdatedByNurse: false)); isUpdatedByNurse: false));

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

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

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

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

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

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

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

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

@ -15,7 +15,11 @@ class DischargeSummaryViewModel extends BaseViewModel {
_dischargeSummaryService.pendingDischargeSummaryList; _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 ); GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId );
hasError = false; hasError = false;
setState(ViewState.Busy); 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;
int? episodeID; int? episodeID;
dynamic doctorID; dynamic doctorID;
int admissionNo; int? admissionNo;
GetChiefComplaintReqModel({this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo}); GetChiefComplaintReqModel({this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo});

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

File diff suppressed because it is too large Load Diff

@ -28,22 +28,24 @@ class GetDischargeSummaryResModel {
int editedBy; int editedBy;
String editedOn; String editedOn;
bool isPatientDied; bool isPatientDied;
Null isMedicineApproved; dynamic isMedicineApproved;
Null isOpenBillDischarge; dynamic isOpenBillDischarge;
Null activatedDate; dynamic activatedDate;
Null activatedBy; dynamic activatedBy;
Null lAMA; dynamic lAMA;
Null patientCodition; dynamic patientCodition;
Null others; dynamic others;
Null reconciliationInstruction; dynamic reconciliationInstruction;
String dischargeInstructions; String dischargeInstructions;
String reason; String reason;
Null dischargeDisposition; dynamic dischargeDisposition;
Null hospitalID; dynamic hospitalID;
String createdByName; String createdByName;
Null createdByNameN; dynamic createdByNameN;
String editedByName; String editedByName;
Null editedByNameN; dynamic editedByNameN;
String clinicName;
String projectName;
GetDischargeSummaryResModel( GetDischargeSummaryResModel(
{this.setupID, {this.setupID,
@ -90,7 +92,9 @@ class GetDischargeSummaryResModel {
this.createdByName, this.createdByName,
this.createdByNameN, this.createdByNameN,
this.editedByName, this.editedByName,
this.editedByNameN}); this.editedByNameN,
this.clinicName,
this.projectName});
GetDischargeSummaryResModel.fromJson(Map<String, dynamic> json) { GetDischargeSummaryResModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];
@ -138,6 +142,8 @@ class GetDischargeSummaryResModel {
createdByNameN = json['CreatedByNameN']; createdByNameN = json['CreatedByNameN'];
editedByName = json['EditedByName']; editedByName = json['EditedByName'];
editedByNameN = json['EditedByNameN']; editedByNameN = json['EditedByNameN'];
clinicName = json['ClinicDescription'];
projectName = json['ProjectName'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -187,6 +193,9 @@ class GetDischargeSummaryResModel {
data['CreatedByNameN'] = this.createdByNameN; data['CreatedByNameN'] = this.createdByNameN;
data['EditedByName'] = this.editedByName; data['EditedByName'] = this.editedByName;
data['EditedByNameN'] = this.editedByNameN; data['EditedByNameN'] = this.editedByNameN;
data['ClinicDescription'] = this.clinicName;
data['ProjectName'] = this.projectName;
return data; 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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -25,6 +26,7 @@ import '../../widgets/auth/verification_methods_list.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers(); Helpers helpers = Helpers();
///TODO Elham* check if this still in user or not
class VerificationMethodsScreen extends StatefulWidget { class VerificationMethodsScreen extends StatefulWidget {
final password; final password;
@ -339,7 +341,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
SecondaryButton( SecondaryButton(
label: TranslationBase label: TranslationBase
.of(context) .of(context)
.useAnotherAccount, .useAnotherAccount??'',
color: Color(0xFFD02127), color: Color(0xFFD02127),
//fontWeight: FontWeight.w700, //fontWeight: FontWeight.w700,
onTap: () { onTap: () {
@ -387,7 +389,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);
} else { } else {
await sharedPref.setString(TOKEN, await sharedPref.setString(TOKEN,
authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!);
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType,isSilentLogin: true); this.startSMSService(authMethodType,isSilentLogin: true);
@ -470,8 +472,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
checkActivationCode({String value,bool isSilentLogin = false}) async { checkActivationCode({String? value,bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value,isSilentLogin: isSilentLogin); await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value!,isSilentLogin: isSilentLogin);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context); Navigator.pop(context);
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);

@ -12,9 +12,8 @@ import 'package:flutter/material.dart';
import 'doctor_repaly_chat.dart'; import 'doctor_repaly_chat.dart';
class AllDoctorQuestions extends StatefulWidget { class AllDoctorQuestions extends StatefulWidget {
final Function changeCurrentTab;
const AllDoctorQuestions({Key? key, this.changeCurrentTab}) : super(key: key); const AllDoctorQuestions({Key? key}) : super(key: key);
@override @override
_AllDoctorQuestionsState createState() => _AllDoctorQuestionsState(); _AllDoctorQuestionsState createState() => _AllDoctorQuestionsState();
@ -31,10 +30,9 @@ class _AllDoctorQuestionsState extends State<AllDoctorQuestions> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2,
isShowAppBar: false, isShowAppBar: false,
body: model.listDoctorWorkingHoursTable.isEmpty 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( : Column(
children: [ children: [
Expanded( Expanded(
@ -82,7 +80,7 @@ class _AllDoctorQuestionsState extends State<AllDoctorQuestions> {
}); });
model.getDoctorReply(pageIndex: pageIndex); 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/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -24,7 +24,7 @@ class DoctorReplayChat extends StatefulWidget {
final DoctorReplayViewModel previousModel; final DoctorReplayViewModel previousModel;
bool showMsgBox = false; bool showMsgBox = false;
DoctorReplayChat( DoctorReplayChat(
{Key? key, this.reply, this.previousModel, {Key? key, required this.reply, required this.previousModel,
}); });
@override @override
@ -37,8 +37,8 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if(widget.reply.doctorResponse.isNotEmpty){ if(widget.reply.doctorResponse!.isNotEmpty){
msgController.text = widget.reply.doctorResponse; msgController.text = widget.reply.doctorResponse!;
} else { } else {
widget.showMsgBox = true; widget.showMsgBox = true;
@ -172,7 +172,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
margin: EdgeInsets.symmetric(horizontal: 0), margin: EdgeInsets.symmetric(horizontal: 0),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
launch("tel://" +widget.reply.mobileNumber); launch("tel://" +widget.reply.mobileNumber!);
}, },
child: Icon( child: Icon(
Icons.phone, Icons.phone,
@ -194,7 +194,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
), ),
AppText( 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, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Colors.white, color: Colors.white,
@ -236,7 +236,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
SizedBox(height: 30,), SizedBox(height: 30,),
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( Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Container( child: Container(
@ -269,7 +269,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
width: 50, width: 50,
height: 50, height: 50,
child: Image.asset( child: Image.asset(
widget.previousModel.doctorProfile.gender == 0 widget.previousModel.doctorProfile!.gender == 0
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -280,7 +280,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
child: AppText( child: AppText(
widget.previousModel.doctorProfile.doctorName, widget.previousModel.doctorProfile!.doctorName,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF2B353E), color: Color(0xFF2B353E),

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

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

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

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class HomePatientCard extends StatelessWidget { class HomePatientCard extends StatelessWidget {
final Color backgroundColor; final Color backgroundColor;
final IconData cardIcon; final IconData cardIcon;
final String cardIconImage; final String? cardIconImage;
final Color backgroundIconColor; final Color backgroundIconColor;
final String text; final String text;
final Color textColor; final Color textColor;
@ -17,7 +17,7 @@ class HomePatientCard extends StatelessWidget {
required this.backgroundColor, required this.backgroundColor,
required this.backgroundIconColor, required this.backgroundIconColor,
required this.cardIcon, required this.cardIcon,
required this.cardIconImage, this.cardIconImage,
required this.text, required this.text,
required this.textColor, required this.textColor,
required this.onTap, required this.onTap,
@ -75,7 +75,7 @@ class HomePatientCard extends StatelessWidget {
color: textColor, color: textColor,
) )
: Image.asset( : Image.asset(
cardIconImage, cardIconImage!,
height: iconSize, height: iconSize,
width: 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/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:sticky_headers/sticky_headers/widget.dart';
import '../../routes.dart'; import '../../routes.dart';
import 'home_screen_header.dart'; import 'home_screen_header.dart';
@ -51,7 +53,7 @@ class _HomeScreenState extends State<HomeScreen> {
bool isExpanded = false; bool isExpanded = false;
bool isInpatient = false; bool isInpatient = false;
int sliderActiveIndex = 0; int sliderActiveIndex = 0;
String? clinicId; var clinicId;
late AuthenticationViewModel authenticationViewModel; late AuthenticationViewModel authenticationViewModel;
int colorIndex = 0; int colorIndex = 0;
final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
@ -328,22 +330,6 @@ class _HomeScreenState extends State<HomeScreen> {
DashboardViewModel model, projectsProvider) { DashboardViewModel model, projectsProvider) {
colorIndex = 0; 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 = []; List<Color> backgroundColors = [];
backgroundColors.add(Color(0xffD02127)); backgroundColors.add(Color(0xffD02127));
backgroundColors.add(Colors.grey[300]!); backgroundColors.add(Colors.grey[300]!);
@ -407,7 +393,7 @@ class _HomeScreenState extends State<HomeScreen> {
context, context,
FadePage( FadePage(
page: InPatientScreen( 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 //TODO Elham* match the of the icon
cardIcon: DoctorApp.arrival_patients, cardIcon: DoctorApp.arrival_patients,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
text: TranslationBase.of(context).registerNewPatient, text: TranslationBase.of(context).registerNewPatient!,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,

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

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

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

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

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

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

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

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

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

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

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

@ -26,7 +26,7 @@ import 'diabetic_details_blood_pressurewideget.dart';
class DiabeticChart extends StatefulWidget { class DiabeticChart extends StatefulWidget {
DiabeticChart({ DiabeticChart({
Key key, Key? key,
}) : super(key: key); }) : super(key: key);
@override @override
@ -45,11 +45,11 @@ class _DiabeticChartState extends State<DiabeticChart> {
DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4) DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4)
]; ];
DiabeticType selectedDiabeticType; late DiabeticType selectedDiabeticType;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
ProjectViewModel projectsProvider = Provider.of(context); ProjectViewModel projectsProvider = Provider.of(context);
return BaseView<PatientViewModel>( 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; final List<GetDiabeticChartValuesResponseModel> diabeticDetailsList;
DiabeticDetails( DiabeticDetails(
{Key? key, this.diabeticDetailsList,}); {Key? key, required this.diabeticDetailsList,});
@override @override
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
@ -70,7 +70,7 @@ class _VitalSignDetailsWidgetState extends State<DiabeticDetails> {
), ),
Table( Table(
border: TableBorder( border: TableBorder(
horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!),
), ),
children: fullData(projectViewModel), children: fullData(projectViewModel),
), ),

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

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

@ -1,49 +1,75 @@
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/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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'discharge_Summary_widget.dart'; import 'discharge_Summary_widget.dart';
class AllDischargeSummary extends StatefulWidget { 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 @override
_AllDischargeSummaryState createState() => _AllDischargeSummaryState(); _AllDischargeSummaryState createState() => _AllDischargeSummaryState();
} }
class _AllDischargeSummaryState extends State<AllDischargeSummary> { class _AllDischargeSummaryState extends State<AllDischargeSummary> {
int pageIndex = 1; int pageIndex = 1;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<DischargeSummaryViewModel>( return BaseView<DischargeSummaryViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getPendingDischargeSummary(); model.getAllDischargeSummary(
patientId: widget.patient.patientId,
admissionNo: int.parse(widget.patient.admissionNo!),
);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: model.pendingDischargeSummaryList.isEmpty body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) model.allDisChargeSummaryList.isEmpty
? ErrorMessage(
error: TranslationBase.of(context).noDataAvailable!)
: Column( : Column(
children: [ 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( Expanded(
child: Container( child: Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: model.pendingDischargeSummaryList.length, itemCount: model.allDisChargeSummaryList.length,
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Column( return Column(
@ -51,9 +77,8 @@ class _AllDischargeSummaryState extends State<AllDischargeSummary> {
InkWell( InkWell(
child: DischargeSummaryWidget( child: DischargeSummaryWidget(
dischargeSummary: model dischargeSummary: model
.pendingDischargeSummaryList[index]), .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/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.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/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class DischargeSummaryWidget extends StatefulWidget { class DischargeSummaryWidget extends StatefulWidget {
final GetDischargeSummaryResModel dischargeSummary; final GetDischargeSummaryResModel dischargeSummary;
bool isShowMore = false; bool isShowMore = false;
DischargeSummaryWidget({Key? key, this.dischargeSummary}); DischargeSummaryWidget({Key? key, required this.dischargeSummary});
@override @override
_DischargeSummaryWidgetState createState() => _DischargeSummaryWidgetState(); _DischargeSummaryWidgetState createState() => _DischargeSummaryWidgetState();
} }
class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> { class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
bool isCardExpanded = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Column(
child: CardWithBgWidget(
bgColor:Colors.transparent,
hasBorder: false,
widget: Container(
child: InkWell(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( 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, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( CustomRow(
AppDateUtils.getDateTimeFromServerFormat( 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) widget.dischargeSummary.createdOn)
.day .day
.toString() + .toString() +
@ -62,61 +88,149 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
widget.dischargeSummary.createdOn) widget.dischargeSummary.createdOn)
.year .year
.toString(), .toString(),
fontFamily: 'Poppins', isCopyable: false,
fontWeight: FontWeight.w600,
), ),
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,
), ),
bodyWidget: Row(
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox(
width: 20,
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// SizedBox(height: 10,), SizedBox(
Row( height: 15.0,
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
crossAxisAlignment: CrossAxisAlignment.start, AppText("More Details"),
children: [ SizedBox(
Column( height: 15.0,
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ Container(
CustomRow( width: MediaQuery.of(context).size.width * 0.5,
label: TranslationBase.of(context).fileNumber, child: RichText(
value: widget.dischargeSummary.patientID.toString(), maxLines: 3,
isCopyable:false, 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( SizedBox(
height: 8, 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( Container(
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
child: RichText( child: RichText(
@ -128,9 +242,7 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
color: Color(0xFF575757)), color: Color(0xFF575757)),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: text: "Planed Procedure" + ": ",
TranslationBase.of(context).requestType +
": ",
style: TextStyle( style: TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
@ -139,8 +251,8 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
//TranslationBase.of(context).doctorResponse + " : ", //TranslationBase.of(context).doctorResponse + " : ",
)), )),
new TextSpan( new TextSpan(
text: text: Helpers.parseHtmlString(
"${widget.dischargeSummary.dischargeInstructions}", widget.dischargeSummary.planedProcedure),
style: TextStyle( style: TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig fontSize: SizeConfig
@ -157,15 +269,11 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
) )
], ],
), ),
// Container( isExpand: isCardExpanded,
// alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight,
// child: Icon(FontAwesomeIcons.arrowRight,
// size: 20, color: Colors.black),)
],
), ),
// onTap: onTap,
)),
), ),
),
],
); );
} }
} }

@ -1,18 +1,9 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/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/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/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/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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/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:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -21,9 +12,9 @@ import 'all_discharge_summary.dart';
import 'pending_discharge_summary.dart'; import 'pending_discharge_summary.dart';
class DischargeSummaryPage extends StatefulWidget { class DischargeSummaryPage extends StatefulWidget {
final Function changeCurrentTab;
const DischargeSummaryPage({Key? key, this.changeCurrentTab}) : super(key: key); const DischargeSummaryPage({Key? key, })
: super(key: key);
@override @override
_DoctorReplyScreenState createState() => _DoctorReplyScreenState(); _DoctorReplyScreenState createState() => _DoctorReplyScreenState();
@ -31,7 +22,7 @@ class DischargeSummaryPage extends StatefulWidget {
class _DoctorReplyScreenState extends State<DischargeSummaryPage> class _DoctorReplyScreenState extends State<DischargeSummaryPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
int _activeTab = 0; int _activeTab = 0;
int pageIndex = 1; int pageIndex = 1;
@ -57,16 +48,15 @@ class _DoctorReplyScreenState extends State<DischargeSummaryPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; 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']; PatiantInformtion patient = routeArgs['patient'];
return WillPopScope( return WillPopScope(
onWillPop: () async { onWillPop: () async {
widget.changeCurrentTab();
return false; return false;
}, },
child: AppScaffold( child: AppScaffold(
appBarTitle: TranslationBase.of(context).replay2, appBarTitle: TranslationBase.of(context).replay2!,
isShowAppBar: true, isShowAppBar: true,
// appBarTitle: TranslationBase.of(context).progressNote, // appBarTitle: TranslationBase.of(context).progressNote,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
@ -111,7 +101,7 @@ class _DoctorReplyScreenState extends State<DischargeSummaryPage>
tabWidget( tabWidget(
screenSize, screenSize,
_activeTab == 1, _activeTab == 1,
TranslationBase.of(context).all, TranslationBase.of(context).all!,
), ),
], ],
), ),
@ -125,8 +115,10 @@ class _DoctorReplyScreenState extends State<DischargeSummaryPage>
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: [ children: [
PendingDischargeSummary(patient:patient ,), PendingDischargeSummary(
AllDischargeSummary(), 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/core/viewModel/profile/discharge_summary_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'discharge_Summary_widget.dart'; import 'discharge_Summary_widget.dart';
class PendingDischargeSummary extends StatefulWidget { class PendingDischargeSummary extends StatefulWidget {
final Function changeCurrentTab;
final PatiantInformtion patient; final PatiantInformtion patient;
const PendingDischargeSummary({Key? key, this.changeCurrentTab, this.patient}) const PendingDischargeSummary({Key? key, required this.patient})
: super(key: key); : super(key: key);
@override @override
@ -34,8 +28,7 @@ class _PendingDischargeSummaryState extends State<PendingDischargeSummary> {
onModelReady: (model) { onModelReady: (model) {
model.getPendingDischargeSummary( model.getPendingDischargeSummary(
patientId: widget.patient.patientId, patientId: widget.patient.patientId,
admissionNo: int.parse(widget.patient.admissionNo), admissionNo: int.parse(widget.patient.admissionNo!),
); );
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -44,9 +37,35 @@ class _PendingDischargeSummaryState extends State<PendingDischargeSummary> {
body: model.pendingDischargeSummaryList.isEmpty body: model.pendingDischargeSummaryList.isEmpty
? ErrorMessage( ? ErrorMessage(
error: TranslationBase.of(context) error: TranslationBase.of(context)
.noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) .noDataAvailable!) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!)
: Column( : Column(
children: [ 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( Expanded(
child: Container( child: Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),

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

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

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

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

@ -9,14 +9,14 @@ class LineChartCurvedLabHistory extends StatefulWidget {
final String title; final String title;
final List<LabResultHistory> labResultHistory; final List<LabResultHistory> labResultHistory;
LineChartCurvedLabHistory({this.title, this.labResultHistory}); LineChartCurvedLabHistory({required this.title, required this.labResultHistory});
@override @override
State<StatefulWidget> createState() => LineChartCurvedLabHistoryState(); State<StatefulWidget> createState() => LineChartCurvedLabHistoryState();
} }
class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> { class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
bool isShowingMainData; late bool isShowingMainData;
List<int> xAxixs = []; List<int> xAxixs = [];
int indexes = 0; int indexes = 0;

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

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

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

@ -13,7 +13,7 @@ class SpecialLabResultDetailsPage extends StatelessWidget {
final String resultData; final String resultData;
final PatiantInformtion patient; 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

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

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

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

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

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

@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PendingOrdersScreen extends StatelessWidget { class PendingOrdersScreen extends StatelessWidget {
const PendingOrdersScreen({Key? key}) : super(key: key); const PendingOrdersScreen({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,8 +36,38 @@ class PendingOrdersScreen extends StatelessWidget {
model.pendingOrdersList.length == 0 model.pendingOrdersList.length == 0
? DrAppEmbeddedError( ? DrAppEmbeddedError(
error: TranslationBase.of(context).noDataAvailable) error: TranslationBase.of(context).noDataAvailable)
: Container( : Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
AppText(
TranslationBase.of(context).pending,
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).orders,
fontSize: 25.0,
fontWeight: FontWeight.w700,
),
],
),
],
),
),
Container(
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.pendingOrdersList.length, itemCount: model.pendingOrdersList.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Padding( return Padding(
@ -52,12 +82,14 @@ class PendingOrdersScreen extends StatelessWidget {
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: child: AppText(
AppText(model.pendingOrdersList[index].notes), model.pendingOrdersList[index].notes),
), ),
), ),
); );
})), })),
],
),
), ),
); );
} }

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

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

@ -21,7 +21,7 @@ class BaseAddProcedureTabPage extends StatefulWidget {
final ProcedureType? procedureType; final ProcedureType? procedureType;
const BaseAddProcedureTabPage( 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); : super(key: key);
@override @override

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

@ -38,10 +38,10 @@ class PatientCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String nationalityName = patientInfo.nationalityName != null String? nationalityName = patientInfo.nationalityName != null
? patientInfo.nationalityName.trim() ? patientInfo.nationalityName!.trim()
: patientInfo.nationality != null : patientInfo.nationality != null
? patientInfo.nationality.trim() ? patientInfo.nationality!.trim()
: patientInfo.nationalityId != : patientInfo.nationalityId !=
null null
? patientInfo.nationalityId ? patientInfo.nationalityId
@ -283,7 +283,7 @@ class PatientCard extends StatelessWidget {
child: Container( child: Container(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: AppText( child: AppText(
nationalityName.truncate(14), nationalityName!.truncate(14),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
textOverflow: TextOverflow.ellipsis, textOverflow: TextOverflow.ellipsis,
@ -352,16 +352,16 @@ class PatientCard extends StatelessWidget {
), ),
CustomRow( CustomRow(
label: label:
TranslationBase.of(context).age + " : ", TranslationBase.of(context).age! + " : ",
value: value:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", "${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}",
), ),
if (isInpatient) if (isInpatient)
CustomRow( CustomRow(
label: patientInfo.admissionDate == null label: patientInfo.admissionDate == null
? "" ? ""
: TranslationBase.of(context) : TranslationBase.of(context)
.admissionDate + .admissionDate! +
" : ", " : ",
value: patientInfo.admissionDate == null value: patientInfo.admissionDate == null
? "" ? ""
@ -370,22 +370,22 @@ class PatientCard extends StatelessWidget {
if (patientInfo.admissionDate != null) if (patientInfo.admissionDate != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.numOfDays + .numOfDays! +
" : ", " : ",
value: value:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}",
), ),
if (patientInfo.admissionDate != null) if (patientInfo.admissionDate != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.clinicName + .clinicName! +
" : ", " : ",
value: "${patientInfo.clinicDescription}", value: "${patientInfo.clinicDescription}",
), ),
if (patientInfo.admissionDate != null) if (patientInfo.admissionDate != null)
CustomRow( CustomRow(
label: label:
TranslationBase.of(context).roomNo + TranslationBase.of(context).roomNo! +
" : ", " : ",
value: "${patientInfo.roomId}", value: "${patientInfo.roomId}",
), ),
@ -394,9 +394,9 @@ class PatientCard extends StatelessWidget {
children: [ children: [
CustomRow( CustomRow(
label: TranslationBase.of(context) 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 // ignore: must_be_immutable
class PatientProfileButton extends StatelessWidget { class PatientProfileButton extends StatelessWidget {
final String nameLine1; final String? nameLine1;
final String nameLine2; final String? nameLine2;
final String icon; final String icon;
final dynamic route; final dynamic route;
final PatiantInformtion patient; final PatiantInformtion patient;
@ -35,8 +35,8 @@ class PatientProfileButton extends StatelessWidget {
required this.patient, required this.patient,
required this.patientType, required this.patientType,
required this.arrivalType, required this.arrivalType,
required this.nameLine1, this.nameLine1,
required this.nameLine2, this.nameLine2,
required this.icon, required this.icon,
this.route, this.route,
this.isDisable = false, this.isDisable = false,

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

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

@ -16,7 +16,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
final bool isInpatient; final bool isInpatient;
ProfileMedicalInfoWidget( 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -57,7 +57,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: LAB_RESULT, route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab, nameLine1: TranslationBase.of(context).lab??'',
nameLine2: TranslationBase.of(context).result, nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'), icon: 'patient/lab_results.png'),
PatientProfileButton( PatientProfileButton(

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

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

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

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

@ -24,7 +24,7 @@ class AppTextFieldCustom extends StatefulWidget {
final int? maxLines; final int? maxLines;
final List<TextInputFormatter>? inputFormatters; final List<TextInputFormatter>? inputFormatters;
final Function(String)? onChanged; final Function(String)? onChanged;
final Function onFieldSubmitted; final Function? onFieldSubmitted;
final String? validationError; final String? validationError;
final bool? isPrscription; final bool? isPrscription;
@ -152,7 +152,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
widget.onChanged!(value); widget.onChanged!(value);
} }
}, },
onFieldSubmitted: widget.onFieldSubmitted, onFieldSubmitted: widget.onFieldSubmitted!(),
obscureText: widget.isSecure!), obscureText: widget.isSecure!),
) )
: AppText( : AppText(
@ -170,7 +170,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
? Container( ? Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
bottom: widget.isSearchTextField bottom: widget.isSearchTextField
? (widget.controller.text.isEmpty || ? (widget.controller!.text.isEmpty ||
widget.controller == null) widget.controller == null)
? 10 ? 10
: 25 : 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 { class AppTextFieldCustomSearch extends StatelessWidget {
const AppTextFieldCustomSearch({ const AppTextFieldCustomSearch({
Key key, Key? key,
this.onChangeFun, this.onChangeFun,
this.positionedChild, this.positionedChild,
this.marginTop, this.marginTop,
@ -20,23 +20,23 @@ class AppTextFieldCustomSearch extends StatelessWidget {
this.hintText, this.hintText,
}); });
final TextEditingController searchController; final TextEditingController? searchController;
final Function onChangeFun; final Function? onChangeFun;
final Function onFieldSubmitted; final Function? onFieldSubmitted;
final Widget positionedChild; final Widget ?positionedChild;
final IconButton suffixIcon; final IconButton? suffixIcon;
final double marginTop; final double? marginTop;
final String validationError; final String? validationError;
final String hintText; final String? hintText;
final TextInputType inputType; final TextInputType? inputType;
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter>? inputFormatters;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( 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( child: Stack(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
@ -54,11 +54,11 @@ class AppTextFieldCustomSearch extends StatelessWidget {
onPressed: () {}, onPressed: () {},
), ),
controller: searchController, controller: searchController,
onChanged: onChangeFun, onChanged: onChangeFun!(),
onFieldSubmitted: onFieldSubmitted, onFieldSubmitted: onFieldSubmitted,
validationError: validationError), validationError: validationError),
if (positionedChild != null) 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? keyId;
final String? hintText; final String? hintText;
final double? width; final double? width;
final Function(dynamic) okFunction; final Function(dynamic)? okFunction;
CountryTextField( CountryTextField(
{Key? key, {Key? key,
@ -41,14 +41,14 @@ class _CountryTextfieldState extends State<CountryTextField> {
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: widget.elementList, list: widget.elementList!,
attributeName: '${widget.keyName}', attributeName: '${widget.keyName}',
attributeValueId: widget.elementList.length == 1 attributeValueId: widget.elementList!.length == 1
? widget.elementList[0]['${widget.keyId}'] ? widget.elementList![0]['${widget.keyId}']
: '${widget.keyId}', : '${widget.keyId}',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) => okFunction: (selectedValue) =>
widget.okFunction(selectedValue), widget.okFunction!(selectedValue),
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
@ -61,14 +61,14 @@ class _CountryTextfieldState extends State<CountryTextField> {
: null, : null,
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: widget.hintText, hintText: widget.hintText,
dropDownText: widget.elementList.length == 1 dropDownText: widget.elementList!.length == 1
? widget.elementList[0]['${widget.keyName}'] ? widget.elementList![0]['${widget.keyName}']
: widget.element != null : widget.element != null
? widget.element['${widget.keyName}'] ? widget.element['${widget.keyName}']
: null, : null,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: validationError:
widget.elementList.length != 1 ? widget.elementError : null, widget.elementList!.length != 1 ? widget.elementError : null,
enabled: false, enabled: false,
), ),
), ),

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

@ -9,7 +9,7 @@ class SlideUpPageRoute extends PageRouteBuilder {
final Widget widget; final Widget widget;
final bool fullscreenDialog; final bool fullscreenDialog;
final bool opaque; 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( : super(

File diff suppressed because it is too large Load Diff

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

Loading…
Cancel
Save