Merge branch 'prescription_changes' into 'development'

hot fix

See merge request Cloud_Solution/doctor_app_flutter!652
merge-requests/653/merge
Mohammad Aljammal 5 years ago
commit 8daf3d2abf

@ -337,7 +337,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z'; const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9'; const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 5.9; const VERSION_ID = 6.0;
const CHANNEL = 9; const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt'; const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true; const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -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/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.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/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:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -439,20 +440,21 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
height: MediaQuery.of(context) height: MediaQuery.of(context)
.size .size
.height * .height *
0.06, 0.0749,
width: double.infinity, width: double.infinity,
child: Row( child: Row(
children: [ children: [
Container( Container(
height: MediaQuery.of(context) // height: MediaQuery.of(context)
.size // .size
.height * // .height *
0.06, // 0.02,
width: MediaQuery.of(context) width: MediaQuery.of(context)
.size .size
.width * .width *
0.35, 0.35,
child: TextFields( child: AppTextFieldCustom(
isPrscription: true,
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter( LengthLimitingTextInputFormatter(
5), 5),
@ -463,15 +465,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TranslationBase.of( TranslationBase.of(
context) context)
.strength, .strength,
fontWeight: FontWeight.w500,
fontSize: 14.0, // fontWeight: FontWeight.w500,
borderWidth: 0.2, // fontSize: 14.0,
// borderWidth: 0.2,
controller: controller:
strengthController, strengthController,
keyboardType: TextInputType // keyboardType: TextInputType
.numberWithOptions( // .numberWithOptions(
decimal: true, // decimal: true,
), // ),
onChanged: (String value) { onChanged: (String value) {
setState(() { setState(() {
strengthChar = strengthChar =
@ -486,30 +490,30 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
); );
} }
}, },
onSubmit: (_) { // onClick: (_) {
if (_selectedMedication != // if (_selectedMedication !=
null && // null &&
duration != null && // duration != null &&
frequency != null && // frequency != null &&
strengthController // strengthController
.text != // .text !=
null) { // null) {
model.getBoxQuantity( // model.getBoxQuantity(
freq: frequency[ // freq: frequency[
'parameterCode'], // 'parameterCode'],
duration: // duration:
duration['id'], // duration['id'],
itemCode: // itemCode:
_selectedMedication // _selectedMedication
.itemId, // .itemId,
strength: double.parse( // strength: double.parse(
strengthController // strengthController
.text)); // .text));
box = model.boxQuintity; // box = model.boxQuintity;
//
return; // return;
} // }
}, // },
// validator: (value) { // validator: (value) {
// if (value.isEmpty && // if (value.isEmpty &&
// strengthController.text.length > // strengthController.text.length >
@ -522,13 +526,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
SizedBox( SizedBox(
width: 10.0, width: 5.0,
), ),
Container( Container(
height: MediaQuery.of(context) // height: MediaQuery.of(context)
.size // .size
.height * // .height *
0.06, // 0.06,
color: Colors.white, color: Colors.white,
width: MediaQuery.of(context) width: MediaQuery.of(context)
.size .size

@ -25,6 +25,7 @@ class AppTextFieldCustom extends StatefulWidget {
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter> inputFormatters;
final Function(String) onChanged; final Function(String) onChanged;
final String validationError; final String validationError;
final bool isPrscription;
AppTextFieldCustom({ AppTextFieldCustom({
this.height = 0, this.height = 0,
@ -43,6 +44,7 @@ class AppTextFieldCustom extends StatefulWidget {
this.inputFormatters, this.inputFormatters,
this.onChanged, this.onChanged,
this.validationError, this.validationError,
this.isPrscription = false,
}); });
@override @override
@ -57,7 +59,9 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
return Column( return Column(
children: [ children: [
Container( 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 decoration: widget.hasBorder
? TextFieldsUtils.containerBorderDecoration( ? TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0Xffffffff),
@ -87,18 +91,23 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
AppText( AppText(
widget.hintText, widget.hintText,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 1.4, fontSize: widget.isPrscription == false
? SizeConfig.textMultiplier * 1.3
: 0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
widget.dropDownText == null widget.dropDownText == null
? Container( ? Container(
height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 : null, height:
child: TextField( widget.height != 0 && widget.maxLines == 1
? widget.height - 22
: null,
child: TextField(
textAlign: projectViewModel.isArabic textAlign: projectViewModel.isArabic
? TextAlign.right ? TextAlign.right
: TextAlign.left, : TextAlign.left,
decoration: decoration: TextFieldsUtils
TextFieldsUtils.textFieldSelectorDecoration( .textFieldSelectorDecoration(
widget.hintText, null, true), widget.hintText, null, true),
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.7, fontSize: SizeConfig.textMultiplier * 1.7,
@ -106,13 +115,17 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
controller: widget.controller, 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, enabled: widget.enabled,
minLines: widget.minLines, minLines: widget.minLines,
maxLines: widget.maxLines, maxLines: widget.maxLines,
inputFormatters: widget.inputFormatters != null inputFormatters:
? widget.inputFormatters widget.inputFormatters != null
: [], ? widget.inputFormatters
: [],
onChanged: (value) { onChanged: (value) {
setState(() {}); setState(() {});
if (widget.onChanged != null) { if (widget.onChanged != null) {
@ -120,7 +133,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
} }
}, },
), ),
) )
: AppText( : AppText(
widget.dropDownText, widget.dropDownText,
fontFamily: 'Poppins', fontFamily: 'Poppins',

Loading…
Cancel
Save