Add Prescription Form New Design

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

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

Loading…
Cancel
Save