finish Admission request new design

merge-requests/394/head
mosazaid 5 years ago
parent 1f70498982
commit f280ed731d

@ -287,6 +287,7 @@ const Map<String, Map<String, String>> localizedValues = {
'room': {'en': 'ROOM:', 'ar': 'الغرفة'}, 'room': {'en': 'ROOM:', 'ar': 'الغرفة'},
'bed': {'en': 'BED:', 'ar': 'السرير'}, 'bed': {'en': 'BED:', 'ar': 'السرير'},
'next': {'en': 'Next', 'ar': 'التالي'}, 'next': {'en': 'Next', 'ar': 'التالي'},
'previous': {'en': 'PREVIOUS', 'ar': 'السابق'},
'healthRecordInformation': { 'healthRecordInformation': {
'en': 'HEALTH RECORD INFORMATION', 'en': 'HEALTH RECORD INFORMATION',
'ar': 'معلومات السجل الصحي' 'ar': 'معلومات السجل الصحي'
@ -705,7 +706,7 @@ const Map<String, Map<String, String>> localizedValues = {
'ar': " : استجابة الإحالة" 'ar': " : استجابة الإحالة"
}, },
'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"}, 'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"},
'diagnosisDetail': {'en': "Diagnosis Detail : ", 'ar': "تفاصيل التشخيص"}, 'diagnosisDetail': {'en': "Diagnosis Details", 'ar': "تفاصيل التشخيص"},
'referralSuccessMsgAccept': { 'referralSuccessMsgAccept': {
'en': "Referral Accepted Successfully", 'en': "Referral Accepted Successfully",
'ar': "تم قبول الإحالة بنجاح" 'ar': "تم قبول الإحالة بنجاح"

@ -96,8 +96,8 @@ class _AdmissionRequestThirdScreenState
), ),
), ),
Container( Container(
margin: EdgeInsets.symmetric( margin:
vertical: 0, horizontal: 16), EdgeInsets.symmetric(vertical: 0, horizontal: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -112,25 +112,20 @@ class _AdmissionRequestThirdScreenState
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
hintText: "test field", hintText: TranslationBase.of(context).clinic,
isDropDown: true, isDropDown: true,
controller: _sickLeaveCommentsController, dropDownText: _selectedClinic != null
), ? _selectedClinic['clinicGroupName']
SizedBox( : null,
height: 10, enabled: false,
), onClick: model.clinicList != null &&
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.clinicList != null &&
model.clinicList.length > 0 model.clinicList.length > 0
? () { ? () {
openListDialogField( openListDialogField(
'clinicGroupName', 'clinicGroupName',
'clinicID', 'clinicID',
model.clinicList, model.clinicList, (selectedValue) {
(selectedValue) {
setState(() { setState(() {
_selectedClinic = selectedValue; _selectedClinic = selectedValue;
}); });
@ -147,11 +142,9 @@ class _AdmissionRequestThirdScreenState
openListDialogField( openListDialogField(
'clinicGroupName', 'clinicGroupName',
'clinicID', 'clinicID',
model.clinicList, model.clinicList, (selectedValue) {
(selectedValue) {
setState(() { setState(() {
_selectedClinic = _selectedClinic = selectedValue;
selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state ==
@ -163,64 +156,45 @@ class _AdmissionRequestThirdScreenState
"Empty List"); "Empty List");
} }
}, },
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.clinic,
_selectedClinic != null
? _selectedClinic[
'clinicGroupName']
: null,
true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText: TranslationBase.of(context).doctor,
onTap: _selectedClinic != null isDropDown: true,
dropDownText: _selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
enabled: false,
onClick: _selectedClinic != null
? model.doctorsList != null && ? model.doctorsList != null &&
model.doctorsList.length > 0 model.doctorsList.length > 0
? () { ? () {
openListDialogField( openListDialogField('DoctorName',
'DoctorName', 'DoctorID', model.doctorsList,
'DoctorID',
model.doctorsList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDoctor = _selectedDoctor = selectedValue;
selectedValue;
}); });
}); });
} }
: () async { : () async {
GifLoaderDialogUtils GifLoaderDialogUtils.showMyDialog(
.showMyDialog(context); context);
await model await model
.getClinicDoctors( .getClinicDoctors(
_selectedClinic[ _selectedClinic['clinicID'])
'clinicID']) .then((_) => GifLoaderDialogUtils
.then((_) => .hideDialog(context));
GifLoaderDialogUtils if (model.state == ViewState.Idle &&
.hideDialog( model.doctorsList.length > 0) {
context)); openListDialogField('DoctorName',
if (model.state == 'DoctorID', model.doctorsList,
ViewState.Idle &&
model.doctorsList.length >
0) {
openListDialogField(
'DoctorName',
'DoctorID',
model.doctorsList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDoctor = _selectedDoctor = selectedValue;
selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state ==
@ -233,27 +207,15 @@ class _AdmissionRequestThirdScreenState
} }
} }
: null, : null,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.doctor,
_selectedDoctor != null
? _selectedDoctor[
'DoctorName']
: null,
true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 16, height: 16,
), ),
AppText( AppText(
TranslationBase.of(context).patientDetails, TranslationBase.of(context).patientDetails,
fontWeight: FontWeight.bold, fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.w700,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -262,82 +224,79 @@ class _AdmissionRequestThirdScreenState
title: AppText( title: AppText(
TranslationBase.of(context).patientPregnant, TranslationBase.of(context).patientPregnant,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1, fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
), ),
value: _patientPregnant, value: _patientPregnant,
activeColor: HexColor("#D02127"),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
_patientPregnant = newValue; _patientPregnant = newValue;
}); });
}, },
controlAffinity: controlAffinity: ListTileControlAffinity.leading,
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0), contentPadding: EdgeInsets.all(0),
), ),
CheckboxListTile( CheckboxListTile(
title: AppText( title: AppText(
TranslationBase.of(context) TranslationBase.of(context).isSickLeaveRequired,
.isSickLeaveRequired,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1, fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
), ),
value: _isSickLeaveRequired, value: _isSickLeaveRequired,
activeColor: HexColor("#D02127"),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
_isSickLeaveRequired = newValue; _isSickLeaveRequired = newValue;
}); });
}, },
controlAffinity: controlAffinity: ListTileControlAffinity.leading,
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0), contentPadding: EdgeInsets.all(0),
), ),
Container( AppTextFieldCustom(
child: TextField( hintText:
decoration: TranslationBase.of(context).sickLeaveComments,
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.sickLeaveComments,
null,
false),
enabled: true,
controller: _sickLeaveCommentsController, controller: _sickLeaveCommentsController,
keyboardType: TextInputType.text,
minLines: 2, minLines: 2,
maxLines: 4, maxLines: 4,
)), inputType: TextInputType.multiline,
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText: TranslationBase.of(context).dietType,
onTap: model.dietTypesList != null && isDropDown: true,
dropDownText: _selectedDietType != null
? _selectedDietType['nameEn']
: null,
enabled: false,
onClick: model.dietTypesList != null &&
model.dietTypesList.length > 0 model.dietTypesList.length > 0
? () { ? () {
openListDialogField('nameEn', 'id', openListDialogField(
model.dietTypesList, 'nameEn', 'id', model.dietTypesList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDietType = _selectedDietType = selectedValue;
selectedValue;
}); });
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(
context); context);
await model.getDietTypes().then( await model.getDietTypes().then((_) =>
(_) => GifLoaderDialogUtils GifLoaderDialogUtils.hideDialog(
.hideDialog(context)); context));
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.dietTypesList.length > model.dietTypesList.length > 0) {
0) { openListDialogField(
openListDialogField('nameEn', 'nameEn', 'id', model.dietTypesList,
'id', model.dietTypesList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDietType = _selectedDietType = selectedValue;
selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state ==
@ -349,70 +308,38 @@ class _AdmissionRequestThirdScreenState
"Empty List"); "Empty List");
} }
}, },
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.dietType,
_selectedDietType != null
? _selectedDietType['nameEn']
: null,
true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
child: TextField( hintText:
decoration: TranslationBase.of(context).dietTypeRemarks,
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.dietTypeRemarks,
null,
false),
enabled: true,
controller: _dietTypeRemarksController, controller: _dietTypeRemarksController,
keyboardType: TextInputType.text,
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
)), inputType: TextInputType.multiline,
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
child: TextField( hintText: TranslationBase.of(context).pastMedicalHistory,
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.pastMedicalHistory,
null,
false),
enabled: true,
controller: _postMedicalHistoryController, controller: _postMedicalHistoryController,
keyboardType: TextInputType.text, minLines: 4,
minLines: 2, maxLines: 6,
maxLines: 4, inputType: TextInputType.multiline,
)), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
child: TextField( hintText: TranslationBase.of(context).pastSurgicalHistory,
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.pastSurgicalHistory,
null,
false),
enabled: true,
controller: _postSurgicalHistoryController, controller: _postSurgicalHistoryController,
keyboardType: TextInputType.text,
minLines: 2, minLines: 2,
maxLines: 4, maxLines: 4,
)), inputType: TextInputType.multiline,
),
], ],
), ),
), ),
@ -424,7 +351,7 @@ class _AdmissionRequestThirdScreenState
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton( child: AppButton(
title: TranslationBase.of(context).next, title: TranslationBase.of(context).next,
color: HexColor("#B8382B"), color: HexColor("#D02127"),
onPressed: () { onPressed: () {
model.admissionRequestData = AdmissionRequest(); model.admissionRequestData = AdmissionRequest();
if (_selectedClinic != null && if (_selectedClinic != null &&
@ -436,8 +363,7 @@ class _AdmissionRequestThirdScreenState
patient.patientMRN; patient.patientMRN;
model.admissionRequestData.appointmentNo = model.admissionRequestData.appointmentNo =
patient.appointmentNo; patient.appointmentNo;
model.admissionRequestData.episodeID = model.admissionRequestData.episodeID = patient.episodeNo;
patient.episodeNo;
model.admissionRequestData.admissionRequestNo = 0; model.admissionRequestData.admissionRequestNo = 0;
model.admissionRequestData.admitToClinic = model.admissionRequestData.admitToClinic =
@ -445,8 +371,7 @@ class _AdmissionRequestThirdScreenState
model.admissionRequestData.mrpDoctorID = model.admissionRequestData.mrpDoctorID =
_selectedDoctor['DoctorID']; _selectedDoctor['DoctorID'];
model.admissionRequestData.isPregnant = model.admissionRequestData.isPregnant = _patientPregnant;
_patientPregnant;
model.admissionRequestData.isSickLeaveRequired = model.admissionRequestData.isSickLeaveRequired =
_isSickLeaveRequired; _isSickLeaveRequired;
model.admissionRequestData.sickLeaveComments = model.admissionRequestData.sickLeaveComments =
@ -463,10 +388,11 @@ class _AdmissionRequestThirdScreenState
_postMedicalHistoryController.text; _postMedicalHistoryController.text;
model.admissionRequestData.pastSurgicalHistory = model.admissionRequestData.pastSurgicalHistory =
_postSurgicalHistoryController.text; _postSurgicalHistoryController.text;
Navigator.of(context).pushNamed( Navigator.of(context)
PATIENT_ADMISSION_REQUEST_2, .pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {
arguments: {
'patient': patient, 'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'admission-data': model.admissionRequestData 'admission-data': model.admissionRequestData
}); });
} else { } else {

@ -7,11 +7,12 @@ import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-view
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -32,11 +33,6 @@ class AdmissionRequestThirdScreen extends StatefulWidget {
class _AdmissionRequestThirdScreenState class _AdmissionRequestThirdScreenState
extends State<AdmissionRequestThirdScreen> { extends State<AdmissionRequestThirdScreen> {
final _treatmentLineController = TextEditingController();
final _complicationsController = TextEditingController();
final _otherProceduresController = TextEditingController();
dynamic _selectedAdmissionType;
dynamic _selectedDiagnosis; dynamic _selectedDiagnosis;
dynamic _selectedIcd; dynamic _selectedIcd;
dynamic _selectedDiagnosisType; dynamic _selectedDiagnosisType;
@ -45,6 +41,8 @@ class _AdmissionRequestThirdScreenState
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'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
AdmissionRequest admissionRequest = routeArgs['admission-data']; AdmissionRequest admissionRequest = routeArgs['admission-data'];
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
@ -53,6 +51,7 @@ class _AdmissionRequestThirdScreenState
return BaseView<AdmissionRequestViewModel>( return BaseView<AdmissionRequestViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false,
appBarTitle: TranslationBase.of(context).admissionRequest, appBarTitle: TranslationBase.of(context).admissionRequest,
body: GestureDetector( body: GestureDetector(
onTap: () { onTap: () {
@ -68,130 +67,51 @@ class _AdmissionRequestThirdScreenState
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
PatientPageHeaderWidget(patient), PatientProfileHeaderNewDesign(
patient, patientType, arrivalType),
Container( Container(
margin: margin: EdgeInsets.all(16.0),
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( AppText(
height: 10, "${TranslationBase.of(context).admission}",
), fontFamily: 'Poppins',
Container( fontSize: SizeConfig.textMultiplier * 1.6,
child: TextField( fontWeight: FontWeight.w600,
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).treatmentLine,
null,
false),
enabled: true,
controller: _treatmentLineController,
keyboardType: TextInputType.text,
minLines: 3,
maxLines: 5,
)),
SizedBox(
height: 10,
), ),
Container( AppText(
child: TextField( "${TranslationBase.of(context).request}",
decoration: Helpers.textFieldSelectorDecoration( fontFamily: 'Poppins',
TranslationBase.of(context).complications, fontSize: SizeConfig.textMultiplier * 3,
null, fontWeight: FontWeight.bold,
false), )
enabled: true, ],
controller: _complicationsController,
keyboardType: TextInputType.text,
minLines: 3,
maxLines: 5,
)),
SizedBox(
height: 10,
), ),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).otherProcedure,
null,
false),
enabled: true,
controller: _otherProceduresController,
keyboardType: TextInputType.text,
minLines: 3,
maxLines: 5,
)),
SizedBox(
height: 10,
), ),
Container( Container(
height: screenSize.height * 0.070, margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16),
child: InkWell( child: Column(
onTap: model.admissionTypeList != null && crossAxisAlignment: CrossAxisAlignment.start,
model.admissionTypeList.length > 0 children: [
? () {
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType =
selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getMasterLookup(MasterKeysService
.AdmissionRequestType)
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.admissionTypeList.length > 0) {
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).admissionType,
_selectedAdmissionType != null
? _selectedAdmissionType['nameEn']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 16,
),
AppText( AppText(
TranslationBase.of(context).diagnosisDetail, TranslationBase.of(context).diagnosisDetail,
fontWeight: FontWeight.bold, fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.w700,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText: TranslationBase.of(context).diagnosis,
onTap: model.diagnosisTypesList != null && dropDownText: _selectedDiagnosis != null
? _selectedDiagnosis['nameEn']
: null,
enabled: false,
isDropDown: true,
onClick: model.diagnosisTypesList != null &&
model.diagnosisTypesList.length > 0 model.diagnosisTypesList.length > 0
? () { ? () {
openListDialogField('nameEn', 'id', openListDialogField('nameEn', 'id',
@ -203,8 +123,7 @@ class _AdmissionRequestThirdScreenState
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context);
await model.getDiagnosis().then((_) => await model.getDiagnosis().then((_) =>
GifLoaderDialogUtils.hideDialog( GifLoaderDialogUtils.hideDialog(
context)); context));
@ -219,31 +138,25 @@ class _AdmissionRequestThirdScreenState
}); });
} else if (model.state == } else if (model.state ==
ViewState.ErrorLocal) { ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(model.error);
model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
"Empty List"); "Empty List");
} }
}, },
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).diagnosis,
_selectedDiagnosis != null
? _selectedDiagnosis['nameEn']
: null,
true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText: TranslationBase.of(context).icd,
onTap: model.icdCodes != null && dropDownText: _selectedIcd != null
? _selectedIcd['description']
: null,
enabled: false,
isDropDown: true,
onClick: model.icdCodes != null &&
model.icdCodes.length > 0 model.icdCodes.length > 0
? () { ? () {
openListDialogField( openListDialogField(
@ -255,8 +168,7 @@ class _AdmissionRequestThirdScreenState
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context);
await model await model
.getICDCodes(patient.patientMRN) .getICDCodes(patient.patientMRN)
.then((_) => .then((_) =>
@ -265,57 +177,47 @@ class _AdmissionRequestThirdScreenState
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.icdCodes.length > 0) { model.icdCodes.length > 0) {
openListDialogField( openListDialogField(
'description', 'description', 'code', model.icdCodes,
'code', (selectedValue) {
model.icdCodes, (selectedValue) {
setState(() { setState(() {
_selectedIcd = selectedValue; _selectedIcd = selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state ==
ViewState.ErrorLocal) { ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(model.error);
model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
"Empty List"); "Empty List");
} }
}, },
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).icd,
_selectedIcd != null
? _selectedIcd['description']
: null,
true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText: TranslationBase.of(context).diagnoseType,
onTap: model.listOfDiagnosisSelectionTypes != dropDownText: _selectedDiagnosisType != null
? _selectedDiagnosisType['description']
: null,
enabled: false,
isDropDown: true,
onClick: model.listOfDiagnosisSelectionTypes !=
null && null &&
model.listOfDiagnosisSelectionTypes model.listOfDiagnosisSelectionTypes.length >
.length >
0 0
? () { ? () {
openListDialogField('description', 'code', openListDialogField('description', 'code',
model.listOfDiagnosisSelectionTypes, model.listOfDiagnosisSelectionTypes,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDiagnosisType = _selectedDiagnosisType = selectedValue;
selectedValue;
}); });
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context);
await model await model
.getMasterLookup(MasterKeysService .getMasterLookup(MasterKeysService
.DiagnosisSelectionType) .DiagnosisSelectionType)
@ -326,9 +228,7 @@ class _AdmissionRequestThirdScreenState
model.listOfDiagnosisSelectionTypes model.listOfDiagnosisSelectionTypes
.length > .length >
0) { 0) {
openListDialogField( openListDialogField('description', 'code',
'description',
'code',
model.listOfDiagnosisSelectionTypes, model.listOfDiagnosisSelectionTypes,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
@ -338,23 +238,12 @@ class _AdmissionRequestThirdScreenState
}); });
} else if (model.state == } else if (model.state ==
ViewState.ErrorLocal) { ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(model.error);
model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
"Empty List"); "Empty List");
} }
}, },
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).diagnoseType,
_selectedDiagnosisType != null
? _selectedDiagnosisType['description']
: null,
true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -367,40 +256,46 @@ class _AdmissionRequestThirdScreenState
)), )),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: HexColor("#EAEAEA"),
fontColor: Colors.black,
onPressed: () {
Navigator.pop(context);
},
),
),
SizedBox(
width: 10,
),
Expanded(
child: AppButton( child: AppButton(
title: TranslationBase.of(context).next, title: TranslationBase.of(context).submit,
color: HexColor("#B8382B"), color: HexColor("#359846"),
onPressed: () async { onPressed: () async {
if (_treatmentLineController.text != "" && if (_selectedDiagnosis != null &&
_complicationsController.text != "" &&
_otherProceduresController.text != "" &&
_selectedAdmissionType != null &&
_selectedDiagnosis != null &&
_selectedIcd != null && _selectedIcd != null &&
_selectedDiagnosisType != null) { _selectedDiagnosisType != null) {
model.admissionRequestData = admissionRequest; model.admissionRequestData = admissionRequest;
model.admissionRequestData.mainLineOfTreatment =
_treatmentLineController.text;
model.admissionRequestData.complications =
_complicationsController.text;
model.admissionRequestData.otherProcedures =
_otherProceduresController.text;
model.admissionRequestData.admissionType =
_selectedAdmissionType['id'];
dynamic admissionRequestDiagnoses = [ dynamic admissionRequestDiagnoses = [
{ {
'diagnosisDescription': _selectedDiagnosis['nameEn'], 'diagnosisDescription':
_selectedDiagnosis['nameEn'],
'diagnosisType': _selectedDiagnosis['id'], 'diagnosisType': _selectedDiagnosis['id'],
'icdCode': _selectedIcd['code'], 'icdCode': _selectedIcd['code'],
'icdCodeDescription': _selectedIcd['description'], 'icdCodeDescription':
_selectedIcd['description'],
'type': _selectedDiagnosisType['code'], 'type': _selectedDiagnosisType['code'],
'remarks': "", 'remarks': "",
'isActive': true, 'isActive': true,
} }
]; ];
model.admissionRequestData.admissionRequestDiagnoses = model.admissionRequestData
.admissionRequestDiagnoses =
admissionRequestDiagnoses; admissionRequestDiagnoses;
await model.makeAdmissionRequest(); await model.makeAdmissionRequest();
@ -408,8 +303,10 @@ class _AdmissionRequestThirdScreenState
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).admissionRequestSuccessMsg); TranslationBase.of(context)
Navigator.popUntil(context, ModalRoute.withName(PATIENTS_PROFILE)); .admissionRequestSuccessMsg);
Navigator.popUntil(context,
ModalRoute.withName(PATIENTS_PROFILE));
} }
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
@ -421,6 +318,9 @@ class _AdmissionRequestThirdScreenState
], ],
), ),
), ),
],
),
),
), ),
); );
} }

@ -12,6 +12,8 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -36,17 +38,23 @@ class _AdmissionRequestSecondScreenState
final _estimatedCostController = TextEditingController(); final _estimatedCostController = TextEditingController();
final _expectedDaysController = TextEditingController(); final _expectedDaysController = TextEditingController();
final _otherDepartmentsInterventionsController = TextEditingController(); final _otherDepartmentsInterventionsController = TextEditingController();
final _treatmentLineController = TextEditingController();
final _complicationsController = TextEditingController();
final _otherProceduresController = TextEditingController();
DateTime _expectedAdmissionDate; DateTime _expectedAdmissionDate;
dynamic _selectedFloor; dynamic _selectedFloor;
dynamic _selectedWard; dynamic _selectedWard;
dynamic _selectedRoomCategory; dynamic _selectedRoomCategory;
dynamic _selectedAdmissionType;
@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'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
AdmissionRequest admissionRequest = routeArgs['admission-data']; AdmissionRequest admissionRequest = routeArgs['admission-data'];
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
@ -55,6 +63,7 @@ class _AdmissionRequestSecondScreenState
return BaseView<AdmissionRequestViewModel>( return BaseView<AdmissionRequestViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false,
appBarTitle: TranslationBase.of(context).admissionRequest, appBarTitle: TranslationBase.of(context).admissionRequest,
body: GestureDetector( body: GestureDetector(
onTap: () { onTap: () {
@ -70,110 +79,117 @@ class _AdmissionRequestSecondScreenState
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
PatientPageHeaderWidget(patient), PatientProfileHeaderNewDesign(
patient, patientType, arrivalType),
Container( Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.all(16.0),
vertical: 16, horizontal: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( AppText(
height: 16, "${TranslationBase.of(context).admission}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600,
), ),
AppText(
"${TranslationBase.of(context).request}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
)
],
),
),
Container(
margin:
EdgeInsets.symmetric(vertical: 0, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.postPlansEstimatedCost, .postPlansEstimatedCost,
fontWeight: FontWeight.bold, fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.w700,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: TextField( hintText:
decoration: TranslationBase.of(context).estimatedCost,
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.estimatedCost,
null,
false),
enabled: true,
controller: _estimatedCostController, controller: _estimatedCostController,
inputType: TextInputType.number,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow( FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS)) RegExp(ONLY_NUMBERS))
], ],
keyboardType: TextInputType.number, ),
)),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
child: TextField( hintText: TranslationBase.of(context).postPlans,
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).postPlans,
null,
false),
enabled: true,
controller: _postPlansEstimatedCostController, controller: _postPlansEstimatedCostController,
keyboardType: TextInputType.text, inputType: TextInputType.multiline,
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
)), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
child: TextField( hintText: TranslationBase.of(context)
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.otherDepartmentsInterventions, .otherDepartmentsInterventions,
null,
false),
enabled: true,
controller: controller:
_otherDepartmentsInterventionsController, _otherDepartmentsInterventionsController,
keyboardType: TextInputType.multiline, inputType: TextInputType.multiline,
minLines: 2, minLines: 2,
maxLines: 4, maxLines: 4,
)), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppText( AppText(
TranslationBase.of(context).otherInformation, TranslationBase.of(context).otherInformation,
fontWeight: FontWeight.bold, fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.w700,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: TextField( hintText:
decoration: TranslationBase.of(context).expectedDays,
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.expectedDays,
null,
false),
enabled: true,
controller: _expectedDaysController, controller: _expectedDaysController,
inputType: TextInputType.number,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow( FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS)) RegExp(ONLY_NUMBERS))
], ],
keyboardType: TextInputType.number, ),
)),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText: TranslationBase.of(context)
onTap: () { .expectedAdmissionDate,
dropDownText: _expectedAdmissionDate != null
? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
: null,
enabled: false,
isDropDown: true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
),
onClick: () {
if (_expectedAdmissionDate == null) { if (_expectedAdmissionDate == null) {
_expectedAdmissionDate = DateTime.now(); _expectedAdmissionDate = DateTime.now();
} }
@ -184,29 +200,19 @@ class _AdmissionRequestSecondScreenState
}); });
}); });
}, },
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.expectedAdmissionDate,
_expectedAdmissionDate != null
? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText: TranslationBase.of(context).floor,
onTap: model.floorList != null && dropDownText: _selectedFloor != null
? _selectedFloor['description']
: null,
enabled: false,
isDropDown: true,
onClick: model.floorList != null &&
model.floorList.length > 0 model.floorList.length > 0
? () { ? () {
openListDialogField( openListDialogField(
@ -226,9 +232,10 @@ class _AdmissionRequestSecondScreenState
context)); context));
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.floorList.length > 0) { model.floorList.length > 0) {
openListDialogField('description', openListDialogField(
'floorID', model.floorList, 'description',
(selectedValue) { 'floorID',
model.floorList, (selectedValue) {
setState(() { setState(() {
_selectedFloor = selectedValue; _selectedFloor = selectedValue;
}); });
@ -242,25 +249,19 @@ class _AdmissionRequestSecondScreenState
"Empty List"); "Empty List");
} }
}, },
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).floor,
_selectedFloor != null
? _selectedFloor['description']
: null,
true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText: TranslationBase.of(context).ward,
onTap: model.wardList != null && dropDownText: _selectedWard != null
? _selectedWard['description']
: null,
enabled: false,
isDropDown: true,
onClick: model.wardList != null &&
model.wardList.length > 0 model.wardList.length > 0
? () { ? () {
openListDialogField( openListDialogField(
@ -283,8 +284,7 @@ class _AdmissionRequestSecondScreenState
openListDialogField( openListDialogField(
'description', 'description',
'nursingStationID', 'nursingStationID',
model.wardList, model.wardList, (selectedValue) {
(selectedValue) {
setState(() { setState(() {
_selectedWard = selectedValue; _selectedWard = selectedValue;
}); });
@ -298,25 +298,20 @@ class _AdmissionRequestSecondScreenState
"Empty List"); "Empty List");
} }
}, },
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).ward,
_selectedWard != null
? _selectedWard['description']
: null,
true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText:
onTap: model.roomCategoryList != null && TranslationBase.of(context).roomCategory,
dropDownText: _selectedRoomCategory != null
? _selectedRoomCategory['description']
: null,
enabled: false,
isDropDown: true,
onClick: model.roomCategoryList != null &&
model.roomCategoryList.length > 0 model.roomCategoryList.length > 0
? () { ? () {
openListDialogField( openListDialogField(
@ -334,11 +329,11 @@ class _AdmissionRequestSecondScreenState
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(
context); context);
await model.getRoomCategories().then( await model.getRoomCategories().then(
(_) => GifLoaderDialogUtils (_) =>
.hideDialog(context)); GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.roomCategoryList.length > model.roomCategoryList.length > 0) {
0) {
openListDialogField( openListDialogField(
'description', 'description',
'categoryID', 'categoryID',
@ -358,23 +353,94 @@ class _AdmissionRequestSecondScreenState
"Empty List"); "Empty List");
} }
}, },
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.roomCategory,
_selectedRoomCategory != null
? _selectedRoomCategory[
'description']
: null,
true),
enabled: false,
), ),
SizedBox(
height: 10,
), ),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).treatmentLine,
controller: _treatmentLineController,
inputType: TextInputType.multiline,
minLines: 3,
maxLines: 5,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).complications,
controller: _complicationsController,
inputType: TextInputType.multiline,
minLines: 3,
maxLines: 5,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).otherProcedure,
controller: _otherProceduresController,
inputType: TextInputType.multiline,
minLines: 3,
maxLines: 5,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText:
TranslationBase.of(context).admissionType,
dropDownText: _selectedAdmissionType != null
? _selectedAdmissionType['nameEn']
: null,
enabled: false,
isDropDown: true,
onClick: model.admissionTypeList != null &&
model.admissionTypeList.length > 0
? () {
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType =
selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getMasterLookup(MasterKeysService
.AdmissionRequestType)
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.admissionTypeList.length >
0) {
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
),
], ],
), ),
), ),
@ -384,23 +450,45 @@ class _AdmissionRequestSecondScreenState
), ),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: HexColor("#EAEAEA"),
fontColor: Colors.black,
onPressed: () {
Navigator.pop(context);
},
),
),
SizedBox(
width: 10,
),
Expanded(
child: AppButton( child: AppButton(
title: TranslationBase.of(context).next, title: TranslationBase.of(context).next,
color: HexColor("#B8382B"), color: HexColor("#D02127"),
onPressed: () async { onPressed: () async {
if (_estimatedCostController.text != "" && if (_estimatedCostController.text != "" &&
_postPlansEstimatedCostController.text != "" && _postPlansEstimatedCostController.text != "" &&
_expectedDaysController.text != "" && _expectedDaysController.text != "" &&
_expectedAdmissionDate != null && _expectedAdmissionDate != null &&
_otherDepartmentsInterventionsController.text != "" && _otherDepartmentsInterventionsController.text !=
"" &&
_selectedFloor != null && _selectedFloor != null &&
_selectedRoomCategory != _selectedRoomCategory !=
null /*_selectedWard is not required*/) { null /*_selectedWard is not required*/ &&
_treatmentLineController.text != "" &&
_complicationsController.text != "" &&
_otherProceduresController.text != "" &&
_selectedAdmissionType != null) {
model.admissionRequestData = admissionRequest; model.admissionRequestData = admissionRequest;
model.admissionRequestData.estimatedCost = model.admissionRequestData.estimatedCost =
int.parse(_estimatedCostController.text); int.parse(_estimatedCostController.text);
model.admissionRequestData.elementsForImprovement = model.admissionRequestData
.elementsForImprovement =
_postPlansEstimatedCostController.text; _postPlansEstimatedCostController.text;
model.admissionRequestData.expectedDays = model.admissionRequestData.expectedDays =
@ -419,11 +507,24 @@ class _AdmissionRequestSecondScreenState
model.admissionRequestData.roomCategoryID = model.admissionRequestData.roomCategoryID =
_selectedRoomCategory['categoryID']; _selectedRoomCategory['categoryID'];
model.admissionRequestData.admissionRequestProcedures = model.admissionRequestData
[]; .admissionRequestProcedures = [];
Navigator.of(context)
.pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: { model.admissionRequestData.mainLineOfTreatment =
_treatmentLineController.text;
model.admissionRequestData.complications =
_complicationsController.text;
model.admissionRequestData.otherProcedures =
_otherProceduresController.text;
model.admissionRequestData.admissionType =
_selectedAdmissionType['id'];
Navigator.of(context).pushNamed(
PATIENT_ADMISSION_REQUEST_3,
arguments: {
'patient': patient, 'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'admission-data': model.admissionRequestData 'admission-data': model.admissionRequestData
}); });
} else { } else {
@ -435,6 +536,9 @@ class _AdmissionRequestSecondScreenState
), ),
], ],
), ),
),
],
),
)), )),
); );
} }

@ -552,6 +552,8 @@ class TranslationBase {
String get next => localizedValues['next'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode];
String get previous => localizedValues['previous'][locale.languageCode];
String get emptyMessage => String get emptyMessage =>
localizedValues['empty-message'][locale.languageCode]; localizedValues['empty-message'][locale.languageCode];

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'app_texts_widget.dart'; import 'app_texts_widget.dart';
class AppTextFieldCustom extends StatefulWidget { class AppTextFieldCustom extends StatefulWidget {
@ -9,17 +9,30 @@ class AppTextFieldCustom extends StatefulWidget {
final String hintText; final String hintText;
final TextEditingController controller; final TextEditingController controller;
final bool isDropDown; final bool isDropDown;
final String dropDownText;
final Icon suffixIcon; final Icon suffixIcon;
final Color dropDownColor; final Color dropDownColor;
final bool enabled;
final TextInputType inputType;
final int minLines;
final int maxLines;
final List<TextInputFormatter> inputFormatters;
AppTextFieldCustom( AppTextFieldCustom({
{this.height = 0, this.height = 0,
this.onClick, this.onClick,
this.hintText, this.hintText,
this.controller, this.controller,
this.isDropDown = false, this.isDropDown = false,
this.dropDownText,
this.suffixIcon, this.suffixIcon,
this.dropDownColor}); this.dropDownColor,
this.enabled = true,
this.inputType = TextInputType.text,
this.minLines = 1,
this.maxLines = 1,
this.inputFormatters,
});
@override @override
_AppTextFieldCustomState createState() => _AppTextFieldCustomState(); _AppTextFieldCustomState createState() => _AppTextFieldCustomState();
@ -43,22 +56,37 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
if (widget.controller.text != "") if ((widget.controller != null &&
widget.controller.text != "") ||
widget.dropDownText != null)
AppText( AppText(
widget.hintText, widget.hintText,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.4, fontSize: SizeConfig.textMultiplier * 1.4,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
TextField( widget.dropDownText == null
? TextField(
textAlign: TextAlign.left, textAlign: TextAlign.left,
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
widget.hintText, null, true), widget.hintText, null, true),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.grey.shade600, fontFamily: 'Poppins',
color: Colors.grey.shade800,
), ),
controller: widget.controller, controller: widget.controller,
keyboardType: widget.inputType,
enabled: widget.enabled,
minLines: widget.minLines,
maxLines: widget.maxLines,
inputFormatters: widget.inputFormatters != null ? widget.inputFormatters : [],
)
: AppText(
widget.dropDownText,
fontFamily: 'Poppins',
color: Colors.grey.shade800,
fontSize: SizeConfig.textMultiplier * 1.7,
), ),
], ],
), ),
@ -67,7 +95,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
? widget.suffixIcon != null ? widget.suffixIcon != null
? widget.suffixIcon ? widget.suffixIcon
: Icon( : Icon(
Icons.arrow_drop_down, Icons.keyboard_arrow_down,
color: widget.dropDownColor != null color: widget.dropDownColor != null
? widget.dropDownColor ? widget.dropDownColor
: Colors.black, : Colors.black,
@ -85,7 +113,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)), borderRadius: BorderRadius.all(Radius.circular(12)),
border: Border.fromBorderSide(BorderSide( border: Border.fromBorderSide(BorderSide(
color: borderColor, color: borderColor,
width: borderWidth == -1 ? 2.0 : borderWidth, width: borderWidth == -1 ? 2.0 : borderWidth,
@ -102,6 +130,9 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
enabledBorder: UnderlineInputBorder( enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)), borderSide: BorderSide(color: Color(0Xffffffff)),
), ),
disabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
focusedBorder: UnderlineInputBorder( focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)), borderSide: BorderSide(color: Color(0Xffffffff)),
), ),

Loading…
Cancel
Save