Add Prescription Form New Design

merge-requests/384/head
hussam al-habibeh 4 years ago
parent 79fe067fe2
commit e4bfdd198b

@ -225,6 +225,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
return SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.45,
color: Color(0xffF8F8F8),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 12.0, vertical: 10.0),
@ -232,9 +233,26 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
AppText(
TranslationBase.of(context).medicines.toUpperCase(),
fontWeight: FontWeight.w900,
Row(
children: [
AppText(
'New Prescription Order',
fontWeight: FontWeight.w700,
fontSize: 20,
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.32,
),
InkWell(
child: Icon(
Icons.close,
size: 23.0,
),
onTap: () {
Navigator.pop(context);
},
)
],
),
SizedBox(
height: spaceBetweenTextFileds,
@ -248,6 +266,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container(
height: MediaQuery.of(context).size.height *
0.070,
color: Colors.white,
child: InkWell(
onTap: model.allMedicationList != null
? () {
@ -340,17 +359,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
itemID: _selectedMedication
.itemId);
},
decoration:
textFieldSelectorDecoration(
TranslationBase.of(context)
.searchMedicineNameHere,
_selectedMedication != null
? _selectedMedication
.description +
('${_selectedMedication.genericName}')
: null,
true,
),
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.searchMedicineNameHere,
_selectedMedication != null
? _selectedMedication
.description +
('${_selectedMedication.genericName}')
: null,
false,
suffixIcon:
Icon(Icons.search)),
enabled: false,
),
),
@ -361,7 +380,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container(
child: Row(
children: [
AppText('Order Type'),
AppText(
'Order Type',
fontWeight: FontWeight.w600,
),
Radio(
activeColor: Color(0xFFB9382C),
value: 1,
@ -445,6 +467,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
width: 10.0,
),
Container(
color: Colors.white,
width: MediaQuery.of(context)
.size
.width *
@ -489,7 +512,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextField(
decoration:
textFieldSelectorDecoration(
'UNIT Type',
'UNIT',
units != null
? units['description']
: null,
@ -504,6 +527,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: model.itemMedicineListRoute != null
? () {
@ -553,6 +577,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: model.itemMedicineList != null
? () {
@ -620,6 +645,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: model.medicationDoseTimeList !=
null
@ -667,6 +693,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container(
height: screenSize.height * 0.070,
width: double.infinity,
color: Colors.white,
child: Row(
children: [
Container(
@ -692,7 +719,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
indication != null
? indication['name']
: null,
true),
false),
enabled: true,
readOnly: true,
),
@ -703,6 +730,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.size
.width *
0.65,
color: Colors.white,
child: InkWell(
onTap: indicationList != null
? () {
@ -722,7 +750,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
indication != null
? indication['name']
: null,
true),
false),
enabled: true,
readOnly: true,
),
@ -734,22 +762,21 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: () =>
selectDate(context, widget.model),
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.date,
selectedDate != null
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).date,
selectedDate != null
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
@ -757,6 +784,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: model.medicationDurationList !=
null
@ -825,6 +853,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: model.allMedicationList != null
? () {
@ -857,7 +886,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
decoration: textFieldSelectorDecoration(
"UOM",
uom != null ? uom : null,
true),
false),
//enabled: false,
readOnly: true,
),
@ -866,6 +895,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: model.allMedicationList != null
? () {
@ -901,7 +931,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
? "Box Quantity: " +
model.boxQuintity.toString()
: null,
true),
false),
//enabled: false,
readOnly: true,
),
@ -932,8 +962,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
color: Color(0xff359846),
title: TranslationBase.of(context)
.addMedication,
fontWeight: FontWeight.w600,
onPressed: () {
// formKey.currentState.save();
// Navigator.pop(context);
@ -1093,11 +1125,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
@ -1105,13 +1137,22 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
Icons.keyboard_arrow_down_sharp,
color: Color(0xff2E303A),
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
fontSize: 13,
color: Color(0xff2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
labelText: selectedText != null ? '$hintText\n$selectedText' : null,
labelStyle: TextStyle(
fontSize: 13,
color: Color(0xff2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
);
}

@ -15,6 +15,7 @@ class AppButton extends StatefulWidget {
final Color fontColor;
final bool loading;
final bool disabled;
final FontWeight fontWeight;
AppButton(
{@required this.onPressed,
@ -25,7 +26,8 @@ class AppButton extends StatefulWidget {
this.padding = 13,
this.loading = false,
this.disabled = false,
this.fontColor = Colors.white});
this.fontColor = Colors.white,
this.fontWeight});
_AppButtonState createState() => _AppButtonState();
}
@ -76,6 +78,7 @@ class _AppButtonState extends State<AppButton> {
widget.title.toUpperCase(),
color: widget.fontColor,
fontSize: SizeConfig.textMultiplier * widget.fontSize,
fontWeight: widget.fontWeight,
),
],
),

Loading…
Cancel
Save