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
if (width != null) {
return width / 100;
@ -84,7 +84,7 @@ class SizeConfig {
return widthMultiplier;
}
static getWidthMultiplier({double width}) {
static getWidthMultiplier({double? width}) {
// TODO handel LandScape case
if (width != null) {
return width / 100;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -15,7 +15,7 @@ class DischargeSummaryViewModel extends BaseViewModel {
_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 );
hasError = false;
setState(ViewState.Busy);

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

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

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

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

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

@ -14,10 +14,27 @@ import 'large_avatar.dart';
class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
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;
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
Widget build(BuildContext context) {
@ -185,7 +202,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
width: 1,
),
AppText(
patient.patientId.toString(),
patientProfileAppBarModel.patient!.patientId.toString(),
fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
@ -225,12 +242,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
),
HeaderRow(
label: TranslationBase.of(context).age + " : ",
label: TranslationBase.of(context).age! + " : ",
value:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
"${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient!.patientDetails != null ? patientProfileAppBarModel.patient!.patientDetails!.dateofBirth ?? "" : patientProfileAppBarModel.patient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
),if (patientProfileAppBarModel.patient!.appointmentDate != null &&
patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty &&
!isFromLabResult)
!isFromLabResult!)
HeaderRow(
label:
TranslationBase.of(context).appointmentDate! + " : ",
@ -250,24 +267,24 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (patient.admissionDate != null &&
patient.admissionDate.isNotEmpty)
if (patientProfileAppBarModel.patient!.admissionDate != null &&
patientProfileAppBarModel.patient!.admissionDate!.isNotEmpty)
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(
label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient &&
patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
patientProfileAppBarModel.patient!.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.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,
isCopyable: true,
),
if (orderNo != null && !isPrescriptions)
if (orderNo != null && !isPrescriptions!)
HeaderRow(
label: 'Order No: ',
value: orderNo ?? '',
),
if (invoiceNO != null && !isPrescriptions)
if (invoiceNO != null && !isPrescriptions!)
HeaderRow(
label: 'Invoice: ',
value: invoiceNO ?? "",
@ -342,23 +359,23 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
label: 'Clinic: ',
value: clinic ?? '',
),
if (isMedicalFile && episode != null)
if (isMedicalFile! && episode != null)
HeaderRow(
label: 'Episode: ',
value: episode ?? '',
),
if (isMedicalFile && visitDate != null)
if (isMedicalFile! && visitDate != null)
HeaderRow(
label: 'Visit Date: ',
value: visitDate ?? '',
),
if (!isMedicalFile)
if (!isMedicalFile!)
HeaderRow(
label: !isPrescriptions
label: !isPrescriptions!
? 'Result Date:'
: 'Prescriptions Date ',
value:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
),
]),
),
@ -396,8 +413,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
}
class HeaderRow extends StatelessWidget {
final String label;
final String value;
final String? label;
final String? value;
const HeaderRow({Key? key, this.label, this.value}) : super(key: key);

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

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

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

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

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

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

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

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

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

@ -5,17 +5,17 @@ import '../app_texts_widget.dart';
class CustomRow extends StatelessWidget {
const CustomRow({
Key key,
Key? key,
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);
final String label;
final String? label;
final String value;
final double labelSize;
final double valueSize;
final double width;
final bool isCopyable;
final double? labelSize;
final double? valueSize;
final double? width;
final bool? isCopyable;
@override
Widget build(BuildContext context) {

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

File diff suppressed because it is too large Load Diff

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

Loading…
Cancel
Save