flutter 2 migration fix

merge-requests/752/merge
hussam al-habibeh 5 years ago
parent eb2b614f74
commit 550d54c034

@ -44,10 +44,10 @@ class BaseAppClient {
if (body['DoctorID'] == "") body['DoctorID'] = null; if (body['DoctorID'] == "") body['DoctorID'] = null;
if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID; if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID;
if (body['ProjectID'] == null) { if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID; body['ProjectID'] = doctorProfile.projectID;
} }
if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile.clinicID;
if (body['DoctorID'] == '') { if (body['DoctorID'] == '') {
body['DoctorID'] = null; body['DoctorID'] = null;
} }
@ -56,7 +56,7 @@ class BaseAppClient {
} }
} }
if (body['TokenID'] == null) { if (body['TokenID'] == null) {
body['TokenID'] = token ?? ''; body['TokenID'] = token;
} }
// body['TokenID'] = "@dm!n" ?? ''; // body['TokenID'] = "@dm!n" ?? '';
String lang = await sharedPref.getString(APP_Language); String lang = await sharedPref.getString(APP_Language);

@ -37,16 +37,16 @@ class SizeConfig {
} else if (constraints.maxHeight < 1000) { } else if (constraints.maxHeight < 1000) {
isHeightMiddle = true; isHeightMiddle = true;
} else { } else {
isHeightLarge = true; isHeightLarge = true;
} }
if(constraints.maxWidth > 600) { if (constraints.maxWidth > 600) {
isWidthLarge = true; isWidthLarge = true;
} }
if (orientation == Orientation.portrait) { if (orientation == Orientation.portrait) {
isPortrait = true; isPortrait = true;
if (realScreenWidth! < 450) { if (realScreenWidth < 450) {
isMobilePortrait = true; isMobilePortrait = true;
} }
screenHeight = realScreenHeight; screenHeight = realScreenHeight;
@ -57,8 +57,8 @@ class SizeConfig {
screenHeight = realScreenWidth; screenHeight = realScreenWidth;
screenWidth = realScreenHeight; screenWidth = realScreenHeight;
} }
_blockWidth = (screenWidth! / 100); _blockWidth = (screenWidth / 100);
_blockHeight = (screenHeight! / 100)!; _blockHeight = (screenHeight / 100);
textMultiplier = _blockHeight; textMultiplier = _blockHeight;
imageSizeMultiplier = _blockWidth; imageSizeMultiplier = _blockWidth;
@ -75,27 +75,26 @@ 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;
} }
return widthMultiplier; return widthMultiplier;
} }
static getWidthMultiplier({double? width}) {
static getWidthMultiplier({double? width}){
// TODO handel LandScape case // TODO handel LandScape case
if(width != null) { if (width != null) {
return width / 100; return width / 100;
} }
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;
} }
return heightMultiplier; return heightMultiplier;
} }

@ -428,7 +428,7 @@ class PatientService extends BaseService {
referralClinic: selectedClinicID.toString(), referralClinic: selectedClinicID.toString(),
referralDoctor: selectedDoctorID.toString(), referralDoctor: selectedDoctorID.toString(),
createdBy: doctorID!, createdBy: doctorID!,
editedBy: doctorID!, editedBy: doctorID,
patientID: patientID!, patientID: patientID!,
patientTypeID: patientTypeID!, patientTypeID: patientTypeID!,
referringClinic: clinicId!, referringClinic: clinicId!,

@ -203,7 +203,7 @@ class PrescriptionService extends LookupService {
"Gender": patient.gender == 1 ? 'Male' : 'Female', "Gender": patient.gender == 1 ? 'Male' : 'Female',
"Age": AppDateUtils.convertDateFromServerFormat(patient.dateofBirth!, 'dd/MM/yyyy') "Age": AppDateUtils.convertDateFromServerFormat(patient.dateofBirth!, 'dd/MM/yyyy')
}, },
"objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg}, "objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg},
"objPrescriptionItems": prescription, "objPrescriptionItems": prescription,
"objAllergies": getAllergiesObj(allergy), "objAllergies": getAllergiesObj(allergy),
"objDiagnosis": getDiagnosisObj(lstAssessments), "objDiagnosis": getDiagnosisObj(lstAssessments),

@ -124,7 +124,7 @@ class PrescriptionsService extends BaseService {
bool isInPatient = false; bool isInPatient = false;
prescriptionsList.forEach((element) { prescriptionsList.forEach((element) {
if (prescriptionsOrder!.appointmentNo == "0") { if (prescriptionsOrder!.appointmentNo == "0") {
if (element.dischargeNo == int.parse(prescriptionsOrder!.dischargeID)) { if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) {
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
_requestPrescriptionReportEnh.clinicID = element.clinicID; _requestPrescriptionReportEnh.clinicID = element.clinicID;
_requestPrescriptionReportEnh.projectID = element.projectID; _requestPrescriptionReportEnh.projectID = element.projectID;

@ -184,7 +184,7 @@ class AuthenticationViewModel extends BaseViewModel {
mobileNumber: loggedUser != null ? loggedUser!.mobileNumber : user!.mobile, mobileNumber: loggedUser != null ? loggedUser!.mobileNumber : user!.mobile,
projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID, projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID,
logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID),
activationCode: activationCode ?? '0000', activationCode: activationCode,
oTPSendType: await sharedPref.getInt(OTP_TYPE), oTPSendType: await sharedPref.getInt(OTP_TYPE),
generalid: "Cs2020@2016\$2958"); generalid: "Cs2020@2016\$2958");
await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp);
@ -232,8 +232,8 @@ 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!);
sharedPref.setString(LOGIN_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.logInTokenID!); sharedPref.setString(LOGIN_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.logInTokenID!);
@ -270,11 +270,12 @@ class AuthenticationViewModel extends BaseViewModel {
/// get doctor profile based on clinic model /// get doctor profile based on clinic model
Future getDoctorProfileBasedOnClinic(ClinicModel clinicInfo) async { Future getDoctorProfileBasedOnClinic(ClinicModel clinicInfo) async {
ProfileReqModel docInfo = new ProfileReqModel( ProfileReqModel docInfo = new ProfileReqModel(
doctorID: clinicInfo.doctorID, doctorID: clinicInfo.doctorID,
clinicID: clinicInfo.clinicID, clinicID: clinicInfo.clinicID,
license: true, license: true,
projectID: clinicInfo.projectID, projectID: clinicInfo.projectID,
tokenID: '',); //TODO change the lan tokenID: '',
); //TODO change the lan
await _authService.getDoctorProfileBasedOnClinic(docInfo); await _authService.getDoctorProfileBasedOnClinic(docInfo);
if (_authService.hasError) { if (_authService.hasError) {
error = _authService.error!; error = _authService.error!;

@ -24,8 +24,8 @@ class DashboardViewModel extends BaseViewModel {
String? get sServiceID => _dashboardService.sServiceID; String? get sServiceID => _dashboardService.sServiceID;
List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList => _specialClinicsService.specialClinicalCareList; List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList =>
_specialClinicsService.specialClinicalCareList;
Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -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;
} }
} }
@ -93,16 +93,14 @@ class DashboardViewModel extends BaseViewModel {
return value.toString(); return value.toString();
} }
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;
} }
}); });
return special; return special;
} }
} }

@ -110,7 +110,7 @@ class PatientViewModel extends BaseViewModel {
setState(ViewState.Busy); setState(ViewState.Busy);
await _patientService.getPatientRadiology(patient); await _patientService.getPatientRadiology(patient);
if (_patientService.hasError) { if (_patientService.hasError) {
error = _patientService.error!!; error = _patientService.error!;
setState(ViewState.Error); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
@ -231,16 +231,16 @@ class PatientViewModel extends BaseViewModel {
Future referToDoctor( Future referToDoctor(
{required String selectedDoctorID, {required String selectedDoctorID,
required String selectedClinicID, required String selectedClinicID,
required int admissionNo, required int admissionNo,
required String extension, required String extension,
required String priority, required String priority,
required String frequency, required String frequency,
required String referringDoctorRemarks, required String referringDoctorRemarks,
required int patientID, required int patientID,
required int patientTypeID, required int patientTypeID,
required String roomID, required String roomID,
required int projectID}) async { required int projectID}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _patientService.referToDoctor( await _patientService.referToDoctor(
selectedClinicID: selectedClinicID, selectedClinicID: selectedClinicID,

@ -23,8 +23,7 @@ import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe;
as cpe;
class ProcedureViewModel extends BaseViewModel { class ProcedureViewModel extends BaseViewModel {
//TODO Hussam clean it //TODO Hussam clean it
@ -78,15 +77,12 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getProcedureCategory( Future getProcedureCategory({String? categoryName, String? categoryID, patientId}) async {
{String? categoryName, String? categoryID, patientId}) async {
if (categoryName == null) return; if (categoryName == null) return;
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedureCategory( await _procedureService.getProcedureCategory(
categoryName: categoryName, categoryName: categoryName, categoryID: categoryID, patientId: patientId);
categoryID: categoryID,
patientId: patientId);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error!; error = _procedureService.error!;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -318,14 +314,13 @@ class ProcedureViewModel extends BaseViewModel {
{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<Procedures> controlsProcedure = [];
@ -334,31 +329,23 @@ class ProcedureViewModel extends BaseViewModel {
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<Controls> controls = [];
controls.add( controls.add(
Controls( Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""),
code: "remarks",
controlValue: element.remarks != null ? element.remarks : ""),
); );
controls.add( controls.add(
Controls( Controls(code: "ordertype", controlValue: procedureType == ProcedureType.PROCEDURE ? element.type ?? "1" : "0"),
code: "ordertype",
controlValue: procedureType == ProcedureType.PROCEDURE
? element.type ?? "1"
: "0"),
); );
controlsProcedure.add(Procedures( controlsProcedure
category: element.categoryID, .add(Procedures(category: element.categoryID, procedure: element.procedureId, controls: controls));
procedure: element.procedureId,
controls: controls));
}); });
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);
@ -371,8 +358,7 @@ class ProcedureViewModel extends BaseViewModel {
Helpers.showErrorToast(error); Helpers.showErrorToast(error);
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 {

@ -17,7 +17,7 @@ Helpers helpers = Helpers();
class ProjectViewModel with ChangeNotifier { class ProjectViewModel with ChangeNotifier {
DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
late Locale _appLocale = Locale(currentLanguage ); late Locale _appLocale = Locale(currentLanguage);
String currentLanguage = 'ar'; String currentLanguage = 'ar';
bool _isArabic = false; bool _isArabic = false;
bool isInternetConnection = true; bool isInternetConnection = true;
@ -52,7 +52,7 @@ class ProjectViewModel with ChangeNotifier {
void loadSharedPrefLanguage() async { void loadSharedPrefLanguage() async {
currentLanguage = await sharedPref.getString(APP_Language); currentLanguage = await sharedPref.getString(APP_Language);
_appLocale = Locale(currentLanguage ?? 'en'); _appLocale = Locale(currentLanguage);
_isArabic = currentLanguage != null _isArabic = currentLanguage != null
? currentLanguage == 'ar' ? currentLanguage == 'ar'
? true ? true

@ -61,68 +61,63 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?6:4), height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4),
),
if(authenticationViewModel.isFromLogin)
InkWell(
onTap: (){
authenticationViewModel.setUnverified(false,isFromLogin: false);
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
},
child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),)
), ),
if (authenticationViewModel.isFromLogin)
InkWell(
onTap: () {
authenticationViewModel.setUnverified(false, isFromLogin: false);
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
},
child: Icon(
Icons.arrow_back_ios,
color: Color(0xFF2B353E),
)),
Column( Column(
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier*(SizeConfig.isHeightVeryShort?3:4), height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4),
), ),
authenticationViewModel.user != null && isMoreOption == false authenticationViewModel.user != null && isMoreOption == false
? Column( ? Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceEvenly,
MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).welcomeBack,
fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*4,
fontWeight: FontWeight.w700,
color: Color(0xFF2B353E),
),
AppText(
Helpers.capitalize(authenticationViewModel.user!.doctorName),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6,
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
),
SizedBox(
height: SizeConfig.heightMultiplier*4,
),
AppText(
TranslationBase.of(context).accountInfo ,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
),
SizedBox(
height: SizeConfig.heightMultiplier*4
),
Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10),
),
border: Border.all(
color: HexColor('#707070'),
width: 0.1),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText(
TranslationBase.of(context).welcomeBack,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
fontWeight: FontWeight.w700,
color: Color(0xFF2B353E),
),
AppText(
Helpers.capitalize(authenticationViewModel.user!.doctorName),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6,
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
),
SizedBox(
height: SizeConfig.heightMultiplier * 4,
),
AppText(
TranslationBase.of(context).accountInfo,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
),
SizedBox(height: SizeConfig.heightMultiplier * 4),
Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10),
),
border: Border.all(color: HexColor('#707070'), width: 0.1),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container( Container(
width: SizeConfig.realScreenWidth * .5, width: SizeConfig.realScreenWidth * .5,
padding: EdgeInsets.all(0), padding: EdgeInsets.all(0),
@ -130,277 +125,198 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
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',
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
Container( Container(
width: MediaQuery.of(context) width: MediaQuery.of(context).size.width * 0.55,
.size
.width *
0.55,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: TranslationBase.of(context).verifyWith, text: TranslationBase.of(context).verifyWith,
style: TextStyle( style: TextStyle(
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
.getTextMultiplierBasedOnWidth() *
4.5,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
children: <TextSpan>[ children: <TextSpan>[
TextSpan( TextSpan(
text: authenticationViewModel text: authenticationViewModel.getType(
.getType( authenticationViewModel.user!.logInTypeID, context),
authenticationViewModel
.user
!.logInTypeID,
context),
style: TextStyle( style: TextStyle(
color: color: Color(0xFF2B353E),
Color(0xFF2B353E), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: fontWeight: FontWeight.w700,
FontWeight.w700,
), ),
) )
]), ]),
), ),
), ),
], ],
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
), ),
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
authenticationViewModel authenticationViewModel.user!.editedOn != null
.user!.editedOn != ? AppDateUtils.getDayMonthYearDateFormatted(
null AppDateUtils.convertStringToDate(
? AppDateUtils authenticationViewModel.user!.editedOn!))
.getDayMonthYearDateFormatted( : authenticationViewModel.user!.createdOn! != null
AppDateUtils
.convertStringToDate(
authenticationViewModel
! .user
!.editedOn!))
: authenticationViewModel
.user!.createdOn! !=
null
? AppDateUtils.getDayMonthYearDateFormatted( ? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(authenticationViewModel!.user AppDateUtils.convertStringToDate(
!.createdOn!)) authenticationViewModel.user!.createdOn!))
: '--', : '--',
textAlign: textAlign: TextAlign.right,
TextAlign.right, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, color: Color(0xFF2E303A),
color: Color(0xFF2E303A), fontWeight: FontWeight.w700,
fontWeight: FontWeight.w700, ),
AppText(
authenticationViewModel.user!.editedOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(
authenticationViewModel.user!.editedOn!))
: authenticationViewModel.user!.createdOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(
authenticationViewModel.user!.createdOn!))
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
)
],
crossAxisAlignment: CrossAxisAlignment.start,
)
],
), ),
AppText( ),
authenticationViewModel.user!.editedOn != SizedBox(
null height: SizeConfig.heightMultiplier * 3,
? AppDateUtils.getHour( ),
AppDateUtils.convertStringToDate( Row(
authenticationViewModel!.user children: [
!.editedOn!)) //todo add translation
: authenticationViewModel.user!.createdOn != AppText(
null "Please Verify",
? AppDateUtils.getHour( fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5,
AppDateUtils.convertStringToDate(authenticationViewModel!.user color: Color(0xFF2B353E),
!.createdOn!)) fontWeight: FontWeight.w700,
: '--', ),
textAlign: ],
TextAlign.right, ),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, SizedBox(
fontWeight: FontWeight.w600, height: SizeConfig.heightMultiplier * 2,
color: Color(0xFF575757), ),
)
],
crossAxisAlignment: CrossAxisAlignment.start,
)
], ],
), )
),
SizedBox(
height: SizeConfig.heightMultiplier*3,
),
Row(
children: [
//todo add translation
AppText(
"Please Verify",
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
],
),
SizedBox(
height: SizeConfig.heightMultiplier*2,
),
],
)
: Column( : Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceEvenly,
MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ this.onlySMSBox == false
this.onlySMSBox == false ? Container(
? Container( margin: EdgeInsets.only(bottom: 20, top: 30),
margin: EdgeInsets.only(bottom: 20, top: 30), child: AppText(
child: AppText( TranslationBase.of(context).verifyLoginWith,
TranslationBase.of(context) fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
.verifyLoginWith , color: Color(0xFF2E303A),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 4 , fontWeight: FontWeight.bold,
color: Color(0xFF2E303A), textAlign: TextAlign.left,
fontWeight: FontWeight.bold, ),
textAlign: TextAlign.left, )
), : AppText(
) TranslationBase.of(context).verifyFingerprint2,
: AppText( fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
TranslationBase.of(context) textAlign: TextAlign.start,
.verifyFingerprint2, ),
fontSize: ]),
SizeConfig.getTextMultiplierBasedOnWidth()* 4,
textAlign: TextAlign.start,
),
]),
authenticationViewModel.user != null && isMoreOption == false authenticationViewModel.user != null && isMoreOption == false
? Column( ? Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: InkWell(
onTap: () =>
{
// TODO check this logic it seem it will create bug to us
authenticateUser(
AuthMethodTypes
.Fingerprint, true)
},
child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel,
authMethodType: SelectedAuthMethodTypesService
.getMethodsTypeService(
authenticationViewModel!.user
!.logInTypeID!!),
authenticateUser:
(AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType,
isActive),
)),
),
Expanded(
child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel,
authMethodType:
AuthMethodTypes.MoreOptions,
onShowMore: () {
setState(() {
isMoreOption = true;
});
},
))
]),
])
: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
onlySMSBox == false
? Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Expanded( Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
child: VerificationMethodsList( Expanded(
authenticationViewModel:authenticationViewModel, child: InkWell(
authMethodType: onTap: () => {
AuthMethodTypes.Fingerprint, // TODO check this logic it seem it will create bug to us
authenticateUser: authenticateUser(AuthMethodTypes.Fingerprint, true)
(AuthMethodTypes },
authMethodType, child: VerificationMethodsList(
isActive) => authenticationViewModel: authenticationViewModel,
authenticateUser( authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(
authMethodType, authenticationViewModel.user!.logInTypeID!),
isActive), authenticateUser: (AuthMethodTypes authMethodType, isActive) =>
)), authenticateUser(authMethodType, isActive),
Expanded( )),
child: VerificationMethodsList( ),
authenticationViewModel:authenticationViewModel, Expanded(
authMethodType: child: VerificationMethodsList(
AuthMethodTypes.FaceID, authenticationViewModel: authenticationViewModel,
authenticateUser: authMethodType: AuthMethodTypes.MoreOptions,
(AuthMethodTypes onShowMore: () {
authMethodType, setState(() {
isActive) => isMoreOption = true;
authenticateUser( });
authMethodType, },
isActive),
)) ))
], ]),
) ])
: SizedBox(), : Column(
Row( mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Expanded( onlySMSBox == false
child: VerificationMethodsList( ? Row(
authenticationViewModel:authenticationViewModel, mainAxisAlignment: MainAxisAlignment.center,
authMethodType: AuthMethodTypes children: <Widget>[
.SMS, Expanded(
authenticateUser: child: VerificationMethodsList(
( authenticationViewModel: authenticationViewModel,
AuthMethodTypes authMethodType, authMethodType: AuthMethodTypes.Fingerprint,
isActive) => authenticateUser: (AuthMethodTypes authMethodType, isActive) =>
authenticateUser( authenticateUser(authMethodType, isActive),
authMethodType, isActive), )),
)), Expanded(
Expanded( child: VerificationMethodsList(
child: VerificationMethodsList( authenticationViewModel: authenticationViewModel,
authenticationViewModel:authenticationViewModel, authMethodType: AuthMethodTypes.FaceID,
authMethodType: authenticateUser: (AuthMethodTypes authMethodType, isActive) =>
AuthMethodTypes.WhatsApp, authenticateUser(authMethodType, isActive),
authenticateUser: ))
( ],
AuthMethodTypes authMethodType, )
isActive) => : SizedBox(),
authenticateUser( Row(
authMethodType, isActive), mainAxisAlignment: MainAxisAlignment.center,
)) children: <Widget>[
], Expanded(
), child: VerificationMethodsList(
]), authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.SMS,
authenticateUser: (AuthMethodTypes authMethodType, isActive) =>
authenticateUser(authMethodType, isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.WhatsApp,
authenticateUser: (AuthMethodTypes authMethodType, isActive) =>
authenticateUser(authMethodType, isActive),
))
],
),
]),
// ) // )
], ],
@ -410,36 +326,36 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
), ),
), ),
), ),
bottomSheet: authenticationViewModel.user == null ? SizedBox(height: 0,) : Container( bottomSheet: authenticationViewModel.user == null
// color: Colors.green, ? SizedBox(
height: SizeConfig.heightMultiplier * 10 , height: 0,
width: double.infinity, )
child: Center( : Container(
child: FractionallySizedBox( // color: Colors.green,
widthFactor: 0.9, height: SizeConfig.heightMultiplier * 10,
child: Column( width: double.infinity,
mainAxisAlignment: MainAxisAlignment.center, child: Center(
children: <Widget>[ child: FractionallySizedBox(
AppButton( widthFactor: 0.9,
title: TranslationBase child: Column(
.of(context) mainAxisAlignment: MainAxisAlignment.center,
.useAnotherAccount, children: <Widget>[
color: Color(0xFFD02127), AppButton(
title: TranslationBase.of(context).useAnotherAccount,
fontWeight: FontWeight.w700, color: Color(0xFFD02127),
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 8 : 6), fontWeight: FontWeight.w700,
hPadding: 1, height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 8 : 6),
hPadding: 1,
onPressed: () { onPressed: () {
authenticationViewModel.deleteUser(); authenticationViewModel.deleteUser();
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
}, },
),
],
),
), ),
),
],
), ),
),
),),
); );
} }

@ -1,4 +1,3 @@
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
@ -29,152 +28,117 @@ class DashboardReferralPatient extends StatelessWidget {
shadowDy: 1, shadowDy: 1,
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child: child:
Column( Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [
crossAxisAlignment: CrossAxisAlignment.start, Expanded(
mainAxisAlignment: MainAxisAlignment.start, flex: 1,
child: Row(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Expanded( children: [
flex: 1, Expanded(
child: Row( flex: 4,
crossAxisAlignment: CrossAxisAlignment.start, child: Padding(
padding: const EdgeInsets.all(5.0),
children: [ child: Column(
Expanded( mainAxisAlignment: MainAxisAlignment.start,
flex: 4, crossAxisAlignment: CrossAxisAlignment.start,
child: Padding( children: [
padding: const EdgeInsets.all(5.0), Padding(
child: Column( padding: EdgeInsets.all(8),
mainAxisAlignment: MainAxisAlignment.start, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Padding( children: [
padding: EdgeInsets.all(8), SizedBox(
child: Column( height: SizeConfig.getHeightMultiplier(height: height) *
mainAxisAlignment: (SizeConfig.isHeightVeryShort
MainAxisAlignment.center, ? 3
crossAxisAlignment: : SizeConfig.isHeightShort
CrossAxisAlignment.start,
children: [
SizedBox(
height: SizeConfig
.getHeightMultiplier(
height: height) *
(SizeConfig.isHeightVeryShort
? 3
: SizeConfig.isHeightShort
? 2 ? 2
: 2) : 2)),
), Label(
Label(firstLine: TranslationBase firstLine: TranslationBase.of(context).patients,
.of(context) secondLine: TranslationBase.of(context).referral,
.patients, color: Color(0xFF2B353E),
secondLine: TranslationBase secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) *
.of(context) (SizeConfig.isHeightVeryShort
.referral, ? 5
color: Color(0xFF2B353E), : SizeConfig.isHeightShort
secondLineFontSize: SizeConfig
.getHeightMultiplier(
height: height) *
(SizeConfig.isHeightVeryShort
? 5
: SizeConfig.isHeightShort
? 7 ? 7
: 12),), : 12),
SizedBox(
height: SizeConfig
.getHeightMultiplier(
height: height) *
(SizeConfig.isHeightVeryShort
? 5
: SizeConfig.isHeightShort
? 10
: 5)
)
],
),),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RowCounts(
dashboardItemList![2]
.summaryoptions![0]
.kPIParameter,
dashboardItemList![2]
.summaryoptions![0]
.value!,
Colors.black, height: height!,),
RowCounts(
dashboardItemList![2]
.summaryoptions![1]
.kPIParameter,
dashboardItemList![2]
.summaryoptions![1]
.value!,
Colors.grey, height: height!,),
RowCounts(
dashboardItemList![2]
.summaryoptions![2]
.kPIParameter,
dashboardItemList![2]
.summaryoptions![2]
.value!,
Colors.red, height: height!,),
],
), ),
) SizedBox(
], height: SizeConfig.getHeightMultiplier(height: height) *
)), (SizeConfig.isHeightVeryShort
), ? 5
Expanded( : SizeConfig.isHeightShort
flex: 3, ? 10
child: Stack(children: [ : 5))
Container( ],
padding:EdgeInsets.all(0), ),
),
child: GaugeChart( Expanded(
_createReferralData(dashboardItemList!))), flex: 1,
Positioned(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( RowCounts(
model! dashboardItemList![2].summaryoptions![0].kPIParameter,
.getPatientCount(dashboardItemList![2]) dashboardItemList![2].summaryoptions![0].value!,
.toString(), Colors.black,
fontSize: SizeConfig.textMultiplier * 3.0, height: height!,
fontWeight: FontWeight.bold, ),
) RowCounts(
dashboardItemList![2].summaryoptions![1].kPIParameter,
dashboardItemList![2].summaryoptions![1].value!,
Colors.grey,
height: height!,
),
RowCounts(
dashboardItemList![2].summaryoptions![2].kPIParameter,
dashboardItemList![2].summaryoptions![2].value!,
Colors.red,
height: height!,
),
], ],
), ),
top: height! * (SizeConfig.isHeightVeryShort?0.35:0.40), )
left: 0, ],
right: 0) )),
]), ),
), Expanded(
], flex: 3,
)), child: Stack(children: [
])); Container(padding: EdgeInsets.all(0), child: GaugeChart(_createReferralData(dashboardItemList!))),
Positioned(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AppText(
model!.getPatientCount(dashboardItemList![2]).toString(),
fontSize: SizeConfig.textMultiplier * 3.0,
fontWeight: FontWeight.bold,
)
],
),
top: height! * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40),
left: 0,
right: 0)
]),
),
],
)),
]));
} }
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), charts.MaterialPalette.black),
getValue(dashboardItemList![1].summaryoptions![0].value), new GaugeSegment(dashboardItemList[2].summaryoptions![1].kPIParameter!,
charts.MaterialPalette.black), getValue(dashboardItemList[1].summaryoptions![1].value), charts.MaterialPalette.gray.shadeDefault),
new GaugeSegment( new GaugeSegment(dashboardItemList[2].summaryoptions![2].kPIParameter!,
dashboardItemList![2].summaryoptions![1].kPIParameter!, getValue(dashboardItemList[1].summaryoptions![2].value), charts.MaterialPalette.red.shadeDefault),
getValue(dashboardItemList[1].summaryoptions![1].value),
charts.MaterialPalette.gray.shadeDefault),
new GaugeSegment(
dashboardItemList[2].summaryoptions![2].kPIParameter!,
getValue(dashboardItemList[1].summaryoptions![2].value),
charts.MaterialPalette.red.shadeDefault),
]; ];
return [ return [
@ -191,5 +155,4 @@ class DashboardReferralPatient extends StatelessWidget {
static int getValue(value) { static int getValue(value) {
return value == 0 ? 1 : value; return value == 0 ? 1 : value;
} }
} }

@ -15,18 +15,24 @@ class DashboardSliderItemWidget extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
children: [ children: [
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!),
),
], ],
), ),
new Container(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort
new Container( ? 16
height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:SizeConfig.isHeightLarge?15:13), : SizeConfig.isHeightShort
? 14
: SizeConfig.isHeightLarge
? 15
: 13),
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: List.generate(item.summaryoptions!.length, (int index) { children: List.generate(item.summaryoptions!.length, (int index) {

@ -38,8 +38,8 @@ 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;
@ -48,7 +48,6 @@ class _HomeScreenState extends State<HomeScreen> {
int colorIndex = 0; int colorIndex = 0;
final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context); ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
@ -60,7 +59,6 @@ class _HomeScreenState extends State<HomeScreen> {
} }
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.setFirebaseNotification(projectsProvider, authenticationViewModel); await model.setFirebaseNotification(projectsProvider, authenticationViewModel);
await model.getDashboard(); await model.getDashboard();
@ -71,9 +69,9 @@ class _HomeScreenState extends State<HomeScreen> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: HomeScreenHeader( appBar: HomeScreenHeader(
model: model, model: model,
onOpenDrawer: (){ onOpenDrawer: () {
Scaffold.of(context).openDrawer(); Scaffold.of(context).openDrawer();
}, },
), ),
@ -108,13 +106,10 @@ class _HomeScreenState extends State<HomeScreen> {
height: SizeConfig.heightMultiplier * 3, height: SizeConfig.heightMultiplier * 3,
), ),
sliderActiveIndex == 1 sliderActiveIndex == 1
? DashboardSliderItemWidget( ? DashboardSliderItemWidget(model.dashboardItemsList[4])
model.dashboardItemsList[4])
: sliderActiveIndex == 0 : sliderActiveIndex == 0
? DashboardSliderItemWidget( ? DashboardSliderItemWidget(model.dashboardItemsList[3])
model.dashboardItemsList[3]) : DashboardSliderItemWidget(model.dashboardItemsList[6]),
: DashboardSliderItemWidget(
model.dashboardItemsList[6]),
], ],
), ),
), ),
@ -131,7 +126,8 @@ class _HomeScreenState extends State<HomeScreen> {
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topRight: Radius.circular(70), topRight: Radius.circular(70),
)), )),
padding: EdgeInsets.only(left: SizeConfig.widthMultiplier * 3.1, top: 10, right: SizeConfig.widthMultiplier * 3.1), padding: EdgeInsets.only(
left: SizeConfig.widthMultiplier * 3.1, top: 10, right: SizeConfig.widthMultiplier * 3.1),
margin: EdgeInsets.only(top: 10), margin: EdgeInsets.only(top: 10),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -154,7 +150,9 @@ class _HomeScreenState extends State<HomeScreen> {
? 16 ? 16
: SizeConfig.isHeightShort : SizeConfig.isHeightShort
? 14 ? 14
: SizeConfig.isHeightLarge?15:13), : SizeConfig.isHeightLarge
? 15
: 13),
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: [ children: [
@ -162,8 +160,13 @@ class _HomeScreenState extends State<HomeScreen> {
], ],
), ),
), ),
SizedBox(height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?3:SizeConfig.isHeightShort?4:2)) SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort
? 3
: SizeConfig.isHeightShort
? 4
: 2))
], ],
), ),
), ),
@ -174,7 +177,7 @@ 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);
@ -193,7 +196,6 @@ class _HomeScreenState extends State<HomeScreen> {
// List<HomePatientCard> patientCards = []; // List<HomePatientCard> patientCards = [];
// //
List<Color> backgroundColors = []; List<Color> backgroundColors = [];
backgroundColors.add(Color(0xffD02127)); backgroundColors.add(Color(0xffD02127));
backgroundColors.add(Colors.grey[300]!); backgroundColors.add(Colors.grey[300]!);
@ -239,8 +241,9 @@ class _HomeScreenState extends State<HomeScreen> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: PatientInPatientScreen(specialClinic: model!.getSpecialClinic(clinicId??projectsProvider page: PatientInPatientScreen(
!.doctorClinicsList[0]!.clinicID!),), specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!),
),
), ),
); );
}, },
@ -327,6 +330,3 @@ class _HomeScreenState extends State<HomeScreen> {
} }
} }
} }

@ -110,20 +110,20 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
if (noteController.text.isNotEmpty) { if (noteController.text.isNotEmpty) {
Helpers.showConfirmationDialog(context, Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?", "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?",
() 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);
} else { } else {
DrAppToastMsg.showSuccesToast("You successfully transfer to admin"); DrAppToastMsg.showSuccesToast("You successfully transfer to admin");
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
}); });
} }
}); });
}, },

@ -104,10 +104,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
isPrescriptions: true, isPrescriptions: true,
isMedicalFile: true, isMedicalFile: true,
episode: episode, episode: episode,
visitDate: visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( vistDate,
vistDate, ), isArabic: projectViewModel.isArabic)}',
), isArabic: projectViewModel.isArabic)}',
isAppointmentHeader: true, isAppointmentHeader: true,
); );
@ -128,30 +127,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
model.getMedicalFile(mrn: pp); model.getMedicalFile(mrn: pp);
} }
}, },
builder: builder: (BuildContext? context, MedicalFileViewModel? model, Widget? child) => AppScaffold(
(BuildContext? context, MedicalFileViewModel? model, Widget ?child) => patientProfileAppBarModel: patientProfileAppBarModel!,
AppScaffold( isShowAppBar: true,
patientProfileAppBarModel: patientProfileAppBarModel!, appBarTitle: TranslationBase.of(context!).medicalReport!.toUpperCase(),
isShowAppBar: true, body: NetworkBaseView(
appBarTitle: TranslationBase baseViewModel: model,
.of(context!)! child: SingleChildScrollView(
.medicalReport! child: Center(
.toUpperCase(), child: Container(
body: NetworkBaseView( child: Column(
baseViewModel: model, children: [
child: SingleChildScrollView( model!.medicalFileList.length != 0 &&
child: Center( model.medicalFileList[0].entityList![0].timelines![encounterNumber].timeLineEvents![0]
child: Container( .consulations!.length !=
child: Column(
children: [
model!.medicalFileList!.length != 0 &&
model
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
.consulations!
.length !=
0 0
? Padding( ? Padding(
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
@ -160,7 +149,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 +194,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 +213,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 +243,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 +286,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 +308,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 +331,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 +350,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 +372,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 +390,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 +421,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 +464,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 +487,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 +509,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 +533,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 +552,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 +589,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 +634,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 +652,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 +667,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 +683,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 +699,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]

@ -62,87 +62,87 @@ class _InPatientPageState extends State<InPatientPage> {
model.filterSearchResults(value); model.filterSearchResults(value);
}), }),
), ),
model.state == ViewState.Idle?model.filteredInPatientItems.length > 0 model.state == ViewState.Idle
? Expanded( ? model.filteredInPatientItems.length > 0
child: Container( ? Expanded(
margin: EdgeInsets.symmetric(horizontal: 16.0), child: Container(
child: SingleChildScrollView( margin: EdgeInsets.symmetric(horizontal: 16.0),
child: Column( child: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, child: ListView.builder(
children: [ physics: const AlwaysScrollableScrollPhysics(),
...List.generate(model.filteredInPatientItems.length, (index) { scrollDirection: Axis.vertical,
if (!widget.isMyInPatient) shrinkWrap: true,
return PatientCard( itemCount: 70,
patientInfo: model.filteredInPatientItems[index], itemBuilder: (context, index) {
patientType: "1", if (!widget.isMyInPatient)
arrivalType: "1", return PatientCard(
isInpatient: true, patientInfo: model.filteredInPatientItems[index],
isMyPatient: patientType: "1",
model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, arrivalType: "1",
onTap: () { isInpatient: true,
FocusScopeNode currentFocus = FocusScope.of(context); isMyPatient:
if (!currentFocus.hasPrimaryFocus) { model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID,
currentFocus.unfocus(); onTap: () {
} FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filteredInPatientItems[index], "patient": model.filteredInPatientItems[index],
"patientType": "1", "patientType": "1",
"from": "0", "from": "0",
"to": "0", "to": "0",
"isSearch": false, "isSearch": false,
"isInpatient": true, "isInpatient": true,
"arrivalType": "1", "arrivalType": "1",
}); });
}, },
); );
else if (model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID && else if (model.filteredInPatientItems[index].doctorId ==
widget.isMyInPatient) model.doctorProfile!.doctorID &&
return PatientCard( widget.isMyInPatient)
patientInfo: model.filteredInPatientItems[index], return PatientCard(
patientType: "1", patientInfo: model.filteredInPatientItems[index],
arrivalType: "1", patientType: "1",
isInpatient: true, arrivalType: "1",
isMyPatient: isInpatient: true,
model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, isMyPatient:
onTap: () { model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID,
FocusScopeNode currentFocus = FocusScope.of(context); onTap: () {
if (!currentFocus.hasPrimaryFocus) { FocusScopeNode currentFocus = FocusScope.of(context);
currentFocus.unfocus(); if (!currentFocus.hasPrimaryFocus) {
} currentFocus.unfocus();
}
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filteredInPatientItems[index], "patient": model.filteredInPatientItems[index],
"patientType": "1", "patientType": "1",
"from": "0", "from": "0",
"to": "0", "to": "0",
"isSearch": false, "isSearch": false,
"isInpatient": true, "isInpatient": true,
"arrivalType": "1", "arrivalType": "1",
}); });
}, },
); );
else else
return SizedBox(); return SizedBox();
}), }),
SizedBox( ),
height: 15,
)
],
), ),
), )
), : Expanded(
) child: SingleChildScrollView(
: Expanded( child:
child: SingleChildScrollView( Container(child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable ?? "")),
child: Container(child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable ?? "")), ),
), )
): Center( : Center(
child: Container( child: Container(
height: 300, height: 300,
width: 300, width: 300,
child: Image.asset( child: Image.asset("assets/images/progress-loading-red.gif"),
"assets/images/progress-loading-red.gif"),
), ),
), ),
], ],

@ -37,7 +37,7 @@ class _InsuranceApprovalScreenNewState extends State<InsuranceApprovalScreenNew>
? (model) => model.getInsuranceInPatient(mrn: patient.patientId) ? (model) => model.getInsuranceInPatient(mrn: patient.patientId)
: patient.appointmentNo != null : patient.appointmentNo != null
? (model) => model.getInsuranceApproval(patient, ? (model) => model.getInsuranceApproval(patient,
appointmentNo: patient?.appointmentNo, projectId: patient.projectId) appointmentNo: patient.appointmentNo, projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient), : (model) => model.getInsuranceApproval(patient),
builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold( builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold(
patientProfileAppBarModel: PatientProfileAppBarModel( patientProfileAppBarModel: PatientProfileAppBarModel(

File diff suppressed because it is too large Load Diff

@ -44,7 +44,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
child: Center( child: Center(
child: Column( child: Column(
children: [ children: [
BottomSheetTitle(title: TranslationBase.of(context).searchPatient!!), BottomSheetTitle(title: TranslationBase.of(context).searchPatient!),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Container( child: Container(

@ -37,10 +37,11 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
patientProfileAppBarModel: PatientProfileAppBarModel( patientProfileAppBarModel: PatientProfileAppBarModel(
patient:widget.patient,isInpatient:widget.isInpatient, patient: widget.patient,
isFromLabResult: true, isInpatient: widget.isInpatient,
appointmentDate: widget.patientLabOrders.orderDate!,), isFromLabResult: true,
appointmentDate: widget.patientLabOrders.orderDate!,
),
baseViewModel: model, baseViewModel: model,
body: AppScaffold( body: AppScaffold(
isShowAppBar: false, isShowAppBar: false,
@ -50,9 +51,8 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
LaboratoryResultWidget( LaboratoryResultWidget(
onTap: () async {}, onTap: () async {},
billNo: widget.patientLabOrders.invoiceNo!, billNo: widget.patientLabOrders.invoiceNo!,
details: model.patientLabSpecialResult.length > 0 details:
? model.patientLabSpecialResult[0]!.resultDataHTML model.patientLabSpecialResult.length > 0 ? model.patientLabSpecialResult[0].resultDataHTML : null,
: null,
orderNo: widget.patientLabOrders.orderNo!, orderNo: widget.patientLabOrders.orderNo!,
patientLabOrder: widget.patientLabOrders, patientLabOrder: widget.patientLabOrders,
patient: widget.patient, patient: widget.patient,

@ -54,85 +54,81 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
child: Container( child: Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// if (model.medicalReportTemplate.length > 0) // if (model.medicalReportTemplate.length > 0)
HtmlRichEditor( HtmlRichEditor(
initialText: (medicalReport != null initialText: (medicalReport != null
? medicalReport.reportDataHtml ? medicalReport.reportDataHtml
: model!.medicalReportTemplate! : model.medicalReportTemplate.length > 0
.length! > 0 ? model.medicalReportTemplate[0].templateTextHtml!: ""), ? model.medicalReportTemplate[0].templateTextHtml!
hint: "Write the medical report ", : ""),
controller: _controller, hint: "Write the medical report ",
height: controller: _controller,
MediaQuery height: MediaQuery.of(context).size.height * 0.75,
.of(context) ),
.size ],
.height *
0.75,
), ),
], ),
),
), ),
), ],
), ),
), ),
], ),
), Container(
), padding: EdgeInsets.all(16.0),
), color: Colors.white,
Container( child: Row(
padding: EdgeInsets.all(16.0), children: [
color: Colors.white, Expanded(
child: Row( child: AppButton(
children: [ title: status == MedicalReportStatus.ADD
Expanded( ? TranslationBase.of(context).save
child: AppButton( : TranslationBase.of(context).save,
title: status == MedicalReportStatus.ADD color: Color(0xffEAEAEA),
? TranslationBase.of(context).save fontColor: Colors.black,
: TranslationBase.of(context).save, // disabled: progressNoteController.text.isEmpty,
color: Color(0xffEAEAEA), fontWeight: FontWeight.w700,
fontColor: Colors.black, onPressed: () async {
// disabled: progressNoteController.text.isEmpty, String txtOfMedicalReport = await _controller.getText();
fontWeight: FontWeight.w700,
onPressed: () async {
String txtOfMedicalReport = await _controller.getText();
if (txtOfMedicalReport.isNotEmpty) { if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.insertMedicalReport(patient, txtOfMedicalReport); await model.insertMedicalReport(patient, txtOfMedicalReport);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} }
} }
}, },
),
),
SizedBox(
width: 8,
),
if (medicalReport != null)
Expanded(
child: AppButton(
title: status == MedicalReportStatus.ADD
? TranslationBase.of(context).add
: TranslationBase.of(context).verify,
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.verifyMedicalReport(patient, medicalReport);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
},
),
),
],
), ),
), ),
SizedBox(
width: 8,
),
if (medicalReport != null)
Expanded(
child: AppButton(
title: status == MedicalReportStatus.ADD
? TranslationBase.of(context).add
: TranslationBase.of(context).verify,
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.verifyMedicalReport(patient, medicalReport);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
},
),
),
], ],
), ),
),
],
),
)); ));
} }

@ -77,8 +77,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
baseViewModel: model, baseViewModel: model,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
patientProfileAppBarModel: PatientProfileAppBarModel( patientProfileAppBarModel: PatientProfileAppBarModel(
patient: patient: patient,
patient,
isInpatient: true, isInpatient: true,
), ),
body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0
@ -115,21 +114,21 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
child: CardWithBgWidget( child: CardWithBgWidget(
hasBorder: false, hasBorder: false,
bgColor: model.patientProgressNoteList[index].status == 1 && bgColor: model.patientProgressNoteList[index].status == 1 &&
authenticationViewModel!.doctorProfile!.doctorID != authenticationViewModel.doctorProfile!.doctorID !=
model.patientProgressNoteList[index].createdBy model.patientProgressNoteList[index].createdBy
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: model.patientProgressNoteList[index].status == 4 : model.patientProgressNoteList[index].status == 4
? Colors.red.shade700 ? Colors.red.shade700
: model.patientProgressNoteList[index].status == 2 : model.patientProgressNoteList[index].status == 2
? Colors.green[600]! ? Colors.green[600]!
: Color(0xFFCC9B14)!, : Color(0xFFCC9B14),
widget: Column( widget: Column(
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (model.patientProgressNoteList[index].status == 1 && if (model.patientProgressNoteList[index].status == 1 &&
authenticationViewModel!.doctorProfile!.doctorID != authenticationViewModel.doctorProfile!.doctorID !=
model.patientProgressNoteList[index].createdBy) model.patientProgressNoteList[index].createdBy)
AppText( AppText(
TranslationBase.of(context).notePending, TranslationBase.of(context).notePending,
@ -153,7 +152,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
if (model.patientProgressNoteList[index].status != 2 && if (model.patientProgressNoteList[index].status != 2 &&
model.patientProgressNoteList[index].status != 4 && model.patientProgressNoteList[index].status != 4 &&
authenticationViewModel!.doctorProfile!.doctorID == authenticationViewModel.doctorProfile!.doctorID ==
model.patientProgressNoteList[index].createdBy) model.patientProgressNoteList[index].createdBy)
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -352,9 +351,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
? AppDateUtils.getDayMonthYearDateFormatted( ? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.getDateTimeFromServerFormat( AppDateUtils.getDateTimeFromServerFormat(
model.patientProgressNoteList[index].createdOn ?? ""), model.patientProgressNoteList[index].createdOn ?? ""),
isArabic: projectViewModel!.isArabic) isArabic: projectViewModel.isArabic)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(),
isArabic: projectViewModel!.isArabic), isArabic: projectViewModel.isArabic),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
@ -445,7 +444,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
color: Colors.white, color: Colors.white,
child: AppText( child: AppText(
projectViewModel!.isArabic projectViewModel.isArabic
? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟"
: 'Are you sure you want $actionName this order?', : 'Are you sure you want $actionName this order?',
fontSize: 15, fontSize: 15,

@ -55,7 +55,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
int _activeTab = 0; int _activeTab = 0;
late StreamController<String> videoCallDurationStreamController; late StreamController<String> videoCallDurationStreamController;
late Stream <String> videoCallDurationStream; //= (() async*{})(); TODO Elham* 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);
@ -94,7 +94,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
if (routeArgs.containsKey("isFromLiveCare")) { if (routeArgs.containsKey("isFromLiveCare")) {
isFromLiveCare = routeArgs['isFromLiveCare']; isFromLiveCare = routeArgs['isFromLiveCare'];
} }
if(routeArgs.containsKey("isCallFinished")) { if (routeArgs.containsKey("isCallFinished")) {
isCallFinished = routeArgs['isCallFinished']; isCallFinished = routeArgs['isCallFinished'];
} }
if (isInpatient) if (isInpatient)
@ -104,7 +104,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
} }
late 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(() {
callTimer.cancel(); callTimer.cancel();
@ -115,7 +115,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
}); });
} }
callDisconnected(){ callDisconnected() {
callTimer.cancel(); callTimer.cancel();
videoCallDurationStreamController.sink.add(''); videoCallDurationStreamController.sink.add('');
} }
@ -134,8 +134,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
children: [ children: [
Column( Column(
children: [ children: [
PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType, PatientProfileHeaderNewDesignAppBar(patient, arrivalType, patientType,
videoCallDurationStream: videoCallDurationStream,isInpatient: isInpatient, videoCallDurationStream: videoCallDurationStream,
isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare, isFromLiveCare: isFromLiveCare,
height: (patient.patientStatusType != null && patient.patientStatusType == 43) height: (patient.patientStatusType != null && patient.patientStatusType == 43)
? 210 ? 210
@ -192,7 +193,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
), ),
if (isFromLiveCare if (isFromLiveCare
? patient.episodeNo != null ? patient.episodeNo != null
:patient.patientStatusType != null && patient.patientStatusType == 43) : patient.patientStatusType != null && patient.patientStatusType == 43)
BaseView<SOAPViewModel>( BaseView<SOAPViewModel>(
onModelReady: (model) async {}, onModelReady: (model) async {},
builder: (_, model, w) => Positioned( builder: (_, model, w) => Positioned(
@ -208,7 +209,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
"${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
color: isFromLiveCare color: isFromLiveCare
? Colors.red.shade700 ? Colors.red.shade700
:patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, : patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
fontColor: Colors.white, fontColor: Colors.white,
vPadding: 8, vPadding: 8,
radius: 30, radius: 30,
@ -222,8 +225,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
), ),
onPressed: () async { onPressed: () async {
if ((isFromLiveCare && if ((isFromLiveCare &&
patient.appointmentNo != null && patient.appointmentNo != null &&
patient.appointmentNo != 0) ||patient.patientStatusType == 43) { patient.appointmentNo != 0) ||
patient.patientStatusType == 43) {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(
appointmentNo: patient.appointmentNo, patientMRN: patient.patientMRN); appointmentNo: patient.appointmentNo, patientMRN: patient.patientMRN);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -239,9 +243,11 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
AppButton( AppButton(
title: title:
"${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
color:isFromLiveCare color: isFromLiveCare
? Colors.red.shade700 ? Colors.red.shade700
:patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, : patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
fontColor: Colors.white, fontColor: Colors.white,
vPadding: 8, vPadding: 8,
radius: 30, radius: 30,
@ -255,9 +261,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
), ),
onPressed: () { onPressed: () {
if ((isFromLiveCare && if ((isFromLiveCare &&
patient.appointmentNo != patient.appointmentNo != null &&
null && patient.appointmentNo != 0) ||
patient.appointmentNo != 0) ||patient.patientStatusType == 43) { patient.patientStatusType == 43) {
Navigator.of(context) Navigator.of(context)
.pushNamed(UPDATE_EPISODE, arguments: {'patient': patient}); .pushNamed(UPDATE_EPISODE, arguments: {'patient': patient});
} }
@ -298,8 +304,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
disabled: model.state == ViewState.BusyLocal, disabled: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
// Navigator.push(context, MaterialPageRoute( // Navigator.push(context, MaterialPageRoute(
// builder: (BuildContext context) => // builder: (BuildContext context) =>
// EndCallScreen(patient:patient))) // EndCallScreen(patient:patient)))
if (isCallFinished) { if (isCallFinished) {
Navigator.push( Navigator.push(
context, context,
@ -317,30 +323,29 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
patient.appointmentNo = model.startCallRes.appointmentNo; patient.appointmentNo = model.startCallRes.appointmentNo;
patient.episodeNo = 0; patient.episodeNo = 0;
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ AppPermissionsUtils.requestVideoCallPermission(
locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected); context: context,
}, type: ''); onTapGrant: () {
locator<VideoCallService>()
.openVideo(model.startCallRes, patient, callConnected, callDisconnected);
} },
} type: '');
}
}
}, },
),
),
), ),
), ),
), SizedBox(
), height: 5,
SizedBox( ),
height: 5, ],
), ),
], )
), : null,
) : null, ),
),
); );
} }
} }

@ -21,12 +21,10 @@ class ReplySummeryOnReferralPatient extends StatefulWidget {
ReplySummeryOnReferralPatient(this.referredPatient, this.doctorReply); ReplySummeryOnReferralPatient(this.referredPatient, this.doctorReply);
@override @override
_ReplySummeryOnReferralPatientState createState() => _ReplySummeryOnReferralPatientState createState() => _ReplySummeryOnReferralPatientState(this.referredPatient);
_ReplySummeryOnReferralPatientState(this.referredPatient);
} }
class _ReplySummeryOnReferralPatientState class _ReplySummeryOnReferralPatientState extends State<ReplySummeryOnReferralPatient> {
extends State<ReplySummeryOnReferralPatient> {
final MyReferralPatientModel referredPatient; final MyReferralPatientModel referredPatient;
_ReplySummeryOnReferralPatientState(this.referredPatient); _ReplySummeryOnReferralPatientState(this.referredPatient);
@ -41,15 +39,12 @@ class _ReplySummeryOnReferralPatientState
body: Container( body: Container(
child: Column( child: Column(
children: [ children: [
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
width: double.infinity, width: double.infinity,
margin: margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
EdgeInsets.symmetric(horizontal: 16, vertical: 16), padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding: EdgeInsets.symmetric(
horizontal: 16, vertical: 16),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -70,7 +65,7 @@ class _ReplySummeryOnReferralPatientState
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
AppText( AppText(
widget.doctorReply ?? '', widget.doctorReply,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -85,8 +80,7 @@ class _ReplySummeryOnReferralPatientState
), ),
), ),
Container( Container(
margin: margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
@ -99,7 +93,9 @@ class _ReplySummeryOnReferralPatientState
color: Colors.red[600], color: Colors.red[600],
), ),
), ),
SizedBox(width: 4,), SizedBox(
width: 4,
),
Expanded( Expanded(
child: AppButton( child: AppButton(
onPressed: () {}, onPressed: () {},

@ -13,7 +13,6 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class ReferredPatientScreen extends StatelessWidget { class ReferredPatientScreen extends StatelessWidget {
PatientType patientType = PatientType.IN_PATIENT; PatientType patientType = PatientType.IN_PATIENT;
@override @override
@ -40,71 +39,72 @@ class ReferredPatientScreen extends StatelessWidget {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}, },
), ),
),model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 ),
? Center( model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0
child: Column( ? Center(
crossAxisAlignment: CrossAxisAlignment.center, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.center,
Container( children: [
height: 100, Container(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
TranslationBase.of(context).referralEmptyMsg,
color: Theme.of(context).errorColor,
),
)
],
), ),
Image.asset('assets/images/no-data.png'), )
Padding( : Expanded(
padding: const EdgeInsets.all(8.0), child: SingleChildScrollView(
child: AppText(
TranslationBase.of(context).referralEmptyMsg,
color: Theme.of(context).errorColor,
),
)
],
),
)
: Expanded(
child: SingleChildScrollView(
// DoctorApplication.svc/REST/GtMyReferredPatient // DoctorApplication.svc/REST/GtMyReferredPatient
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
...List.generate(
...List.generate( model.listMyReferredPatientModel.length,
model.listMyReferredPatientModel.length, (index) => InkWell(
(index) => InkWell( onTap: () {
onTap: () { Navigator.push(
Navigator.push( context,
context, FadePage(
FadePage( page: ReferredPatientDetailScreen(model.getReferredPatientItem(index)),
page: ReferredPatientDetailScreen(model.getReferredPatientItem(index)), ),
);
},
child: PatientReferralItemWidget(
referralStatus: model.getReferredPatientItem(index).referralStatusDesc,
referralStatusCode: model.getReferredPatientItem(index).referralStatus,
patientName:
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
patientGender: model.getReferredPatientItem(index).gender,
referredDate: AppDateUtils.convertDateFromServerFormat(
model.getReferredPatientItem(index).referralDate!, "dd/MM/yyyy"),
referredTime: AppDateUtils.convertDateFromServerFormat(
model.getReferredPatientItem(index).referralDate!, "hh:mm a"),
patientID: "${model.getReferredPatientItem(index).patientID}",
isSameBranch: model.getReferredPatientItem(index).isReferralDoctorSameBranch,
isReferral: false,
remark: model.getReferredPatientItem(index).referringDoctorRemarks,
nationality: model.getReferredPatientItem(index).nationalityName,
nationalityFlag: model.getReferredPatientItem(index).nationalityFlagURL,
doctorAvatar: model.getReferredPatientItem(index).doctorImageURL,
referralDoctorName:
"${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}",
clinicDescription: model.getReferredPatientItem(index).referralClinicDescription,
infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black),
),
), ),
); ),
}, ],
child: PatientReferralItemWidget(
referralStatus: model.getReferredPatientItem(index).referralStatusDesc,
referralStatusCode: model.getReferredPatientItem(index).referralStatus,
patientName:
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
patientGender: model.getReferredPatientItem(index).gender,
referredDate: AppDateUtils.convertDateFromServerFormat(
model.getReferredPatientItem(index).referralDate!, "dd/MM/yyyy"),
referredTime: AppDateUtils.convertDateFromServerFormat(
model.getReferredPatientItem(index).referralDate!, "hh:mm a"),
patientID: "${model.getReferredPatientItem(index).patientID}",
isSameBranch: model.getReferredPatientItem(index).isReferralDoctorSameBranch,
isReferral: false,
remark: model.getReferredPatientItem(index).referringDoctorRemarks,
nationality: model.getReferredPatientItem(index).nationalityName,
nationalityFlag: model.getReferredPatientItem(index).nationalityFlagURL,
doctorAvatar: model.getReferredPatientItem(index).doctorImageURL,
referralDoctorName:
"${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}",
clinicDescription: model.getReferredPatientItem(index).referralClinicDescription,
infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black),
),
), ),
), ),
],
),),
), ),
), ),
], ],
), ),
), ),
@ -118,8 +118,7 @@ class PatientTypeRadioWidget extends StatefulWidget {
PatientTypeRadioWidget(this.radioOnChange); PatientTypeRadioWidget(this.radioOnChange);
@override @override
_PatientTypeRadioWidgetState createState() => _PatientTypeRadioWidgetState createState() => _PatientTypeRadioWidgetState(this.radioOnChange);
_PatientTypeRadioWidgetState(this.radioOnChange);
} }
class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> { class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
@ -141,7 +140,7 @@ class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
onChanged: (PatientType? value) { onChanged: (PatientType? value) {
setState(() { setState(() {
patientType = value!; patientType = value!;
radioOnChange(value!); radioOnChange(value);
}); });
}, },
), ),

@ -198,7 +198,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
), ),
), ),
new TextSpan( new TextSpan(
text: assessment.appointmentId.toString() ?? "", text: assessment.appointmentId.toString(),
style: new TextStyle( style: new TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),

@ -38,7 +38,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
baseViewModel: mode, baseViewModel: mode,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient),
appBarTitle: TranslationBase.of(context).vitalSign!, appBarTitle: TranslationBase.of(context).vitalSign!,
body: mode.patientVitalSignsHistory.length > 0 body: mode.patientVitalSignsHistory.length > 0
? Column( ? Column(
@ -54,7 +54,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s",
fontSize: SizeConfig.textMultiplier * 1.6, fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),

@ -190,9 +190,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
appBarTitle: pageTitle ?? "", appBarTitle: pageTitle ?? "",
backgroundColor: Color.fromRGBO(248, 248, 248, 1), backgroundColor: Color.fromRGBO(248, 248, 248, 1),
isShowAppBar: true, isShowAppBar: true,
patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient),
patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -203,7 +201,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6, fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -71,10 +71,10 @@ postPrescription(
prescriptionList.add(PrescriptionRequestModel( prescriptionList.add(PrescriptionRequestModel(
covered: true, covered: true,
dose: double.parse(dose ?? "0"), dose: double.parse(dose ?? "0"),
itemId: drugId!.isEmpty ? 1 : int.parse(drugId ?? "0"), itemId: drugId!.isEmpty ? 1 : int.parse(drugId),
doseUnitId: int.parse(doseUnit ?? "1"), doseUnitId: int.parse(doseUnit ?? "1"),
route: route!.isEmpty ? 1 : int.parse(route ?? "1"), route: route!.isEmpty ? 1 : int.parse(route),
frequency: frequency!.isEmpty ? 1 : int.parse(frequency!), frequency: frequency!.isEmpty ? 1 : int.parse(frequency),
remarks: instruction, remarks: instruction,
approvalRequired: true, approvalRequired: true,
icdcode10Id: icdCode.toString(), icdcode10Id: icdCode.toString(),

@ -72,10 +72,10 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
prescriptionList.add(PrescriptionRequestModel( prescriptionList.add(PrescriptionRequestModel(
covered: true, covered: true,
dose: double.parse(dose!), dose: double.parse(dose!),
itemId: drugId!.isEmpty ? 1 : int.parse(drugId!), itemId: drugId!.isEmpty ? 1 : int.parse(drugId),
doseUnitId: int.parse(doseUnit!), doseUnitId: int.parse(doseUnit!),
route: route!.isEmpty ? 1 : int.parse(route!), route: route!.isEmpty ? 1 : int.parse(route),
frequency: frequency!.isEmpty ? 1 : int.parse(frequency!), frequency: frequency!.isEmpty ? 1 : int.parse(frequency),
remarks: instruction, remarks: instruction,
approvalRequired: true, approvalRequired: true,
icdcode10Id: icdCode.toString(), icdcode10Id: icdCode.toString(),
@ -85,7 +85,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
postProcedureReqModel.prescriptionRequestModel = prescriptionList; postProcedureReqModel.prescriptionRequestModel = prescriptionList;
await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); await model!.postPrescription(postProcedureReqModel, patient.patientMRN!);
if (model!.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
model.getPrescriptions(patient); model.getPrescriptions(patient);
@ -617,7 +617,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
route: model.itemMedicineListRoute.length == 1 route: model.itemMedicineListRoute.length == 1
? model.itemMedicineListRoute[0]['parameterCode'].toString() ? model.itemMedicineListRoute[0]['parameterCode'].toString()
: route['parameterCode'].toString(), : route['parameterCode'].toString(),
drugId: (widget!.groupProcedures!.aliasN! drugId: (widget.groupProcedures!.aliasN!
.replaceAll("item code ;", "")), .replaceAll("item code ;", "")),
strength: strengthController.text, strength: strengthController.text,
indication: indicationController.text, indication: indicationController.text,

@ -44,8 +44,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100]!, backgroundColor: Colors.grey[100]!,
baseViewModel: model, baseViewModel: model,
patientProfileAppBarModel: PatientProfileAppBarModel( patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient),
patient:patient),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
@ -92,8 +91,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
color: Colors.grey, color: Colors.grey,
), ),
Expanded( Expanded(
child: AppText( child:
" " + model.inPatientPrescription[prescriptionIndex].direction! ?? '')), AppText(" " + model.inPatientPrescription[prescriptionIndex].direction!)),
], ],
), ),
Row( Row(
@ -102,8 +101,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).route, TranslationBase.of(context).route,
color: Colors.grey, color: Colors.grey,
), ),
AppText( AppText(" " + model.inPatientPrescription[prescriptionIndex].route.toString()),
" " + model.inPatientPrescription[prescriptionIndex].route.toString() ?? ''),
], ],
), ),
Row( Row(
@ -114,7 +112,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
" " + model.inPatientPrescription[prescriptionIndex].refillType! ?? '')), " " + model.inPatientPrescription[prescriptionIndex].refillType!)),
], ],
), ),
Row( Row(
@ -156,9 +154,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
color: Colors.grey, color: Colors.grey,
), ),
AppText(" " + AppText(" " +
model.inPatientPrescription[prescriptionIndex] model.inPatientPrescription[prescriptionIndex].unitofMeasurementDescription!),
.unitofMeasurementDescription! ??
''),
], ],
), ),
Row( Row(
@ -167,8 +163,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).dailyDoses, TranslationBase.of(context).dailyDoses,
color: Colors.grey, color: Colors.grey,
), ),
AppText( AppText(" " + model.inPatientPrescription[prescriptionIndex].dose.toString()),
" " + model.inPatientPrescription[prescriptionIndex].dose.toString() ?? ''),
], ],
), ),
Row( Row(
@ -177,10 +172,10 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).status, TranslationBase.of(context).status,
color: Colors.grey, color: Colors.grey,
), ),
AppText(" " + AppText(
model.inPatientPrescription[prescriptionIndex].statusDescription " " +
.toString() ?? model.inPatientPrescription[prescriptionIndex].statusDescription.toString(),
''), ),
], ],
), ),
Row( Row(
@ -189,7 +184,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).processed, TranslationBase.of(context).processed,
color: Colors.grey, color: Colors.grey,
), ),
AppText(" " + model.inPatientPrescription[prescriptionIndex].processedBy! ?? ''), AppText(" " + model.inPatientPrescription[prescriptionIndex].processedBy!),
], ],
), ),
Row( Row(
@ -198,8 +193,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).dailyDoses, TranslationBase.of(context).dailyDoses,
color: Colors.grey, color: Colors.grey,
), ),
AppText( AppText(" " + model.inPatientPrescription[prescriptionIndex].dose.toString()),
" " + model.inPatientPrescription[prescriptionIndex].dose.toString() ?? ''),
], ],
), ),
SizedBox( SizedBox(

@ -37,8 +37,7 @@ class PrescriptionItemsPage extends StatelessWidget {
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,
@ -123,7 +122,7 @@ class PrescriptionItemsPage extends StatelessWidget {
TranslationBase.of(context).frequency, TranslationBase.of(context).frequency,
color: Colors.grey, color: Colors.grey,
), ),
AppText(" " + model.prescriptionReportList[index].frequencyN! ?? ''), AppText(" " + model.prescriptionReportList[index].frequencyN!),
], ],
), ),
Row( Row(
@ -132,8 +131,7 @@ class PrescriptionItemsPage extends StatelessWidget {
TranslationBase.of(context).dailyDoses, TranslationBase.of(context).dailyDoses,
color: Colors.grey, color: Colors.grey,
), ),
AppText( AppText(" " + model.prescriptionReportList[index].doseDailyQuantity),
" " + model.prescriptionReportList[index].doseDailyQuantity ?? ''),
], ],
), ),
Row( Row(
@ -142,8 +140,7 @@ class PrescriptionItemsPage extends StatelessWidget {
TranslationBase.of(context).duration, TranslationBase.of(context).duration,
color: Colors.grey, color: Colors.grey,
), ),
AppText( AppText(" " + model.prescriptionReportList[index].days.toString()),
" " + model.prescriptionReportList[index].days.toString() ?? ''),
], ],
), ),
SizedBox( SizedBox(
@ -237,9 +234,7 @@ class PrescriptionItemsPage extends StatelessWidget {
TranslationBase.of(context).route, TranslationBase.of(context).route,
color: Colors.grey, color: Colors.grey,
), ),
Expanded( Expanded(child: AppText(" " + model.prescriptionReportEnhList[index].route!)),
child:
AppText(" " + model.prescriptionReportEnhList[index].route! ?? '')),
], ],
), ),
Row( Row(
@ -248,7 +243,7 @@ class PrescriptionItemsPage extends StatelessWidget {
TranslationBase.of(context).frequency, TranslationBase.of(context).frequency,
color: Colors.grey, color: Colors.grey,
), ),
AppText(" " + model.prescriptionReportEnhList[index].frequency! ?? ''), AppText(" " + model.prescriptionReportEnhList[index].frequency!),
], ],
), ),
Row( Row(
@ -258,8 +253,7 @@ class PrescriptionItemsPage extends StatelessWidget {
color: Colors.grey, color: Colors.grey,
), ),
AppText(" " + AppText(" " +
model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? model.prescriptionReportEnhList[index].doseDailyQuantity.toString()),
''),
], ],
), ),
Row( Row(
@ -268,7 +262,7 @@ class PrescriptionItemsPage extends StatelessWidget {
TranslationBase.of(context).duration, TranslationBase.of(context).duration,
color: Colors.grey, color: Colors.grey,
), ),
AppText(" " + model.prescriptionReportList[index].days.toString() ?? ''), AppText(" " + model.prescriptionReportList[index].days.toString()),
], ],
), ),
SizedBox( SizedBox(

@ -26,7 +26,8 @@ class ProcedureCard extends StatelessWidget {
required this.categoryID, required this.categoryID,
this.categoryName, this.categoryName,
required this.patient, required this.patient,
required this.doctorID, this.isInpatient = false, required this.doctorID,
this.isInpatient = false,
}) : super(key: key); }) : super(key: key);
@override @override
@ -189,11 +190,13 @@ class ProcedureCard extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
entityList.remarks.toString() ?? '', entityList.remarks.toString(),
fontSize: 12, fontSize: 12,
), ),
), ),
if ((entityList.categoryID == 2 || entityList.categoryID == 4) && doctorID == entityList.doctorID && !isInpatient) if ((entityList.categoryID == 2 || entityList.categoryID == 4) &&
doctorID == entityList.doctorID &&
!isInpatient)
InkWell( InkWell(
child: Icon(DoctorApp.edit), child: Icon(DoctorApp.edit),
onTap: onTap, onTap: onTap,

@ -11,22 +11,21 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'ProcedureType.dart'; import 'ProcedureType.dart';
class AddFavouriteProcedure extends StatefulWidget { class AddFavouriteProcedure 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;
AddFavouriteProcedure({ AddFavouriteProcedure({
Key? key, Key? key,
required this.model, this.model,
required this.prescriptionModel, this.prescriptionModel,
required this.patient, required this.patient,
required this.procedureType, required this.procedureType,
}); });
@ -41,15 +40,13 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
ProcedureViewModel? model; ProcedureViewModel? model;
PatiantInformtion? patient; PatiantInformtion? patient;
List<ProcedureTempleteDetailsModel> entityList = []; List<ProcedureTempleteDetailsModel> entityList = [];
late ProcedureTempleteDetailsModel groupProcedures; 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) => AppScaffold(
builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) =>
AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: Column( body: Column(
@ -72,8 +69,7 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
entityList.add(history); entityList.add(history);
}); });
}, },
isEntityFavListSelected: (master) => isEntityFavListSelected: (master) => isEntityListSelected(master),
isEntityListSelected(master),
groupProcedures: groupProcedures, groupProcedures: groupProcedures,
selectProcedures: (selectedProcedure) { selectProcedures: (selectedProcedure) {
setState(() { setState(() {
@ -88,12 +84,11 @@ 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,
color: Color(0xff359846), color: Color(0xff359846),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
onPressed: () { onPressed: () {
if(widget.procedureType == ProcedureType.PRESCRIPTION){ if (widget.procedureType == ProcedureType.PRESCRIPTION) {
if (groupProcedures == null) { if (groupProcedures == null) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
'Please Select item ', 'Please Select item ',
@ -114,8 +109,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 +120,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),
), ),
), ),
); );

@ -16,23 +16,21 @@ import 'ProcedureType.dart';
import 'entity_list_checkbox_search_widget.dart'; import 'entity_list_checkbox_search_widget.dart';
class AddProcedurePage extends StatefulWidget { class AddProcedurePage extends StatefulWidget {
final ProcedureViewModel model; final ProcedureViewModel? model;
final PatiantInformtion patient; final PatiantInformtion patient;
final ProcedureType procedureType; final ProcedureType procedureType;
const AddProcedurePage( const AddProcedurePage({Key? key, this.model, required this.patient, required this.procedureType}) : super(key: key);
{Key? key, required this.model, required this.patient, required this.procedureType})
: super(key: key);
@override @override
_AddProcedurePageState createState() => _AddProcedurePageState( _AddProcedurePageState createState() =>
patient: patient, model: model, procedureType: this.procedureType); _AddProcedurePageState(patient: patient, model: model, procedureType: this.procedureType);
} }
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});
@ -60,8 +58,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
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: [
@ -82,29 +79,24 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
Column( Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: 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,
), ),
], ],
), ),
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,
minLines: 1, minLines: 1,
@ -113,22 +105,17 @@ 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(
child: InkWell( child: InkWell(
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: procedureName.text);
categoryName:
procedureName.text);
else else
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context!) TranslationBase.of(context).atLeastThreeCharacters,
.atLeastThreeCharacters,
); );
}, },
child: Icon( child: Icon(
@ -141,16 +128,13 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
), ),
], ],
), ),
if ((procedureType == ProcedureType.PROCEDURE if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) &&
? procedureName.text.isNotEmpty
: 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);
@ -165,8 +149,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
//TODO build your fun herr //TODO build your fun herr
// widget.addSelectedHistories(); // widget.addSelectedHistories();
}, },
isEntityListSelected: (master) => isEntityListSelected: (master) => isEntityListSelected(master),
isEntityListSelected(master),
)), )),
], ],
), ),
@ -181,14 +164,13 @@ 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;
} }
@ -198,7 +180,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
entityList: entityList, entityList: entityList,
patient: patient, patient: patient,
remarks: remarksController.text); remarks: remarksController.text);
Navigator.pop(context!); Navigator.pop(context);
}, },
), ),
], ],
@ -211,8 +193,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
} }
bool isEntityListSelected(EntityList masterKey) { bool isEntityListSelected(EntityList masterKey) {
Iterable<EntityList> history = entityList Iterable<EntityList> history = entityList.where((element) => masterKey.procedureId == element.procedureId);
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) { if (history.length > 0) {
return true; return true;
} }

@ -21,21 +21,16 @@ class BaseAddProcedureTabPage extends StatefulWidget {
final ProcedureType? procedureType; final ProcedureType? procedureType;
const BaseAddProcedureTabPage( const BaseAddProcedureTabPage(
{Key? key, {Key? key, this.model, this.prescriptionModel, this.patient, @required this.procedureType})
this.model,
this.prescriptionModel,
this.patient,
@required this.procedureType})
: super(key: key); : super(key: key);
@override @override
_BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState( _BaseAddProcedureTabPageState createState() =>
patient: patient!, model: model!, procedureType: procedureType!); _BaseAddProcedureTabPageState(patient: patient!, model: model, procedureType: procedureType!);
} }
class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage> class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin { final ProcedureViewModel? model;
final ProcedureViewModel model;
final PatiantInformtion patient; final PatiantInformtion patient;
final ProcedureType procedureType; final ProcedureType procedureType;
@ -68,8 +63,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(
baseViewModel: model, baseViewModel: model,
@ -131,8 +125,7 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
tabWidget( tabWidget(
screenSize, screenSize,
_activeTab == 0, _activeTab == 0,
procedureType procedureType.getFavouriteTabName(context),
.getFavouriteTabName(context),
), ),
tabWidget( tabWidget(
screenSize, screenSize,
@ -152,22 +145,15 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
controller: _tabController, controller: _tabController,
children: [ children: [
AddFavouriteProcedure( AddFavouriteProcedure(
model: this.model,
prescriptionModel:
widget.prescriptionModel!,
patient: patient, patient: patient,
procedureType: procedureType, procedureType: procedureType,
), ),
if (widget.procedureType == if (widget.procedureType == ProcedureType.PRESCRIPTION)
ProcedureType.PRESCRIPTION) PrescriptionFormWidget(widget.prescriptionModel!, widget.patient!,
PrescriptionFormWidget( widget.prescriptionModel!.prescriptionList)
widget.prescriptionModel!,
widget.patient!,
widget!.prescriptionModel!
.prescriptionList!)
else else
AddProcedurePage( AddProcedurePage(
model: this.model, model: this.model!,
patient: patient, patient: patient,
procedureType: procedureType, procedureType: procedureType,
), ),
@ -193,10 +179,8 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration: TextFieldsUtils.containerBorderDecoration(
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0),
borderRadius: 4,
borderWidth: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [

@ -69,7 +69,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
width: 5.0, width: 5.0,
), ),
AppText( AppText(
widget.toolbarTitle ?? 'Add Procedure', widget.toolbarTitle,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 20, fontSize: 20,
), ),
@ -196,7 +196,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: widget.addButtonTitle ?? TranslationBase.of(context).addSelectedProcedures, title: widget.addButtonTitle,
color: Color(0xff359846), color: Color(0xff359846),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
onPressed: () async { onPressed: () async {
@ -213,9 +213,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
}); });
Navigator.pop(context); Navigator.pop(context);
await model.preparePostProcedure( await model.preparePostProcedure(
entityList: entityList, entityList: entityList, patient: widget.patient, remarks: remarksController.text);
patient: widget.patient,
remarks: remarksController.text);
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
}, },

@ -44,7 +44,9 @@ class ProcedureScreen extends StatelessWidget {
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100],
baseViewModel: model, baseViewModel: model,
patientProfileAppBarModel: PatientProfileAppBarModel( patientProfileAppBarModel: PatientProfileAppBarModel(
patient: patient, isInpatient:isInpatient,), patient: patient,
isInpatient: isInpatient,
),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
@ -173,7 +175,7 @@ class ProcedureScreen extends StatelessWidget {
// 'You Cant Update This Procedure'); // 'You Cant Update This Procedure');
}, },
patient: patient, patient: patient,
doctorID: model!.doctorProfile!.doctorID!, doctorID: model.doctorProfile!.doctorID!,
), ),
), ),
if (model.state == ViewState.ErrorLocal || if (model.state == ViewState.ErrorLocal ||

@ -264,17 +264,16 @@ class Helpers {
} }
static getLabelFromKPI(String kpi) { static getLabelFromKPI(String kpi) {
if (kpi.indexOf("(") > -1 && kpi.indexOf(")")>-1) if (kpi.indexOf("(") > -1 && kpi.indexOf(")") > -1)
return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")")); return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")"));
else else
return ''; return '';
} }
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";
} }
} }

@ -218,7 +218,7 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.bold)), fontWeight: FontWeight.bold)),
new TextSpan( new TextSpan(
text: widget.reply?.remarks?.trim() ?? '', text: widget.reply.remarks?.trim() ?? '',
style: TextStyle(fontFamily: 'Poppins', color: Color(0xFF575757), fontSize: 12)), style: TextStyle(fontFamily: 'Poppins', color: Color(0xFF575757), fontSize: 12)),
], ],
), ),

@ -82,9 +82,9 @@ class MyScheduleWidget extends StatelessWidget {
SizedBox( SizedBox(
height: 5, height: 5,
), ),
if (workingHoursTable!.clinicName != null) if (workingHoursTable.clinicName != null)
AppText( AppText(
workingHoursTable!.clinicName ?? "", workingHoursTable.clinicName ?? "",
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),

@ -1,12 +1,10 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PatientReferralItemWidget extends StatelessWidget { class PatientReferralItemWidget extends StatelessWidget {
final String? referralStatus; final String? referralStatus;
@ -50,8 +48,6 @@ class PatientReferralItemWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0),
child: Column( child: Column(
@ -76,7 +72,7 @@ class PatientReferralItemWidget extends StatelessWidget {
AppText( AppText(
referralStatus != null ? referralStatus : "", referralStatus != null ? referralStatus : "",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier!, fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: referralStatusCode == 1 color: referralStatusCode == 1
? Color(0xffc4aa54) ? Color(0xffc4aa54)
@ -85,10 +81,10 @@ class PatientReferralItemWidget extends StatelessWidget {
: Colors.red[700], : Colors.red[700],
), ),
AppText( AppText(
referredDate??'', referredDate ?? '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier!, fontSize: 2.0 * SizeConfig.textMultiplier,
color: Color(0XFF28353E), color: Color(0XFF28353E),
) )
], ],
@ -98,8 +94,8 @@ class PatientReferralItemWidget extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
patientName??'', patientName ?? '',
fontSize: SizeConfig.textMultiplier! * 2.2, fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -121,10 +117,10 @@ class PatientReferralItemWidget extends StatelessWidget {
width: 4, width: 4,
), ),
AppText( AppText(
referredTime??'', referredTime ?? '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier!, fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
) )
], ],
@ -143,14 +139,14 @@ class PatientReferralItemWidget extends StatelessWidget {
TranslationBase.of(context).fileNumber, TranslationBase.of(context).fileNumber,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier!, fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
patientID!, patientID!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier!, fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -165,16 +161,16 @@ class PatientReferralItemWidget extends StatelessWidget {
: TranslationBase.of(context).refClinic, : TranslationBase.of(context).refClinic,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier!, fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
!isReferralClinic! !isReferralClinic!
? isSameBranch ? isSameBranch
? TranslationBase.of(context).sameBranch ? TranslationBase.of(context).sameBranch
: TranslationBase.of(context).otherBranch : TranslationBase.of(context).otherBranch
: " " + referralClinic!, : " " + referralClinic!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -218,7 +214,7 @@ class PatientReferralItemWidget extends StatelessWidget {
TranslationBase.of(context).remarks ?? "" + " : ", TranslationBase.of(context).remarks ?? "" + " : ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier!, fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
@ -226,7 +222,7 @@ class PatientReferralItemWidget extends StatelessWidget {
remark ?? "", remark ?? "",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier!, fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
maxLines: 1, maxLines: 1,
), ),
@ -281,10 +277,10 @@ class PatientReferralItemWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
referralDoctorName??'', referralDoctorName ?? '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 1.7 * SizeConfig.textMultiplier!, fontSize: 1.7 * SizeConfig.textMultiplier,
color: Colors.black, color: Colors.black,
), ),
if (clinicDescription != null) if (clinicDescription != null)
@ -292,7 +288,7 @@ class PatientReferralItemWidget extends StatelessWidget {
clinicDescription!, clinicDescription!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.4 * SizeConfig.textMultiplier!, fontSize: 1.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],

@ -35,7 +35,6 @@ class PatientCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
margin: EdgeInsets.all(6), margin: EdgeInsets.all(6),
@ -58,10 +57,10 @@ class PatientCard extends StatelessWidget {
: isMyPatient : isMyPatient
? Colors.green[500]! ? Colors.green[500]!
: isInpatient : isInpatient
? Colors.white! ? Colors.white
: !isFromSearch : !isFromSearch
? Colors.red[800]! ? Colors.red[800]!
: Colors.white!, : Colors.white,
widget: Container( widget: Container(
color: Colors.white, color: Colors.white,
// padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
@ -242,7 +241,6 @@ class PatientCard extends StatelessWidget {
textOverflow: TextOverflow.ellipsis, textOverflow: TextOverflow.ellipsis,
), ),
), ),
if (patientInfo.gender == 1) if (patientInfo.gender == 1)
Icon( Icon(
DoctorApp.male_2, DoctorApp.male_2,
@ -253,9 +251,10 @@ class PatientCard extends StatelessWidget {
DoctorApp.female_1, DoctorApp.female_1,
color: Colors.pink, color: Colors.pink,
), ),
if (isFromLiveCare)
if(isFromLiveCare) ShowTimer(
ShowTimer(patientInfo: patientInfo,), patientInfo: patientInfo,
),
]), ]),
), ),
Row( Row(
@ -462,6 +461,4 @@ class PatientCard extends StatelessWidget {
)), )),
)); ));
} }
} }

@ -46,7 +46,7 @@ class AddNewOrder extends StatelessWidget {
height: 10, height: 10,
), ),
AppText( AppText(
label ?? '', label,
color: Colors.grey[600], color: Colors.grey[600],
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
) )

@ -12,14 +12,12 @@ import 'package:url_launcher/url_launcher.dart';
import 'large_avatar.dart'; import 'large_avatar.dart';
class PatientProfileAppBar extends StatelessWidget 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({required 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) {
@ -53,23 +51,18 @@ class PatientProfileAppBar extends StatelessWidget
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
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(patientProfileAppBarModel.patient!.fullName ??
: Helpers.capitalize( patientProfileAppBarModel.patient!.patientDetails!.fullName!),
patientProfileAppBarModel.patient!.fullName ??
patientProfileAppBarModel
.patient!.patientDetails!.fullName!),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -89,8 +82,7 @@ class PatientProfileAppBar extends StatelessWidget
margin: EdgeInsets.symmetric(horizontal: 4), margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
launch("tel://" + launch("tel://" + patientProfileAppBarModel.patient!.mobileNumber!);
patientProfileAppBarModel.patient!.mobileNumber!);
}, },
child: Icon( child: Icon(
Icons.phone, Icons.phone,
@ -107,9 +99,7 @@ class PatientProfileAppBar extends StatelessWidget
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
gender == 1 gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -126,9 +116,7 @@ class PatientProfileAppBar extends StatelessWidget
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
patientProfileAppBarModel patientProfileAppBarModel.patient!.patientStatusType == 43
.patient!.patientStatusType ==
43
? AppText( ? AppText(
TranslationBase.of(context).arrivedP, TranslationBase.of(context).arrivedP,
color: Colors.green, color: Colors.green,
@ -143,14 +131,10 @@ 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 != null
.patient!.startTime != ? patientProfileAppBarModel.patient!.startTime
null
? patientProfileAppBarModel
.patient!.startTime
: '', : '',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12, fontSize: 12,
@ -165,9 +149,7 @@ class PatientProfileAppBar extends StatelessWidget
children: [ children: [
RichText( RichText(
text: TextSpan( text: TextSpan(
style: TextStyle( style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black),
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of(context).fileNumber, text: TranslationBase.of(context).fileNumber,
@ -179,9 +161,7 @@ class PatientProfileAppBar extends StatelessWidget
), ),
), ),
new TextSpan( new TextSpan(
text: patientProfileAppBarModel text: patientProfileAppBarModel.patient!.patientId.toString(),
.patient!.patientId
.toString(),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -195,27 +175,20 @@ class PatientProfileAppBar extends StatelessWidget
children: [ children: [
AppText( AppText(
patientProfileAppBarModel.patient!.nationalityName ?? patientProfileAppBarModel.patient!.nationalityName ??
patientProfileAppBarModel patientProfileAppBarModel.patient!.nationality ??
.patient!.nationality ?? patientProfileAppBarModel.patient!.nationalityId ??
patientProfileAppBarModel
.patient!.nationalityId ??
'', '',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
patientProfileAppBarModel patientProfileAppBarModel.patient!.nationalityFlagURL != null
.patient!.nationalityFlagURL !=
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, StackTrace? stackTrace) {
Object exception,
StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -253,10 +226,9 @@ class PatientProfileAppBar extends StatelessWidget
), ),
), ),
if (patientProfileAppBarModel.patient!.appointmentDate != if (patientProfileAppBarModel.patient!.appointmentDate != null &&
null && patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty &&
patientProfileAppBarModel !isFromLabResult)
.patient!.appointmentDate!.isNotEmpty && !isFromLabResult)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -272,9 +244,7 @@ class PatientProfileAppBar extends StatelessWidget
), ),
AppText( AppText(
AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate( AppDateUtils.convertStringToDate(patientProfileAppBarModel.patient!.appointmentDate!)),
patientProfileAppBarModel
.patient!.appointmentDate!)),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12, fontSize: 12,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
@ -305,9 +275,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, fontSize: 12)),
fontWeight: FontWeight.w700,
fontSize: 12)),
], ],
), ),
), ),
@ -316,10 +284,8 @@ 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.patient!.admissionDate!.isNotEmpty)
patientProfileAppBarModel
.patient!.admissionDate!.isNotEmpty)
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
@ -331,18 +297,12 @@ class PatientProfileAppBar extends StatelessWidget
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: patientProfileAppBarModel text: patientProfileAppBarModel.patient!.admissionDate == null
.patient!.admissionDate ==
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 == null
.patient!.admissionDate ==
null
? "" ? ""
: "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}", : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}",
style: TextStyle( style: TextStyle(
@ -351,20 +311,13 @@ class PatientProfileAppBar extends StatelessWidget
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
)), )),
]))), ]))),
if (patientProfileAppBarModel.patient!.admissionDate != if (patientProfileAppBarModel.patient!.admissionDate != null)
null)
Row( Row(
children: [ children: [
AppText( AppText("${TranslationBase.of(context).numOfDays}: ",
"${TranslationBase.of(context).numOfDays}: ", fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
fontSize: 10, if (patientProfileAppBarModel.isDischargedPatient! &&
fontWeight: FontWeight.w600, patientProfileAppBarModel.patient!.dischargeDate != null)
color: Color(0xFF575757)),
if (patientProfileAppBarModel!
.isDischargedPatient! &&
patientProfileAppBarModel
.patient!.dischargeDate !=
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,
@ -394,14 +347,11 @@ class PatientProfileAppBar extends StatelessWidget
width: 30, width: 30,
height: 30, height: 30,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: projectViewModel.isArabic ? 10 : 85, left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5),
right: projectViewModel.isArabic ? 85 : 10,
top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
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),
)), )),
), ),
@ -424,145 +374,107 @@ class PatientProfileAppBar extends StatelessWidget
flex: 5, flex: 5,
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, AppText(
children: <Widget>[ '${TranslationBase.of(context).dr}${patientProfileAppBarModel.doctorName}',
AppText( color: Color(0xFF2E303A),
'${TranslationBase.of(context).dr}${patientProfileAppBarModel.doctorName}', fontWeight: FontWeight.w700,
color: Color(0xFF2E303A), fontSize: 12,
fontWeight: FontWeight.w700, ),
fontSize: 12, if (patientProfileAppBarModel.orderNo != null &&
), !patientProfileAppBarModel.isPrescriptions!)
if (patientProfileAppBarModel.orderNo != Row(
null && children: <Widget>[
!patientProfileAppBarModel AppText(
.isPrescriptions!) 'Order No: ',
Row( fontSize: 10,
children: <Widget>[ fontWeight: FontWeight.w600,
AppText( color: Color(0xFF575757),
'Order No: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(
patientProfileAppBarModel
.orderNo ??
'',
fontSize: 12)
],
), ),
if (patientProfileAppBarModel.invoiceNO != AppText(patientProfileAppBarModel.orderNo ?? '', fontSize: 12)
null && ],
!patientProfileAppBarModel! ),
.isPrescriptions!) if (patientProfileAppBarModel.invoiceNO != null &&
Row( !patientProfileAppBarModel.isPrescriptions!)
children: <Widget>[ Row(
AppText( children: <Widget>[
'Invoice: ', AppText(
fontSize: 10, 'Invoice: ',
fontWeight: FontWeight.w600, fontSize: 10,
color: Color(0xFF575757), fontWeight: FontWeight.w600,
), color: Color(0xFF575757),
AppText(
patientProfileAppBarModel
.invoiceNO ??
"",
fontSize: 12)
],
), ),
if (patientProfileAppBarModel.branch != AppText(patientProfileAppBarModel.invoiceNO ?? "", fontSize: 12)
null) ],
Row( ),
children: [ if (patientProfileAppBarModel.branch != null)
AppText( Row(
'Branch: ', children: [
fontSize: 10, AppText(
fontWeight: FontWeight.w600, 'Branch: ',
color: Color(0xFF575757), fontSize: 10,
), fontWeight: FontWeight.w600,
AppText( color: Color(0xFF575757),
patientProfileAppBarModel
.branch ??
'',
fontSize: 12)
],
), ),
if (patientProfileAppBarModel.clinic != AppText(patientProfileAppBarModel.branch ?? '', fontSize: 12)
null) ],
Row( ),
children: [ if (patientProfileAppBarModel.clinic != null)
AppText( Row(
'Clinic: ', children: [
fontSize: 10, AppText(
fontWeight: FontWeight.w600, 'Clinic: ',
color: Color(0xFF575757), fontSize: 10,
), fontWeight: FontWeight.w600,
AppText( color: Color(0xFF575757),
patientProfileAppBarModel
.clinic ??
'',
fontSize: 12)
],
), ),
if (patientProfileAppBarModel AppText(patientProfileAppBarModel.clinic ?? '', fontSize: 12)
.isMedicalFile! && ],
patientProfileAppBarModel.episode != ),
null) if (patientProfileAppBarModel.isMedicalFile! &&
Row( patientProfileAppBarModel.episode != null)
children: [ Row(
AppText( children: [
'Episode: ', AppText(
fontSize: 10, 'Episode: ',
fontWeight: FontWeight.w600, fontSize: 10,
color: Color(0xFF575757), fontWeight: FontWeight.w600,
), color: Color(0xFF575757),
AppText( ),
patientProfileAppBarModel AppText(patientProfileAppBarModel.episode ?? '', fontSize: 12)
.episode ?? ],
'', ),
fontSize: 12) if (patientProfileAppBarModel.isMedicalFile! &&
], patientProfileAppBarModel.visitDate != null)
Row(
children: [
AppText(
'Visit Date: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
), ),
if (patientProfileAppBarModel AppText(patientProfileAppBarModel.visitDate ?? '', fontSize: 12)
.isMedicalFile! && ],
patientProfileAppBarModel.visitDate != ),
null) if (!patientProfileAppBarModel.isMedicalFile!)
Row( Row(
children: [ children: <Widget>[
AppText( AppText(
'Visit Date: ', !patientProfileAppBarModel.isPrescriptions!
fontSize: 10, ? 'Result Date:'
fontWeight: FontWeight.w600, : 'Prescriptions Date ',
color: Color(0xFF575757), fontSize: 10,
), fontWeight: FontWeight.w600,
AppText( color: Color(0xFF575757),
patientProfileAppBarModel
.visitDate ??
'',
fontSize: 12)
],
), ),
if (!patientProfileAppBarModel AppText(
.isMedicalFile!) '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}',
Row( fontSize: 12,
children: <Widget>[
AppText(
!patientProfileAppBarModel
.isPrescriptions!
? 'Result Date:'
: 'Prescriptions Date ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}',
fontSize: 12,
)
],
) )
]), ],
)
]),
), ),
), ),
], ],
@ -583,12 +495,16 @@ class PatientProfileAppBar extends StatelessWidget
patientProfileAppBarModel.height == 0 patientProfileAppBarModel.height == 0
? patientProfileAppBarModel.isAppointmentHeader! ? patientProfileAppBarModel.isAppointmentHeader!
? 270 ? 270
: ((patientProfileAppBarModel.patient!.appointmentDate! != null &&patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty ) : ((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,9 +20,9 @@ class StarRating extends StatelessWidget {
5, 5,
(index) => Padding( (index) => Padding(
padding: EdgeInsets.only(right: 1.0), padding: EdgeInsets.only(right: 1.0),
child: Icon((index + 1) <= (totalAverage ?? 0) ? EvaIcons.star : EvaIcons.starOutline, child: Icon((index + 1) <= (totalAverage) ? EvaIcons.star : EvaIcons.starOutline,
size: size, size: size,
color: (index + 1) <= (totalAverage ?? 0) color: (index + 1) <= (totalAverage)
? Color.fromRGBO(255, 186, 0, 1.0) ? Color.fromRGBO(255, 186, 0, 1.0)
: Theme.of(context).hintColor), : Theme.of(context).hintColor),
)), )),

@ -103,7 +103,7 @@ class _SecondaryButtonState extends State<SecondaryButton> with TickerProviderSt
void didUpdateWidget(SecondaryButton oldWidget) { void didUpdateWidget(SecondaryButton oldWidget) {
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
if (oldWidget.disabled != widget.disabled) { if (oldWidget.disabled != widget.disabled) {
bool d = widget.disabled ?? false; bool d = widget.disabled;
if (!d) { if (!d) {
_rippleController.forward(); _rippleController.forward();
} else { } else {

@ -39,7 +39,7 @@ class CardWithBgWidget extends StatelessWidget {
Positioned( Positioned(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: bgColor ?? HexColor('#58434F'), color: bgColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10), topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10), bottomLeft: Radius.circular(10),
@ -55,7 +55,7 @@ class CardWithBgWidget extends StatelessWidget {
Positioned( Positioned(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: bgColor ?? HexColor('#58434F'), color: bgColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10), topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10), bottomLeft: Radius.circular(10),

@ -61,7 +61,7 @@ class DoctorCard extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
doctorName ?? "", doctorName,
fontSize: 15, fontSize: 15,
bold: true, bold: true,
)), )),

@ -27,7 +27,7 @@ class ErrorMessage extends StatelessWidget {
padding: const EdgeInsets.only(top: 12, bottom: 12, right: 20, left: 30), padding: const EdgeInsets.only(top: 12, bottom: 12, right: 20, left: 30),
child: Center( child: Center(
child: AppText( child: AppText(
error ?? '', error,
textAlign: TextAlign.center, textAlign: TextAlign.center,
)), )),
), ),

Loading…
Cancel
Save