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

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

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

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

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

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

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

@ -3,16 +3,16 @@ import 'package:flutter/material.dart';
class NavigationService { class NavigationService {
final GlobalKey<NavigatorState> navigatorKey = final GlobalKey<NavigatorState> navigatorKey =
new GlobalKey<NavigatorState>(); new GlobalKey<NavigatorState>();
Future<dynamic> navigateTo(String routeName,{Object arguments}) { Future<dynamic> navigateTo(String routeName,{required Object arguments}) {
return navigatorKey.currentState.pushNamed(routeName,arguments: arguments); return navigatorKey.currentState!.pushNamed(routeName,arguments: arguments);
} }
Future<dynamic> pushReplacementNamed(String routeName,{Object arguments}) { Future<dynamic> pushReplacementNamed(String routeName,{required Object arguments}) {
return navigatorKey.currentState.pushReplacementNamed(routeName,arguments: arguments); return navigatorKey.currentState!.pushReplacementNamed(routeName,arguments: arguments);
} }
Future<dynamic> pushNamedAndRemoveUntil(String routeName) { 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{ class VideoCallService extends BaseService{
StartCallRes startCallRes; late StartCallRes startCallRes;
PatiantInformtion patient; late PatiantInformtion patient;
LiveCarePatientServices _liveCarePatientServices = locator<LiveCarePatientServices>(); LiveCarePatientServices _liveCarePatientServices = locator<LiveCarePatientServices>();
openVideo(StartCallRes startModel,PatiantInformtion patientModel,VoidCallback onCallConnected, VoidCallback onCallDisconnected)async{ openVideo(StartCallRes startModel,PatiantInformtion patientModel,VoidCallback onCallConnected, VoidCallback onCallDisconnected)async{
this.startCallRes = startModel; this.startCallRes = startModel;
this.patient = patientModel; this.patient = patientModel;
DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); DoctorProfileModel? doctorProfile = await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen( await VideoChannel.openVideoCallScreen(
kToken: startCallRes.openTokenID,//"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", kToken: startCallRes.openTokenID,//"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",
kSessionId:startCallRes.openSessionID,//1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg 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}" : "-"), patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
tokenID: await sharedPref.getString(TOKEN), tokenID: await sharedPref.getString(TOKEN),
generalId: GENERAL_ID, generalId: GENERAL_ID,
doctorId: doctorProfile.doctorID, doctorId: doctorProfile!.doctorID,
onFailure: (String error) { onFailure: (String error) {
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
},onCallConnected: onCallConnected, },onCallConnected: onCallConnected,
onCallEnd: () { onCallEnd: () {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance!.addPostFrameCallback((_) async {
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext); GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext!);
endCall(patient.vcId, false,).then((value) { endCall(patient.vcId!, false,).then((value) {
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext); GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext!);
if (hasError) { if (hasError) {
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
}else }else
@ -54,10 +54,10 @@ class VideoCallService extends BaseService{
}); });
}, },
onCallNotRespond: (SessionStatusModel sessionStatusModel) { onCallNotRespond: (SessionStatusModel sessionStatusModel) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance!.addPostFrameCallback((_) {
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext); GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext!);
endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { endCall(patient.vcId!, sessionStatusModel.sessionStatus == 3,).then((value) {
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext); GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext!);
if (hasError) { if (hasError) {
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
} else { } else {
@ -76,13 +76,13 @@ class VideoCallService extends BaseService{
hasError = false; hasError = false;
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
EndCallReq endCallReq = new EndCallReq(); EndCallReq endCallReq = new EndCallReq();
endCallReq.doctorId = doctorProfile.doctorID; endCallReq.doctorId = doctorProfile!.doctorID;
endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.generalid = 'Cs2020@2016\$2958';
endCallReq.vCID = vCID; endCallReq.vCID = vCID;
endCallReq.isDestroy = isPatient; endCallReq.isDestroy = isPatient;
await _liveCarePatientServices.endCall(endCallReq); await _liveCarePatientServices.endCall(endCallReq);
if (_liveCarePatientServices.hasError) { 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'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
class ScanQrService extends BaseService { class ScanQrService extends BaseService {
List<PatiantInformtion> myInPatientList = List(); List<PatiantInformtion> myInPatientList = [];
List<PatiantInformtion> inPatientList = List(); List<PatiantInformtion> inPatientList = [];
Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async { Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
if (isMyInpatient) { if (isMyInpatient) {
requestModel.doctorID = doctorProfile.doctorID; requestModel.doctorID = doctorProfile!.doctorID!;
} else { } else {
requestModel.doctorID = 0; requestModel.doctorID = 0;
} }
@ -26,7 +26,7 @@ class ScanQrService extends BaseService {
response['List_MyInPatient'].forEach((v) { response['List_MyInPatient'].forEach((v) {
PatiantInformtion patient = PatiantInformtion.fromJson(v); PatiantInformtion patient = PatiantInformtion.fromJson(v);
inPatientList.add(patient); inPatientList.add(patient);
if (patient.doctorId == doctorProfile.doctorID) { if (patient.doctorId == doctorProfile!.doctorID!) {
myInPatientList.add(patient); myInPatientList.add(patient);
} }
}); });

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

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

@ -155,7 +155,7 @@ class PatientReferralService extends LookupService {
hasError = false; hasError = false;
RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel(); RequestMyReferralPatientModel();
DoctorProfileModel doctorProfile = await getDoctorProfile(); DoctorProfileModel? doctorProfile = await getDoctorProfile();
await baseAppClient.post( await baseAppClient.post(
GET_MY_REFERRED_OUT_PATIENT, 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 { class PatientService extends BaseService {
List<VitalSignResModel> _patientVitalSignList = []; List<VitalSignResModel> _patientVitalSignList = [];
List<VitalSignResModel> patientVitalSignOrderdSubList = []; List<VitalSignResModel> patientVitalSignOrderdSubList = [];
List<PatiantInformtion> inPatientList = List(); List<PatiantInformtion> inPatientList = [];
List<PatiantInformtion> myInPatientList = List(); List<PatiantInformtion> myInPatientList = [];
List<VitalSignResModel> get patientVitalSignList => _patientVitalSignList; List<VitalSignResModel> get patientVitalSignList => _patientVitalSignList;
@ -141,7 +141,7 @@ class PatientService extends BaseService {
await getDoctorProfile(); await getDoctorProfile();
if (isMyInpatient) { if (isMyInpatient) {
requestModel.doctorID = doctorProfile.doctorID; requestModel.doctorID = doctorProfile!.doctorID!;
} else { } else {
requestModel.doctorID = 0; requestModel.doctorID = 0;
} }
@ -155,7 +155,7 @@ class PatientService extends BaseService {
response['List_MyInPatient'].forEach((v) { response['List_MyInPatient'].forEach((v) {
PatiantInformtion patient = PatiantInformtion.fromJson(v); PatiantInformtion patient = PatiantInformtion.fromJson(v);
inPatientList.add(patient); inPatientList.add(patient);
if (patient.doctorId == doctorProfile.doctorID) { if (patient.doctorId == doctorProfile!.doctorID!) {
myInPatientList.add(patient); myInPatientList.add(patient);
} }
}); });

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -18,7 +18,7 @@ class DashboardSliderItemWidget extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ 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 GestureTapCallback onTap;
final Color color; final Color color;
final double opacity; final double opacity;
final double width; final double? width;
final EdgeInsets margin; final EdgeInsets margin;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

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

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

@ -7,13 +7,13 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class Label extends StatelessWidget { class Label extends StatelessWidget {
Label({ 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); }) : super(key: key);
final String firstLine; final String? firstLine;
final String secondLine; final String? secondLine;
Color color; Color color;
final double secondLineFontSize; final double? secondLineFontSize;
final double firstLineFontSize; final double? firstLineFontSize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

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

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

@ -66,7 +66,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
//'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg',
kApiKey: '46209962', kApiKey: '46209962',
vcId: widget.patientData.vcId, 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", tokenID: token, //"hfkjshdf347r8743",
generalId: "Cs2020@2016\$2958", generalId: "Cs2020@2016\$2958",
doctorId: doctorprofile['DoctorID'], doctorId: doctorprofile['DoctorID'],

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

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

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

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

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

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

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

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

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

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

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

@ -428,7 +428,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
], ],
), ),
), ),
if (referredPatient.referredDoctorRemarks.isNotEmpty) if (referredPatient.referredDoctorRemarks!.isNotEmpty)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0),
@ -487,7 +487,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
widget: AddReplayOnReferralPatient( widget: AddReplayOnReferralPatient(
patientReferralViewModel: patientReferralViewModel, patientReferralViewModel: patientReferralViewModel,
myReferralInPatientModel: referredPatient, 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), title: AppText(TranslationBase.of(context).inPatient),
value: PatientType.IN_PATIENT, value: PatientType.IN_PATIENT,
groupValue: patientType, groupValue: patientType,
onChanged: (PatientType value) { onChanged: (PatientType? value) {
setState(() { setState(() {
patientType = value; patientType = value!;
radioOnChange(value); radioOnChange(value!);
}); });
}, },
), ),
@ -151,9 +151,9 @@ class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
title: AppText(TranslationBase.of(context).outpatient), title: AppText(TranslationBase.of(context).outpatient),
value: PatientType.OUT_PATIENT, value: PatientType.OUT_PATIENT,
groupValue: patientType, groupValue: patientType,
onChanged: (PatientType value) { onChanged: (PatientType? value) {
setState(() { setState(() {
patientType = value; patientType = value!;
radioOnChange(value); radioOnChange(value);
}); });
}, },

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

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

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

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

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

@ -7,7 +7,7 @@ import 'package:permission_handler/permission_handler.dart';
class AppPermissionsUtils { 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 cameraPermission = Permission.camera;
var microphonePermission = Permission.microphone; var microphonePermission = Permission.microphone;

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

@ -396,7 +396,7 @@ class AppDateUtils {
static convertDateFormatImproved(String str) { static convertDateFormatImproved(String str) {
String newDate; String newDate ='';
const start = "/Date("; const start = "/Date(";
if (str.isNotEmpty) { if (str.isNotEmpty) {
const end = "+0300)"; const end = "+0300)";
@ -413,6 +413,6 @@ class AppDateUtils {
date.day.toString().padLeft(2, '0'); 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 twoDigits(int n) => n.toString().padLeft(2, "0");
String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60)); String twoDigitMinutes = twoDigits(duration!.inMinutes.remainder(60));
String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); String twoDigitSeconds = twoDigits(duration!.inSeconds.remainder(60));
return "$twoDigitMinutes:$twoDigitSeconds"; return "$twoDigitMinutes:$twoDigitSeconds";
} }
} }

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

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

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

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

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

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

@ -20,10 +20,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isFromLiveCare; final bool isFromLiveCare;
final Stream<String> videoCallDurationStream; final Stream <String> videoCallDurationStream;
PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType, 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -101,7 +101,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
child: Container( child: Container(
decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), 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 else

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

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

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

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

Loading…
Cancel
Save