Merge branch 'flutter_2_developemt' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into hussam_flutter_2

 Conflicts:
	lib/core/viewModel/PatientRegistrationViewModel.dart
	lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart
	lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart
	lib/screens/patients/profile/referral/my-referral-detail-screen.dart
	lib/screens/reschedule-leaves/reschedule_leave.dart
hussam_flutter_2
hussam al-habibeh 4 years ago
commit f53920d040

@ -142,10 +142,8 @@ class PatientRegistrationViewModel extends BaseViewModel {
} }
Future sendActivationCodeByOTPNotificationType( Future sendActivationCodeByOTPNotificationType(
{SendActivationCodeByOTPNotificationTypeForRegistrationModel? {
registrationModel, required int otpType}) async {
required int otpType,
PatientRegistrationViewModel? user}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
print(checkPatientForRegistrationModel); print(checkPatientForRegistrationModel);
print(checkPatientForRegistrationModel); print(checkPatientForRegistrationModel);
@ -183,7 +181,7 @@ class PatientRegistrationViewModel extends BaseViewModel {
channel: 3, channel: 3,
// TODO Elham* loginType // TODO Elham* loginType
loginType: 4, loginType: 4,
logInTokenID: _patientRegistrationService.logInTokenID, logInTokenID:_patientRegistrationService.logInTokenID ,
nationalID: checkPatientForRegistrationModel.patientIdentificationID, nationalID: checkPatientForRegistrationModel.patientIdentificationID,
patientID: 0, patientID: 0,
mobileNo: checkPatientForRegistrationModel.patientMobileNumber.toString(), mobileNo: checkPatientForRegistrationModel.patientMobileNumber.toString(),

@ -1,16 +1,16 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedExamination { class MySelectedExamination {
MasterKeyModel selectedExamination; MasterKeyModel? selectedExamination;
String remark; String? remark;
bool isNormal; bool isNormal;
bool isAbnormal; bool isAbnormal;
bool notExamined; bool notExamined;
bool isNew; bool isNew;
bool isLocal; bool isLocal;
int createdBy; int? createdBy;
String createdOn; String? createdOn;
String editedOn; String? editedOn;
MySelectedExamination({ MySelectedExamination({
this.selectedExamination, this.selectedExamination,

@ -1,8 +1,8 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedHistory { class MySelectedHistory {
MasterKeyModel selectedHistory; MasterKeyModel? selectedHistory;
String remark; String? remark;
bool? isChecked; bool? isChecked;
bool? isLocal; bool? isLocal;

@ -74,7 +74,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
DoctorApp.filter_1, DoctorApp.filter_1,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20, onPressed: () { },
), ),
), ),
SizedBox( SizedBox(
@ -209,8 +209,8 @@ class _DischargedPatientState extends State<DischargedPatient> {
25, 25,
width: width:
30, 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext? context,
Object Object?
exception, exception,
StackTrace? StackTrace?
stackTrace) { stackTrace) {

@ -9,22 +9,19 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PendingOrdersScreen extends StatelessWidget { class PendingOrdersScreen extends StatelessWidget {
const PendingOrdersScreen({Key key}) : super(key: key); const PendingOrdersScreen({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<PendingOrdersViewModel>( return BaseView<PendingOrdersViewModel>(
onModelReady: (model) => model.getPendingOrders( onModelReady: (model) async {},
patientId: patient.patientMRN, builder: (_, model, w) => AppScaffold(
admissionNo: int.parse(patient.admissionNo)),
builder:
(BuildContext context, PendingOrdersViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient,
isInpatient: isInpatient, isInpatient: isInpatient,
@ -35,7 +32,7 @@ class PendingOrdersScreen extends StatelessWidget {
body: model.pendingOrdersList == null || body: model.pendingOrdersList == null ||
model.pendingOrdersList.length == 0 model.pendingOrdersList.length == 0
? DrAppEmbeddedError( ? DrAppEmbeddedError(
error: TranslationBase.of(context).noDataAvailable) error: TranslationBase.of(context).noDataAvailable!)
: Column( : Column(
children: [ children: [
Padding( Padding(

@ -70,7 +70,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
_tabController.dispose(); _tabController.dispose();
super.dispose(); super.dispose();
if (isFromLiveCare) { if (isFromLiveCare) {
_liveCareViewModel.removePatientFromDoctorList(patient.vcId); _liveCareViewModel.removePatientFromDoctorList(patient.vcId!);
} }
} }
@ -139,7 +139,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
return BaseView<LiveCarePatientViewModel>( return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (isFromLiveCare && patient.patientStatus == 1) if (isFromLiveCare && patient.patientStatus == 1)
await model.addPatientToDoctorList(patient.vcId); await model.addPatientToDoctorList(patient!.vcId!);
},builder: (_, model, w) => AppScaffold( },builder: (_, model, w) => AppScaffold(
baseViewModel: model,isLoading: true, baseViewModel: model,isLoading: true,
appBarTitle: TranslationBase.of(context).patientProfile ?? "", appBarTitle: TranslationBase.of(context).patientProfile ?? "",
@ -151,6 +151,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
Column( Column(
children: [ children: [
PatientProfileAppBar( PatientProfileAppBar(
patient,
patientProfileAppBarModel: PatientProfileAppBarModel( patientProfileAppBarModel: PatientProfileAppBarModel(
patient: patient, patient: patient,
videoCallDurationStream: videoCallDurationStream, videoCallDurationStream: videoCallDurationStream,
@ -364,7 +365,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.startCall( await model.startCall(
isReCall: false, vCID: patient.vcId); isReCall: false, vCID: patient.vcId!);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -398,7 +399,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
: true, : true,
callConnected, callConnected,
callDisconnected); callDisconnected);
}); }, type: '');
} }
} }
}, },
@ -417,16 +418,16 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
); );
} }
createEpisode({PatiantInformtion patient, SOAPViewModel model}) async { createEpisode({required PatiantInformtion patient, required SOAPViewModel model}) async {
await locator<AnalyticsService>().logEvent( await locator<AnalyticsService>().logEvent(
eventCategory: "Patient Profile", eventCategory: "Patient Profile",
eventAction: "Create Episode", eventAction: "Create Episode",
); );
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) { if (patient.admissionNo != null && patient.admissionNo!.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel postEpisodeReqModel =
PostEpisodeForInpatientRequestModel( PostEpisodeForInpatientRequestModel(
admissionNo: int.parse(patient.admissionNo), admissionNo: int.parse(patient!.admissionNo!),
patientID: patient.patientId); patientID: patient.patientId);
await model.postEpisodeForInPatient(postEpisodeReqModel); await model.postEpisodeForInPatient(postEpisodeReqModel);
} else { } else {

@ -33,77 +33,41 @@ class ProfileGridForOther extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'patient/vital_signs.png',
TranslationBase.of(context).vital!,
TranslationBase.of(context).signs!,
VITAL_SIGN_DETAILS,
'patient/vital_signs.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).lab!, TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png',
TranslationBase.of(context).result!,
LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).lab!, TranslationBase.of(context).special!,
TranslationBase.of(context).lab!, ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png',
TranslationBase.of(context).special!,
ALL_SPECIAL_LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).service!,
TranslationBase.of(context).radiology!, RADIOLOGY_PATIENT, 'patient/health_summary.png',
TranslationBase.of(context).service!,
RADIOLOGY_PATIENT,
'patient/health_summary.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).prescription!,
TranslationBase.of(context).orders!, ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png',
TranslationBase.of(context).prescription!,
ORDER_PRESCRIPTION_NEW,
'patient/order_prescription.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY,
TranslationBase.of(context).health!,
TranslationBase.of(context).summary!,
HEALTH_SUMMARY,
'patient/health_summary.png', 'patient/health_summary.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png',
PATIENT_ECG, 'patient/patient_sick_leave.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!,
TranslationBase.of(context).orders!, ORDER_PROCEDURE, 'patient/Order_Procedures.png',
TranslationBase.of(context).procedures!,
ORDER_PROCEDURE,
'patient/Order_Procedures.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!,
TranslationBase.of(context).insurance!, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png',
TranslationBase.of(context).service!,
PATIENT_INSURANCE_APPROVALS_NEW,
'patient/vital_signs.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png',
TranslationBase.of(context).patientSick!,
TranslationBase.of(context).leave!,
ADD_SICKLEAVE,
'patient/patient_sick_leave.png',
isInPatient: isInpatient), isInPatient: isInpatient),
if (isFromLiveCare || if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
(patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!,
PatientProfileCardModel( PATIENT_UCAF_REQUEST, 'patient/ucaf.png',
TranslationBase.of(context).patient!,
TranslationBase.of(context).ucaf!,
PATIENT_UCAF_REQUEST,
'patient/ucaf.png',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isFromLiveCare isDisable: isFromLiveCare
? patient.appointmentNo == null ? patient.appointmentNo == null
: patient.patientStatusType != 43 || : patient.patientStatusType != 43 || patient.appointmentNo == null),
patient.appointmentNo == null), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).referral!, TranslationBase.of(context).referral!,
TranslationBase.of(context).patient!, TranslationBase.of(context).patient!,
@ -112,21 +76,15 @@ class ProfileGridForOther extends StatelessWidget {
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isFromLiveCare isDisable: isFromLiveCare
? patient.appointmentNo == null ? patient.appointmentNo == null
: patient.patientStatusType != 43 || : patient.patientStatusType != 43 || patient.appointmentNo == null,
patient.appointmentNo == null,
), ),
if (isFromLiveCare || if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
(patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!,
PatientProfileCardModel( PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png',
TranslationBase.of(context).admission!,
TranslationBase.of(context).request!,
PATIENT_ADMISSION_REQUEST,
'patient/admission_req.png',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isFromLiveCare isDisable: isFromLiveCare
? patient.appointmentNo == null ? patient.appointmentNo == null
: patient.patientStatusType != 43 || : patient.patientStatusType != 43 || patient.appointmentNo == null),
patient.appointmentNo == null),
]; ];
return Column( return Column(
@ -141,8 +99,7 @@ class ProfileGridForOther extends StatelessWidget {
crossAxisCount: 3, crossAxisCount: 3,
itemCount: cardsList.length, itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1), staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) => itemBuilder: (BuildContext context, int index) => PatientProfileButton(
PatientProfileButton(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,

@ -30,87 +30,45 @@ class ProfileGridForSearch extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'patient/vital_signs.png',
TranslationBase.of(context).vital!,
TranslationBase.of(context).signs!,
VITAL_SIGN_DETAILS,
'patient/vital_signs.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).lab!, TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png',
TranslationBase.of(context).result!,
LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).lab!, TranslationBase.of(context).special!,
TranslationBase.of(context).lab!, ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png',
TranslationBase.of(context).special!,
ALL_SPECIAL_LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).service!,
TranslationBase.of(context).radiology!, RADIOLOGY_PATIENT, 'patient/health_summary.png',
TranslationBase.of(context).service!,
RADIOLOGY_PATIENT,
'patient/health_summary.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).prescription!,
TranslationBase.of(context).orders!, ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png',
TranslationBase.of(context).prescription!,
ORDER_PRESCRIPTION_NEW,
'patient/order_prescription.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY,
TranslationBase.of(context).health!,
TranslationBase.of(context).summary!,
HEALTH_SUMMARY,
'patient/health_summary.png', 'patient/health_summary.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png',
PATIENT_ECG, 'patient/patient_sick_leave.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!,
TranslationBase.of(context).orders!, ORDER_PROCEDURE, 'patient/Order_Procedures.png',
TranslationBase.of(context).procedures!,
ORDER_PROCEDURE,
'patient/Order_Procedures.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!,
TranslationBase.of(context).insurance!, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png',
TranslationBase.of(context).service!,
PATIENT_INSURANCE_APPROVALS_NEW,
'patient/vital_signs.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png',
TranslationBase.of(context).patientSick!,
TranslationBase.of(context).leave!,
ADD_SICKLEAVE,
'patient/patient_sick_leave.png',
isInPatient: isInpatient), isInPatient: isInpatient),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!,
TranslationBase.of(context).patient!, PATIENT_UCAF_REQUEST, 'patient/ucaf.png',
TranslationBase.of(context).ucaf!, isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false),
PATIENT_UCAF_REQUEST,
'patient/ucaf.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).referral!, TranslationBase.of(context).patient!,
TranslationBase.of(context).referral!, REFER_PATIENT_TO_DOCTOR, 'patient/refer_patient.png',
TranslationBase.of(context).patient!, isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false),
REFER_PATIENT_TO_DOCTOR,
'patient/refer_patient.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!,
TranslationBase.of(context).admission!, PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png',
TranslationBase.of(context).request!, isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false),
PATIENT_ADMISSION_REQUEST,
'patient/admission_req.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
]; ];
return Column( return Column(
@ -125,8 +83,7 @@ class ProfileGridForSearch extends StatelessWidget {
crossAxisCount: 3, crossAxisCount: 3,
itemCount: cardsList.length, itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1), staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) => itemBuilder: (BuildContext context, int index) => PatientProfileButton(
PatientProfileButton(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,

@ -16,10 +16,9 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class MyReferralDetailScreen extends StatelessWidget { class MyReferralDetailScreen extends StatelessWidget {
final MyReferralPatientModel referralPatient; final MyReferralPatientModel? referralPatient;
const MyReferralDetailScreen({Key? key, required this.referralPatient}) const MyReferralDetailScreen({Key? key, this.referralPatient}) : super(key: key);
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -54,15 +53,13 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
(Helpers.capitalize(referralPatient.firstName! + (Helpers.capitalize(referralPatient!.firstName! + " " + referralPatient!.lastName!)),
" " +
referralPatient.lastName!)),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
), ),
referralPatient.gender == 1 referralPatient!.gender! == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -82,7 +79,7 @@ class MyReferralDetailScreen extends StatelessWidget {
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
referralPatient.gender == 1 referralPatient!.gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -96,31 +93,23 @@ class MyReferralDetailScreen extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
referralPatient.referralStatus != null referralPatient!.referralStatus != null
? model.getReferralStatusNameByCode( ? model.getReferralStatusNameByCode(referralPatient!.referralStatus!, context)
referralPatient.referralStatus!,
context)
: "", : "",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: referralPatient.referralStatus == 1 color: referralPatient!.referralStatus == 1
? Color(0xffc4aa54) ? Color(0xffc4aa54)
: referralPatient.referralStatus == : referralPatient!.referralStatus == 46 || referralPatient!.referralStatus! == 2
46 ||
referralPatient
.referralStatus ==
2
? Colors.green[700] ? Colors.green[700]
: Colors.red[700], : Colors.red[700],
), ),
AppText( AppText(
AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDayMonthYearDateFormatted(referralPatient!.referralDate!),
referralPatient.referralDate!),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier,
@ -129,35 +118,29 @@ class MyReferralDetailScreen extends StatelessWidget {
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).fileNumber,
.fileNumber,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
"${referralPatient.patientID}", "${referralPatient!.patientID}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: 1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
), ),
AppText( AppText(
AppDateUtils.getTimeHHMMA( AppDateUtils.getTimeHHMMA(referralPatient!.referralDate!),
referralPatient.referralDate!),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -166,70 +149,50 @@ class MyReferralDetailScreen extends StatelessWidget {
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).referredFrom,
.referredFrom,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * fontSize: 1.7 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
referralPatient referralPatient!.targetProjectId! == referralPatient!.sourceProjectId!
.targetProjectId == ? TranslationBase.of(context).sameBranch
referralPatient : TranslationBase.of(context).otherBranch,
.sourceProjectId
? TranslationBase.of(
context)
.sameBranch
: TranslationBase.of(
context)
.otherBranch,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * fontSize: 1.8 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).remarks! + " : ",
.remarks! +
" : ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * fontSize: 1.7 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referralPatient referralPatient!.referringDoctorRemarks ?? '',
.referringDoctorRemarks ??
'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * fontSize: 1.8 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
), ),
@ -241,29 +204,22 @@ class MyReferralDetailScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
referralPatient.nationalityName != referralPatient!.nationalityName != null
null ? referralPatient!.nationalityName
? referralPatient.nationalityName
: "", : "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: fontSize: 1.4 * SizeConfig.textMultiplier,
1.4 * SizeConfig.textMultiplier,
), ),
referralPatient.nationalityFlagURL != referralPatient!.nationalityFlagURL != null
null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referralPatient referralPatient!.nationalityFlagURL!,
.nationalityFlagURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext errorBuilder:
context, (BuildContext ?context, Object ?exception, StackTrace? stackTrace) {
Object exception,
StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -276,8 +232,7 @@ class MyReferralDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: margin: EdgeInsets.only(left: 10, right: 0),
EdgeInsets.only(left: 10, right: 0),
child: Image.asset( child: Image.asset(
'assets/images/patient/ic_ref_arrow_up.png', 'assets/images/patient/ic_ref_arrow_up.png',
height: 50, height: 50,
@ -285,20 +240,14 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
left: 0, padding: EdgeInsets.only(left: 4.0, right: 4.0),
top: 25,
right: 0,
bottom: 0),
padding: EdgeInsets.only(
left: 4.0, right: 4.0),
child: Container( child: Container(
width: 40, width: 40,
height: 40, height: 40,
child: CircleAvatar( child: CircleAvatar(
radius: 25.0, radius: 25.0,
backgroundImage: NetworkImage( backgroundImage: NetworkImage(referralPatient!.doctorImageURL!),
referralPatient.doctorImageURL!),
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
), ),
), ),
@ -306,19 +255,14 @@ class MyReferralDetailScreen extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0),
left: 10,
top: 25,
right: 10,
bottom: 0),
child: Column( child: Column(
children: [ children: [
AppText( AppText(
referralPatient.doctorName, referralPatient!.doctorName,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.7 * fontSize: 1.7 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -349,12 +293,11 @@ class MyReferralDetailScreen extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16), padding: const EdgeInsets.symmetric(horizontal: 16),
child: SizedBox( child: SizedBox(
child: ProfileMedicalInfoWidgetSearch( child: ProfileMedicalInfoWidgetSearch(
patient: model patient: model.getPatientFromReferralO(referralPatient!),
.getPatientFromReferralO(referralPatient),
patientType: "7", patientType: "7",
isInpatient: false, isInpatient: false,
from: "", from: null,
to: "", to: null,
), ),
), ),
), ),
@ -363,7 +306,7 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
), ),
), ),
if (referralPatient.referralStatus == 1) if (referralPatient!.referralStatus == 1)
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Row( child: Row(
@ -378,13 +321,11 @@ class MyReferralDetailScreen extends StatelessWidget {
vPadding: 12, vPadding: 12,
disabled: model.state == ViewState.Busy, disabled: model.state == ViewState.Busy,
onPressed: () async { onPressed: () async {
await model.responseReferral(referralPatient, true); await model.responseReferral(referralPatient!, true);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept);
TranslationBase.of(context)
.referralSuccessMsgAccept);
model.getMyReferralOutPatientService(); model.getMyReferralOutPatientService();
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
@ -405,14 +346,11 @@ class MyReferralDetailScreen extends StatelessWidget {
vPadding: 12, vPadding: 12,
disabled: model.state == ViewState.Busy, disabled: model.state == ViewState.Busy,
onPressed: () async { onPressed: () async {
await model.responseReferral( await model.responseReferral(referralPatient!, false);
referralPatient, false);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject);
TranslationBase.of(context)
.referralSuccessMsgReject);
model.getMyReferralOutPatientService(); model.getMyReferralOutPatientService();
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);

@ -115,7 +115,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: BottomSheetTitle( appBar: BottomSheetTitle(
title: TranslationBase.of(context).addAssessmentDetails), title: TranslationBase.of(context).addAssessmentDetails!),
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Center( child: Center(
@ -210,9 +210,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
.width * 0.7, .width * 0.7,
child: AppText( child: AppText(
widget.mySelectedAssessment widget.mySelectedAssessment
.selectedICD.description + .selectedICD!.description! +
(' (${widget.mySelectedAssessment (' (${widget.mySelectedAssessment
.selectedICD.code} )'), .selectedICD!.code!} )'),
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,

@ -165,7 +165,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
), ),
new TextSpan( new TextSpan(
text: assessment text: assessment
.selectedICD.code .selectedICD!.code
.trim() .trim()
.toUpperCase() ?? .toUpperCase() ??
""), ""),
@ -191,7 +191,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: assessment text: assessment
.selectedICD.description .selectedICD!.description
.toString(), .toString(),
), ),
], ],
@ -249,7 +249,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.condition + .condition! +
" : ", " : ",
style: new TextStyle( style: new TextStyle(
letterSpacing: -0.4, letterSpacing: -0.4,
@ -260,11 +260,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
text: projectViewModel text: projectViewModel
.isArabic .isArabic
? assessment ? assessment
.selectedDiagnosisCondition .selectedDiagnosisCondition!
.nameAr .nameAr!
: assessment : assessment
.selectedDiagnosisCondition .selectedDiagnosisCondition!
.nameEn, .nameEn!,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
@ -289,7 +289,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.dType + .dType! +
' : ', ' : ',
style: new TextStyle( style: new TextStyle(
letterSpacing: -0.4, letterSpacing: -0.4,
@ -300,10 +300,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
text: projectViewModel text: projectViewModel
.isArabic .isArabic
? assessment ? assessment
.selectedDiagnosisType .selectedDiagnosisType!
.nameAr .nameAr
: assessment : assessment
.selectedDiagnosisType .selectedDiagnosisType!
.nameEn, .nameEn,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
@ -331,7 +331,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.doctor + .doctor! +
' : ', ' : ',
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
@ -374,7 +374,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
'') '')
? TranslationBase.of( ? TranslationBase.of(
context) context)
.remarks + .remarks! +
" : " " : "
: '', : '',
fontSize: SizeConfig fontSize: SizeConfig
@ -405,8 +405,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
? AppDateUtils ? AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.parse( DateTime.parse(
assessment assessment!
.createdOn)) .createdOn!))
: AppDateUtils : AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.now()), DateTime.now()),
@ -419,8 +419,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
assessment.createdOn != null assessment.createdOn != null
? AppDateUtils.getHour( ? AppDateUtils.getHour(
DateTime.parse( DateTime.parse(
assessment assessment!
.createdOn)) .createdOn!))
: AppDateUtils.getHour( : AppDateUtils.getHour(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -25,7 +25,7 @@ class AddExaminationPage extends StatefulWidget {
} }
class _AddExaminationPageState extends State<AddExaminationPage> { class _AddExaminationPageState extends State<AddExaminationPage> {
List<MySelectedExamination> mySelectedExaminationLocal; late List<MySelectedExamination> mySelectedExaminationLocal;
@override @override
initState() { initState() {

@ -20,7 +20,7 @@ class AddExaminationWidget extends StatefulWidget {
final bool Function(MasterKeyModel) isServiceSelected; final bool Function(MasterKeyModel) isServiceSelected;
bool isExpand; bool isExpand;
final VoidCallback expandClick; final VoidCallback expandClick;
final List<MySelectedExamination> mySelectedExamination; final List<MySelectedExamination>? mySelectedExamination;
AddExaminationWidget({ AddExaminationWidget({
required this.item, required this.item,
@ -44,13 +44,13 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
@override @override
void initState() { void initState() {
if (getSelectedExam(widget.item) != null) { if (getSelectedExam(widget.item) != null) {
examination = getSelectedExam(widget.item); examination = getSelectedExam(widget.item)!;
status = examination.isNormal status = examination.isNormal
? 1 ? 1
: examination.isAbnormal : examination.isAbnormal
? 2 ? 2
: 3; : 3;
remarksController.text = examination.remark; remarksController.text = examination!.remark!;
} else { } else {
examination.selectedExamination = widget.item; examination.selectedExamination = widget.item;
} }
@ -75,7 +75,7 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
Checkbox( Checkbox(
value:widget.isServiceSelected(widget.item), value:widget.isServiceSelected(widget.item),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool newValue) { onChanged: (bool ?newValue) {
onExamTap(); onExamTap();
}), }),
Container( Container(
@ -274,11 +274,11 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
}); });
} }
MySelectedExamination getSelectedExam(MasterKeyModel masterKey) { MySelectedExamination? getSelectedExam(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where( Iterable<MySelectedExamination> exam = widget.mySelectedExamination!.where(
(element) => (element) =>
masterKey.id == element.selectedExamination.id && masterKey.id == element.selectedExamination!.id &&
masterKey.typeId == element.selectedExamination.typeId); masterKey.typeId == element.selectedExamination!.typeId);
if (exam.length > 0) { if (exam.length > 0) {
return exam.first; return exam.first;
} }

@ -73,7 +73,7 @@ class ExaminationItemCard extends StatelessWidget {
SizedBox( SizedBox(
height: 4, height: 4,
), ),
if (examination.remark.isNotEmpty) if (examination.remark!.isNotEmpty)
RemarkText(remark: examination.remark), RemarkText(remark: examination.remark),
], ],
), ),

@ -19,7 +19,7 @@ class ExaminationsListSearchWidget extends StatefulWidget {
{required this.removeExamination, {required this.removeExamination,
required this.addExamination, required this.addExamination,
required this.isServiceSelected, required this.isServiceSelected,
required this.masterList, this.mySelectedExamination}); required this.masterList, required this.mySelectedExamination});
@override @override
_ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState(); _ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState();

@ -71,7 +71,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
await model.getMasterLookup(MasterKeysService.PhysicalExamination); await model.getMasterLookup(MasterKeysService.PhysicalExamination);
} }
model.patientPhysicalExamList.forEach((element) { model.patientPhysicalExamList.forEach((element) {
MasterKeyModel examMaster = model.getOneMasterKey( MasterKeyModel? examMaster = model.getOneMasterKey(
masterKeys: MasterKeysService.PhysicalExamination, masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId, id: element.examId,
); );
@ -152,7 +152,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination( removeExamination(
examination.selectedExamination); examination!.selectedExamination!);
}); });
}).toList(), }).toList(),
), ),
@ -181,7 +181,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination( removeExamination(
examination.selectedExamination); examination.selectedExamination!);
}); });
}).toList(), }).toList(),
) )
@ -205,7 +205,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if (mySelectedExamination.isNotEmpty) { if (mySelectedExamination.isNotEmpty) {
if(!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && if(!model.isAddExamInProgress && widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) { widget.patientInfo.admissionNo!.isNotEmpty) {
Navigator.of(context).pop(); Navigator.of(context).pop();
}else{ }else{
widget.changeLoadingState(true); widget.changeLoadingState(true);
@ -230,8 +230,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID, editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id, examId: exam.selectedExamination!.id,
examType: exam.selectedExamination.typeId, examType: exam.selectedExamination!.typeId,
isAbnormal: exam.isAbnormal, isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal, isNormal: exam.isNormal,
notExamined: exam.notExamined, notExamined: exam.notExamined,
@ -248,13 +248,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
isNew: exam.isNew, isNew: exam.isNew,
); );
if (widget.patientInfo.admissionNo != null && if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) { widget.patientInfo.admissionNo!.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo = listHisProgNotePhysicalExaminationVM.admissionNo =
int.parse(widget.patientInfo.admissionNo); int.parse(widget.patientInfo.admissionNo!);
} else { } else {
listHisProgNotePhysicalExaminationVM.admissionNo = 0; listHisProgNotePhysicalExaminationVM.admissionNo = 0;
} }
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!
.add(listHisProgNotePhysicalExaminationVM); .add(listHisProgNotePhysicalExaminationVM);
}); });
@ -268,13 +268,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
widget.changeLoadingState(false); widget.changeLoadingState(false);
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
if(widget.patientInfo.admissionNo != null && if(widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) { widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
model.isAddExamInProgress = false; model.isAddExamInProgress = false;
} }
} else { } else {
if(widget.patientInfo.admissionNo != null && if(widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) { widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
widget.changeLoadingState(false); widget.changeLoadingState(false);
model.isAddExamInProgress = false; model.isAddExamInProgress = false;
@ -322,9 +322,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
mySelectedExaminationLocal.forEach((element) { mySelectedExaminationLocal.forEach((element) {
if ((mySelectedExamination.singleWhere( if ((mySelectedExamination.singleWhere(
(it) => (it) =>
it.selectedExamination.id == it.selectedExamination!.id ==
element.selectedExamination.id, element.selectedExamination!.id)) ==
orElse: () => null)) ==
null) { null) {
mySelectedExamination.insert(0,element); mySelectedExamination.insert(0,element);
} }
@ -335,16 +334,16 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
mySelectedExamination.forEach((element) { mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere( if ((mySelectedExaminationLocal.singleWhere(
(it) => (it) =>
it.selectedExamination.id == it.selectedExamination!.id ==
element.selectedExamination.id, element.selectedExamination!.id,
orElse: () => null)) == )) ==
null) { null) {
removedList.add(element); removedList.add(element);
} }
}); });
removedList.forEach((element) { removedList.forEach((element) {
removeExamination(element.selectedExamination); removeExamination(element.selectedExamination!);
}); });
Navigator.of(context).pop(); Navigator.of(context).pop();
} }

@ -37,7 +37,8 @@ class UpdatePlanPage extends StatefulWidget {
required this.changeLoadingState, required this.changeLoadingState,
required this.currentIndex, required this.currentIndex,
required this.sOAPViewModel, required this.sOAPViewModel,
this.changeStateFun}); required this.changeStateFun});
@override @override
_UpdatePlanPageState createState() => _UpdatePlanPageState(); _UpdatePlanPageState createState() => _UpdatePlanPageState();
@ -90,7 +91,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
///TODO set progressNote in model; ///TODO set progressNote in model;
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote); widget.sOAPViewModel!.patientProgressNoteList[0]!.planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
@ -126,7 +127,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote); widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName; widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
@ -253,7 +254,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.parse( DateTime.parse(
patientProgressNote patientProgressNote
.createdOn)) .createdOn!))
: AppDateUtils : AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.now()), DateTime.now()),
@ -288,7 +289,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
? AppDateUtils.getHour( ? AppDateUtils.getHour(
DateTime.parse( DateTime.parse(
patientProgressNote patientProgressNote
.createdOn)) .createdOn!))
: AppDateUtils.getHour( : AppDateUtils.getHour(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -385,7 +386,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
.getPatientProgressNote(getGetProgressNoteReqModel); .getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote); widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName; widget.sOAPViewModel.patientProgressNoteList[0].createdByName;

@ -9,7 +9,7 @@ class SOAPStepHeader extends StatelessWidget {
const SOAPStepHeader({ const SOAPStepHeader({
Key? key, Key? key,
required this.currentIndex, required this.currentIndex,
required this.changePageViewIndex, this.patientInfo, required this.changePageViewIndex, required this.patientInfo,
}) : super(key: key); }) : super(key: key);
final int currentIndex; final int currentIndex;

@ -4,8 +4,8 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class BottomSheetDialogButton extends StatelessWidget { class BottomSheetDialogButton extends StatelessWidget {
final Function onTap; final VoidCallback? onTap;
final String label; final String? label;
double headerHeight = SizeConfig.heightMultiplier * 12; double headerHeight = SizeConfig.heightMultiplier * 12;

@ -3,9 +3,9 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class RemarkText extends StatelessWidget { class RemarkText extends StatelessWidget {
final String remark; final String? remark;
const RemarkText({ const RemarkText({
Key key, this.remark, Key? key, this.remark,
}) : super(key: key); }) : super(key: key);
@override @override

@ -7,8 +7,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class RemoveButton extends StatelessWidget { class RemoveButton extends StatelessWidget {
final Function onTap; final VoidCallback? onTap;
final String label; final String? label;
const RemoveButton({Key? key, this.onTap, this.label}) : super(key: key); const RemoveButton({Key? key, this.onTap, this.label}) : super(key: key);

@ -4,10 +4,10 @@ import 'package:flutter/material.dart';
class StepDetailsWidget extends StatelessWidget { class StepDetailsWidget extends StatelessWidget {
final String stepLabel; final String stepLabel;
final double marginLeft; final double? marginLeft;
const StepDetailsWidget({ const StepDetailsWidget({
Key key, this.stepLabel, this.marginLeft = 0, Key? key, required this.stepLabel, this.marginLeft = 0,
}) : super(key: key); }) : super(key: key);
@override @override

@ -6,9 +6,9 @@ import 'package:hexcolor/hexcolor.dart';
class StatusLabel extends StatelessWidget { class StatusLabel extends StatelessWidget {
const StatusLabel({ const StatusLabel({
Key key, Key? key,
this.stepId, required this.stepId,
this.selectedStepId, required this.selectedStepId,
}) : super(key: key); }) : super(key: key);
final int stepId; final int stepId;

@ -17,10 +17,10 @@ class StepsWidget extends StatelessWidget {
StepsWidget( StepsWidget(
{Key? key, {Key? key,
this.index, required this.index,
this.changeCurrentTab, required this.changeCurrentTab,
this.height = 0.0, this.height = 0.0,
this.patientInfo}); required this.patientInfo});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -52,7 +52,7 @@ class StepsWidget extends StatelessWidget {
child: Container( child: Container(
width: MediaQuery.of(context).size.width * width: MediaQuery.of(context).size.width *
(patientInfo.admissionNo == null || (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty patientInfo.admissionNo!.isEmpty
? 0.9 ? 0.9
: 0.85), : 0.85),
child: Divider( child: Divider(
@ -115,7 +115,7 @@ class StepsWidget extends StatelessWidget {
Positioned( Positioned(
top: circleTop, top: circleTop,
left: patientInfo.admissionNo == null || left: patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty patientInfo.admissionNo!.isEmpty
? MediaQuery.of(context).size.width * 0.25 ? MediaQuery.of(context).size.width * 0.25
: MediaQuery.of(context).size.width * 0.71, : MediaQuery.of(context).size.width * 0.71,
child: InkWell( child: InkWell(
@ -167,7 +167,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
if (patientInfo.admissionNo == null || if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty) patientInfo.admissionNo!.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
left: MediaQuery.of(context).size.width * 0.47, left: MediaQuery.of(context).size.width * 0.47,
@ -222,7 +222,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
if (patientInfo.admissionNo == null || if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty) patientInfo.admissionNo!.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
right: 0, right: 0,
@ -289,7 +289,7 @@ class StepsWidget extends StatelessWidget {
child: Center( child: Center(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null || width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty?0.9:0.85), patientInfo.admissionNo!.isEmpty?0.9:0.85),
child: Divider( child: Divider(
color: Colors.grey, color: Colors.grey,
height: 0.75, height: 0.75,
@ -349,7 +349,7 @@ class StepsWidget extends StatelessWidget {
Positioned( Positioned(
top: circleTop, top: circleTop,
right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null || right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty?0.25:0.71), patientInfo.admissionNo!.isEmpty?0.25:0.71),
child: InkWell( child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null, onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column( child: Column(
@ -396,7 +396,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
if (patientInfo.admissionNo == null || if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty) patientInfo.admissionNo!.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
right: MediaQuery.of(context).size.width * 0.50, right: MediaQuery.of(context).size.width * 0.50,
@ -451,7 +451,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
if (patientInfo.admissionNo == null || if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty) patientInfo.admissionNo!.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
left: 0, left: 0,

@ -100,7 +100,7 @@ class _AddAllergiesState extends State<AddAllergies> {
isServiceSelected: (master) => isServiceSelected: (master) =>
isServiceSelected(master), isServiceSelected(master),
getServiceSelectedAllergy: (master) => getServiceSelectedAllergy: (master) =>
getSelectedAllergy(master), getSelectedAllergy(master)!, hintSearchText: '', buttonName: '',
), ),
), ),
), ),
@ -145,7 +145,7 @@ class _AddAllergiesState extends State<AddAllergies> {
myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id); myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id);
} }
MySelectedAllergy? getSelectedAllergy(MasterKeyModel masterKey) { MySelectedAllergy ? getSelectedAllergy(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy = myAllergiesListLocal.where((element) => Iterable<MySelectedAllergy> allergy = myAllergiesListLocal.where((element) =>
masterKey.id == element.selectedAllergy!.id && masterKey.id == element.selectedAllergy!.id &&
masterKey.typeId == element.selectedAllergy!.typeId && masterKey.typeId == element.selectedAllergy!.typeId &&

@ -27,12 +27,12 @@ class AddAllergiesItem extends StatefulWidget {
const AddAllergiesItem( const AddAllergiesItem(
{Key? key, {Key? key,
this.model, required this.model,
this.removeAllergy, required this.removeAllergy,
this.addAllergy, required this.addAllergy,
this.isServiceSelected, required this.isServiceSelected,
this.getServiceSelectedAllergy, required this.getServiceSelectedAllergy,
this.item}) required this.item})
: super(key: key); : super(key: key);
@override @override
@ -40,7 +40,7 @@ class AddAllergiesItem extends StatefulWidget {
} }
class _AddAllergiesItemState extends State<AddAllergiesItem> { class _AddAllergiesItemState extends State<AddAllergiesItem> {
MasterKeyModel _selectedAllergySeverity; late MasterKeyModel _selectedAllergySeverity;
bool isSubmitted = false; bool isSubmitted = false;
@override @override
@ -48,7 +48,7 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
bool isSelected = widget.isServiceSelected(widget.item); bool isSelected = widget.isServiceSelected(widget.item);
MySelectedAllergy mySelectedAllergy; MySelectedAllergy mySelectedAllergy =MySelectedAllergy() ;
if (isSelected) { if (isSelected) {
mySelectedAllergy = widget.getServiceSelectedAllergy(widget.item); mySelectedAllergy = widget.getServiceSelectedAllergy(widget.item);
} }
@ -58,8 +58,8 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
text: isSelected text: isSelected
? mySelectedAllergy.selectedAllergySeverity != null ? mySelectedAllergy.selectedAllergySeverity != null
? projectViewModel.isArabic ? projectViewModel.isArabic
? mySelectedAllergy.selectedAllergySeverity.nameAr ? mySelectedAllergy.selectedAllergySeverity!.nameAr
: mySelectedAllergy.selectedAllergySeverity.nameEn : mySelectedAllergy.selectedAllergySeverity!.nameEn
: null : null
: null); : null);
return HeaderBodyExpandableNotifier( return HeaderBodyExpandableNotifier(
@ -71,7 +71,7 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
Checkbox( Checkbox(
value: widget.isServiceSelected(widget.item), value: widget.isServiceSelected(widget.item),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool newValue) { onChanged: (bool ?newValue) {
onTapItem(); onTapItem();
}), }),
InkWell( InkWell(
@ -97,12 +97,12 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
if (mySelectedAllergy != null) { if (mySelectedAllergy != null) {
setState(() { setState(() {
mySelectedAllergy.isExpanded = mySelectedAllergy.isExpanded =
mySelectedAllergy.isExpanded ? false : true; mySelectedAllergy.isExpanded! ? false : true;
}); });
} }
}, },
child: Icon( child: Icon(
(mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false) (mySelectedAllergy!.isExpanded!)
? EvaIcons.arrowIosUpwardOutline ? EvaIcons.arrowIosUpwardOutline
: EvaIcons.arrowIosDownwardOutline, : EvaIcons.arrowIosDownwardOutline,
color: Color(0xFF575757), color: Color(0xFF575757),
@ -142,14 +142,14 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
} }
: null, : null,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
hintText: TranslationBase.of(context).selectSeverity + "*", hintText: TranslationBase.of(context).selectSeverity! + "*",
enabled: false, enabled: false,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
height: Helpers.getTextFieldHeight(), height: Helpers.getTextFieldHeight(),
validationError: mySelectedAllergy != null && validationError: mySelectedAllergy != null &&
mySelectedAllergy.selectedAllergySeverity == null && mySelectedAllergy.selectedAllergySeverity == null &&
mySelectedAllergy.hasValidationError mySelectedAllergy!.hasValidationError!
? TranslationBase.of(context).severityValidationError ? TranslationBase.of(context).severityValidationError
: null, : null,
controller: severityController, controller: severityController,

@ -25,15 +25,15 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
MasterKeyCheckboxSearchAllergiesWidget( MasterKeyCheckboxSearchAllergiesWidget(
{Key? key, {Key? key,
this.model, required this.model,
this.addSelectedAllergy, required this.addSelectedAllergy,
this.removeAllergy, required this.removeAllergy,
this.masterList, required this.masterList,
this.addAllergy, required this.addAllergy,
this.isServiceSelected, required this.isServiceSelected,
this.buttonName, required this.buttonName,
this.hintSearchText, required this.hintSearchText,
this.getServiceSelectedAllergy}) required this.getServiceSelectedAllergy})
: super(key: key); : super(key: key);
@override @override
@ -80,7 +80,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
icon: Icon( icon: Icon(
Icons.search, Icons.search,
color: Colors.black, color: Colors.black,
)), ), onPressed: () { },),
), ),
DividerWithSpacesAround(), DividerWithSpacesAround(),
SizedBox( SizedBox(
@ -127,8 +127,8 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = []; List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((items) { dummySearchList.forEach((items) {
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || if (items.nameAr!.toLowerCase().contains(query.toLowerCase()) ||
items.nameEn.toLowerCase().contains(query.toLowerCase())) { items.nameEn!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(items); dummyListData.add(items);
} }
}); });

@ -77,11 +77,11 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
AppText( AppText(
projectViewModel.isArabic projectViewModel.isArabic
? selectedAllergy ? selectedAllergy
.selectedAllergySeverity.nameAr .selectedAllergySeverity!.nameAr
: selectedAllergy : selectedAllergy
.selectedAllergySeverity.nameEn .selectedAllergySeverity!.nameEn!
.toUpperCase(), .toUpperCase(),
textDecoration: selectedAllergy.isChecked textDecoration: selectedAllergy!.isChecked!
? null ? null
: TextDecoration.lineThrough, : TextDecoration.lineThrough,
color: Color(0xFFCC9B14), color: Color(0xFFCC9B14),
@ -132,7 +132,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
.toList(); .toList();
if (allergy.length > 0) { if (allergy.length > 0) {
if (allergy.first.isLocal) { if (allergy!.first!.isLocal!) {
setState(() { setState(() {
widget.myAllergiesList.remove(allergy.first); widget.myAllergiesList.remove(allergy.first);
}); });
@ -165,9 +165,8 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
mySelectedAllergy.forEach((element) { mySelectedAllergy.forEach((element) {
if ((widget.myAllergiesList.singleWhere( if ((widget.myAllergiesList.singleWhere(
(it) => (it) =>
it.selectedAllergy.id == it.selectedAllergy!.id ==
element.selectedAllergy.id, element.selectedAllergy!.id,)) ==
orElse: () => null)) ==
null) { null) {
widget.myAllergiesList.add(element); widget.myAllergiesList.add(element);
} }
@ -178,9 +177,8 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
widget.myAllergiesList.forEach((element) { widget.myAllergiesList.forEach((element) {
if ((mySelectedAllergy.singleWhere( if ((mySelectedAllergy.singleWhere(
(it) => (it) =>
it.selectedAllergy.id == it.selectedAllergy!.id ==
element.selectedAllergy.id, element.selectedAllergy!.id)) ==
orElse: () => null)) ==
null) { null) {
removedList.add(element); removedList.add(element);
} }

@ -59,7 +59,7 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: appBar:
BottomSheetTitle(title: TranslationBase.of(context).addHistory), BottomSheetTitle(title: TranslationBase.of(context).addHistory!),
body: Center( body: Center(
child: Container( child: Container(
child: Column( child: Column(

@ -70,9 +70,9 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget> with TickerPr
letterSpacing: -0.48,), letterSpacing: -0.48,),
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
), ),
if (myHistory.isChecked) if (myHistory!.isChecked!)
RemoveButton( RemoveButton(
onTap: () => removeHistory(myHistory.selectedHistory), onTap: () => removeHistory(myHistory!.selectedHistory!),
) )
], ],
), ),
@ -97,7 +97,7 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget> with TickerPr
.toList(); .toList();
if (history.length > 0){ if (history.length > 0){
if (history.first.isLocal) { if (history!.first!.isLocal!) {
setState(() { setState(() {
widget.myHistoryList.remove(history.first); widget.myHistoryList.remove(history.first);
}); });

@ -481,7 +481,6 @@ class _ActivationPageState extends State<ActivationPage> {
sendActivationCode(type) async { sendActivationCode(type) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.model.sendActivationCodeByOTPNotificationType(otpType: type); await widget.model.sendActivationCodeByOTPNotificationType(otpType: type);
if (widget.model.state == ViewState.ErrorLocal) { if (widget.model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.model.error); Helpers.showErrorToast(widget.model.error);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -99,9 +99,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
offTime = widget.updateData != null offTime = widget.updateData != null ? widget.updateData.requisitionType.toString() : offTime;
? widget.updateData.requisitionType.toString()
: offTime;
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(), onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => BaseView<SickLeaveViewModel>( builder: (_, model, w) => BaseView<SickLeaveViewModel>(
@ -129,141 +127,21 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
widthFactor: 0.9, widthFactor: 0.9,
child: ListView( child: ListView(
children: [ children: [
// Container(
// margin: EdgeInsets.all(8),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.all(
// Radius.circular(6.0)),
// border: Border.all(
// width: 1.0,
// color: HexColor("#CCCCCC"))),
// width: double.infinity,
// child: Padding(
// padding: EdgeInsets.only(
// top: SizeConfig.widthMultiplier * 0.9,
// bottom:
// SizeConfig.widthMultiplier * 0.9,
// right: SizeConfig.widthMultiplier * 3,
// left: SizeConfig.widthMultiplier * 3),
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Row(
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// Expanded(
// // add Expanded to have your dropdown button fill remaining space
// child:
// DropdownButtonHideUnderline(
// child: new IgnorePointer(
// ignoring: true,
// child: DropdownButton(
// focusColor:
// Colors.grey,
// isExpanded: true,
// dropdownColor:
// Colors.grey,
// value: getClinicName(
// model) ??
// "",
// iconSize: 0,
// elevation: 16,
// selectedItemBuilder:
// (BuildContext
// context) {
// return model
// .getClinicNameList()
// .map((item) {
// return Row(
// mainAxisSize:
// MainAxisSize
// .max,
// children: <
// Widget>[
// AppText(
// item,
// fontSize:
// SizeConfig.textMultiplier *
// 2.1,
// color: Colors
// .grey[
// 500],
// ),
// ],
// );
// }).toList();
// },
// onChanged:
// (newValue) =>
// {},
// items: model
// .getClinicNameList()
// .map((item) {
// return DropdownMenuItem(
// value: item
// .toString(),
// child: Text(
// item,
// textAlign:
// TextAlign
// .end,
// ),
// );
// }).toList(),
// ))),
// ),
// ],
// )
// ],
// ),
// )),
// Container(
// margin: EdgeInsets.all(8),
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.all(Radius.circular(6.0)),
// border: Border.all(
// width: 1.0,
// color: HexColor("#CCCCCC"))),
// padding: EdgeInsets.all(5),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// new IgnorePointer(
// ignoring: true,
// child: AppTextFormField(
// readOnly: true,
// hintText: profile != null
// ? profile['DoctorName']
// : "",
// borderColor: Colors.white,
// onSaved: (value) {},
// inputFormatter: ONLY_NUMBERS))
// ],
// ),
// ),
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: bottom: SizeConfig.widthMultiplier * 0.9,
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -271,35 +149,22 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2.allOffTime.length > 0 model2.allOffTime.length > 0
? Expanded( ? Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: child: DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: DropdownButton(
child:
DropdownButton(
// focusColor: Colors.grey, // focusColor: Colors.grey,
isExpanded: true, isExpanded: true,
value: offTime == null value: offTime == null ? model2.allOffTime[0]['code'] : offTime,
? model2.allOffTime[0]
['code']
: offTime,
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder: (BuildContext context) {
(BuildContext return model2.allOffTime.map((item) {
context) {
return model2.allOffTime
.map((item) {
return Row( return Row(
mainAxisSize: mainAxisSize: MainAxisSize.max,
MainAxisSize
.max,
children: <Widget>[ children: <Widget>[
AppText( AppText(
item[ item['description'],
'description'],
fontSize: SizeConfig fontSize: SizeConfig.textMultiplier * 2.1,
.textMultiplier *
2.1,
// color: // color:
// Colors.grey, // Colors.grey,
), ),
@ -313,29 +178,21 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
}); });
if (offTime == '1') { if (offTime == '1') {
model2.getReasons(18); model2.getReasons(18);
} else if (offTime == } else if (offTime == '2') {
'2') {
model2.getReasons(19); model2.getReasons(19);
} else if (offTime == } else if (offTime == '3' || offTime == '5') {
'3' || model2.getReasons(102);
offTime == '5') {
model2
.getReasons(102);
setState(() { setState(() {
offTime = newValue; offTime = newValue;
}); });
} }
}, },
items: model2.allOffTime items: model2.allOffTime.map((item) {
.map((item) { return DropdownMenuItem<String>(
return DropdownMenuItem< value: item['code'].toString(),
String>(
value: item['code']
.toString(),
child: Text( child: Text(
item['description'], item['description'],
textAlign: textAlign: TextAlign.end,
TextAlign.end,
), ),
); );
}).toList(), }).toList(),
@ -353,38 +210,24 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppTextFormField( AppTextFormField(
hintText: TranslationBase.of( hintText: TranslationBase.of(context).fromDate,
context)
.fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(icon: Icon(Icons.calendar_today), onPressed: () { },),
icon: Icon( textInputType: TextInputType.number,
Icons.calendar_today),
onPressed: () {}),
textInputType:
TextInputType.number,
controller: _toDateController, controller: _toDateController,
onTap: () { onTap: () {
_presentDatePicker( _presentDatePicker('fromDate');
'fromDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (val) => onChanged: (val) => fromDate = val,
fromDate = val, onSaved: (val) => fromDate = val,
onSaved: (val) =>
fromDate = val,
) )
], ],
)), )),
@ -394,37 +237,24 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Container( child: Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all( border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
Radius.circular(
6.0)),
border: Border.all(
width: 1.0,
color: HexColor(
"#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
DateTimePicker( DateTimePicker(
timeHintText: timeHintText: TranslationBase.of(context).fromTime,
TranslationBase.of( type: DateTimePickerType.time,
context)
.fromTime,
type: DateTimePickerType
.time,
controller: _controller4, controller: _controller4,
onChanged: (val) => onChanged: (val) => fromTime = val,
fromTime = val,
validator: (val) { validator: (val) {
print(val); print(val);
// setState( // setState(
// () => _valueToValidate4 = val); // () => _valueToValidate4 = val);
return null; return null;
}, },
onSaved: (val) => onSaved: (val) => fromTime = val!,
fromTime = val!,
) )
], ],
), ),
@ -434,37 +264,24 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Container( child: Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all( border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
Radius.circular(
6.0)),
border: Border.all(
width: 1.0,
color: HexColor(
"#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
DateTimePicker( DateTimePicker(
timeHintText: timeHintText: TranslationBase.of(context).toTime,
TranslationBase.of( type: DateTimePickerType.time,
context)
.toTime,
type: DateTimePickerType
.time,
controller: _controller5, controller: _controller5,
onChanged: (val) => onChanged: (val) => toTime = val,
toTime = val,
validator: (val) { validator: (val) {
print(val); print(val);
// setState( // setState(
// () => _valueToValidate4 = val); // () => _valueToValidate4 = val);
return null; return null;
}, },
onSaved: (val) => onSaved: (val) => toTime = val!,
toTime = val!,
) )
], ],
), ),
@ -479,35 +296,21 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppTextFormField( AppTextFormField(
hintText: hintText: TranslationBase.of(context).fromDate,
TranslationBase.of(
context)
.fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(icon: Icon(Icons.calendar_today), onPressed: () { },),
icon: Icon(Icons textInputType: TextInputType.number,
.calendar_today),
onPressed: () {}),
textInputType:
TextInputType.number,
readOnly: true, readOnly: true,
controller: controller: _toDateController,
_toDateController,
onTap: () { onTap: () {
_presentDatePicker( _presentDatePicker('fromDate');
'fromDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (value) { onChanged: (value) {
@ -520,36 +323,21 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppTextFormField( AppTextFormField(
hintText: hintText: TranslationBase.of(context).toDate,
TranslationBase.of(
context)
.toDate,
readOnly: true, readOnly: true,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(icon: Icon(Icons.calendar_today), onPressed: () { },),
icon: Icon( textInputType: TextInputType.number,
Icons.calendar_today), controller: _toDateController2,
onPressed: () {},
),
textInputType:
TextInputType.number,
controller:
_toDateController2,
onTap: () { onTap: () {
_presentDatePicker( _presentDatePicker('toDate');
'toDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (value) { onChanged: (value) {
@ -564,22 +352,17 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: bottom: SizeConfig.widthMultiplier * 0.9,
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -587,39 +370,23 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2.allReasons.length > 0 model2.allReasons.length > 0
? Expanded( ? Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: child: DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: DropdownButton(
child:
DropdownButton(
focusColor: Colors.grey, focusColor: Colors.grey,
isExpanded: true, isExpanded: true,
value: model2 value: model2.allReasons[0]['id'].toString() ?? "",
.allReasons[0]
['id']
.toString() ??
"",
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder: (BuildContext context) {
(BuildContext return model2.allReasons.map((item) {
context) {
return model2.allReasons
.map((item) {
return Row( return Row(
mainAxisSize: mainAxisSize: MainAxisSize.max,
MainAxisSize
.max,
children: <Widget>[ children: <Widget>[
AppText( AppText(
projectsProvider projectsProvider.isArabic
.isArabic ? item['nameAr']
? item[ : item['nameEn'],
'nameAr'] fontSize: SizeConfig.textMultiplier * 2.1,
: item[
'nameEn'],
fontSize: SizeConfig
.textMultiplier *
2.1,
// color: // color:
// Colors.grey, // Colors.grey,
), ),
@ -632,20 +399,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
reason = newValue; reason = newValue;
}) })
}, },
items: model2.allReasons items: model2.allReasons.map((item) {
.map((item) { return DropdownMenuItem<String>(
return DropdownMenuItem< value: item['id'].toString(),
String>(
value: item['id']
.toString(),
child: Text( child: Text(
projectsProvider projectsProvider.isArabic ? item['nameAr'] : item['nameEn'],
.isArabic textAlign: TextAlign.end,
? item['nameAr']
: item[
'nameEn'],
textAlign:
TextAlign.end,
), ),
); );
}).toList(), }).toList(),
@ -661,92 +420,55 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: bottom: SizeConfig.widthMultiplier * 0.9,
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
model2.coveringDoctors.length > 0 if (model2.coveringDoctors.length > 0) Expanded(
? Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownSearch( child: DropdownSearch(
mode: Mode.BOTTOM_SHEET, mode: Mode.BOTTOM_SHEET,
dropdownSearchDecoration: dropdownSearchDecoration: InputDecoration(
InputDecoration( contentPadding: EdgeInsets.all(0), border: InputBorder.none),
contentPadding:
EdgeInsets
.all(0),
border:
InputBorder
.none),
//maxHeight: 300, //maxHeight: 300,
items: model2 items: model2.coveringDoctors.map((item) {
.coveringDoctors return projectsProvider.isArabic
.map((item) { ? item['doctorNameN']
return projectsProvider : item['doctorName'];
.isArabic
? item[
'doctorNameN']
: item[
'doctorName'];
}).toList(), }).toList(),
// label: "Doctor List", // label: "Doctor List",
onChanged: (item) { onChanged: (item) {
model2.coveringDoctors model2.coveringDoctors.forEach((newVal) => {
.forEach( if (newVal['doctorName'] == item)
(newVal) => { doctorID = newVal['DoctorID']
if (newVal[
'doctorName'] ==
item)
doctorID =
newVal['DoctorID']
}); });
}, },
selectedItem: selectedItem: getSelectedDoctor(model2),
getSelectedDoctor(
model2),
showSearchBox: true, showSearchBox: true,
searchBoxDecoration: searchBoxDecoration: InputDecoration(
InputDecoration( border: OutlineInputBorder(),
border: contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0),
OutlineInputBorder(), labelText: "Search Doctor",
contentPadding:
EdgeInsets.fromLTRB(
12, 12, 8, 0),
labelText:
"Search Doctor",
), ),
popupTitle: Container( popupTitle: Container(
height: 50, height: 50,
decoration: decoration: BoxDecoration(
BoxDecoration( color: Theme.of(context).primaryColorDark,
color: Theme.of( borderRadius: BorderRadius.only(
context) topLeft: Radius.circular(20),
.primaryColorDark, topRight: Radius.circular(20),
borderRadius:
BorderRadius.only(
topLeft:
Radius.circular(
20),
topRight:
Radius.circular(
20),
), ),
), ),
child: Center( child: Center(
@ -754,91 +476,20 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
'', '',
style: TextStyle( style: TextStyle(
fontSize: 24, fontSize: 24,
fontWeight: fontWeight: FontWeight.bold,
FontWeight color: Colors.white,
.bold,
color:
Colors.white,
), ),
), ),
), ),
), ),
popupShape: popupShape: RoundedRectangleBorder(
RoundedRectangleBorder( borderRadius: BorderRadius.only(
borderRadius: topLeft: Radius.circular(24),
BorderRadius.only( topRight: Radius.circular(24),
topLeft:
Radius.circular(
24),
topRight:
Radius.circular(
24),
), ),
), ),
), ),
// DropdownButtonHideUnderline( ) else SizedBox(),
// child: DropdownButton(
// focusColor: Colors.grey,
// isExpanded: true,
// value: doctorID == null
// ? model2
// .coveringDoctors[0]
// ['doctorID']
// .toString()
// : doctorID,
// iconSize: 40,
// elevation: 16,
// selectedItemBuilder:
// (BuildContext context) {
// return model2
// .coveringDoctors
// .map((item) {
// return Row(
// mainAxisSize:
// MainAxisSize.max,
// children: <Widget>[
// AppText(
// projectsProvider
// .isArabic
// ? item[
// 'doctorNameN']
// : item[
// 'doctorName'],
// fontSize: SizeConfig
// .textMultiplier *
// 2.1,
// ),
// ],
// );
// }).toList();
// },
// onChanged: (newValue) => {
// setState(() {
// doctorID = newValue;
// })
// },
// items: model2
// .coveringDoctors
// .map((item) {
// return DropdownMenuItem<
// String>(
// value: item['doctorID']
// .toString(),
// child: Text(
// projectsProvider
// .isArabic
// ? item[
// 'doctorNameN']
// : item[
// 'doctorName'],
// textAlign:
// TextAlign.start,
// ),
// );
// }).toList(),
// )),
)
: SizedBox(),
], ],
) )
], ],
@ -846,17 +497,14 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
)), )),
SizedBox(height: SizeConfig.screenHeight * .3), SizedBox(height: SizeConfig.screenHeight * .3),
Container( Container(
margin: EdgeInsets.all( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
SizeConfig.widthMultiplier * 5),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: widget.isUpdate == true title: widget.isUpdate == true
? TranslationBase.of(context) ? TranslationBase.of(context).updateReschedule
.updateReschedule : TranslationBase.of(context).addReschedule,
: TranslationBase.of(context)
.addReschedule,
color: HexColor('#359846'), color: HexColor('#359846'),
onPressed: () { onPressed: () {
if (offTime == '1' || offTime == '2') { if (offTime == '1' || offTime == '2') {
@ -866,9 +514,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
addRecheduleLeave(model2); addRecheduleLeave(model2);
} }
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday);
TranslationBase.of(context)
.onlyOfftimeHoliday);
} }
}, },
), ),
@ -901,16 +547,13 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
final df = new DateFormat('HH:mm:ss'); final df = new DateFormat('HH:mm:ss');
final dateFormat = new DateFormat('yyyy-MM-dd'); final dateFormat = new DateFormat('yyyy-MM-dd');
this.offTime = widget.updateData.requisitionType.toString(); this.offTime = widget.updateData.requisitionType.toString();
_toDateController.text = _toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom));
dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom));
//df.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom));
this.fromTime = this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom));
df.format(DateTime.parse(widget.updateData.dateTimeFrom));
this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3);
this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo));
this.toTime = this.toTime.substring(0, this.toTime.length - 3); this.toTime = this.toTime.substring(0, this.toTime.length - 3);
_toDateController2.text = _toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo));
dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo));
_controller5.text = toTime; _controller5.text = toTime;
_controller4.text = fromTime; _controller4.text = fromTime;
toDate = _toDateController2.text; toDate = _toDateController2.text;
@ -923,8 +566,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
getClinicName(model) { getClinicName(model) {
var clinicID = this.profile['ClinicID'] ?? 1; var clinicID = this.profile['ClinicID'] ?? 1;
var clinicInfo = var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList();
model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList();
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
} }
@ -934,16 +576,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
var fromDates = fromDate; var fromDates = fromDate;
var toDates = toDate; var toDates = toDate;
if (offTime == '1') { if (offTime == '1') {
fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + fromDate = df.format(
'T' + DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime + ':' + DateTime.now().second.toString()));
fromTime + toDate = df
':' + .format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime + ':' + DateTime.now().second.toString()));
DateTime.now().second.toString()));
toDate = df.format(DateTime.parse(dateFormat.format(fromDates) +
'T' +
toTime +
':' +
DateTime.now().second.toString()));
} else { } else {
fromDate = df.format(fromDates); fromDate = df.format(fromDates);
toDate = df.format(toDates); toDate = df.format(toDates);
@ -958,8 +594,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"dateTimeTo": toDate, "dateTimeTo": toDate,
"date": offTime == '1' ? fromDate : df.format(DateTime.now()), "date": offTime == '1' ? fromDate : df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId": "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
"status": 2, "status": 2,
"schedule": [ "schedule": [
{ {
@ -982,8 +617,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(), builder: (context) => AddRescheduleLeavScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen')
settings: RouteSettings(name: 'AddRescheduleLeaveScreen')
// MyReferredPatient(), // MyReferredPatient(),
), ),
); );
@ -998,21 +632,13 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
dynamic fromDates = fromDate; dynamic fromDates = fromDate;
dynamic toDates = toDate; dynamic toDates = toDate;
if (offTime == '1') { if (offTime == '1') {
fromDate = df.format(DateTime.parse(_toDateController.text)) + fromDate =
'T' + df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString();
fromTime +
':' +
DateTime.now().second.toString();
toDate = df.format(DateTime.parse(_toDateController2.text)) +
'T' +
toTime +
':' +
DateTime.now().second.toString();
} else {
fromDate = df.format(
fromDates is DateTime ? fromDates : DateTime.parse(fromDates));
toDate = toDate =
df.format(toDates is DateTime ? toDates : DateTime.parse(toDates)); df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime + ':' + DateTime.now().second.toString();
} else {
fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates));
toDate = df.format(toDates is DateTime ? toDates : DateTime.parse(toDates));
} }
Map<String, dynamic> request = { Map<String, dynamic> request = {
@ -1025,8 +651,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"dateTimeTo": toDate, "dateTimeTo": toDate,
"date": offTime == '1' ? fromDate : df.format(DateTime.now()), "date": offTime == '1' ? fromDate : df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId": "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
"status": 2, "status": 2,
"schedule": [ "schedule": [
{ {
@ -1064,8 +689,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
: model2.coveringDoctors[0]['doctorName']; : model2.coveringDoctors[0]['doctorName'];
else { else {
model2.coveringDoctors.forEach((newVal) => { model2.coveringDoctors.forEach((newVal) => {
if (newVal['doctorID'].toString() == doctorID) if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']}
{doctorName = newVal['doctorName']}
}); });
return doctorName; return doctorName;
} }

@ -8,8 +8,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ProfileMedicalInfoWidgetSearch extends StatefulWidget { class ProfileMedicalInfoWidgetSearch extends StatefulWidget {
final String from; final String? from;
final String to; final String? to;
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
final String? arrivalType; final String? arrivalType;
@ -21,8 +21,8 @@ class ProfileMedicalInfoWidgetSearch extends StatefulWidget {
required this.patient, required this.patient,
required this.patientType, required this.patientType,
this.arrivalType, this.arrivalType,
required this.from, this.from,
required this.to, this.to,
this.isInpatient = false, this.isInpatient = false,
this.isDischargedPatient}); this.isDischargedPatient});

@ -35,7 +35,7 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.8.2" version: "2.8.1"
autocomplete_textfield: autocomplete_textfield:
dependency: "direct main" dependency: "direct main"
description: description:
@ -154,7 +154,7 @@ packages:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.1.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
@ -315,7 +315,7 @@ packages:
name: dropdown_search name: dropdown_search
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.3" version: "2.0.1"
equatable: equatable:
dependency: transitive dependency: transitive
description: description:
@ -769,7 +769,7 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.11" version: "0.12.10"
meta: meta:
dependency: transitive dependency: transitive
description: description:
@ -1173,7 +1173,7 @@ packages:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.3" version: "0.4.2"
timing: timing:
dependency: transitive dependency: transitive
description: description:
@ -1257,7 +1257,7 @@ packages:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.1" version: "2.1.0"
video_player: video_player:
dependency: transitive dependency: transitive
description: description:

@ -45,7 +45,7 @@ dependencies:
#Icons #Icons
eva_icons_flutter: ^3.0.0 eva_icons_flutter: ^3.0.0
font_awesome_flutter: ^9.0.0 font_awesome_flutter: ^9.0.0
dropdown_search: ^0.6.1 dropdown_search: ^2.0.1
flutter_staggered_grid_view: ^0.4.0 flutter_staggered_grid_view: ^0.4.0
expandable: ^5.0.1 expandable: ^5.0.1

Loading…
Cancel
Save