Merge branch 'fix-issues' into 'development'

design inhancment

See merge request Cloud_Solution/doctor_app_flutter!319
merge-requests/320/merge
Mohammad Aljammal 5 years ago
commit 3c090ecdaf

@ -43,11 +43,11 @@ class MedicineViewModel extends BaseViewModel {
Future getItem({int itemID}) async { Future getItem({int itemID}) async {
//hasError = false; //hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.BusyLocal); setState(ViewState.Busy);
await _prescriptionService.getItem(itemID: itemID); await _prescriptionService.getItem(itemID: itemID);
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {
error = _prescriptionService.error; error = _prescriptionService.error;
setState(ViewState.ErrorLocal); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -360,12 +360,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.width * .width *
0.550, 0.550,
child: TextFields( child: TextFields(
// inputFormatters: [ inputFormatters: [
// LengthLimitingTextInputFormatter( LengthLimitingTextInputFormatter(
// 4), 4),
// WhitelistingTextInputFormatter // WhitelistingTextInputFormatter
// .digitsOnly // .digitsOnly
// ], ],
hintText: hintText:
TranslationBase.of(context) TranslationBase.of(context)
.strength, .strength,

@ -115,7 +115,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
(BuildContext context, StateSetter setState /*You can rename this!*/) { (BuildContext context, StateSetter setState /*You can rename this!*/) {
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getMedicationList(); //await model.getMedicationList();
await model.getMedicationStrength(); await model.getMedicationStrength();
await model.getMedicationDuration(); await model.getMedicationDuration();
await model.getMedicationRoute(); await model.getMedicationRoute();
@ -257,14 +257,17 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter( LengthLimitingTextInputFormatter(
4), 4),
WhitelistingTextInputFormatter // WhitelistingTextInputFormatter
.digitsOnly // .digitsOnly
], ],
hintText: widget.doseStreangth, hintText: widget.doseStreangth,
fontSize: 15.0, fontSize: 15.0,
controller: strengthController, controller: strengthController,
keyboardType: keyboardType: TextInputType
TextInputType.number, .numberWithOptions(
decimal: true,
),
onChanged: (String value) { onChanged: (String value) {
setState(() { setState(() {
strengthChar = value.length; strengthChar = value.length;
@ -558,78 +561,90 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
height: 12.0, height: 12.0,
), ),
Container( Container(
height: screenSize.height * 0.070, height: model.patientAssessmentList
width: double.infinity, .isNotEmpty
child: Row( ? screenSize.height * 0.070
children: [ : 0.0,
Container( width: model.patientAssessmentList
width: MediaQuery.of(context) .isNotEmpty
.size ? double.infinity
.width * : 0.0,
0.29, child: model.patientAssessmentList
child: InkWell( .isNotEmpty
onTap: indicationList != null ? Row(
? () { children: [
Helpers.hideKeyboard( Container(
context); width:
} MediaQuery.of(context)
: null, .size
child: TextField( .width *
decoration: 0.29,
textFieldSelectorDecoration( child: InkWell(
model.patientAssessmentList onTap:
.isNotEmpty indicationList != null
? model ? () {
.patientAssessmentList[ Helpers.hideKeyboard(
0] context);
.icdCode10ID }
.toString() : null,
: '', child: TextField(
indication != null decoration: textFieldSelectorDecoration(
? indication['name'] model.patientAssessmentList
: null, .isNotEmpty
true), ? model
enabled: true, .patientAssessmentList[
readOnly: true, 0]
), .icdCode10ID
), .toString()
), : '',
Container( indication != null
width: MediaQuery.of(context) ? indication[
.size 'name']
.width * : null,
0.61, true),
child: InkWell( enabled: true,
onTap: indicationList != null readOnly: true,
? () { ),
Helpers.hideKeyboard( ),
context); ),
} Container(
: null, width:
child: TextField( MediaQuery.of(context)
maxLines: 3, .size
decoration: .width *
textFieldSelectorDecoration( 0.61,
model.patientAssessmentList child: InkWell(
.isNotEmpty onTap:
? model indicationList != null
.patientAssessmentList[ ? () {
0] Helpers.hideKeyboard(
.asciiDesc context);
.toString() }
: '', : null,
indication != null child: TextField(
? indication['name'] maxLines: 3,
: null, decoration: textFieldSelectorDecoration(
true), model.patientAssessmentList
enabled: true, .isNotEmpty
readOnly: true, ? model
), .patientAssessmentList[
), 0]
), .asciiDesc
], .toString()
), : '',
), indication != null
? indication[
'name']
: null,
true),
enabled: true,
readOnly: true,
),
),
),
],
)
: null),
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
@ -688,6 +703,27 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
title: 'update prescription' title: 'update prescription'
.toUpperCase(), .toUpperCase(),
onPressed: () { onPressed: () {
if (int.parse(
strengthController.text) >
1000) {
DrAppToastMsg.showErrorToast(
"1000 is the MAX for the strength");
return;
}
if (int.parse(strengthController
.text) ==
0) {
DrAppToastMsg.showErrorToast(
"Streangth can't be zero");
return;
}
if (strengthController
.text.length >
4) {
DrAppToastMsg.showErrorToast(
"Streangth can't be zero");
return;
}
updatePrescription( updatePrescription(
newStartDate: selectedDate, newStartDate: selectedDate,
newDoseStreangth: newDoseStreangth:

@ -221,49 +221,69 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
child: Column( child: Column(
children: [ children: [
AppText( AppText(
DateTime.parse(model DateTime.parse(model
.procedureList[ .procedureList[
0] 0]
.entityList[ .entityList[
index] index]
.orderDate) .orderDate)
.day .year
.toString(), .toString(),
color: color: model
Colors.green, .procedureList[
), 0]
.entityList[
index]
.orderType ==
0
? Color(
0xFFB9382C)
: Colors
.green),
AppText( AppText(
Helpers.getMonth(model Helpers.getMonth(model.procedureList[0].entityList[index].orderDate !=
.procedureList[ null
0] ? (DateTime.parse(model.procedureList[0].entityList[index].orderDate)
.entityList[ .month)
index] : DateTime.now()
.orderDate != .month)
null .toUpperCase(),
? (DateTime.parse(model color: model
.procedureList[ .procedureList[
0] 0]
.entityList[ .entityList[
index] index]
.orderDate) .orderType ==
.month) 0
: DateTime ? Color(
.now() 0xFFB9382C)
.month) : Colors
.toUpperCase(), .green),
color: AppText(
Colors.green, DateTime.parse(model
) .procedureList[
0]
.entityList[
index]
.orderDate)
.day
.toString(),
color: model
.procedureList[
0]
.entityList[
index]
.orderType ==
0
? Color(
0xFFB9382C)
: Colors
.green),
], ],
), ),
), ),
Expanded( Expanded(
child: Container( child: Container(
// height: MediaQuery.of(
// context)
// .size
// .height *
// 0.21,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -308,17 +328,17 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
13.0, 13.0,
), ),
Expanded( Expanded(
child: child: AppText(
AppText( model.procedureList[0].entityList[index].orderType ==
model.procedureList[0].entityList[index].orderType == 1
1 ? 'Routine'
? 'Routine' : 'Urgent',
: 'Urgent', fontSize:
fontSize: 13.5,
11.5, color: model.procedureList[0].entityList[index].orderType ==
color: Color( 0
0xFFB9382C), ? Color(0xFFB9382C)
), : Colors.green),
), ),
], ],
), ),

Loading…
Cancel
Save