From 68e9470273e259894246c3c2007c167fb9ac8e55 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 16:06:02 +0300 Subject: [PATCH 1/2] hot fix --- lib/config/config.dart | 2 +- .../prescription/add_prescription_form.dart | 86 ++++++++++--------- .../text_fields/app-textfield-custom.dart | 29 ++++--- 3 files changed, 64 insertions(+), 53 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index b21ee8ed..ec8efe26 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -337,7 +337,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 5.9; +const VERSION_ID = 6.0; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 91536aeb..b9951f8e 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -439,20 +440,20 @@ class _PrescriptionFormWidgetState extends State { height: MediaQuery.of(context) .size .height * - 0.06, + 0.075, width: double.infinity, child: Row( children: [ Container( - height: MediaQuery.of(context) - .size - .height * - 0.06, + // height: MediaQuery.of(context) + // .size + // .height * + // 0.02, width: MediaQuery.of(context) .size .width * 0.35, - child: TextFields( + child: AppTextFieldCustom( inputFormatters: [ LengthLimitingTextInputFormatter( 5), @@ -463,15 +464,16 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of( context) .strength, - fontWeight: FontWeight.w500, - fontSize: 14.0, - borderWidth: 0.2, + // fontWeight: FontWeight.w500, + // fontSize: 14.0, + // borderWidth: 0.2, + controller: strengthController, - keyboardType: TextInputType - .numberWithOptions( - decimal: true, - ), + // keyboardType: TextInputType + // .numberWithOptions( + // decimal: true, + // ), onChanged: (String value) { setState(() { strengthChar = @@ -486,30 +488,30 @@ class _PrescriptionFormWidgetState extends State { ); } }, - onSubmit: (_) { - if (_selectedMedication != - null && - duration != null && - frequency != null && - strengthController - .text != - null) { - model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: - duration['id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text)); - box = model.boxQuintity; - - return; - } - }, + // onClick: (_) { + // if (_selectedMedication != + // null && + // duration != null && + // frequency != null && + // strengthController + // .text != + // null) { + // model.getBoxQuantity( + // freq: frequency[ + // 'parameterCode'], + // duration: + // duration['id'], + // itemCode: + // _selectedMedication + // .itemId, + // strength: double.parse( + // strengthController + // .text)); + // box = model.boxQuintity; + // + // return; + // } + // }, // validator: (value) { // if (value.isEmpty && // strengthController.text.length > @@ -522,13 +524,13 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox( - width: 10.0, + width: 5.0, ), Container( - height: MediaQuery.of(context) - .size - .height * - 0.06, + // height: MediaQuery.of(context) + // .size + // .height * + // 0.06, color: Colors.white, width: MediaQuery.of(context) .size diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index da92f574..e00ffc7b 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -57,7 +57,9 @@ class _AppTextFieldCustomState extends State { return Column( children: [ Container( - height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 : null, + height: widget.height != 0 && widget.maxLines == 1 + ? widget.height + 8 + : null, decoration: widget.hasBorder ? TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), @@ -92,13 +94,16 @@ class _AppTextFieldCustomState extends State { ), widget.dropDownText == null ? Container( - height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 : null, - child: TextField( + height: + widget.height != 0 && widget.maxLines == 1 + ? widget.height - 22 + : null, + child: TextField( textAlign: projectViewModel.isArabic ? TextAlign.right : TextAlign.left, - decoration: - TextFieldsUtils.textFieldSelectorDecoration( + decoration: TextFieldsUtils + .textFieldSelectorDecoration( widget.hintText, null, true), style: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, @@ -106,13 +111,17 @@ class _AppTextFieldCustomState extends State { color: Color(0xFF575757), ), controller: widget.controller, - keyboardType: widget.inputType?? (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline), + keyboardType: widget.inputType ?? + (widget.maxLines == 1 + ? TextInputType.text + : TextInputType.multiline), enabled: widget.enabled, minLines: widget.minLines, maxLines: widget.maxLines, - inputFormatters: widget.inputFormatters != null - ? widget.inputFormatters - : [], + inputFormatters: + widget.inputFormatters != null + ? widget.inputFormatters + : [], onChanged: (value) { setState(() {}); if (widget.onChanged != null) { @@ -120,7 +129,7 @@ class _AppTextFieldCustomState extends State { } }, ), - ) + ) : AppText( widget.dropDownText, fontFamily: 'Poppins', From d2814f610e480679eeb6e796cbb6e5a30e24c0af Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 16:28:46 +0300 Subject: [PATCH 2/2] hot fix --- lib/screens/prescription/add_prescription_form.dart | 4 +++- lib/widgets/shared/text_fields/app-textfield-custom.dart | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index b9951f8e..cfb6263b 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -440,7 +440,7 @@ class _PrescriptionFormWidgetState extends State { height: MediaQuery.of(context) .size .height * - 0.075, + 0.0749, width: double.infinity, child: Row( children: [ @@ -454,6 +454,7 @@ class _PrescriptionFormWidgetState extends State { .width * 0.35, child: AppTextFieldCustom( + isPrscription: true, inputFormatters: [ LengthLimitingTextInputFormatter( 5), @@ -464,6 +465,7 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of( context) .strength, + // fontWeight: FontWeight.w500, // fontSize: 14.0, // borderWidth: 0.2, diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index e00ffc7b..ded2568d 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -25,6 +25,7 @@ class AppTextFieldCustom extends StatefulWidget { final List inputFormatters; final Function(String) onChanged; final String validationError; + final bool isPrscription; AppTextFieldCustom({ this.height = 0, @@ -43,6 +44,7 @@ class AppTextFieldCustom extends StatefulWidget { this.inputFormatters, this.onChanged, this.validationError, + this.isPrscription = false, }); @override @@ -89,7 +91,9 @@ class _AppTextFieldCustomState extends State { AppText( widget.hintText, color: Color(0xFF2E303A), - fontSize: SizeConfig.textMultiplier * 1.4, + fontSize: widget.isPrscription == false + ? SizeConfig.textMultiplier * 1.3 + : 0, fontWeight: FontWeight.w700, ), widget.dropDownText == null