fix utils && widget

merge-requests/889/head
Elham Rababh 3 years ago
parent ced1c9b392
commit dc0f3e7235

@ -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,

@ -39,13 +39,12 @@ class PatientRegistrationService extends BaseService {
} }
sendActivationCodeByOTPNotificationType( sendActivationCodeByOTPNotificationType(
{required SendActivationCodeByOTPNotificationTypeForRegistrationModel {
registrationModel,
required int otpType, required int otpType,
required PatientRegistrationViewModel model, required PatientRegistrationViewModel model,
required CheckPatientForRegistrationModel required CheckPatientForRegistrationModel
checkPatientForRegistrationModel}) async { checkPatientForRegistrationModel}) async {
registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel( SendActivationCodeByOTPNotificationTypeForRegistrationModel(
oTPSendType: otpType, oTPSendType: otpType,
patientIdentificationID: checkPatientForRegistrationModel patientIdentificationID: checkPatientForRegistrationModel

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

@ -13,10 +13,10 @@ class PendingOrderService extends BaseService {
List<AdmissionOrdersModel> get admissionOrderList => _admissionOrderList; List<AdmissionOrdersModel> get admissionOrderList => _admissionOrderList;
Future getPendingOrders( Future getPendingOrders(
{required PendingOrderRequestModel pendingOrderRequestModel, {
required int patientId, required int patientId,
required 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(
{required AdmissionOrdersRequestModel admissionOrdersRequestModel, {
required int patientId, required int patientId,
required 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;

@ -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);

@ -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,7 @@ class DischargeSummaryViewModel extends BaseViewModel {
_dischargeSummaryService.pendingDischargeSummaryList; _dischargeSummaryService.pendingDischargeSummaryList;
Future getPendingDischargeSummary({int patientId, int admissionNo, }) async { 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);

@ -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;

@ -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,

@ -14,10 +14,27 @@ import 'large_avatar.dart';
class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
final PatientProfileAppBarModel patientProfileAppBarModel; final PatientProfileAppBarModel patientProfileAppBarModel;
final bool isFromLabResult; 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({required 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});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -185,7 +202,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
width: 1, width: 1,
), ),
AppText( AppText(
patient.patientId.toString(), patientProfileAppBarModel.patient!.patientId.toString(),
fontSize: fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() * SizeConfig.getTextMultiplierBasedOnWidth() *
3.5, 3.5,
@ -225,12 +242,12 @@ 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(patientProfileAppBarModel.patient!.patientDetails != null ? patientProfileAppBarModel.patient!.patientDetails!.dateofBirth ?? "" : patientProfileAppBarModel.patient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
),if (patientProfileAppBarModel.patient!.appointmentDate != null && ),if (patientProfileAppBarModel.patient!.appointmentDate != null &&
patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty && patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty &&
!isFromLabResult) !isFromLabResult!)
HeaderRow( HeaderRow(
label: label:
TranslationBase.of(context).appointmentDate! + " : ", TranslationBase.of(context).appointmentDate! + " : ",
@ -250,24 +267,24 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (patient.admissionDate != null && if (patientProfileAppBarModel.patient!.admissionDate != null &&
patient.admissionDate.isNotEmpty) patientProfileAppBarModel.patient!.admissionDate!.isNotEmpty)
HeaderRow( HeaderRow(
label: patient.admissionDate == null label: patientProfileAppBarModel.patient!.admissionDate == null
? "" ? ""
: TranslationBase.of(context).admissionDate + : TranslationBase.of(context).admissionDate! +
" : ", " : ",
value: patient.admissionDate == null value: patientProfileAppBarModel.patient!.admissionDate == null
? "" ? ""
: "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}",
), ),
if (patient.admissionDate != null) if (patientProfileAppBarModel.patient!.admissionDate != null)
HeaderRow( HeaderRow(
label: "${TranslationBase.of(context).numOfDays}: ", label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient && value: isDischargedPatient &&
patient.dischargeDate != null patientProfileAppBarModel.patient!.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" ? "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}",
) )
], ],
), ),
@ -322,12 +339,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 +359,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)}',
), ),
]), ]),
), ),
@ -396,8 +413,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
} }
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)";
@ -343,7 +343,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
date.day.toString().padLeft(2, '0'); date.day.toString().padLeft(2, '0');
} }
return newDate ?? ''; return newDate??'';
} }
isToday(date) { isToday(date) {

@ -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(

@ -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,9 +9,9 @@ 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(
pageBuilder: ( pageBuilder: (
BuildContext context, BuildContext context,

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