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['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID;
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'] == '') {
body['DoctorID'] = null;
}
@ -56,7 +56,7 @@ class BaseAppClient {
}
}
if (body['TokenID'] == null) {
body['TokenID'] = token ?? '';
body['TokenID'] = token;
}
// body['TokenID'] = "@dm!n" ?? '';
String lang = await sharedPref.getString(APP_Language);

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

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

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

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

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

@ -24,8 +24,8 @@ class DashboardViewModel extends BaseViewModel {
String? get sServiceID => _dashboardService.sServiceID;
List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList => _specialClinicsService.specialClinicalCareList;
List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList =>
_specialClinicsService.specialClinicalCareList;
Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async {
setState(ViewState.Busy);
@ -82,7 +82,7 @@ class DashboardViewModel extends BaseViewModel {
);
await authProvider.getDoctorProfileBasedOnClinic(clinicModel);
if (authProvider.state == ViewState.ErrorLocal) {
error = authProvider.error!;
error = authProvider.error;
}
}
@ -93,16 +93,14 @@ class DashboardViewModel extends BaseViewModel {
return value.toString();
}
GetSpecialClinicalCareListResponseModel? getSpecialClinic(clinicId){
GetSpecialClinicalCareListResponseModel? special ;
GetSpecialClinicalCareListResponseModel? getSpecialClinic(clinicId) {
GetSpecialClinicalCareListResponseModel? special;
specialClinicalCareList.forEach((element) {
if(element.clinicID == 1){
if (element.clinicID == 1) {
special = element;
}
});
return special;
}
}

@ -110,7 +110,7 @@ class PatientViewModel extends BaseViewModel {
setState(ViewState.Busy);
await _patientService.getPatientRadiology(patient);
if (_patientService.hasError) {
error = _patientService.error!!;
error = _patientService.error!;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
@ -231,16 +231,16 @@ class PatientViewModel extends BaseViewModel {
Future referToDoctor(
{required String selectedDoctorID,
required String selectedClinicID,
required int admissionNo,
required String extension,
required String priority,
required String frequency,
required String referringDoctorRemarks,
required int patientID,
required int patientTypeID,
required String roomID,
required int projectID}) async {
required String selectedClinicID,
required int admissionNo,
required String extension,
required String priority,
required String frequency,
required String referringDoctorRemarks,
required int patientID,
required int patientTypeID,
required String roomID,
required int projectID}) async {
setState(ViewState.BusyLocal);
await _patientService.referToDoctor(
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/helpers.dart';
import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'
as cpe;
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe;
class ProcedureViewModel extends BaseViewModel {
//TODO Hussam clean it
@ -78,15 +77,12 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getProcedureCategory(
{String? categoryName, String? categoryID, patientId}) async {
Future getProcedureCategory({String? categoryName, String? categoryID, patientId}) async {
if (categoryName == null) return;
hasError = false;
setState(ViewState.Busy);
await _procedureService.getProcedureCategory(
categoryName: categoryName,
categoryID: categoryID,
patientId: patientId);
categoryName: categoryName, categoryID: categoryID, patientId: patientId);
if (_procedureService.hasError) {
error = _procedureService.error!;
setState(ViewState.ErrorLocal);
@ -318,14 +314,13 @@ class ProcedureViewModel extends BaseViewModel {
{String? remarks,
String? orderType,
PatiantInformtion? patient,
List<cpe.EntityList> ? entityList,
List<cpe.EntityList>? entityList,
ProcedureType? procedureType}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient!.patientMRN;
procedureValadteRequestModel.episodeID = patient!.episodeNo;
procedureValadteRequestModel.appointmentNo = patient!.appointmentNo;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
List<Procedures> controlsProcedure = [];
@ -334,31 +329,23 @@ class ProcedureViewModel extends BaseViewModel {
postProcedureReqModel.patientMRN = patient.patientMRN;
entityList!.forEach((element) {
procedureValadteRequestModel.procedure = [element!.procedureId!];
procedureValadteRequestModel.procedure = [element.procedureId!];
List<Controls> controls = [];
controls.add(
Controls(
code: "remarks",
controlValue: element.remarks != null ? element.remarks : ""),
Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""),
);
controls.add(
Controls(
code: "ordertype",
controlValue: procedureType == ProcedureType.PROCEDURE
? element.type ?? "1"
: "0"),
Controls(code: "ordertype", controlValue: procedureType == ProcedureType.PROCEDURE ? element.type ?? "1" : "0"),
);
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
controlsProcedure
.add(Procedures(category: element.categoryID, procedure: element.procedureId, controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure;
await valadteProcedure(procedureValadteRequestModel);
if (state == ViewState.Idle) {
if (valadteProcedureList[0].entityList!.length == 0) {
await postProcedure(postProcedureReqModel, patient!.patientMRN!);
await postProcedure(postProcedureReqModel, patient.patientMRN!);
if (state == ViewState.ErrorLocal) {
Helpers.showErrorToast(error);
@ -371,8 +358,7 @@ class ProcedureViewModel extends BaseViewModel {
Helpers.showErrorToast(error);
getProcedure(mrn: patient.patientMRN);
} else if (state == ViewState.Idle) {
Helpers.showErrorToast(
valadteProcedureList[0].entityList![0].warringMessages);
Helpers.showErrorToast(valadteProcedureList[0].entityList![0].warringMessages);
}
}
} else {

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

@ -61,68 +61,63 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
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),)
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),
)),
Column(
children: <Widget>[
SizedBox(
height: SizeConfig.heightMultiplier*(SizeConfig.isHeightVeryShort?3:4),
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4),
),
authenticationViewModel.user != null && isMoreOption == false
? Column(
mainAxisAlignment:
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,
mainAxisAlignment: 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,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * .5,
padding: EdgeInsets.all(0),
@ -130,277 +125,198 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
TranslationBase.of(context)
.lastLoginAt!,
TranslationBase.of(context).lastLoginAt!,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
),
),
Container(
width: MediaQuery.of(context)
.size
.width *
0.55,
width: MediaQuery.of(context).size.width * 0.55,
child: RichText(
text: TextSpan(
text: TranslationBase.of(context).verifyWith,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.w600,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
fontWeight: FontWeight.w600,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
fontFamily: 'Poppins',
),
children: <TextSpan>[
TextSpan(
text: authenticationViewModel
.getType(
authenticationViewModel
.user
!.logInTypeID,
context),
text: authenticationViewModel.getType(
authenticationViewModel.user!.logInTypeID, context),
style: TextStyle(
color:
Color(0xFF2B353E),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2B353E),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
fontFamily: 'Poppins',
fontWeight:
FontWeight.w700,
fontWeight: FontWeight.w700,
),
)
]),
),
),
],
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
),
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
authenticationViewModel
.user!.editedOn !=
null
? AppDateUtils
.getDayMonthYearDateFormatted(
AppDateUtils
.convertStringToDate(
authenticationViewModel
! .user
!.editedOn!))
: authenticationViewModel
.user!.createdOn! !=
null
authenticationViewModel.user!.editedOn != null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
authenticationViewModel.user!.editedOn!))
: authenticationViewModel.user!.createdOn! != null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(authenticationViewModel!.user
!.createdOn!))
: '--',
textAlign:
TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
AppDateUtils.convertStringToDate(
authenticationViewModel.user!.createdOn!))
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
color: Color(0xFF2E303A),
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 !=
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,
)
),
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,
),
],
),
),
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(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
this.onlySMSBox == false
? Container(
margin: EdgeInsets.only(bottom: 20, top: 30),
child: AppText(
TranslationBase.of(context)
.verifyLoginWith ,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 4 ,
color: Color(0xFF2E303A),
fontWeight: FontWeight.bold,
textAlign: TextAlign.left,
),
)
: AppText(
TranslationBase.of(context)
.verifyFingerprint2,
fontSize:
SizeConfig.getTextMultiplierBasedOnWidth()* 4,
textAlign: TextAlign.start,
),
]),
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
this.onlySMSBox == false
? Container(
margin: EdgeInsets.only(bottom: 20, top: 30),
child: AppText(
TranslationBase.of(context).verifyLoginWith,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
color: Color(0xFF2E303A),
fontWeight: FontWeight.bold,
textAlign: TextAlign.left,
),
)
: AppText(
TranslationBase.of(context).verifyFingerprint2,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
textAlign: TextAlign.start,
),
]),
authenticationViewModel.user != null && isMoreOption == false
? Column(
mainAxisAlignment: MainAxisAlignment.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,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel,
authMethodType:
AuthMethodTypes.Fingerprint,
authenticateUser:
(AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType,
isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel,
authMethodType:
AuthMethodTypes.FaceID,
authenticateUser:
(AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType,
isActive),
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;
});
},
))
],
)
: SizedBox(),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
]),
])
: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
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),
))
],
),
]),
onlySMSBox == false
? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.Fingerprint,
authenticateUser: (AuthMethodTypes authMethodType, isActive) =>
authenticateUser(authMethodType, isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.FaceID,
authenticateUser: (AuthMethodTypes authMethodType, isActive) =>
authenticateUser(authMethodType, isActive),
))
],
)
: SizedBox(),
Row(
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(
// color: Colors.green,
height: SizeConfig.heightMultiplier * 10 ,
width: double.infinity,
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase
.of(context)
.useAnotherAccount,
color: Color(0xFFD02127),
fontWeight: FontWeight.w700,
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 8 : 6),
hPadding: 1,
onPressed: () {
authenticationViewModel.deleteUser();
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
},
bottomSheet: authenticationViewModel.user == null
? SizedBox(
height: 0,
)
: Container(
// color: Colors.green,
height: SizeConfig.heightMultiplier * 10,
width: double.infinity,
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context).useAnotherAccount,
color: Color(0xFFD02127),
fontWeight: FontWeight.w700,
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 8 : 6),
hPadding: 1,
onPressed: () {
authenticationViewModel.deleteUser();
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
},
),
],
),
),
],
),
),
),
),),
);
}

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

@ -15,18 +15,24 @@ class DashboardSliderItemWidget extends StatelessWidget {
Widget build(BuildContext context) {
return Column(
children: [
Row(
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Label(firstLine:Helpers.getLabelFromKPI(item!.kPIName!) ,secondLine:Helpers.getNameFromKPI(item!.kPIName!), ),
Label(
firstLine: Helpers.getLabelFromKPI(item.kPIName!),
secondLine: Helpers.getNameFromKPI(item.kPIName!),
),
],
),
new Container(
height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:SizeConfig.isHeightLarge?15:13),
new Container(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort
? 16
: SizeConfig.isHeightShort
? 14
: SizeConfig.isHeightLarge
? 15
: 13),
child: ListView(
scrollDirection: Axis.horizontal,
children: List.generate(item.summaryoptions!.length, (int index) {

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

@ -110,20 +110,20 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
if (noteController.text.isNotEmpty) {
Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?",
() async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
await model.transferToAdmin(widget!.patient!.vcId!, noteController.text);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast("You successfully transfer to admin");
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context).pop();
}
});
() async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
await model.transferToAdmin(widget.patient.vcId!, noteController.text);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast("You successfully transfer to admin");
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context).pop();
}
});
}
});
},

@ -104,10 +104,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
isPrescriptions: true,
isMedicalFile: true,
episode: episode,
visitDate:
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
vistDate,
), isArabic: projectViewModel.isArabic)}',
visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
vistDate,
), isArabic: projectViewModel.isArabic)}',
isAppointmentHeader: true,
);
@ -128,30 +127,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
model.getMedicalFile(mrn: pp);
}
},
builder:
(BuildContext? context, MedicalFileViewModel? model, Widget ?child) =>
AppScaffold(
patientProfileAppBarModel: patientProfileAppBarModel!,
isShowAppBar: true,
appBarTitle: TranslationBase
.of(context!)!
.medicalReport!
.toUpperCase(),
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
child: Center(
child: Container(
child: Column(
children: [
model!.medicalFileList!.length != 0 &&
model
.medicalFileList![0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
.consulations!
.length !=
builder: (BuildContext? context, MedicalFileViewModel? model, Widget? child) => AppScaffold(
patientProfileAppBarModel: patientProfileAppBarModel!,
isShowAppBar: true,
appBarTitle: TranslationBase.of(context!).medicalReport!.toUpperCase(),
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
child: Center(
child: Container(
child: Column(
children: [
model!.medicalFileList.length != 0 &&
model.medicalFileList[0].entityList![0].timelines![encounterNumber].timeLineEvents![0]
.consulations!.length !=
0
? Padding(
padding: EdgeInsets.all(10.0),
@ -160,7 +149,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
SizedBox(height: 25.0),
if (model.medicalFileList.length != 0 &&
model.medicalFileList![0].entityList![0].timelines![encounterNumber]
model.medicalFileList[0].entityList![0].timelines![encounterNumber]
.timeLineEvents![0].consulations!.length !=
0)
Container(
@ -205,7 +194,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -224,7 +213,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Expanded(
child: AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -254,7 +243,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 30,
),
if (model.medicalFileList.length != 0 &&
model.medicalFileList![0].entityList![0].timelines![encounterNumber]
model.medicalFileList[0].entityList![0].timelines![encounterNumber]
.timeLineEvents![0].consulations!.length !=
0)
Container(
@ -297,7 +286,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -319,7 +308,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -342,7 +331,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Expanded(
child: AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -361,7 +350,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Expanded(
child: AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -383,7 +372,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Expanded(
child: AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -401,7 +390,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -432,7 +421,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 30,
),
if (model.medicalFileList.length != 0 &&
model.medicalFileList![0].entityList![0].timelines![encounterNumber]
model.medicalFileList[0].entityList![0].timelines![encounterNumber]
.timeLineEvents![0].consulations!.length !=
0)
Container(
@ -475,7 +464,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -498,7 +487,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -520,7 +509,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
AppText(
AppDateUtils.getDateFormatted(DateTime.parse(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -544,7 +533,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Expanded(
child: AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -563,7 +552,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -600,7 +589,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 30,
),
if (model.medicalFileList.length != 0 &&
model.medicalFileList![0].entityList![0].timelines![encounterNumber]
model.medicalFileList[0].entityList![0].timelines![encounterNumber]
.timeLineEvents![0].consulations!.length !=
0)
Container(
@ -645,7 +634,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -663,7 +652,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
AppText(TranslationBase.of(context).examType! + ": "),
AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -678,7 +667,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -694,7 +683,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
AppText(TranslationBase.of(context).abnormal! + ": "),
AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]
@ -710,7 +699,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
AppText(
model
.medicalFileList![0]
.medicalFileList[0]
.entityList![0]
.timelines![encounterNumber]
.timeLineEvents![0]

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

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

File diff suppressed because it is too large Load Diff

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

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

@ -54,85 +54,81 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// if (model.medicalReportTemplate.length > 0)
HtmlRichEditor(
initialText: (medicalReport != null
? medicalReport.reportDataHtml
: model!.medicalReportTemplate!
.length! > 0 ? model.medicalReportTemplate[0].templateTextHtml!: ""),
hint: "Write the medical report ",
controller: _controller,
height:
MediaQuery
.of(context)
.size
.height *
0.75,
children: [
// if (model.medicalReportTemplate.length > 0)
HtmlRichEditor(
initialText: (medicalReport != null
? medicalReport.reportDataHtml
: model.medicalReportTemplate.length > 0
? model.medicalReportTemplate[0].templateTextHtml!
: ""),
hint: "Write the medical report ",
controller: _controller,
height: MediaQuery.of(context).size.height * 0.75,
),
],
),
],
),
),
),
),
],
),
),
],
),
),
),
Container(
padding: EdgeInsets.all(16.0),
color: Colors.white,
child: Row(
children: [
Expanded(
child: AppButton(
title: status == MedicalReportStatus.ADD
? TranslationBase.of(context).save
: TranslationBase.of(context).save,
color: Color(0xffEAEAEA),
fontColor: Colors.black,
// disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700,
onPressed: () async {
String txtOfMedicalReport = await _controller.getText();
),
Container(
padding: EdgeInsets.all(16.0),
color: Colors.white,
child: Row(
children: [
Expanded(
child: AppButton(
title: status == MedicalReportStatus.ADD
? TranslationBase.of(context).save
: TranslationBase.of(context).save,
color: Color(0xffEAEAEA),
fontColor: Colors.black,
// disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700,
onPressed: () async {
String txtOfMedicalReport = await _controller.getText();
if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await model.insertMedicalReport(patient, txtOfMedicalReport);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
}
},
if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await model.insertMedicalReport(patient, txtOfMedicalReport);
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);
}
},
),
),
],
),
),
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,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
patientProfileAppBarModel: PatientProfileAppBarModel(
patient:
patient,
patient: patient,
isInpatient: true,
),
body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0
@ -115,21 +114,21 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
child: CardWithBgWidget(
hasBorder: false,
bgColor: model.patientProgressNoteList[index].status == 1 &&
authenticationViewModel!.doctorProfile!.doctorID !=
authenticationViewModel.doctorProfile!.doctorID !=
model.patientProgressNoteList[index].createdBy
? Color(0xFFCC9B14)
: model.patientProgressNoteList[index].status == 4
? Colors.red.shade700
: model.patientProgressNoteList[index].status == 2
? Colors.green[600]!
: Color(0xFFCC9B14)!,
: Color(0xFFCC9B14),
widget: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (model.patientProgressNoteList[index].status == 1 &&
authenticationViewModel!.doctorProfile!.doctorID !=
authenticationViewModel.doctorProfile!.doctorID !=
model.patientProgressNoteList[index].createdBy)
AppText(
TranslationBase.of(context).notePending,
@ -153,7 +152,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
),
if (model.patientProgressNoteList[index].status != 2 &&
model.patientProgressNoteList[index].status != 4 &&
authenticationViewModel!.doctorProfile!.doctorID ==
authenticationViewModel.doctorProfile!.doctorID ==
model.patientProgressNoteList[index].createdBy)
Row(
crossAxisAlignment: CrossAxisAlignment.start,
@ -352,9 +351,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.getDateTimeFromServerFormat(
model.patientProgressNoteList[index].createdOn ?? ""),
isArabic: projectViewModel!.isArabic)
isArabic: projectViewModel.isArabic)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(),
isArabic: projectViewModel!.isArabic),
isArabic: projectViewModel.isArabic),
fontWeight: FontWeight.w600,
fontSize: 14,
),
@ -445,7 +444,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
padding: EdgeInsets.all(20),
color: Colors.white,
child: AppText(
projectViewModel!.isArabic
projectViewModel.isArabic
? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟"
: 'Are you sure you want $actionName this order?',
fontSize: 15,

@ -55,7 +55,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
int _activeTab = 0;
late StreamController<String> videoCallDurationStreamController;
late Stream <String> videoCallDurationStream; //= (() async*{})(); TODO Elham*
late Stream<String> videoCallDurationStream; //= (() async*{})(); TODO Elham*
@override
void initState() {
_tabController = TabController(length: 2, vsync: this);
@ -94,7 +94,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
if (routeArgs.containsKey("isFromLiveCare")) {
isFromLiveCare = routeArgs['isFromLiveCare'];
}
if(routeArgs.containsKey("isCallFinished")) {
if (routeArgs.containsKey("isCallFinished")) {
isCallFinished = routeArgs['isCallFinished'];
}
if (isInpatient)
@ -104,7 +104,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
}
late StreamSubscription callTimer;
callConnected(){
callConnected() {
callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null)
..onDone(() {
callTimer.cancel();
@ -115,7 +115,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
});
}
callDisconnected(){
callDisconnected() {
callTimer.cancel();
videoCallDurationStreamController.sink.add('');
}
@ -134,8 +134,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
children: [
Column(
children: [
PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType,
videoCallDurationStream: videoCallDurationStream,isInpatient: isInpatient,
PatientProfileHeaderNewDesignAppBar(patient, arrivalType, patientType,
videoCallDurationStream: videoCallDurationStream,
isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare,
height: (patient.patientStatusType != null && patient.patientStatusType == 43)
? 210
@ -192,7 +193,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
),
if (isFromLiveCare
? patient.episodeNo != null
:patient.patientStatusType != null && patient.patientStatusType == 43)
: patient.patientStatusType != null && patient.patientStatusType == 43)
BaseView<SOAPViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) => Positioned(
@ -208,7 +209,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
"${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
color: isFromLiveCare
? Colors.red.shade700
:patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700,
: patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
fontColor: Colors.white,
vPadding: 8,
radius: 30,
@ -222,8 +225,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
),
onPressed: () async {
if ((isFromLiveCare &&
patient.appointmentNo != null &&
patient.appointmentNo != 0) ||patient.patientStatusType == 43) {
patient.appointmentNo != null &&
patient.appointmentNo != 0) ||
patient.patientStatusType == 43) {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(
appointmentNo: patient.appointmentNo, patientMRN: patient.patientMRN);
GifLoaderDialogUtils.showMyDialog(context);
@ -239,9 +243,11 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
AppButton(
title:
"${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
color:isFromLiveCare
? Colors.red.shade700
:patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700,
color: isFromLiveCare
? Colors.red.shade700
: patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
fontColor: Colors.white,
vPadding: 8,
radius: 30,
@ -255,9 +261,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
),
onPressed: () {
if ((isFromLiveCare &&
patient.appointmentNo !=
null &&
patient.appointmentNo != 0) ||patient.patientStatusType == 43) {
patient.appointmentNo != null &&
patient.appointmentNo != 0) ||
patient.patientStatusType == 43) {
Navigator.of(context)
.pushNamed(UPDATE_EPISODE, arguments: {'patient': patient});
}
@ -298,8 +304,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
// Navigator.push(context, MaterialPageRoute(
// builder: (BuildContext context) =>
// EndCallScreen(patient:patient)))
// builder: (BuildContext context) =>
// EndCallScreen(patient:patient)))
if (isCallFinished) {
Navigator.push(
context,
@ -317,30 +323,29 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
patient.appointmentNo = model.startCallRes.appointmentNo;
patient.episodeNo = 0;
GifLoaderDialogUtils.hideDialog(context);
AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){
locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected);
}, type: '');
}
}
},
GifLoaderDialogUtils.hideDialog(context);
AppPermissionsUtils.requestVideoCallPermission(
context: context,
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);
@override
_ReplySummeryOnReferralPatientState createState() =>
_ReplySummeryOnReferralPatientState(this.referredPatient);
_ReplySummeryOnReferralPatientState createState() => _ReplySummeryOnReferralPatientState(this.referredPatient);
}
class _ReplySummeryOnReferralPatientState
extends State<ReplySummeryOnReferralPatient> {
class _ReplySummeryOnReferralPatientState extends State<ReplySummeryOnReferralPatient> {
final MyReferralPatientModel referredPatient;
_ReplySummeryOnReferralPatientState(this.referredPatient);
@ -41,15 +39,12 @@ class _ReplySummeryOnReferralPatientState
body: Container(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
width: double.infinity,
margin:
EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding: EdgeInsets.symmetric(
horizontal: 16, vertical: 16),
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
@ -70,7 +65,7 @@ class _ReplySummeryOnReferralPatientState
color: Color(0XFF2E303A),
),
AppText(
widget.doctorReply ?? '',
widget.doctorReply,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
@ -85,8 +80,7 @@ class _ReplySummeryOnReferralPatientState
),
),
Container(
margin:
EdgeInsets.symmetric(horizontal: 16, vertical: 16),
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Row(
children: [
Expanded(
@ -99,7 +93,9 @@ class _ReplySummeryOnReferralPatientState
color: Colors.red[600],
),
),
SizedBox(width: 4,),
SizedBox(
width: 4,
),
Expanded(
child: AppButton(
onPressed: () {},

@ -13,7 +13,6 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class ReferredPatientScreen extends StatelessWidget {
PatientType patientType = PatientType.IN_PATIENT;
@override
@ -40,71 +39,72 @@ class ReferredPatientScreen extends StatelessWidget {
GifLoaderDialogUtils.hideDialog(context);
},
),
),model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0
? Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
height: 100,
),
model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0
? Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
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(
padding: const EdgeInsets.all(8.0),
child: AppText(
TranslationBase.of(context).referralEmptyMsg,
color: Theme.of(context).errorColor,
),
)
],
),
)
: Expanded(
child: SingleChildScrollView(
)
: Expanded(
child: SingleChildScrollView(
// DoctorApplication.svc/REST/GtMyReferredPatient
child: Container(
child: Column(
children: [
...List.generate(
model.listMyReferredPatientModel.length,
(index) => InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: ReferredPatientDetailScreen(model.getReferredPatientItem(index)),
...List.generate(
model.listMyReferredPatientModel.length,
(index) => InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
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);
@override
_PatientTypeRadioWidgetState createState() =>
_PatientTypeRadioWidgetState(this.radioOnChange);
_PatientTypeRadioWidgetState createState() => _PatientTypeRadioWidgetState(this.radioOnChange);
}
class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
@ -141,7 +140,7 @@ class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
onChanged: (PatientType? value) {
setState(() {
patientType = value!;
radioOnChange(value!);
radioOnChange(value);
});
},
),

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

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

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

@ -71,10 +71,10 @@ postPrescription(
prescriptionList.add(PrescriptionRequestModel(
covered: true,
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"),
route: route!.isEmpty ? 1 : int.parse(route ?? "1"),
frequency: frequency!.isEmpty ? 1 : int.parse(frequency!),
route: route!.isEmpty ? 1 : int.parse(route),
frequency: frequency!.isEmpty ? 1 : int.parse(frequency),
remarks: instruction,
approvalRequired: true,
icdcode10Id: icdCode.toString(),

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

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

@ -37,8 +37,7 @@ class PrescriptionItemsPage extends StatelessWidget {
clinic: prescriptions.clinicDescription!,
branch: prescriptions.name!,
isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
prescriptions.appointmentDate!),
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate!),
doctorName: prescriptions.doctorName!,
profileUrl: prescriptions.doctorImageURL!,
isAppointmentHeader: true,
@ -123,7 +122,7 @@ class PrescriptionItemsPage extends StatelessWidget {
TranslationBase.of(context).frequency,
color: Colors.grey,
),
AppText(" " + model.prescriptionReportList[index].frequencyN! ?? ''),
AppText(" " + model.prescriptionReportList[index].frequencyN!),
],
),
Row(
@ -132,8 +131,7 @@ class PrescriptionItemsPage extends StatelessWidget {
TranslationBase.of(context).dailyDoses,
color: Colors.grey,
),
AppText(
" " + model.prescriptionReportList[index].doseDailyQuantity ?? ''),
AppText(" " + model.prescriptionReportList[index].doseDailyQuantity),
],
),
Row(
@ -142,8 +140,7 @@ class PrescriptionItemsPage extends StatelessWidget {
TranslationBase.of(context).duration,
color: Colors.grey,
),
AppText(
" " + model.prescriptionReportList[index].days.toString() ?? ''),
AppText(" " + model.prescriptionReportList[index].days.toString()),
],
),
SizedBox(
@ -237,9 +234,7 @@ class PrescriptionItemsPage extends StatelessWidget {
TranslationBase.of(context).route,
color: Colors.grey,
),
Expanded(
child:
AppText(" " + model.prescriptionReportEnhList[index].route! ?? '')),
Expanded(child: AppText(" " + model.prescriptionReportEnhList[index].route!)),
],
),
Row(
@ -248,7 +243,7 @@ class PrescriptionItemsPage extends StatelessWidget {
TranslationBase.of(context).frequency,
color: Colors.grey,
),
AppText(" " + model.prescriptionReportEnhList[index].frequency! ?? ''),
AppText(" " + model.prescriptionReportEnhList[index].frequency!),
],
),
Row(
@ -258,8 +253,7 @@ class PrescriptionItemsPage extends StatelessWidget {
color: Colors.grey,
),
AppText(" " +
model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ??
''),
model.prescriptionReportEnhList[index].doseDailyQuantity.toString()),
],
),
Row(
@ -268,7 +262,7 @@ class PrescriptionItemsPage extends StatelessWidget {
TranslationBase.of(context).duration,
color: Colors.grey,
),
AppText(" " + model.prescriptionReportList[index].days.toString() ?? ''),
AppText(" " + model.prescriptionReportList[index].days.toString()),
],
),
SizedBox(

@ -26,7 +26,8 @@ class ProcedureCard extends StatelessWidget {
required this.categoryID,
this.categoryName,
required this.patient,
required this.doctorID, this.isInpatient = false,
required this.doctorID,
this.isInpatient = false,
}) : super(key: key);
@override
@ -189,11 +190,13 @@ class ProcedureCard extends StatelessWidget {
children: [
Expanded(
child: AppText(
entityList.remarks.toString() ?? '',
entityList.remarks.toString(),
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(
child: Icon(DoctorApp.edit),
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/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/network_base_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'ProcedureType.dart';
class AddFavouriteProcedure extends StatefulWidget {
final ProcedureViewModel model;
final PrescriptionViewModel prescriptionModel;
final ProcedureViewModel? model;
final PrescriptionViewModel? prescriptionModel;
final PatiantInformtion patient;
final ProcedureType procedureType;
AddFavouriteProcedure({
Key? key,
required this.model,
required this.prescriptionModel,
this.model,
this.prescriptionModel,
required this.patient,
required this.procedureType,
});
@ -41,15 +40,13 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
ProcedureViewModel? model;
PatiantInformtion? patient;
List<ProcedureTempleteDetailsModel> entityList = [];
late ProcedureTempleteDetailsModel groupProcedures;
ProcedureTempleteDetailsModel? groupProcedures;
@override
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>(
onModelReady: (model) =>
model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()),
builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) =>
AppScaffold(
onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()),
builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold(
isShowAppBar: false,
baseViewModel: model,
body: Column(
@ -72,8 +69,7 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
entityList.add(history);
});
},
isEntityFavListSelected: (master) =>
isEntityListSelected(master),
isEntityFavListSelected: (master) => isEntityListSelected(master),
groupProcedures: groupProcedures,
selectProcedures: (selectedProcedure) {
setState(() {
@ -88,12 +84,11 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: widget.procedureType.getAddButtonTitle(context!) ??
TranslationBase.of(context!).addSelectedProcedures,
title: widget.procedureType.getAddButtonTitle(context),
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
if(widget.procedureType == ProcedureType.PRESCRIPTION){
if (widget.procedureType == ProcedureType.PRESCRIPTION) {
if (groupProcedures == null) {
DrAppToastMsg.showErrorToast(
'Please Select item ',
@ -114,8 +109,7 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
} else {
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context!)
.fillTheMandatoryProcedureDetails,
TranslationBase.of(context).fillTheMandatoryProcedureDetails,
);
return;
}
@ -126,8 +120,8 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
items: entityList,
model: model,
patient: widget.patient,
addButtonTitle: widget.procedureType.getAddButtonTitle(context!),
toolbarTitle: widget.procedureType.getToolbarLabel(context!),
addButtonTitle: widget.procedureType.getAddButtonTitle(context),
toolbarTitle: widget.procedureType.getToolbarLabel(context),
),
),
);

@ -16,23 +16,21 @@ import 'ProcedureType.dart';
import 'entity_list_checkbox_search_widget.dart';
class AddProcedurePage extends StatefulWidget {
final ProcedureViewModel model;
final ProcedureViewModel? model;
final PatiantInformtion patient;
final ProcedureType procedureType;
const AddProcedurePage(
{Key? key, required this.model, required this.patient, required this.procedureType})
: super(key: key);
const AddProcedurePage({Key? key, this.model, required this.patient, required this.procedureType}) : super(key: key);
@override
_AddProcedurePageState createState() => _AddProcedurePageState(
patient: patient, model: model, procedureType: this.procedureType);
_AddProcedurePageState createState() =>
_AddProcedurePageState(patient: patient, model: model, procedureType: this.procedureType);
}
class _AddProcedurePageState extends State<AddProcedurePage> {
int? selectedType;
ProcedureViewModel? model;
PatiantInformtion ?patient;
PatiantInformtion? patient;
ProcedureType? procedureType;
_AddProcedurePageState({this.patient, this.model, this.procedureType});
@ -60,8 +58,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
categoryID: procedureType!.getCategoryId(),
patientId: patient!.patientId);
},
builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) =>
AppScaffold(
builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold(
isShowAppBar: false,
body: Column(
children: [
@ -82,29 +79,24 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
TranslationBase.of(context!)
.pleaseEnterProcedure,
TranslationBase.of(context).pleaseEnterProcedure,
fontWeight: FontWeight.w700,
fontSize: 20,
),
],
),
SizedBox(
height:
MediaQuery.of(context!).size.height * 0.02,
height: MediaQuery.of(context).size.height * 0.02,
),
Row(
children: [
Container(
width: MediaQuery.of(context!).size.width *
0.79,
width: MediaQuery.of(context).size.width * 0.79,
child: AppTextFieldCustom(
hintText: TranslationBase.of(context!)
.searchProcedureHere,
hintText: TranslationBase.of(context).searchProcedureHere,
isTextFieldHasSuffix: false,
maxLines: 1,
minLines: 1,
@ -113,22 +105,17 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
),
),
SizedBox(
width: MediaQuery.of(context!).size.width *
0.02,
width: MediaQuery.of(context).size.width * 0.02,
),
Expanded(
child: InkWell(
onTap: () {
if (procedureName.text.isNotEmpty &&
procedureName.text.length >= 3)
if (procedureName.text.isNotEmpty && procedureName.text.length >= 3)
model!.getProcedureCategory(
patientId: patient!.patientId,
categoryName:
procedureName.text);
patientId: patient!.patientId, categoryName: procedureName.text);
else
DrAppToastMsg.showErrorToast(
TranslationBase.of(context!)
.atLeastThreeCharacters,
TranslationBase.of(context).atLeastThreeCharacters,
);
},
child: Icon(
@ -141,16 +128,13 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
),
],
),
if ((procedureType == ProcedureType.PROCEDURE
? procedureName.text.isNotEmpty
: true) &&
if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) &&
model!.categoriesList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList:
model!.categoriesList[0].entityList!,
model: widget.model!,
masterList: model.categoriesList[0].entityList!,
removeHistory: (item) {
setState(() {
entityList.remove(item);
@ -165,8 +149,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
isEntityListSelected: (master) => isEntityListSelected(master),
)),
],
),
@ -181,14 +164,13 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: procedureType!.getAddButtonTitle(context!),
title: procedureType!.getAddButtonTitle(context),
fontWeight: FontWeight.w700,
color: Color(0xff359846),
onPressed: () async {
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context!)
.fillTheMandatoryProcedureDetails,
TranslationBase.of(context).fillTheMandatoryProcedureDetails,
);
return;
}
@ -198,7 +180,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
entityList: entityList,
patient: patient,
remarks: remarksController.text);
Navigator.pop(context!);
Navigator.pop(context);
},
),
],
@ -211,8 +193,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
}
bool isEntityListSelected(EntityList masterKey) {
Iterable<EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
Iterable<EntityList> history = entityList.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) {
return true;
}

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

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

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

@ -264,17 +264,16 @@ class Helpers {
}
static getLabelFromKPI(String kpi) {
if (kpi.indexOf("(") > -1 && kpi.indexOf(")")>-1)
return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")"));
if (kpi.indexOf("(") > -1 && kpi.indexOf(")") > -1)
return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")"));
else
return '';
}
static String timeFrom({Duration? duration}) {
String twoDigits(int n) => n.toString().padLeft(2, "0");
String twoDigitMinutes = twoDigits(duration!.inMinutes.remainder(60));
String twoDigitSeconds = twoDigits(duration!.inSeconds.remainder(60));
String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60));
return "$twoDigitMinutes:$twoDigitSeconds";
}
}

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

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

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

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

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

@ -12,14 +12,12 @@ import 'package:url_launcher/url_launcher.dart';
import 'large_avatar.dart';
class PatientProfileAppBar extends StatelessWidget
with PreferredSizeWidget {
class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
final PatientProfileAppBarModel patientProfileAppBarModel;
final bool isFromLabResult;
final VoidCallback? onPressed;
PatientProfileAppBar(
{required this.patientProfileAppBarModel, this.isFromLabResult=false, this.onPressed});
PatientProfileAppBar({required this.patientProfileAppBarModel, this.isFromLabResult = false, this.onPressed});
@override
Widget build(BuildContext context) {
@ -53,23 +51,18 @@ class PatientProfileAppBar extends StatelessWidget
icon: Icon(Icons.arrow_back_ios),
color: Color(0xFF2B353E), //Colors.black,
onPressed: () {
if(onPressed!=null)
onPressed!();
Navigator.pop(context);
if (onPressed != null) onPressed!();
Navigator.pop(context);
},
),
Expanded(
child: AppText(
patientProfileAppBarModel.patient!.firstName != null
? (Helpers.capitalize(
patientProfileAppBarModel.patient!.firstName) +
? (Helpers.capitalize(patientProfileAppBarModel.patient!.firstName) +
" " +
Helpers.capitalize(
patientProfileAppBarModel.patient!.lastName))
: Helpers.capitalize(
patientProfileAppBarModel.patient!.fullName ??
patientProfileAppBarModel
.patient!.patientDetails!.fullName!),
Helpers.capitalize(patientProfileAppBarModel.patient!.lastName))
: Helpers.capitalize(patientProfileAppBarModel.patient!.fullName ??
patientProfileAppBarModel.patient!.patientDetails!.fullName!),
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
@ -89,8 +82,7 @@ class PatientProfileAppBar extends StatelessWidget
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" +
patientProfileAppBarModel.patient!.mobileNumber!);
launch("tel://" + patientProfileAppBarModel.patient!.mobileNumber!);
},
child: Icon(
Icons.phone,
@ -107,9 +99,7 @@ class PatientProfileAppBar extends StatelessWidget
width: 60,
height: 60,
child: Image.asset(
gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
@ -126,9 +116,7 @@ class PatientProfileAppBar extends StatelessWidget
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
patientProfileAppBarModel
.patient!.patientStatusType ==
43
patientProfileAppBarModel.patient!.patientStatusType == 43
? AppText(
TranslationBase.of(context).arrivedP,
color: Colors.green,
@ -143,14 +131,10 @@ class PatientProfileAppBar extends StatelessWidget
fontFamily: 'Poppins',
fontSize: 12,
),
patientProfileAppBarModel.patient!.startTime !=
null
patientProfileAppBarModel.patient!.startTime != null
? AppText(
patientProfileAppBarModel
.patient!.startTime !=
null
? patientProfileAppBarModel
.patient!.startTime
patientProfileAppBarModel.patient!.startTime != null
? patientProfileAppBarModel.patient!.startTime
: '',
fontWeight: FontWeight.w700,
fontSize: 12,
@ -165,9 +149,7 @@ class PatientProfileAppBar extends StatelessWidget
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black),
style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).fileNumber,
@ -179,9 +161,7 @@ class PatientProfileAppBar extends StatelessWidget
),
),
new TextSpan(
text: patientProfileAppBarModel
.patient!.patientId
.toString(),
text: patientProfileAppBarModel.patient!.patientId.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
@ -195,27 +175,20 @@ class PatientProfileAppBar extends StatelessWidget
children: [
AppText(
patientProfileAppBarModel.patient!.nationalityName ??
patientProfileAppBarModel
.patient!.nationality ??
patientProfileAppBarModel
.patient!.nationalityId ??
patientProfileAppBarModel.patient!.nationality ??
patientProfileAppBarModel.patient!.nationalityId ??
'',
fontWeight: FontWeight.bold,
fontSize: 12,
),
patientProfileAppBarModel
.patient!.nationalityFlagURL !=
null
patientProfileAppBarModel.patient!.nationalityFlagURL != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patientProfileAppBarModel
.patient!.nationalityFlagURL!,
patientProfileAppBarModel.patient!.nationalityFlagURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace? stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -253,10 +226,9 @@ class PatientProfileAppBar extends StatelessWidget
),
),
if (patientProfileAppBarModel.patient!.appointmentDate !=
null &&
patientProfileAppBarModel
.patient!.appointmentDate!.isNotEmpty && !isFromLabResult)
if (patientProfileAppBarModel.patient!.appointmentDate != null &&
patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty &&
!isFromLabResult)
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
@ -272,9 +244,7 @@ class PatientProfileAppBar extends StatelessWidget
),
AppText(
AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
patientProfileAppBarModel
.patient!.appointmentDate!)),
AppDateUtils.convertStringToDate(patientProfileAppBarModel.patient!.appointmentDate!)),
fontWeight: FontWeight.w700,
fontSize: 12,
color: Color(0xFF2E303A),
@ -305,9 +275,7 @@ class PatientProfileAppBar extends StatelessWidget
new TextSpan(
text:
'${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 12)),
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 12)),
],
),
),
@ -316,10 +284,8 @@ class PatientProfileAppBar extends StatelessWidget
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (patientProfileAppBarModel.patient!.admissionDate !=
null &&
patientProfileAppBarModel
.patient!.admissionDate!.isNotEmpty)
if (patientProfileAppBarModel.patient!.admissionDate != null &&
patientProfileAppBarModel.patient!.admissionDate!.isNotEmpty)
Container(
child: RichText(
text: new TextSpan(
@ -331,18 +297,12 @@ class PatientProfileAppBar extends StatelessWidget
),
children: <TextSpan>[
new TextSpan(
text: patientProfileAppBarModel
.patient!.admissionDate ==
null
text: patientProfileAppBarModel.patient!.admissionDate == null
? ""
: TranslationBase.of(context)
.admissionDate! +
" : ",
: TranslationBase.of(context).admissionDate! + " : ",
style: TextStyle(fontSize: 10)),
new TextSpan(
text: patientProfileAppBarModel
.patient!.admissionDate ==
null
text: patientProfileAppBarModel.patient!.admissionDate == null
? ""
: "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}",
style: TextStyle(
@ -351,20 +311,13 @@ class PatientProfileAppBar extends StatelessWidget
color: Color(0xFF2E303A),
)),
]))),
if (patientProfileAppBarModel.patient!.admissionDate !=
null)
if (patientProfileAppBarModel.patient!.admissionDate != null)
Row(
children: [
AppText(
"${TranslationBase.of(context).numOfDays}: ",
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757)),
if (patientProfileAppBarModel!
.isDischargedPatient! &&
patientProfileAppBarModel
.patient!.dischargeDate !=
null)
AppText("${TranslationBase.of(context).numOfDays}: ",
fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
if (patientProfileAppBarModel.isDischargedPatient! &&
patientProfileAppBarModel.patient!.dischargeDate != null)
AppText(
"${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}",
fontWeight: FontWeight.w700,
@ -394,14 +347,11 @@ class PatientProfileAppBar extends StatelessWidget
width: 30,
height: 30,
margin: EdgeInsets.only(
left: projectViewModel.isArabic ? 10 : 85,
right: projectViewModel.isArabic ? 85 : 10,
top: 5),
left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border(
bottom:
BorderSide(color: Colors.grey[400]!, width: 2.5),
bottom: 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,
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${TranslationBase.of(context).dr}${patientProfileAppBarModel.doctorName}',
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
fontSize: 12,
),
if (patientProfileAppBarModel.orderNo !=
null &&
!patientProfileAppBarModel
.isPrescriptions!)
Row(
children: <Widget>[
AppText(
'Order No: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(
patientProfileAppBarModel
.orderNo ??
'',
fontSize: 12)
],
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
AppText(
'${TranslationBase.of(context).dr}${patientProfileAppBarModel.doctorName}',
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
fontSize: 12,
),
if (patientProfileAppBarModel.orderNo != null &&
!patientProfileAppBarModel.isPrescriptions!)
Row(
children: <Widget>[
AppText(
'Order No: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
if (patientProfileAppBarModel.invoiceNO !=
null &&
!patientProfileAppBarModel!
.isPrescriptions!)
Row(
children: <Widget>[
AppText(
'Invoice: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(
patientProfileAppBarModel
.invoiceNO ??
"",
fontSize: 12)
],
AppText(patientProfileAppBarModel.orderNo ?? '', fontSize: 12)
],
),
if (patientProfileAppBarModel.invoiceNO != null &&
!patientProfileAppBarModel.isPrescriptions!)
Row(
children: <Widget>[
AppText(
'Invoice: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
if (patientProfileAppBarModel.branch !=
null)
Row(
children: [
AppText(
'Branch: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(
patientProfileAppBarModel
.branch ??
'',
fontSize: 12)
],
AppText(patientProfileAppBarModel.invoiceNO ?? "", fontSize: 12)
],
),
if (patientProfileAppBarModel.branch != null)
Row(
children: [
AppText(
'Branch: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
if (patientProfileAppBarModel.clinic !=
null)
Row(
children: [
AppText(
'Clinic: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(
patientProfileAppBarModel
.clinic ??
'',
fontSize: 12)
],
AppText(patientProfileAppBarModel.branch ?? '', fontSize: 12)
],
),
if (patientProfileAppBarModel.clinic != null)
Row(
children: [
AppText(
'Clinic: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
if (patientProfileAppBarModel
.isMedicalFile! &&
patientProfileAppBarModel.episode !=
null)
Row(
children: [
AppText(
'Episode: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(
patientProfileAppBarModel
.episode ??
'',
fontSize: 12)
],
AppText(patientProfileAppBarModel.clinic ?? '', fontSize: 12)
],
),
if (patientProfileAppBarModel.isMedicalFile! &&
patientProfileAppBarModel.episode != null)
Row(
children: [
AppText(
'Episode: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(patientProfileAppBarModel.episode ?? '', fontSize: 12)
],
),
if (patientProfileAppBarModel.isMedicalFile! &&
patientProfileAppBarModel.visitDate != null)
Row(
children: [
AppText(
'Visit Date: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
if (patientProfileAppBarModel
.isMedicalFile! &&
patientProfileAppBarModel.visitDate !=
null)
Row(
children: [
AppText(
'Visit Date: ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(
patientProfileAppBarModel
.visitDate ??
'',
fontSize: 12)
],
AppText(patientProfileAppBarModel.visitDate ?? '', fontSize: 12)
],
),
if (!patientProfileAppBarModel.isMedicalFile!)
Row(
children: <Widget>[
AppText(
!patientProfileAppBarModel.isPrescriptions!
? 'Result Date:'
: 'Prescriptions Date ',
fontSize: 10,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
if (!patientProfileAppBarModel
.isMedicalFile!)
Row(
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,
)
],
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}',
fontSize: 12,
)
]),
],
)
]),
),
),
],
@ -583,12 +495,16 @@ class PatientProfileAppBar extends StatelessWidget
patientProfileAppBarModel.height == 0
? patientProfileAppBarModel.isAppointmentHeader!
? 270
: ((patientProfileAppBarModel.patient!.appointmentDate! != null &&patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty )
? patientProfileAppBarModel.isFromLabResult!?170:150
: ((patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty)
? patientProfileAppBarModel.isFromLabResult!
? 170
: 150
: patientProfileAppBarModel.patient!.admissionDate != null
? patientProfileAppBarModel.isFromLabResult!?170:150
? patientProfileAppBarModel.isFromLabResult!
? 170
: 150
: patientProfileAppBarModel.isDischargedPatient!
? 240!
: 130!)
? 240
: 130)
: patientProfileAppBarModel.height!);
}

@ -20,9 +20,9 @@ class StarRating extends StatelessWidget {
5,
(index) => Padding(
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,
color: (index + 1) <= (totalAverage ?? 0)
color: (index + 1) <= (totalAverage)
? Color.fromRGBO(255, 186, 0, 1.0)
: Theme.of(context).hintColor),
)),

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

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

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

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

Loading…
Cancel
Save