|
|
|
|
@ -25,6 +25,7 @@ class AppTextFieldCustom extends StatefulWidget {
|
|
|
|
|
final List<TextInputFormatter> 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
|
|
|
|
|
@ -57,7 +59,9 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
|
|
|
|
|
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),
|
|
|
|
|
@ -87,18 +91,23 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
|
|
|
|
|
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
|
|
|
|
|
? 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 +115,17 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
|
|
|
|
|
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 +133,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
: AppText(
|
|
|
|
|
widget.dropDownText,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
|