Merge branch 'fix-issues' into 'development'

design inhancment

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

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

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

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

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

Loading…
Cancel
Save