fix error to make the code work with flutter 2

merge-requests/748/head
Elham Rababah 5 years ago
parent ca6306950d
commit 329711a002

@ -75,7 +75,7 @@ class SizeConfig {
print('isMobilePortrait $isMobilePortrait');
}
static getTextMultiplierBasedOnWidth({double width}){
static getTextMultiplierBasedOnWidth({double? width}){
// TODO handel LandScape case
if(width != null) {
return width / 100;
@ -84,7 +84,7 @@ class SizeConfig {
}
static getWidthMultiplier({double width}){
static getWidthMultiplier({double? width}){
// TODO handel LandScape case
if(width != null) {
return width / 100;
@ -92,7 +92,7 @@ class SizeConfig {
return widthMultiplier;
}
static getHeightMultiplier({double height}){
static getHeightMultiplier({double? height}){
// TODO handel LandScape case
if(height != null) {
return height / 100;

@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
class AlternativeService {
int serviceID;
String serviceName;
bool isSelected;
int? serviceID;
String? serviceName;
bool? isSelected;
AlternativeService(
{this.serviceID, this.serviceName, this.isSelected = false});
@ -23,7 +23,7 @@ class AlternativeService {
}
class AlternativeServicesList with ChangeNotifier {
List<AlternativeService> _alternativeServicesList;
late List<AlternativeService> _alternativeServicesList;
getServicesList(){
return _alternativeServicesList;

@ -1,9 +1,9 @@
class LiveCareUserLoginRequestModel {
String tokenID;
String generalid;
int doctorId;
int isOutKsa;
int isLogin;
String? tokenID;
String? generalid;
int? doctorId;
int? isOutKsa;
int? isLogin;
LiveCareUserLoginRequestModel({this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.isLogin});

@ -11,8 +11,8 @@ class PatientSearchRequestModel {
int ?searchType;
String? mobileNo;
String? identificationNo;
int nursingStationID;
int clinicID=0;
int? nursingStationID;
int? clinicID=0;
PatientSearchRequestModel(
{this.doctorID = 0,

@ -61,7 +61,7 @@ class MyReferralPatientModel {
String? priorityDescription;
String? referringClinicDescription;
String? referringDoctorName;
int referalStatus;
int? referalStatus;
MyReferralPatientModel(
{this.rowID,

@ -1,27 +1,27 @@
class MyReferralPatientRequestModel {
int channel;
int clinicID;
int doctorID;
int editedBy;
String firstName;
String from;
String iPAdress;
bool isLoginForDoctorApp;
int languageID;
String lastName;
String middleName;
int patientID;
String patientIdentificationID;
String patientMobileNumber;
bool patientOutSA;
int patientTypeID;
int projectID;
String sessionID;
String stamp;
String to;
String tokenID;
double versionID;
String vidaAuthTokenID;
int? channel;
int? clinicID;
int? doctorID;
int? editedBy;
String? firstName;
String? from;
String? iPAdress;
bool? isLoginForDoctorApp;
int? languageID;
String? lastName;
String? middleName;
int? patientID;
String? patientIdentificationID;
String? patientMobileNumber;
bool? patientOutSA;
int? patientTypeID;
int? projectID;
String? sessionID;
String? stamp;
String? to;
String? tokenID;
double? versionID;
String? vidaAuthTokenID;
MyReferralPatientRequestModel(
{this.channel,

@ -1,19 +1,19 @@
class AddReferredRemarksRequestModel {
int projectID;
int admissionNo;
int lineItemNo;
String referredDoctorRemarks;
int editedBy;
int referalStatus;
bool isLoginForDoctorApp;
String iPAdress;
bool patientOutSA;
String tokenID;
int languageID;
double versionID;
int channel;
String sessionID;
int deviceTypeID;
int? projectID;
int? admissionNo;
int? lineItemNo;
String? referredDoctorRemarks;
int? editedBy;
int? referalStatus;
bool? isLoginForDoctorApp;
String? iPAdress;
bool? patientOutSA;
String? tokenID;
int? languageID;
double? versionID;
int? channel;
String? sessionID;
int? deviceTypeID;
AddReferredRemarksRequestModel(
{this.projectID,

@ -3,16 +3,16 @@ import 'package:flutter/material.dart';
class NavigationService {
final GlobalKey<NavigatorState> navigatorKey =
new GlobalKey<NavigatorState>();
Future<dynamic> navigateTo(String routeName,{Object arguments}) {
return navigatorKey.currentState.pushNamed(routeName,arguments: arguments);
Future<dynamic> navigateTo(String routeName,{required Object arguments}) {
return navigatorKey.currentState!.pushNamed(routeName,arguments: arguments);
}
Future<dynamic> pushReplacementNamed(String routeName,{Object arguments}) {
return navigatorKey.currentState.pushReplacementNamed(routeName,arguments: arguments);
Future<dynamic> pushReplacementNamed(String routeName,{required Object arguments}) {
return navigatorKey.currentState!.pushReplacementNamed(routeName,arguments: arguments);
}
Future<dynamic> pushNamedAndRemoveUntil(String routeName) {
return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false);
return navigatorKey.currentState!.pushNamedAndRemoveUntil(routeName,(asd)=>false);
}
}

@ -18,14 +18,14 @@ import 'NavigationService.dart';
class VideoCallService extends BaseService{
StartCallRes startCallRes;
PatiantInformtion patient;
late StartCallRes startCallRes;
late PatiantInformtion patient;
LiveCarePatientServices _liveCarePatientServices = locator<LiveCarePatientServices>();
openVideo(StartCallRes startModel,PatiantInformtion patientModel,VoidCallback onCallConnected, VoidCallback onCallDisconnected)async{
this.startCallRes = startModel;
this.patient = patientModel;
DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true);
DoctorProfileModel? doctorProfile = await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen(
kToken: startCallRes.openTokenID,//"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",
kSessionId:startCallRes.openSessionID,//1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg
@ -34,15 +34,15 @@ class VideoCallService extends BaseService{
patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
tokenID: await sharedPref.getString(TOKEN),
generalId: GENERAL_ID,
doctorId: doctorProfile.doctorID,
doctorId: doctorProfile!.doctorID,
onFailure: (String error) {
DrAppToastMsg.showErrorToast(error);
},onCallConnected: onCallConnected,
onCallEnd: () {
WidgetsBinding.instance.addPostFrameCallback((_) async {
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext);
endCall(patient.vcId, false,).then((value) {
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext);
WidgetsBinding.instance!.addPostFrameCallback((_) async {
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext!);
endCall(patient.vcId!, false,).then((value) {
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext!);
if (hasError) {
DrAppToastMsg.showErrorToast(error);
}else
@ -54,10 +54,10 @@ class VideoCallService extends BaseService{
});
},
onCallNotRespond: (SessionStatusModel sessionStatusModel) {
WidgetsBinding.instance.addPostFrameCallback((_) {
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext);
endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) {
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext);
WidgetsBinding.instance!.addPostFrameCallback((_) {
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext!);
endCall(patient.vcId!, sessionStatusModel.sessionStatus == 3,).then((value) {
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext!);
if (hasError) {
DrAppToastMsg.showErrorToast(error);
} else {
@ -76,13 +76,13 @@ class VideoCallService extends BaseService{
hasError = false;
await getDoctorProfile(isGetProfile: true);
EndCallReq endCallReq = new EndCallReq();
endCallReq.doctorId = doctorProfile.doctorID;
endCallReq.doctorId = doctorProfile!.doctorID;
endCallReq.generalid = 'Cs2020@2016\$2958';
endCallReq.vCID = vCID;
endCallReq.isDestroy = isPatient;
await _liveCarePatientServices.endCall(endCallReq);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
error = _liveCarePatientServices.error!;
}
}

@ -4,15 +4,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
class ScanQrService extends BaseService {
List<PatiantInformtion> myInPatientList = List();
List<PatiantInformtion> inPatientList = List();
List<PatiantInformtion> myInPatientList = [];
List<PatiantInformtion> inPatientList = [];
Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async {
hasError = false;
await getDoctorProfile();
if (isMyInpatient) {
requestModel.doctorID = doctorProfile.doctorID;
requestModel.doctorID = doctorProfile!.doctorID!;
} else {
requestModel.doctorID = 0;
}
@ -26,7 +26,7 @@ class ScanQrService extends BaseService {
response['List_MyInPatient'].forEach((v) {
PatiantInformtion patient = PatiantInformtion.fromJson(v);
inPatientList.add(patient);
if (patient.doctorId == doctorProfile.doctorID) {
if (patient.doctorId == doctorProfile!.doctorID!) {
myInPatientList.add(patient);
}
});

@ -113,10 +113,10 @@ class LiveCarePatientServices extends BaseService {
}, isLiveCare: _isLive);
}
Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async {
Future isLogin({LiveCareUserLoginRequestModel? isLoginRequestModel, int? loginStatus}) async {
hasError = false;
await getDoctorProfile( );
isLoginRequestModel.doctorId = super.doctorProfile.doctorID;
isLoginRequestModel!.doctorId = super.doctorProfile!.doctorID!;
await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async {
isLoginResponse = response;
}, onFailure: (String error, int statusCode) {

@ -13,7 +13,7 @@ class MyReferralInPatientService extends BaseService {
await getDoctorProfile();
MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel(
doctorID: doctorProfile!.doctorID,
doctorID: doctorProfile!.doctorID!,
firstName: "0",
middleName: "0",
lastName: "0",
@ -48,7 +48,7 @@ class MyReferralInPatientService extends BaseService {
await getDoctorProfile();
MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel(
doctorID: doctorProfile.doctorID,
doctorID: doctorProfile!.doctorID!,
firstName: "0",
middleName: "0",
lastName: "0",
@ -104,15 +104,15 @@ class MyReferralInPatientService extends BaseService {
hasError = false;
await getDoctorProfile();
AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = AddReferredRemarksRequestModel(
editedBy: doctorProfile.doctorID,
projectID: doctorProfile.projectID,
editedBy: doctorProfile!.doctorID!,
projectID: doctorProfile!.projectID!,
referredDoctorRemarks: referredDoctorRemarks,
referalStatus: referalStatus);
_requestAddReferredDoctorRemarks.projectID = referral.projectID;
_requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo);
_requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo;
_requestAddReferredDoctorRemarks.projectID = referral.projectID!;
_requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo!);
_requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo!;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks;
_requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID;
_requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID!;
_requestAddReferredDoctorRemarks.referalStatus = referalStatus;
// _requestAddReferredDoctorRemarks.patientID = referral.patientID;

@ -155,7 +155,7 @@ class PatientReferralService extends LookupService {
hasError = false;
RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel();
DoctorProfileModel doctorProfile = await getDoctorProfile();
DoctorProfileModel? doctorProfile = await getDoctorProfile();
await baseAppClient.post(
GET_MY_REFERRED_OUT_PATIENT,

@ -24,8 +24,8 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_mode
class PatientService extends BaseService {
List<VitalSignResModel> _patientVitalSignList = [];
List<VitalSignResModel> patientVitalSignOrderdSubList = [];
List<PatiantInformtion> inPatientList = List();
List<PatiantInformtion> myInPatientList = List();
List<PatiantInformtion> inPatientList = [];
List<PatiantInformtion> myInPatientList = [];
List<VitalSignResModel> get patientVitalSignList => _patientVitalSignList;
@ -141,7 +141,7 @@ class PatientService extends BaseService {
await getDoctorProfile();
if (isMyInpatient) {
requestModel.doctorID = doctorProfile.doctorID;
requestModel.doctorID = doctorProfile!.doctorID!;
} else {
requestModel.doctorID = 0;
}
@ -155,7 +155,7 @@ class PatientService extends BaseService {
response['List_MyInPatient'].forEach((v) {
PatiantInformtion patient = PatiantInformtion.fromJson(v);
inPatientList.add(patient);
if (patient.doctorId == doctorProfile.doctorID) {
if (patient.doctorId == doctorProfile!.doctorID!) {
myInPatientList.add(patient);
}
});

@ -23,7 +23,7 @@ class ProcedureService extends BaseService {
List<Procedures> procedureslist = [];
List<dynamic> categoryList = [];
// List<ProcedureTempleteModel> _templateList = List();
// List<ProcedureTempleteModel> _templateList = [];
// List<ProcedureTempleteModel> get templateList => _templateList;
List<ProcedureTempleteDetailsModel> templateList = [];

@ -71,15 +71,15 @@ class LiveCarePatientViewModel extends BaseViewModel {
Future startCall({required int vCID, required bool isReCall}) async {
StartCallReq startCallReq = new StartCallReq();
await getDoctorProfile();
startCallReq.clinicId = super.doctorProfile!.clinicID;
startCallReq.clinicId = super.doctorProfile!.clinicID!;
startCallReq.vCID = vCID; //["VC_ID"];
startCallReq.isrecall = isReCall;
startCallReq.doctorId = doctorProfile!.doctorID;
startCallReq.doctorId = doctorProfile!.doctorID!;
startCallReq.isOutKsa = false; //["IsOutKSA"];
startCallReq.projectName = doctorProfile!.projectName;
startCallReq.docotrName = doctorProfile!.doctorName;
startCallReq.clincName = doctorProfile!.clinicDescription;
startCallReq.docSpec = doctorProfile!.doctorTitleForProfile;
startCallReq.projectName = doctorProfile!.projectName!;
startCallReq.docotrName = doctorProfile!.doctorName!;
startCallReq.clincName = doctorProfile!.clinicDescription!;
startCallReq.docSpec = doctorProfile!.doctorTitleForProfile!;
startCallReq.generalid = 'Cs2020@2016\$2958';
setState(ViewState.BusyLocal);
@ -92,9 +92,9 @@ class LiveCarePatientViewModel extends BaseViewModel {
}
}
setSelectedCheckboxValues(AlternativeService service, bool isSelected) {
int index = alternativeServicesList.indexOf(service);
if (index != -1) alternativeServicesList[index].isSelected = isSelected;
setSelectedCheckboxValues(AlternativeService? service, bool? isSelected) {
int index = alternativeServicesList.indexOf(service!);
if (index != -1) alternativeServicesList[index].isSelected = isSelected!;
notifyListeners();
}
@ -118,10 +118,10 @@ class LiveCarePatientViewModel extends BaseViewModel {
}
List<int> getSelectedAlternativeServices() {
List<int> selectedServices = List();
List<int> selectedServices = [];
for (AlternativeService service in alternativeServicesList) {
if (service.isSelected) {
selectedServices.add(service.serviceID);
if (service.isSelected!) {
selectedServices.add(service.serviceID!);
}
}
return selectedServices;
@ -131,7 +131,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
setState(ViewState.BusyLocal);
await _liveCarePatientServices.getAlternativeServices(vcID);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
error = _liveCarePatientServices.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
@ -154,7 +154,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
setState(ViewState.BusyLocal);
await _liveCarePatientServices.sendSMSInstruction(vcID);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
error = _liveCarePatientServices.error!;
setState(ViewState.ErrorLocal);
} else {
await getPendingPatientERForDoctorApp();
@ -186,14 +186,14 @@ class LiveCarePatientViewModel extends BaseViewModel {
await getDoctorProfile(isGetProfile: true);
LiveCareUserLoginRequestModel userLoginRequestModel = new LiveCareUserLoginRequestModel();
userLoginRequestModel.isOutKsa = (doctorProfile.projectID == 2 || doctorProfile.projectID == 3) ? 1 : 0;
userLoginRequestModel.isOutKsa = (doctorProfile!.projectID! == 2 || doctorProfile!.projectID! == 3) ? 1 : 0;
userLoginRequestModel.isLogin = loginStatus;
userLoginRequestModel.generalid = "Cs2020@2016\$2958";
setState(ViewState.BusyLocal);
await _liveCarePatientServices.isLogin(loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
error = _liveCarePatientServices.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);

@ -199,7 +199,7 @@ class PatientSearchViewModel extends BaseViewModel {
}
await _specialClinicsService.getSpecialClinicalCareMappingList(clinicId);
if (_specialClinicsService.hasError) {
error = _specialClinicsService.error;
error = _specialClinicsService.error!;
if (isLocalBusy) {
setState(ViewState.ErrorLocal);
} else {

@ -232,7 +232,7 @@ class AuthenticationViewModel extends BaseViewModel {
/// add  token to shared preferences in case of send activation code is success
setDataAfterSendActivationSuccess(
SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) {
print("VerificationCode : " +sendActivationCodeForDoctorAppResponseModel.verificationCode);
print("VerificationCode : " +sendActivationCodeForDoctorAppResponseModel!.verificationCode!);
// DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode!);
sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!);
sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!);

@ -66,7 +66,7 @@ class DashboardViewModel extends BaseViewModel {
setState(ViewState.Busy);
await _specialClinicsService.getSpecialClinicalCareList();
if (_specialClinicsService.hasError) {
error = _specialClinicsService.error;
error = _specialClinicsService.error!;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
@ -82,7 +82,7 @@ class DashboardViewModel extends BaseViewModel {
);
await authProvider.getDoctorProfileBasedOnClinic(clinicModel);
if (authProvider.state == ViewState.ErrorLocal) {
error = authProvider.error;
error = authProvider.error!;
}
}
@ -94,8 +94,8 @@ class DashboardViewModel extends BaseViewModel {
}
GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId){
GetSpecialClinicalCareListResponseModel special ;
GetSpecialClinicalCareListResponseModel? getSpecialClinic(clinicId){
GetSpecialClinicalCareListResponseModel? special ;
specialClinicalCareList.forEach((element) {
if(element.clinicID == 1){
special = element;

@ -140,7 +140,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.BusyLocal);
await _referralPatientService.getMyReferredOutPatient();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
error = _referralPatientService.error!;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
@ -183,7 +183,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Busy);
await _myReferralService.getMyReferralOutPatientService();
if (_myReferralService.hasError) {
error = _myReferralService.error;
error = _myReferralService.error!;
if (localBusy)
setState(ViewState.ErrorLocal);
else
@ -239,7 +239,7 @@ class PatientReferralViewModel extends BaseViewModel {
patientID: patient.patientId,
roomID: patient.roomId,
referralClinic: clinicID,
admissionNo: int.parse(patient.admissionNo),
admissionNo: int.parse(patient.admissionNo!),
referralDoctor: doctorID,
patientTypeID: patient.patientType,
referringDoctorRemarks: remarks,
@ -395,7 +395,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Busy);
await _myReferralService.replayReferred(referredDoctorRemarks, referral, referalStatus);
if (_myReferralService.hasError) {
error = _myReferralService.error;
error = _myReferralService.error!;
setState(ViewState.ErrorLocal);
} else
getMyReferralPatientService();

@ -277,7 +277,7 @@ class PatientViewModel extends BaseViewModel {
await _patientService.getInPatient(requestModel, false);
if (_patientService.hasError) {
error = _patientService.error;
error = _patientService.error!;
setState(ViewState.ErrorLocal);
} else {
// setDefaultInPatientList();

@ -315,27 +315,27 @@ class ProcedureViewModel extends BaseViewModel {
}
Future preparePostProcedure(
{String remarks,
String orderType,
PatiantInformtion patient,
List<cpe.EntityList> entityList,
ProcedureType procedureType}) async {
{String? remarks,
String? orderType,
PatiantInformtion? patient,
List<cpe.EntityList> ? entityList,
ProcedureType? procedureType}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
procedureValadteRequestModel.patientMRN = patient!.patientMRN;
procedureValadteRequestModel.episodeID = patient!.episodeNo;
procedureValadteRequestModel.appointmentNo = patient!.appointmentNo;
List<Procedures> controlsProcedure = List();
List<Procedures> controlsProcedure = [];
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = List();
entityList!.forEach((element) {
procedureValadteRequestModel.procedure = [element!.procedureId!];
List<Controls> controls = [];
controls.add(
Controls(
code: "remarks",
@ -357,8 +357,8 @@ class ProcedureViewModel extends BaseViewModel {
postProcedureReqModel.procedures = controlsProcedure;
await valadteProcedure(procedureValadteRequestModel);
if (state == ViewState.Idle) {
if (valadteProcedureList[0].entityList.length == 0) {
await postProcedure(postProcedureReqModel, patient.patientMRN);
if (valadteProcedureList[0].entityList!.length == 0) {
await postProcedure(postProcedureReqModel, patient!.patientMRN!);
if (state == ViewState.ErrorLocal) {
Helpers.showErrorToast(error);
@ -372,7 +372,7 @@ class ProcedureViewModel extends BaseViewModel {
getProcedure(mrn: patient.patientMRN);
} else if (state == ViewState.Idle) {
Helpers.showErrorToast(
valadteProcedureList[0].entityList[0].warringMessages);
valadteProcedureList[0].entityList![0].warringMessages);
}
}
} else {

@ -15,7 +15,7 @@ class ScanQrViewModel extends BaseViewModel {
await _scanQrService.getInPatient(requestModel, true);
if (_scanQrService.hasError) {
error = _scanQrService.error;
error = _scanQrService.error!;
setState(ViewState.ErrorLocal);
} else {

@ -1,9 +1,9 @@
class GetSpecialClinicalCareListResponseModel {
int projectID;
int clinicID;
String clinicDescription;
String clinicDescriptionN;
bool isActive;
int? projectID;
int? clinicID;
String? clinicDescription;
String? clinicDescriptionN;
bool? isActive;
GetSpecialClinicalCareListResponseModel(
{this.projectID,

@ -1,10 +1,10 @@
class GetSpecialClinicalCareMappingListResponseModel {
int mappingProjectID;
int clinicID;
int nursingStationID;
bool isActive;
int projectID;
String description;
int? mappingProjectID;
int? clinicID;
int? nursingStationID;
bool? isActive;
int? projectID;
String? description;
GetSpecialClinicalCareMappingListResponseModel(
{this.mappingProjectID,

@ -1,15 +1,15 @@
class StartCallReq {
String clincName;
int clinicId;
String docSpec;
String docotrName;
int doctorId;
String generalid;
bool isOutKsa;
bool isrecall;
String projectName;
String tokenID;
int vCID;
String ?clincName;
int ?clinicId;
String ?docSpec;
String? docotrName;
int ?doctorId;
String? generalid;
bool? isOutKsa;
bool ? isrecall;
String? projectName;
String ?tokenID;
int ?vCID;
StartCallReq(
{this.clincName,

@ -1,24 +1,24 @@
import '../patiant_info_model.dart';
class PatientProfileAppBarModel {
double height;
bool isInpatient;
bool isDischargedPatient;
bool isFromLiveCare;
PatiantInformtion patient;
String doctorName;
String branch;
DateTime appointmentDate;
String profileUrl;
String invoiceNO;
String orderNo;
bool isPrescriptions;
bool isMedicalFile;
String episode;
String visitDate;
String clinic;
bool isAppointmentHeader;
bool isFromLabResult;
double? height;
bool? isInpatient;
bool? isDischargedPatient;
bool? isFromLiveCare;
PatiantInformtion? patient;
String? doctorName;
String? branch;
DateTime? appointmentDate;
String? profileUrl;
String? invoiceNO;
String? orderNo;
bool? isPrescriptions;
bool? isMedicalFile;
String? episode;
String? visitDate;
String? clinic;
bool? isAppointmentHeader;
bool? isFromLabResult;
PatientProfileAppBarModel(
{this.height = 0.0,

@ -55,7 +55,7 @@ class _LoginScreenState extends State<LoginScreen> {
height: 10,
),
Text(
TranslationBase.of(context).welcomeTo,
TranslationBase.of(context).welcomeTo??"",
style: TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
@ -64,7 +64,7 @@ class _LoginScreenState extends State<LoginScreen> {
fontFamily: 'Poppins'),
),
Text(
TranslationBase.of(context).drSulaimanAlHabib,
TranslationBase.of(context).drSulaimanAlHabib!,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,

@ -91,7 +91,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
color: Color(0xFF2B353E),
),
AppText(
Helpers.capitalize(authenticationViewModel.user.doctorName),
Helpers.capitalize(authenticationViewModel.user!.doctorName),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6,
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
@ -131,7 +131,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
children: [
Text(
TranslationBase.of(context)
.lastLoginAt,
.lastLoginAt!,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: 'Poppins',
@ -164,7 +164,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
.getType(
authenticationViewModel
.user
.logInTypeID,
!.logInTypeID,
context),
style: TextStyle(
color:
@ -191,21 +191,21 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
children: [
AppText(
authenticationViewModel
.user.editedOn !=
.user!.editedOn !=
null
? AppDateUtils
.getDayMonthYearDateFormatted(
AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.editedOn))
! .user
!.editedOn!))
: authenticationViewModel
.user.createdOn !=
.user!.createdOn! !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(authenticationViewModel.user
.createdOn))
AppDateUtils.convertStringToDate(authenticationViewModel!.user
!.createdOn!))
: '--',
textAlign:
TextAlign.right,
@ -214,17 +214,17 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
fontWeight: FontWeight.w700,
),
AppText(
authenticationViewModel.user.editedOn !=
authenticationViewModel.user!.editedOn !=
null
? AppDateUtils.getHour(
AppDateUtils.convertStringToDate(
authenticationViewModel.user
.editedOn))
: authenticationViewModel.user.createdOn !=
authenticationViewModel!.user
!.editedOn!))
: authenticationViewModel.user!.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils.convertStringToDate(authenticationViewModel.user
.createdOn))
AppDateUtils.convertStringToDate(authenticationViewModel!.user
!.createdOn!))
: '--',
textAlign:
TextAlign.right,
@ -308,8 +308,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
authenticationViewModel:authenticationViewModel,
authMethodType: SelectedAuthMethodTypesService
.getMethodsTypeService(
authenticationViewModel.user
.logInTypeID),
authenticationViewModel!.user
!.logInTypeID!!),
authenticateUser:
(AuthMethodTypes
authMethodType,

@ -13,11 +13,11 @@ import 'package:flutter/material.dart';
import 'label.dart';
class DashboardReferralPatient extends StatelessWidget {
final List<DashboardModel> dashboardItemList;
final double height;
final DashboardViewModel model;
final List<DashboardModel>? dashboardItemList;
final double? height;
final DashboardViewModel? model;
const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key);
const DashboardReferralPatient({Key? key, this.dashboardItemList, this.height, this.model}) : super(key: key);
@override
Widget build(BuildContext context) {
return RoundedContainer(
@ -101,30 +101,30 @@ class DashboardReferralPatient extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RowCounts(
dashboardItemList[2]
.summaryoptions[0]
dashboardItemList![2]
.summaryoptions![0]
.kPIParameter,
dashboardItemList[2]
.summaryoptions[0]
.value,
Colors.black, height: height,),
dashboardItemList![2]
.summaryoptions![0]
.value!,
Colors.black, height: height!,),
RowCounts(
dashboardItemList[2]
.summaryoptions[1]
dashboardItemList![2]
.summaryoptions![1]
.kPIParameter,
dashboardItemList[2]
.summaryoptions[1]
.value,
Colors.grey, height: height,),
dashboardItemList![2]
.summaryoptions![1]
.value!,
Colors.grey, height: height!,),
RowCounts(
dashboardItemList[2]
.summaryoptions[2]
dashboardItemList![2]
.summaryoptions![2]
.kPIParameter,
dashboardItemList[2]
.summaryoptions[2]
.value,
Colors.red, height: height,),
dashboardItemList![2]
.summaryoptions![2]
.value!,
Colors.red, height: height!,),
],
),
)
@ -138,21 +138,21 @@ class DashboardReferralPatient extends StatelessWidget {
padding:EdgeInsets.all(0),
child: GaugeChart(
_createReferralData(dashboardItemList))),
_createReferralData(dashboardItemList!))),
Positioned(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AppText(
model
.getPatientCount(dashboardItemList[2])
model!
.getPatientCount(dashboardItemList![2])
.toString(),
fontSize: SizeConfig.textMultiplier * 3.0,
fontWeight: FontWeight.bold,
)
],
),
top: height * (SizeConfig.isHeightVeryShort?0.35:0.40),
top: height! * (SizeConfig.isHeightVeryShort?0.35:0.40),
left: 0,
right: 0)
]),
@ -164,16 +164,16 @@ class DashboardReferralPatient extends StatelessWidget {
static List<charts.Series<GaugeSegment, String>> _createReferralData(List<DashboardModel> dashboardItemList) {
final data = [
new GaugeSegment(
dashboardItemList[2].summaryoptions[0].kPIParameter,
getValue(dashboardItemList[1].summaryoptions[0].value),
dashboardItemList![2].summaryoptions![0].kPIParameter!,
getValue(dashboardItemList![1].summaryoptions![0].value),
charts.MaterialPalette.black),
new GaugeSegment(
dashboardItemList[2].summaryoptions[1].kPIParameter,
getValue(dashboardItemList[1].summaryoptions[1].value),
dashboardItemList![2].summaryoptions![1].kPIParameter!,
getValue(dashboardItemList[1].summaryoptions![1].value),
charts.MaterialPalette.gray.shadeDefault),
new GaugeSegment(
dashboardItemList[2].summaryoptions[2].kPIParameter,
getValue(dashboardItemList[1].summaryoptions[2].value),
dashboardItemList[2].summaryoptions![2].kPIParameter!,
getValue(dashboardItemList[1].summaryoptions![2].value),
charts.MaterialPalette.red.shadeDefault),
];

@ -18,7 +18,7 @@ class DashboardSliderItemWidget extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Label(firstLine:Helpers.getLabelFromKPI(item.kPIName) ,secondLine:Helpers.getNameFromKPI(item.kPIName), ),
Label(firstLine:Helpers.getLabelFromKPI(item!.kPIName!) ,secondLine:Helpers.getNameFromKPI(item!.kPIName!), ),
],
),

@ -18,7 +18,7 @@ class HomePageCard extends StatelessWidget {
final GestureTapCallback onTap;
final Color color;
final double opacity;
final double width;
final double? width;
final EdgeInsets margin;
@override
Widget build(BuildContext context) {

@ -38,12 +38,12 @@ class HomeScreen extends StatefulWidget {
class _HomeScreenState extends State<HomeScreen> {
bool isLoading = false;
ProjectViewModel projectsProvider;
DoctorProfileModel profile;
ProjectViewModel ?projectsProvider;
DoctorProfileModel ?profile;
bool isExpanded = false;
bool isInpatient = false;
int sliderActiveIndex = 0;
String clinicId;
String? clinicId;
late AuthenticationViewModel authenticationViewModel;
int colorIndex = 0;
final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
@ -142,8 +142,8 @@ class _HomeScreenState extends State<HomeScreen> {
),
Container(
child: Label(
firstLine: TranslationBase.of(context).patients,
secondLine: TranslationBase.of(context).services,
firstLine: TranslationBase.of(context).patients!,
secondLine: TranslationBase.of(context).services!,
)),
SizedBox(
height: SizeConfig.heightMultiplier * .6,
@ -177,21 +177,38 @@ class _HomeScreenState extends State<HomeScreen> {
List<Widget> homePatientsCardsWidget(DashboardViewModel model,projectsProvider) {
colorIndex = 0;
List<Color> backgroundColors = List(3);
backgroundColors[0] = Color(0xffD02127);
backgroundColors[1] = Colors.grey[300];
backgroundColors[2] = Color(0xff2B353E);
List<Color> backgroundIconColors = List(3);
backgroundIconColors[0] = Colors.white12;
backgroundIconColors[1] = Colors.white38;
backgroundIconColors[2] = Colors.white10;
List<Color> textColors = List(3);
textColors[0] = Colors.white;
textColors[1] = Color(0xFF353E47);
textColors[2] = Colors.white;
// List<Color> backgroundColors = List(3);
// backgroundColors[0] = Color(0xffD02127);
// backgroundColors[1] = Colors.grey[300];
// backgroundColors[2] = Color(0xff2B353E);
// List<Color> backgroundIconColors = List(3);
// backgroundIconColors[0] = Colors.white12;
// backgroundIconColors[1] = Colors.white38;
// backgroundIconColors[2] = Colors.white10;
// List<Color> textColors = List(3);
// textColors[0] = Colors.white;
// textColors[1] = Color(0xFF353E47);
// textColors[2] = Colors.white;
//
// List<HomePatientCard> patientCards = [];
//
List<HomePatientCard> patientCards = List();
List<Color> backgroundColors = [];
backgroundColors.add(Color(0xffD02127));
backgroundColors.add(Colors.grey[300]!);
backgroundColors.add(Color(0xff2B353E));
List<Color> backgroundIconColors = [];
backgroundIconColors.add(Colors.white12);
backgroundIconColors.add(Colors.white38);
backgroundIconColors.add(Colors.white10);
List<Color> textColors = [];
textColors.add(Colors.white);
textColors.add(Colors.black);
textColors.add(Colors.white);
List<HomePatientCard> patientCards = [];
if (model.hasVirtualClinic) {
patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex],
@ -222,8 +239,8 @@ class _HomeScreenState extends State<HomeScreen> {
Navigator.push(
context,
FadePage(
page: PatientInPatientScreen(specialClinic: model.getSpecialClinic(clinicId??projectsProvider
.doctorClinicsList[0].clinicID),),
page: PatientInPatientScreen(specialClinic: model!.getSpecialClinic(clinicId??projectsProvider
!.doctorClinicsList[0]!.clinicID!),),
),
);
},

@ -23,7 +23,7 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget {
double height = SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 10 : 6);
HomeScreenHeader({Key key, this.model, this.onOpenDrawer}) : super(key: key);
HomeScreenHeader({Key? key, required this.model, required this.onOpenDrawer}) : super(key: key);
@override
_HomeScreenHeaderState createState() => _HomeScreenHeaderState();
@ -33,11 +33,11 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget {
}
class _HomeScreenHeaderState extends State<HomeScreenHeader> {
ProjectViewModel projectsProvider;
int clinicId;
ProjectViewModel? projectsProvider;
int? clinicId;
AuthenticationViewModel authenticationViewModel;
AuthenticationViewModel? authenticationViewModel;
@override
@ -170,15 +170,15 @@ class _HomeScreenHeaderState extends State<HomeScreenHeader> {
);
}).toList();
},
onChanged: (newValue) async {
onChanged: (int? newValue) async {
setState(() {
clinicId = newValue;
});
GifLoaderDialogUtils.showMyDialog(
context);
await widget.model.changeClinic(newValue,
authenticationViewModel);
await widget.model.changeClinic(newValue!,
authenticationViewModel!);
GifLoaderDialogUtils.hideDialog(
context);
if (widget.model.state ==

@ -7,13 +7,13 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable
class Label extends StatelessWidget {
Label({
Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize,
Key? key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize,
}) : super(key: key);
final String firstLine;
final String secondLine;
final String? firstLine;
final String? secondLine;
Color color;
final double secondLineFontSize;
final double firstLineFontSize;
final double? secondLineFontSize;
final double? firstLineFontSize;
@override
Widget build(BuildContext context) {

@ -24,9 +24,9 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:hexcolor/hexcolor.dart';
class EndCallScreen extends StatefulWidget {
final PatiantInformtion patient;
final PatiantInformtion? patient;
const EndCallScreen({Key? key, required this.patient,}) : super(key: key);
const EndCallScreen({Key? key, this.patient,}) : super(key: key);
@override
_EndCallScreenState createState() => _EndCallScreenState();
@ -34,7 +34,7 @@ class EndCallScreen extends StatefulWidget {
class _EndCallScreenState extends State<EndCallScreen> {
bool isInpatient = false;
PatiantInformtion patient;
PatiantInformtion ?patient;
bool isDischargedPatient = false;
bool isSearchAndOut = false;
late String patientType;
@ -53,7 +53,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
if(routeArgs.containsKey('patient'))
patient = routeArgs['patient'];
}
@ -64,10 +64,10 @@ class _EndCallScreenState extends State<EndCallScreen> {
PatientProfileCardModel(
TranslationBase.of(context).resume!, TranslationBase.of(context).theCall!, '', 'patient/vital_signs.png',
isInPatient: isInpatient,
color: Colors.green[800],
color: Colors.green[800]!,
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.startCall(isReCall: false, vCID: patient.vcId!).then((value) async {
await liveCareModel.startCall(isReCall: false, vCID: patient!.vcId!).then((value) async {
await liveCareModel.getDoctorProfile();
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
@ -77,8 +77,8 @@ class _EndCallScreenState extends State<EndCallScreen> {
kToken: liveCareModel.startCallRes.openTokenID,
kSessionId: liveCareModel.startCallRes.openSessionID,
kApiKey: '46209962',
vcId: patient.vcId,
patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
vcId: patient!.vcId,
patientName: patient!.fullName ?? (patient!.firstName != null ? "${patient!.firstName} ${patient!.lastName}" : "-"),
tokenID: await liveCareModel.getToken(),
generalId: GENERAL_ID,
doctorId: liveCareModel.doctorProfile!.doctorID,
@ -89,7 +89,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.endCall(
patient.vcId!,
patient!.vcId!,
false,
);GifLoaderDialogUtils.hideDialog(context);
@ -101,7 +101,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.endCall(
patient.vcId!,
patient!.vcId!,
sessionStatusModel.sessionStatus == 3,
);
GifLoaderDialogUtils.hideDialog(context);
@ -118,21 +118,21 @@ class _EndCallScreenState extends State<EndCallScreen> {
PatientProfileCardModel(
TranslationBase.of(context).endLC!, TranslationBase.of(context).consultation!, '', 'patient/vital_signs.png',
isInPatient: isInpatient,
color: Colors.red[800],
color: Colors.red[800]!,
onTap: () {
Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?",
() async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.getAlternativeServices(patient.vcId!);
await liveCareModel.getAlternativeServices(patient!.vcId!);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
} else {
showAlternativesDialog(context, liveCareModel, (bool isConfirmed) async {
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.endCallWithCharge(patient.vcId, isConfirmed);
await liveCareModel.endCallWithCharge(patient!.vcId!, isConfirmed);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
@ -153,7 +153,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
() async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.sendSMSInstruction(patient.vcId);
await liveCareModel.sendSMSInstruction(patient!.vcId!);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
@ -170,7 +170,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
TranslationBase.of(context).transferTo!, TranslationBase.of(context).admin!, '', 'patient/health_summary.png',
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient)));
MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient!)));
}, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin),
];
@ -187,9 +187,9 @@ class _EndCallScreenState extends State<EndCallScreen> {
.of(context)
.scaffoldBackgroundColor,
isShowAppBar: true,
appBar: PatientProfileAppBar(patientProfileAppBarModel :PatientProfileAppBarModel(patient: patient,isInpatient: isInpatient,
appBar: PatientProfileAppBar(patientProfileAppBarModel :PatientProfileAppBarModel(patient: patient!,isInpatient: isInpatient,
isDischargedPatient: isDischargedPatient,
height: (patient.patientStatusType != null && patient.patientStatusType == 43)
height: (patient!.patientStatusType != null && patient!.patientStatusType == 43)
? 210
: isDischargedPatient
? 240
@ -235,7 +235,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) => PatientProfileButton(
patient: patient,
patient: patient!,
patientType: patientType,
arrivalType: arrivalType,
from: from,
@ -251,7 +251,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
isLoading: cardsList[index].isLoading,
isDartIcon: cardsList[index].isDartIcon,
dartIcon: cardsList[index].dartIcon,
color: cardsList[index].color,
color: cardsList[index].color,
),
),
],
@ -351,10 +351,10 @@ class _EndCallScreenState extends State<EndCallScreen> {
}
class CheckBoxListWidget extends StatefulWidget {
final LiveCarePatientViewModel model;
final LiveCarePatientViewModel? model;
const CheckBoxListWidget({
Key key,
Key? key,
this.model,
}) : super(key: key);
@ -368,7 +368,7 @@ class _CheckBoxListState extends State<CheckBoxListWidget> {
return SingleChildScrollView(
child: Column(
children: [
...widget.model.alternativeServicesList
...widget.model!.alternativeServicesList
.map(
(element) => Container(
child: CheckboxListTile(
@ -380,7 +380,7 @@ class _CheckBoxListState extends State<CheckBoxListWidget> {
value: element.isSelected,
onChanged: (newValue) {
setState(() {
widget.model
widget.model!
.setSelectedCheckboxValues(element, newValue);
});
},

@ -113,7 +113,7 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
() async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
await model.transferToAdmin(widget.patient.vcId, noteController.text);
await model.transferToAdmin(widget!.patient!.vcId!, noteController.text);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);

@ -66,7 +66,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
//'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg',
kApiKey: '46209962',
vcId: widget.patientData.vcId,
patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-",
patientName: widget.patientData.fullName != null ? widget.patientData.fullName! : widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-",
tokenID: token, //"hfkjshdf347r8743",
generalId: "Cs2020@2016\$2958",
doctorId: doctorprofile['DoctorID'],

@ -90,8 +90,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
bool isHistoryExpand = true;
bool isAssessmentExpand = true;
PatientProfileAppBarModel patientProfileAppBarModel;
ProjectViewModel projectViewModel;
PatientProfileAppBarModel? patientProfileAppBarModel;
ProjectViewModel? projectViewModel;
@override
void didChangeDependencies() {
@ -129,13 +129,13 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
}
},
builder:
(BuildContext context, MedicalFileViewModel model, Widget child) =>
(BuildContext? context, MedicalFileViewModel? model, Widget ?child) =>
AppScaffold(
patientProfileAppBarModel: patientProfileAppBarModel,
patientProfileAppBarModel: patientProfileAppBarModel!,
isShowAppBar: true,
appBarTitle: TranslationBase
.of(context)
.medicalReport
.of(context!)!
.medicalReport!
.toUpperCase(),
body: NetworkBaseView(
baseViewModel: model,
@ -144,13 +144,13 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
child: Container(
child: Column(
children: [
model.medicalFileList.length != 0 &&
model!.medicalFileList!.length != 0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
.consulations!
.length !=
0
? Padding(
@ -160,7 +160,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
SizedBox(height: 25.0),
if (model.medicalFileList.length != 0 &&
model.medicalFileList[0].entityList![0].timelines![encounterNumber]
model.medicalFileList![0].entityList![0].timelines![encounterNumber]
.timeLineEvents![0].consulations!.length !=
0)
Container(
@ -205,7 +205,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -224,7 +224,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Expanded(
child: AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -254,7 +254,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 30,
),
if (model.medicalFileList.length != 0 &&
model.medicalFileList[0].entityList![0].timelines![encounterNumber]
model.medicalFileList![0].entityList![0].timelines![encounterNumber]
.timeLineEvents![0].consulations!.length !=
0)
Container(
@ -297,7 +297,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -319,7 +319,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -342,7 +342,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Expanded(
child: AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -361,7 +361,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Expanded(
child: AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -383,7 +383,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Expanded(
child: AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -401,7 +401,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -432,7 +432,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 30,
),
if (model.medicalFileList.length != 0 &&
model.medicalFileList[0].entityList![0].timelines![encounterNumber]
model.medicalFileList![0].entityList![0].timelines![encounterNumber]
.timeLineEvents![0].consulations!.length !=
0)
Container(
@ -475,7 +475,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -498,7 +498,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -520,7 +520,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
AppText(
AppDateUtils.getDateFormatted(DateTime.parse(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -544,7 +544,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Expanded(
child: AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -563,7 +563,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -600,7 +600,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 30,
),
if (model.medicalFileList.length != 0 &&
model.medicalFileList[0].entityList![0].timelines![encounterNumber]
model.medicalFileList![0].entityList![0].timelines![encounterNumber]
.timeLineEvents![0].consulations!.length !=
0)
Container(
@ -645,7 +645,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -663,7 +663,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
AppText(TranslationBase.of(context).examType! + ": "),
AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -678,7 +678,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -694,7 +694,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
AppText(TranslationBase.of(context).abnormal! + ": "),
AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -710,7 +710,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
AppText(
model
.medicalFileList[0]
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]

@ -18,9 +18,9 @@ import 'DischargedPatientPage.dart';
import 'InPatientPage.dart';
class PatientInPatientScreen extends StatefulWidget {
GetSpecialClinicalCareListResponseModel specialClinic;
GetSpecialClinicalCareListResponseModel? specialClinic;
PatientInPatientScreen({Key key, this.specialClinic});
PatientInPatientScreen({Key? key, this.specialClinic});
@override
_PatientInPatientScreenState createState() => _PatientInPatientScreenState();
@ -30,7 +30,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
late TabController _tabController;
int _activeTab = 0;
int selectedMapId;
int? selectedMapId;
@override
@ -182,7 +182,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
);
}).toList();
},
onChanged: (newValue) async {
onChanged: (int? newValue) async {
setState(() {
selectedMapId = newValue;
});

@ -32,8 +32,8 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
ProjectViewModel projectViewModel = Provider.of(context!);
final routeArgs = ModalRoute.of(context!)!.settings.arguments as Map;
return BaseView<InsuranceViewModel>(
onModelReady: (model) => model.insuranceApprovalInPatient.length == 0
@ -44,7 +44,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
appointmentNo: patient.appointmentNo, projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient)
: null,
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
builder: (BuildContext? context, InsuranceViewModel? model, Widget? child) =>
AppScaffold(
isShowAppBar: true,
baseViewModel: model,
@ -62,7 +62,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row(
children: [
AppText(
TranslationBase.of(context).insurance22,
TranslationBase.of(context!).insurance22,
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
@ -72,7 +72,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row(
children: [
AppText(
TranslationBase.of(context).approvals22,
TranslationBase.of(context!).approvals22,
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
@ -99,19 +99,16 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row(
children: [
AppText(
model
.insuranceApprovalInPatient[
model!.insuranceApprovalInPatient[
indexInsurance]
.approvalStatusDescption !=
null
? model
.insuranceApprovalInPatient[
? model!.insuranceApprovalInPatient[
indexInsurance]
.approvalStatusDescption ??
""
: "",
color: model
.insuranceApprovalInPatient[
color: model!.insuranceApprovalInPatient[
indexInsurance]
.approvalStatusDescption !=
null
@ -128,10 +125,9 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row(
children: [
AppText(
model
.insuranceApprovalInPatient[
model!.insuranceApprovalInPatient[
indexInsurance]
.doctorName
.doctorName!
.toUpperCase(),
color: Colors.black,
fontSize: 18,
@ -159,10 +155,9 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
BorderRadius.circular(
50),
child: Image.network(
model
.insuranceApprovalInPatient[
model!.insuranceApprovalInPatient[
indexInsurance]
.doctorImage,
.doctorImage!,
fit: BoxFit.fill,
width: 700,
),
@ -191,15 +186,14 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
AppText(
TranslationBase.of(
context)
.clinic +
.clinic! +
": ",
color: Colors.grey[500],
fontSize: 14,
),
Expanded(
child: AppText(
model
.insuranceApprovalInPatient[
model!.insuranceApprovalInPatient[
indexInsurance]
.clinicName,
fontSize: 14,
@ -212,14 +206,13 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
AppText(
TranslationBase.of(
context)
.approvalNo +
.approvalNo! +
": ",
color: Colors.grey[500],
fontSize: 14,
),
AppText(
model
.insuranceApprovalInPatient[
model!.insuranceApprovalInPatient[
indexInsurance]
.approvalNo
.toString(),
@ -235,8 +228,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
fontSize: 14,
),
AppText(
model
.insuranceApprovalInPatient[
model!.insuranceApprovalInPatient[
indexInsurance]
.unUsedCount
.toString(),
@ -249,7 +241,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
AppText(
TranslationBase.of(
context)
.companyName +
.companyName! +
": ",
color: Colors.grey[500],
),
@ -261,13 +253,13 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
AppText(
TranslationBase.of(
context)
.receiptOn +
.receiptOn! +
": ",
color: Colors.grey[500],
),
Expanded(
child: AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn!), isArabic: projectViewModel.isArabic)}',
color: Colors.black,
fontWeight:
FontWeight.w600,
@ -280,12 +272,12 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
AppText(
TranslationBase.of(
context)
.expiryDate +
.expiryDate! +
": ",
color: Colors.grey[500],
),
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}',
color: Colors.black,
fontWeight:
FontWeight.w600,
@ -312,21 +304,21 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
children: [
Expanded(
child: AppText(
TranslationBase.of(context)
TranslationBase.of(context!)
.procedure,
fontWeight: FontWeight.w700,
),
),
Expanded(
child: AppText(
TranslationBase.of(context)
TranslationBase.of(context!)
.status,
fontWeight: FontWeight.w700,
),
),
Expanded(
child: AppText(
TranslationBase.of(context)
TranslationBase.of(context!)
.usageStatus,
fontWeight: FontWeight.w700,
),
@ -343,10 +335,9 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
child: ListView.builder(
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: model
.insuranceApprovalInPatient[
itemCount: model!.insuranceApprovalInPatient[
indexInsurance]
.apporvalDetails
.apporvalDetails!
.length,
itemBuilder:
(BuildContext context,
@ -359,10 +350,9 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Expanded(
child: Container(
child: AppText(
model
.insuranceApprovalInPatient[
model!.insuranceApprovalInPatient[
indexInsurance]
?.apporvalDetails[
?.apporvalDetails![
index]
?.procedureName ??
"",
@ -375,10 +365,9 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Expanded(
child: Container(
child: AppText(
model
.insuranceApprovalInPatient[
model!.insuranceApprovalInPatient[
indexInsurance]
?.apporvalDetails[
?.apporvalDetails![
index]
?.status ??
"",
@ -391,10 +380,9 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Expanded(
child: Container(
child: AppText(
model
.insuranceApprovalInPatient[
model!.insuranceApprovalInPatient[
indexInsurance]
?.apporvalDetails[
?.apporvalDetails![
index]
?.isInvoicedDesc ??
"",
@ -439,7 +427,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row(
children: [
AppText(
TranslationBase.of(context).insurance22,
TranslationBase.of(context!).insurance22,
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
@ -449,7 +437,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row(
children: [
AppText(
TranslationBase.of(context).approvals22,
TranslationBase.of(context!).approvals22,
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
@ -476,19 +464,16 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row(
children: [
AppText(
model
.insuranceApproval[
model!.insuranceApproval[
indexInsurance]
.approvalStatusDescption !=
null
? model
.insuranceApproval[
? model!.insuranceApproval[
indexInsurance]
.approvalStatusDescption ??
""
: "",
color: model
.insuranceApproval[
color: model!.insuranceApproval[
indexInsurance]
.approvalStatusDescption !=
null
@ -503,9 +488,8 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row(
children: [
AppText(
model
.insuranceApproval[indexInsurance]
.doctorName
model!.insuranceApproval[indexInsurance]
.doctorName!
.toUpperCase(),
color: Colors.black,
fontSize: 18,
@ -533,10 +517,9 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
BorderRadius.circular(
50),
child: Image.network(
model
.insuranceApproval[
model!.insuranceApproval[
indexInsurance]
.doctorImage,
.doctorImage!,
fit: BoxFit.fill,
width: 700,
),
@ -565,15 +548,14 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
AppText(
TranslationBase.of(
context)
.clinic +
.clinic! +
": ",
color: Colors.grey[500],
fontSize: 14,
),
Expanded(
child: AppText(
model
.insuranceApproval[
model!.insuranceApproval[
indexInsurance]
.clinicName,
fontSize: 14,
@ -586,14 +568,13 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
AppText(
TranslationBase.of(
context)
.approvalNo +
.approvalNo! +
": ",
color: Colors.grey[500],
fontSize: 14,
),
AppText(
model
.insuranceApproval[
model!.insuranceApproval[
indexInsurance]
.approvalNo
.toString(),
@ -606,14 +587,13 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
AppText(
TranslationBase.of(
context)
.unusedCount +
.unusedCount! +
": ",
color: Colors.grey[500],
fontSize: 14,
),
AppText(
model
.insuranceApproval[
model!.insuranceApproval[
indexInsurance]
.unUsedCount
.toString(),
@ -626,7 +606,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
AppText(
TranslationBase.of(
context)
.companyName +
.companyName! +
": ",
color: Colors.grey[500],
),
@ -638,13 +618,13 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
AppText(
TranslationBase.of(
context)
.receiptOn +
.receiptOn! +
": ",
color: Colors.grey[500],
),
Expanded(
child: AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn!), isArabic: projectViewModel.isArabic)}',
color: Colors.black,
fontWeight:
FontWeight.w600,
@ -657,17 +637,16 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
AppText(
TranslationBase.of(
context)
.expiryDate +
.expiryDate! +
": ",
color: Colors.grey[500],
),
if (model
.insuranceApproval[
if (model!.insuranceApproval[
indexInsurance]
.expiryDate !=
null)
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model!.insuranceApproval[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}',
color: Colors.black,
fontWeight:
FontWeight.w600,
@ -694,21 +673,21 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
children: [
Expanded(
child: AppText(
TranslationBase.of(context)
TranslationBase.of(context!)
.procedure,
fontWeight: FontWeight.w700,
),
),
Expanded(
child: AppText(
TranslationBase.of(context)
TranslationBase.of(context!)
.status,
fontWeight: FontWeight.w700,
),
),
Expanded(
child: AppText(
TranslationBase.of(context)
TranslationBase.of(context!)
.usageStatus,
fontWeight: FontWeight.w700,
),
@ -725,10 +704,9 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
child: ListView.builder(
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: model
.insuranceApproval[
itemCount: model!.insuranceApproval[
indexInsurance]
.apporvalDetails
.apporvalDetails!
.length,
itemBuilder:
(BuildContext context,
@ -741,10 +719,9 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Expanded(
child: Container(
child: AppText(
model
.insuranceApproval[
model!.insuranceApproval[
indexInsurance]
?.apporvalDetails[
?.apporvalDetails![
index]
?.procedureName ??
"",
@ -757,10 +734,9 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Expanded(
child: Container(
child: AppText(
model
.insuranceApproval[
model!.insuranceApproval[
indexInsurance]
?.apporvalDetails[
?.apporvalDetails![
index]
?.status ??
"",
@ -773,10 +749,9 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Expanded(
child: Container(
child: AppText(
model
.insuranceApproval[
model!.insuranceApproval[
indexInsurance]
?.apporvalDetails[
?.apporvalDetails![
index]
?.isInvoicedDesc ??
"",

@ -39,7 +39,7 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
patientProfileAppBarModel: PatientProfileAppBarModel(
patient:widget.patient,isInpatient:widget.isInpatient,
isFromLabResult: true,
appointmentDate: widget.patientLabOrders.orderDate,),
appointmentDate: widget.patientLabOrders.orderDate!,),
baseViewModel: model,
body: AppScaffold(

@ -59,10 +59,10 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
HtmlRichEditor(
initialText: (medicalReport != null
? medicalReport.reportDataHtml
: model.medicalReportTemplate
.length > 0 ? model
.medicalReportTemplate[0] : ""),
: model!.medicalReportTemplate!
.length! > 0 ? model.medicalReportTemplate[0].templateTextHtml!: ""),
hint: "Write the medical report ",
controller: _controller,
height:
MediaQuery
.of(context)

@ -112,7 +112,7 @@ class MedicalReportPage extends StatelessWidget {
hasBorder: false,
bgColor: model.medicalReportList[index].status == 1
? Color(0xFFCC9B14)
: Colors.green[700],
: Colors.green[700]!,
widget: Column(
children: [
Row(

@ -13,7 +13,8 @@ class PatientProfileCardModel {
final bool isSelectInpatient;
final bool isDartIcon;
final IconData? dartIcon;
final Color color;
final Color? color;
PatientProfileCardModel(this.nameLine1, this.nameLine2, this.route, this.icon,
{this.isInPatient = false,

@ -54,8 +54,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
int index = 0;
int _activeTab = 0;
StreamController<String> videoCallDurationStreamController;
Stream<String> videoCallDurationStream = (() async*{})();
late StreamController<String> videoCallDurationStreamController;
late Stream <String> videoCallDurationStream; //= (() async*{})(); TODO Elham*
@override
void initState() {
_tabController = TabController(length: 2, vsync: this);
@ -103,7 +103,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
_activeTab = 1;
}
StreamSubscription callTimer;
late StreamSubscription callTimer;
callConnected(){
callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null)
..onDone(() {
@ -117,7 +117,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
callDisconnected(){
callTimer.cancel();
videoCallDurationStreamController.sink.add(null);
videoCallDurationStreamController.sink.add('');
}
@override
@ -299,7 +299,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
onPressed: () async {
// Navigator.push(context, MaterialPageRoute(
// builder: (BuildContext context) =>
// EndCallScreen(patient:patient)));if (isCallFinished) {
// EndCallScreen(patient:patient)))
if (isCallFinished) {
Navigator.push(
context,
MaterialPageRoute(
@ -319,7 +320,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
GifLoaderDialogUtils.hideDialog(context);
AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){
locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected);
});
}, type: '');
}

@ -33,7 +33,7 @@ class RadiologyDetailsPage extends StatelessWidget {
builder: (_, model, widget) => AppScaffold(
patientProfileAppBarModel: PatientProfileAppBarModel(
patient: patient,
appointmentDate: finalRadiology.orderDate,
appointmentDate: finalRadiology.orderDate!,
doctorName: finalRadiology.doctorName,
clinic: finalRadiology.clinicDescription,
branch: finalRadiology.projectName,

@ -24,8 +24,8 @@ import 'ReplySummeryOnReferralPatient.dart';
class AddReplayOnReferralPatient extends StatefulWidget {
final PatientReferralViewModel patientReferralViewModel;
final MyReferralPatientModel myReferralInPatientModel;
final AddReferredRemarksRequestModel myReferralInPatientRequestModel;
final bool isEdited;
final AddReferredRemarksRequestModel? myReferralInPatientRequestModel;
final bool? isEdited;
const AddReplayOnReferralPatient(
{Key? key, required this.patientReferralViewModel, required this.myReferralInPatientModel,

@ -37,7 +37,7 @@ class _ReplySummeryOnReferralPatientState
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).summeryReply,
appBarTitle: TranslationBase.of(context).summeryReply!,
body: Container(
child: Column(
children: [

@ -428,7 +428,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
],
),
),
if (referredPatient.referredDoctorRemarks.isNotEmpty)
if (referredPatient.referredDoctorRemarks!.isNotEmpty)
Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0),
@ -487,7 +487,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
widget: AddReplayOnReferralPatient(
patientReferralViewModel: patientReferralViewModel,
myReferralInPatientModel: referredPatient,
isEdited: referredPatient.referredDoctorRemarks.isNotEmpty,
isEdited: referredPatient.referredDoctorRemarks!.isNotEmpty,
),
),
);

@ -138,10 +138,10 @@ class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
title: AppText(TranslationBase.of(context).inPatient),
value: PatientType.IN_PATIENT,
groupValue: patientType,
onChanged: (PatientType value) {
onChanged: (PatientType? value) {
setState(() {
patientType = value;
radioOnChange(value);
patientType = value!;
radioOnChange(value!);
});
},
),
@ -151,9 +151,9 @@ class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
title: AppText(TranslationBase.of(context).outpatient),
value: PatientType.OUT_PATIENT,
groupValue: patientType,
onChanged: (PatientType value) {
onChanged: (PatientType? value) {
setState(() {
patientType = value;
patientType = value!;
radioOnChange(value);
});
},

@ -34,13 +34,13 @@ class PrescriptionItemsPage extends StatelessWidget {
baseViewModel: model,
patientProfileAppBarModel: PatientProfileAppBarModel(
patient: patient,
clinic: prescriptions.clinicDescription,
branch: prescriptions.name,
clinic: prescriptions.clinicDescription!,
branch: prescriptions.name!,
isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
prescriptions.appointmentDate!),
doctorName: prescriptions.doctorName,
profileUrl: prescriptions.doctorImageURL,
doctorName: prescriptions.doctorName!,
profileUrl: prescriptions.doctorImageURL!,
isAppointmentHeader: true,
),
body: SingleChildScrollView(

@ -10,19 +10,19 @@ enum ProcedureType {
extension procedureType on ProcedureType {
String getFavouriteTabName(BuildContext context) {
return TranslationBase.of(context).favoriteTemplates;
return TranslationBase.of(context).favoriteTemplates!;
}
String getAllLabelName(BuildContext context) {
switch (this) {
case ProcedureType.PROCEDURE:
return TranslationBase.of(context).allProcedures;
return TranslationBase.of(context).allProcedures!;
case ProcedureType.LAB_RESULT:
return TranslationBase.of(context).allLab;
return TranslationBase.of(context).allLab!;
case ProcedureType.RADIOLOGY:
return TranslationBase.of(context).allRadiology;
return TranslationBase.of(context).allRadiology!;
case ProcedureType.PRESCRIPTION:
return TranslationBase.of(context).allPrescription;
return TranslationBase.of(context).allPrescription!;
default:
return "";
}
@ -31,13 +31,13 @@ extension procedureType on ProcedureType {
String getToolbarLabel(BuildContext context) {
switch (this) {
case ProcedureType.PROCEDURE:
return TranslationBase.of(context).addProcedures;
return TranslationBase.of(context).addProcedures!;
case ProcedureType.LAB_RESULT:
return TranslationBase.of(context).addLabOrder;
return TranslationBase.of(context).addLabOrder!;
case ProcedureType.RADIOLOGY:
return TranslationBase.of(context).addRadiologyOrder;
return TranslationBase.of(context).addRadiologyOrder!;
case ProcedureType.PRESCRIPTION:
return TranslationBase.of(context).addPrescription;
return TranslationBase.of(context).addPrescription!;
default:
return "";
}
@ -46,13 +46,13 @@ extension procedureType on ProcedureType {
String getAddButtonTitle(BuildContext context) {
switch (this) {
case ProcedureType.PROCEDURE:
return TranslationBase.of(context).addProcedures;
return TranslationBase.of(context).addProcedures!;
case ProcedureType.LAB_RESULT:
return TranslationBase.of(context).addLabOrder;
return TranslationBase.of(context).addLabOrder!;
case ProcedureType.RADIOLOGY:
return TranslationBase.of(context).addRadiologyOrder;
return TranslationBase.of(context).addRadiologyOrder!;
case ProcedureType.PRESCRIPTION:
return TranslationBase.of(context).addPrescription;
return TranslationBase.of(context).addPrescription!;
default:
return "";
}
@ -61,7 +61,7 @@ extension procedureType on ProcedureType {
String getCategoryId() {
switch (this) {
case ProcedureType.PROCEDURE:
return null;
return '';
case ProcedureType.LAB_RESULT:
return "02";
case ProcedureType.RADIOLOGY:
@ -69,20 +69,20 @@ extension procedureType on ProcedureType {
case ProcedureType.PRESCRIPTION:
return "55";
default:
return null;
return '';
}
}
String getCategoryName() {
switch (this) {
case ProcedureType.PROCEDURE:
return null;
return '';
case ProcedureType.LAB_RESULT:
return "Laboratory";
case ProcedureType.RADIOLOGY:
return "Radiology";
default:
return null;
return '';
}
}
}

@ -24,11 +24,11 @@ class AddFavouriteProcedure extends StatefulWidget {
final ProcedureType procedureType;
AddFavouriteProcedure({
Key key,
this.model,
this.prescriptionModel,
this.patient,
@required this.procedureType,
Key? key,
required this.model,
required this.prescriptionModel,
required this.patient,
required this.procedureType,
});
@override
@ -38,26 +38,26 @@ class AddFavouriteProcedure extends StatefulWidget {
class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
_AddFavouriteProcedureState({this.patient, this.model});
ProcedureViewModel model;
PatiantInformtion patient;
List<ProcedureTempleteDetailsModel> entityList = List();
ProcedureTempleteDetailsModel groupProcedures;
ProcedureViewModel? model;
PatiantInformtion? patient;
List<ProcedureTempleteDetailsModel> entityList = [];
late ProcedureTempleteDetailsModel groupProcedures;
@override
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>(
onModelReady: (model) =>
model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) =>
AppScaffold(
isShowAppBar: false,
baseViewModel: model,
body: Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
height: MediaQuery.of(context!).size.height * 0.070,
),
if (model.templateList.length != 0)
if (model!.templateList.length != 0)
Expanded(
child: EntityListCheckboxSearchFavProceduresWidget(
isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION),
@ -88,8 +88,8 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: widget.procedureType.getAddButtonTitle(context) ??
TranslationBase.of(context).addSelectedProcedures,
title: widget.procedureType.getAddButtonTitle(context!) ??
TranslationBase.of(context!).addSelectedProcedures,
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
@ -114,7 +114,7 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
} else {
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
TranslationBase.of(context!)
.fillTheMandatoryProcedureDetails,
);
return;
@ -126,8 +126,8 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
items: entityList,
model: model,
patient: widget.patient,
addButtonTitle: widget.procedureType.getAddButtonTitle(context),
toolbarTitle: widget.procedureType.getToolbarLabel(context),
addButtonTitle: widget.procedureType.getAddButtonTitle(context!),
toolbarTitle: widget.procedureType.getToolbarLabel(context!),
),
),
);

@ -21,7 +21,7 @@ class AddProcedurePage extends StatefulWidget {
final ProcedureType procedureType;
const AddProcedurePage(
{Key key, this.model, this.patient, @required this.procedureType})
{Key? key, required this.model, required this.patient, required this.procedureType})
: super(key: key);
@override
@ -30,17 +30,17 @@ class AddProcedurePage extends StatefulWidget {
}
class _AddProcedurePageState extends State<AddProcedurePage> {
int selectedType;
ProcedureViewModel model;
PatiantInformtion patient;
ProcedureType procedureType;
int? selectedType;
ProcedureViewModel? model;
PatiantInformtion ?patient;
ProcedureType? procedureType;
_AddProcedurePageState({this.patient, this.model, this.procedureType});
TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List();
List<EntityList> entityListProcedure = List();
List<EntityList> entityList = [];
List<EntityList> entityListProcedure = [];
TextEditingController procedureName = TextEditingController();
dynamic selectedCategory;
@ -56,17 +56,17 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
return BaseView<ProcedureViewModel>(
onModelReady: (model) {
model.getProcedureCategory(
categoryName: procedureType.getCategoryName(),
categoryID: procedureType.getCategoryId(),
patientId: patient.patientId);
categoryName: procedureType!.getCategoryName(),
categoryID: procedureType!.getCategoryId(),
patientId: patient!.patientId);
},
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) =>
AppScaffold(
isShowAppBar: false,
body: Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
height: MediaQuery.of(context!).size.height * 0.070,
),
Expanded(
child: NetworkBaseView(
@ -86,7 +86,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
MainAxisAlignment.spaceBetween,
children: [
AppText(
TranslationBase.of(context)
TranslationBase.of(context!)
.pleaseEnterProcedure,
fontWeight: FontWeight.w700,
fontSize: 20,
@ -95,15 +95,15 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
),
SizedBox(
height:
MediaQuery.of(context).size.height * 0.02,
MediaQuery.of(context!).size.height * 0.02,
),
Row(
children: [
Container(
width: MediaQuery.of(context).size.width *
width: MediaQuery.of(context!).size.width *
0.79,
child: AppTextFieldCustom(
hintText: TranslationBase.of(context)
hintText: TranslationBase.of(context!)
.searchProcedureHere,
isTextFieldHasSuffix: false,
maxLines: 1,
@ -113,7 +113,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
),
),
SizedBox(
width: MediaQuery.of(context).size.width *
width: MediaQuery.of(context!).size.width *
0.02,
),
Expanded(
@ -121,13 +121,13 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
onTap: () {
if (procedureName.text.isNotEmpty &&
procedureName.text.length >= 3)
model.getProcedureCategory(
patientId: patient.patientId,
model!.getProcedureCategory(
patientId: patient!.patientId,
categoryName:
procedureName.text);
else
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
TranslationBase.of(context!)
.atLeastThreeCharacters,
);
},
@ -144,13 +144,13 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
if ((procedureType == ProcedureType.PROCEDURE
? procedureName.text.isNotEmpty
: true) &&
model.categoriesList.length != 0)
model!.categoriesList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList:
model.categoriesList[0].entityList,
model!.categoriesList[0].entityList!,
removeHistory: (item) {
setState(() {
entityList.remove(item);
@ -181,24 +181,24 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: procedureType.getAddButtonTitle(context),
title: procedureType!.getAddButtonTitle(context!),
fontWeight: FontWeight.w700,
color: Color(0xff359846),
onPressed: () async {
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
TranslationBase.of(context!)
.fillTheMandatoryProcedureDetails,
);
return;
}
await this.model.preparePostProcedure(
await this.model!.preparePostProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
remarks: remarksController.text);
Navigator.pop(context);
Navigator.pop(context!);
},
),
],

@ -15,13 +15,13 @@ import 'add-favourite-procedure.dart';
import 'add-procedure-page.dart';
class BaseAddProcedureTabPage extends StatefulWidget {
final ProcedureViewModel model;
final PrescriptionViewModel prescriptionModel;
final PatiantInformtion patient;
final ProcedureType procedureType;
final ProcedureViewModel? model;
final PrescriptionViewModel? prescriptionModel;
final PatiantInformtion? patient;
final ProcedureType? procedureType;
const BaseAddProcedureTabPage(
{Key key,
{Key? key,
this.model,
this.prescriptionModel,
this.patient,
@ -30,7 +30,7 @@ class BaseAddProcedureTabPage extends StatefulWidget {
@override
_BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState(
patient: patient, model: model, procedureType: procedureType);
patient: patient!, model: model!, procedureType: procedureType!);
}
class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
@ -39,9 +39,9 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
final PatiantInformtion patient;
final ProcedureType procedureType;
_BaseAddProcedureTabPageState({this.patient, this.model, this.procedureType});
_BaseAddProcedureTabPageState({required this.patient, required this.model, required this.procedureType});
TabController _tabController;
late TabController _tabController;
int _activeTab = 0;
@override
@ -68,7 +68,7 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) =>
AppScaffold(
isShowAppBar: false,
body: NetworkBaseView(
@ -154,17 +154,17 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
AddFavouriteProcedure(
model: this.model,
prescriptionModel:
widget.prescriptionModel,
widget.prescriptionModel!,
patient: patient,
procedureType: procedureType,
),
if (widget.procedureType ==
ProcedureType.PRESCRIPTION)
PrescriptionFormWidget(
widget.prescriptionModel,
widget.patient,
widget.prescriptionModel
.prescriptionList)
widget.prescriptionModel!,
widget.patient!,
widget!.prescriptionModel!
.prescriptionList!)
else
AddProcedurePage(
model: this.model,

@ -7,7 +7,7 @@ import 'package:permission_handler/permission_handler.dart';
class AppPermissionsUtils {
static requestVideoCallPermission({BuildContext context, String type,Function onTapGrant}) async {
static requestVideoCallPermission({required BuildContext context, required String type,required Function onTapGrant}) async {
var cameraPermission = Permission.camera;
var microphonePermission = Permission.microphone;

@ -19,9 +19,9 @@ class VideoChannel {
String? tokenID,
String? generalId,
int? doctorId,
String patientName, Function()? onCallEnd,
required String patientName, Function()? onCallEnd,
Function(SessionStatusModel sessionStatusModel)? onCallNotRespond,
Function(String error)? onFailure, VoidCallback onCallConnected, VoidCallback onCallDisconnected}) async {
Function(String error)? onFailure, VoidCallback? onCallConnected, VoidCallback? onCallDisconnected}) async {
onCallConnected = onCallConnected ?? (){};
onCallDisconnected = onCallDisconnected ?? (){};
@ -29,10 +29,10 @@ class VideoChannel {
try {
_channel.setMethodCallHandler((call) {
if(call.method == 'onCallConnected'){
onCallConnected();
onCallConnected!();
}
if(call.method == 'onCallDisconnected'){
onCallDisconnected();
onCallDisconnected!();
}
return true as dynamic;
});

@ -396,7 +396,7 @@ class AppDateUtils {
static convertDateFormatImproved(String str) {
String newDate;
String newDate ='';
const start = "/Date(";
if (str.isNotEmpty) {
const end = "+0300)";
@ -413,6 +413,6 @@ class AppDateUtils {
date.day.toString().padLeft(2, '0');
}
return newDate??'';
return newDate;
}
}

@ -271,10 +271,10 @@ class Helpers {
}
static String timeFrom({Duration duration}) {
static String timeFrom({Duration? duration}) {
String twoDigits(int n) => n.toString().padLeft(2, "0");
String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60));
String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60));
String twoDigitMinutes = twoDigits(duration!.inMinutes.remainder(60));
String twoDigitSeconds = twoDigits(duration!.inSeconds.remainder(60));
return "$twoDigitMinutes:$twoDigitSeconds";
}
}

@ -847,8 +847,8 @@ class TranslationBase {
String? get selectProcedures => localizedValues['selectProcedures']![locale.languageCode];
String? get addSelectedProcedures => localizedValues['addSelectedProcedures']![locale.languageCode];
String get addProcedures =>
localizedValues['addProcedures'][locale.languageCode];
String? get addProcedures =>
localizedValues['addProcedures']![locale.languageCode];
String? get updateProcedure => localizedValues['updateProcedure']![locale.languageCode];
@ -1081,14 +1081,14 @@ class TranslationBase {
String? get impressionRecommendation => localizedValues['impressionRecommendation']![locale.languageCode];
String? get onHold => localizedValues['onHold']![locale.languageCode];
String? get verified => localizedValues['verified']![locale.languageCode];
String get favoriteTemplates => localizedValues['favoriteTemplates'][locale.languageCode];
String get allProcedures => localizedValues['allProcedures'][locale.languageCode];
String get allRadiology => localizedValues['allRadiology'][locale.languageCode];
String get allLab => localizedValues['allLab'][locale.languageCode];
String get allPrescription => localizedValues['allPrescription'][locale.languageCode];
String get addPrescription => localizedValues['addPrescription'][locale.languageCode];
String get edit => localizedValues['edit'][locale.languageCode];
String get summeryReply => localizedValues['summeryReply'][locale.languageCode];
String? get favoriteTemplates => localizedValues['favoriteTemplates']![locale.languageCode];
String? get allProcedures => localizedValues['allProcedures']![locale.languageCode];
String? get allRadiology => localizedValues['allRadiology']![locale.languageCode];
String? get allLab => localizedValues['allLab']![locale.languageCode];
String? get allPrescription => localizedValues['allPrescription']![locale.languageCode];
String? get addPrescription => localizedValues['addPrescription']![locale.languageCode];
String? get edit => localizedValues['edit']![locale.languageCode];
String? get summeryReply => localizedValues['summeryReply']![locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
class RowCounts extends StatelessWidget {
final name;
final int count;
final double height;
final double? height;
final Color c;
RowCounts(this.name, this.count, this.c, {this.height});
@override

@ -10,7 +10,7 @@ class AskPermissionDialog extends StatefulWidget {
final String type;
final Function onTapGrant;
AskPermissionDialog({this.type, this.onTapGrant});
AskPermissionDialog({required this.type, required this.onTapGrant});
@override
_AskPermissionDialogState createState() => _AskPermissionDialogState();

@ -9,7 +9,7 @@ class ShowTimer extends StatefulWidget {
const ShowTimer({
Key key, this.patientInfo,
Key? key, required this.patientInfo,
}) : super(key: key);
@override
@ -50,7 +50,7 @@ class _ShowTimerState extends State<ShowTimer> {
generateShowTimerString() {
DateTime now = DateTime.now();
DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime);
DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime!);
String timer = AppDateUtils.differenceBetweenDateAndCurrent(
liveCareDate, context, isShowSecond: true, isShowDays: false);

@ -27,8 +27,8 @@ class PatientProfileButton extends StatelessWidget {
final bool isSelectInpatient;
final bool isDartIcon;
final IconData? dartIcon;
final bool isFromLiveCare;
final Color color;
final bool? isFromLiveCare;
final Color? color;
PatientProfileButton({
Key? key,

@ -16,20 +16,20 @@ class PatientProfileAppBar extends StatelessWidget
with PreferredSizeWidget {
final PatientProfileAppBarModel patientProfileAppBarModel;
final bool isFromLabResult;
final VoidCallback onPressed;
final VoidCallback? onPressed;
PatientProfileAppBar(
{this.patientProfileAppBarModel, this.isFromLabResult=false, this.onPressed});
{required this.patientProfileAppBarModel, this.isFromLabResult=false, this.onPressed});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
int gender = 1;
if (patientProfileAppBarModel.patient.patientDetails != null) {
gender = patientProfileAppBarModel.patient.patientDetails.gender;
if (patientProfileAppBarModel.patient!.patientDetails != null) {
gender = patientProfileAppBarModel.patient!.patientDetails!.gender!;
} else {
gender = patientProfileAppBarModel.patient.gender;
gender = patientProfileAppBarModel.patient!.gender!;
}
return Container(
@ -54,22 +54,22 @@ class PatientProfileAppBar extends StatelessWidget
color: Color(0xFF2B353E), //Colors.black,
onPressed: () {
if(onPressed!=null)
onPressed();
onPressed!();
Navigator.pop(context);
},
),
Expanded(
child: AppText(
patientProfileAppBarModel.patient.firstName != null
patientProfileAppBarModel.patient!.firstName != null
? (Helpers.capitalize(
patientProfileAppBarModel.patient.firstName) +
patientProfileAppBarModel.patient!.firstName) +
" " +
Helpers.capitalize(
patientProfileAppBarModel.patient.lastName))
patientProfileAppBarModel.patient!.lastName))
: Helpers.capitalize(
patientProfileAppBarModel.patient.fullName ??
patientProfileAppBarModel.patient!.fullName ??
patientProfileAppBarModel
.patient.patientDetails.fullName),
.patient!.patientDetails!.fullName!),
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
@ -90,7 +90,7 @@ class PatientProfileAppBar extends StatelessWidget
child: InkWell(
onTap: () {
launch("tel://" +
patientProfileAppBarModel.patient.mobileNumber);
patientProfileAppBarModel.patient!.mobileNumber!);
},
child: Icon(
Icons.phone,
@ -121,13 +121,13 @@ class PatientProfileAppBar extends StatelessWidget
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
patientProfileAppBarModel.patient.patientStatusType != null
patientProfileAppBarModel.patient!.patientStatusType != null
? Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
patientProfileAppBarModel
.patient.patientStatusType ==
.patient!.patientStatusType ==
43
? AppText(
TranslationBase.of(context).arrivedP,
@ -143,14 +143,14 @@ class PatientProfileAppBar extends StatelessWidget
fontFamily: 'Poppins',
fontSize: 12,
),
patientProfileAppBarModel.patient.startTime !=
patientProfileAppBarModel.patient!.startTime !=
null
? AppText(
patientProfileAppBarModel
.patient.startTime !=
.patient!.startTime !=
null
? patientProfileAppBarModel
.patient.startTime
.patient!.startTime
: '',
fontWeight: FontWeight.w700,
fontSize: 12,
@ -180,7 +180,7 @@ class PatientProfileAppBar extends StatelessWidget
),
new TextSpan(
text: patientProfileAppBarModel
.patient.patientId
.patient!.patientId
.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
@ -194,28 +194,28 @@ class PatientProfileAppBar extends StatelessWidget
Row(
children: [
AppText(
patientProfileAppBarModel.patient.nationalityName ??
patientProfileAppBarModel.patient!.nationalityName ??
patientProfileAppBarModel
.patient.nationality ??
.patient!.nationality ??
patientProfileAppBarModel
.patient.nationalityId ??
.patient!.nationalityId ??
'',
fontWeight: FontWeight.bold,
fontSize: 12,
),
patientProfileAppBarModel
.patient.nationalityFlagURL !=
.patient!.nationalityFlagURL !=
null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patientProfileAppBarModel
.patient.nationalityFlagURL,
.patient!.nationalityFlagURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -234,7 +234,7 @@ class PatientProfileAppBar extends StatelessWidget
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).age + " : ",
text: TranslationBase.of(context).age! + " : ",
style: TextStyle(
fontSize: 10,
fontWeight: FontWeight.w600,
@ -242,7 +242,7 @@ class PatientProfileAppBar extends StatelessWidget
)),
new TextSpan(
text:
"${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient.patientDetails != null ? patientProfileAppBarModel.patient.patientDetails.dateofBirth ?? "" : patientProfileAppBarModel.patient.dateofBirth ?? "", context, isServerFormat: !patientProfileAppBarModel.isFromLiveCare)}",
"${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient!.patientDetails != null ? patientProfileAppBarModel.patient!.patientDetails!.dateofBirth ?? "" : patientProfileAppBarModel.patient!.dateofBirth ?? "", context, isServerFormat: !patientProfileAppBarModel.isFromLiveCare!)}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 12,
@ -253,15 +253,15 @@ class PatientProfileAppBar extends StatelessWidget
),
),
if (patientProfileAppBarModel.patient.appointmentDate !=
if (patientProfileAppBarModel.patient!.appointmentDate !=
null &&
patientProfileAppBarModel
.patient.appointmentDate.isNotEmpty && !isFromLabResult)
.patient!.appointmentDate!.isNotEmpty && !isFromLabResult)
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).appointmentDate + " : ",
TranslationBase.of(context).appointmentDate! + " : ",
fontSize: 10,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
@ -274,7 +274,7 @@ class PatientProfileAppBar extends StatelessWidget
AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
patientProfileAppBarModel
.patient.appointmentDate)),
.patient!.appointmentDate!)),
fontWeight: FontWeight.w700,
fontSize: 12,
color: Color(0xFF2E303A),
@ -284,7 +284,7 @@ class PatientProfileAppBar extends StatelessWidget
)
],
),
if (patientProfileAppBarModel.isFromLabResult)
if (patientProfileAppBarModel.isFromLabResult!)
Container(
child: RichText(
text: new TextSpan(
@ -304,7 +304,7 @@ class PatientProfileAppBar extends StatelessWidget
)),
new TextSpan(
text:
'${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 12)),
@ -316,10 +316,10 @@ class PatientProfileAppBar extends StatelessWidget
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (patientProfileAppBarModel.patient.admissionDate !=
if (patientProfileAppBarModel.patient!.admissionDate !=
null &&
patientProfileAppBarModel
.patient.admissionDate.isNotEmpty)
.patient!.admissionDate!.isNotEmpty)
Container(
child: RichText(
text: new TextSpan(
@ -332,26 +332,26 @@ class PatientProfileAppBar extends StatelessWidget
children: <TextSpan>[
new TextSpan(
text: patientProfileAppBarModel
.patient.admissionDate ==
.patient!.admissionDate ==
null
? ""
: TranslationBase.of(context)
.admissionDate +
.admissionDate! +
" : ",
style: TextStyle(fontSize: 10)),
new TextSpan(
text: patientProfileAppBarModel
.patient.admissionDate ==
.patient!.admissionDate ==
null
? ""
: "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate.toString())))}",
: "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 12,
color: Color(0xFF2E303A),
)),
]))),
if (patientProfileAppBarModel.patient.admissionDate !=
if (patientProfileAppBarModel.patient!.admissionDate !=
null)
Row(
children: [
@ -360,20 +360,20 @@ class PatientProfileAppBar extends StatelessWidget
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757)),
if (patientProfileAppBarModel
.isDischargedPatient &&
if (patientProfileAppBarModel!
.isDischargedPatient! &&
patientProfileAppBarModel
.patient.dischargeDate !=
.patient!.dischargeDate !=
null)
AppText(
"${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}",
"${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}",
fontWeight: FontWeight.w700,
fontSize: 12,
color: Color(0xFF2E303A),
)
else
AppText(
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}",
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}",
fontWeight: FontWeight.w700,
fontSize: 12,
color: Color(0xFF2E303A),
@ -386,7 +386,7 @@ class PatientProfileAppBar extends StatelessWidget
),
),
]),
if (patientProfileAppBarModel.isAppointmentHeader)
if (patientProfileAppBarModel.isAppointmentHeader!)
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -401,8 +401,8 @@ class PatientProfileAppBar extends StatelessWidget
shape: BoxShape.rectangle,
border: Border(
bottom:
BorderSide(color: Colors.grey[400], width: 2.5),
left: BorderSide(color: Colors.grey[400], width: 2.5),
BorderSide(color: Colors.grey[400]!, width: 2.5),
left: BorderSide(color: Colors.grey[400]!, width: 2.5),
)),
),
Expanded(
@ -436,7 +436,7 @@ class PatientProfileAppBar extends StatelessWidget
if (patientProfileAppBarModel.orderNo !=
null &&
!patientProfileAppBarModel
.isPrescriptions)
.isPrescriptions!)
Row(
children: <Widget>[
AppText(
@ -454,8 +454,8 @@ class PatientProfileAppBar extends StatelessWidget
),
if (patientProfileAppBarModel.invoiceNO !=
null &&
!patientProfileAppBarModel
.isPrescriptions)
!patientProfileAppBarModel!
.isPrescriptions!)
Row(
children: <Widget>[
AppText(
@ -506,7 +506,7 @@ class PatientProfileAppBar extends StatelessWidget
],
),
if (patientProfileAppBarModel
.isMedicalFile &&
.isMedicalFile! &&
patientProfileAppBarModel.episode !=
null)
Row(
@ -525,7 +525,7 @@ class PatientProfileAppBar extends StatelessWidget
],
),
if (patientProfileAppBarModel
.isMedicalFile &&
.isMedicalFile! &&
patientProfileAppBarModel.visitDate !=
null)
Row(
@ -544,12 +544,12 @@ class PatientProfileAppBar extends StatelessWidget
],
),
if (!patientProfileAppBarModel
.isMedicalFile)
.isMedicalFile!)
Row(
children: <Widget>[
AppText(
!patientProfileAppBarModel
.isPrescriptions
.isPrescriptions!
? 'Result Date:'
: 'Prescriptions Date ',
fontSize: 10,
@ -557,7 +557,7 @@ class PatientProfileAppBar extends StatelessWidget
color: Color(0xFF575757),
),
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}',
fontSize: 12,
)
],
@ -581,14 +581,14 @@ class PatientProfileAppBar extends StatelessWidget
Size get preferredSize => Size(
double.maxFinite,
patientProfileAppBarModel.height == 0
? patientProfileAppBarModel.isAppointmentHeader
? patientProfileAppBarModel.isAppointmentHeader!
? 270
: ((patientProfileAppBarModel.patient.appointmentDate != null &&patientProfileAppBarModel.patient.appointmentDate.isNotEmpty )
? patientProfileAppBarModel.isFromLabResult?170:150
: patientProfileAppBarModel.patient.admissionDate != null
? patientProfileAppBarModel.isFromLabResult?170:150
: patientProfileAppBarModel.isDischargedPatient
? 240
: 130)
: patientProfileAppBarModel.height);
: ((patientProfileAppBarModel.patient!.appointmentDate! != null &&patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty )
? patientProfileAppBarModel.isFromLabResult!?170:150
: patientProfileAppBarModel.patient!.admissionDate != null
? patientProfileAppBarModel.isFromLabResult!?170:150
: patientProfileAppBarModel.isDischargedPatient!
? 240!
: 130!)
: patientProfileAppBarModel.height!);
}

@ -20,10 +20,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
final bool isDischargedPatient;
final bool isFromLiveCare;
final Stream<String> videoCallDurationStream;
final Stream <String> videoCallDurationStream;
PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType,
{this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, this.videoCallDurationStream});
{this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, required this.videoCallDurationStream});
@override
Widget build(BuildContext context) {
@ -101,7 +101,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
child: Container(
decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10),
child: Text(snapshot.data, style: TextStyle(color: Colors.white),),
child: Text(snapshot.data!, style: TextStyle(color: Colors.white),),
),
);
else

@ -21,12 +21,12 @@ class AppScaffold extends StatelessWidget {
final Widget? bottomSheet;
final Color? backgroundColor;
final PreferredSizeWidget? appBar;
final Widget drawer;
final Widget bottomNavigationBar;
final Widget? drawer;
final Widget? bottomNavigationBar;
final String? subtitle;
final bool isHomeIcon;
final bool extendBody;
final PatientProfileAppBarModel patientProfileAppBarModel;
final PatientProfileAppBarModel? patientProfileAppBarModel;
AppScaffold(
{this.appBarTitle = '',
@ -57,7 +57,7 @@ class AppScaffold extends StatelessWidget {
bottomNavigationBar: bottomNavigationBar,
appBar: isShowAppBar
? patientProfileAppBarModel != null ? PatientProfileAppBar(
patientProfileAppBarModel: patientProfileAppBarModel,) : appBar ??
patientProfileAppBarModel: patientProfileAppBarModel!,) : appBar ??
AppBar(
elevation: 0,
backgroundColor: Colors.white,

@ -18,7 +18,7 @@ class AppText extends StatefulWidget {
final double? marginRight;
final double? marginBottom;
final double? marginLeft;
final double letterSpacing;
final double? letterSpacing;
final TextAlign? textAlign;
final bool? bold;
final bool? regular;

@ -22,7 +22,7 @@ class AppButton extends StatefulWidget {
final double? radius;
final double? vPadding;
final double? hPadding;
final double height;
final double? height;
AppButton({
@required this.onPressed,

@ -11,7 +11,7 @@ class DrawerItem extends StatefulWidget {
final IconData? icon;
final Color? color;
final String? assetLink;
final double drawerWidth;
final double? drawerWidth;
DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink, this.drawerWidth});

Loading…
Cancel
Save