|
|
|
|
@ -37,262 +37,262 @@ class NumberTextInputFormatter extends TextInputFormatter {
|
|
|
|
|
|
|
|
|
|
final _mobileFormatter = NumberTextInputFormatter();
|
|
|
|
|
|
|
|
|
|
// class TextFields extends StatefulWidget {
|
|
|
|
|
// TextFields(
|
|
|
|
|
// {Key? key,
|
|
|
|
|
// this.type,
|
|
|
|
|
// this.hintText,
|
|
|
|
|
// this.suffixIcon,
|
|
|
|
|
// this.autoFocus,
|
|
|
|
|
// this.onChanged,
|
|
|
|
|
// this.initialValue,
|
|
|
|
|
// this.minLines,
|
|
|
|
|
// this.maxLines,
|
|
|
|
|
// this.inputFormatters,
|
|
|
|
|
// this.padding,
|
|
|
|
|
// this.focus = false,
|
|
|
|
|
// this.maxLengthEnforced = true,
|
|
|
|
|
// this.suffixIconColor,
|
|
|
|
|
// this.inputAction,
|
|
|
|
|
// this.onSubmit,
|
|
|
|
|
// this.keepPadding = true,
|
|
|
|
|
// this.textCapitalization = TextCapitalization.none,
|
|
|
|
|
// this.controller,
|
|
|
|
|
// this.keyboardType,
|
|
|
|
|
// this.validator,
|
|
|
|
|
// this.borderOnlyError = false,
|
|
|
|
|
// this.onSaved,
|
|
|
|
|
// this.onSuffixTap,
|
|
|
|
|
// this.readOnly= false,
|
|
|
|
|
// this.maxLength,
|
|
|
|
|
// this.prefixIcon,
|
|
|
|
|
// this.bare = false,
|
|
|
|
|
// this.onTap,
|
|
|
|
|
// this.fontSize = 16.0,
|
|
|
|
|
// this.fontWeight = FontWeight.w700,
|
|
|
|
|
// this.fillColor,
|
|
|
|
|
// this.hintColor})
|
|
|
|
|
// : super(key: key);
|
|
|
|
|
//
|
|
|
|
|
// final String? hintText;
|
|
|
|
|
// final String? initialValue;
|
|
|
|
|
// final String? type;
|
|
|
|
|
// final bool? autoFocus;
|
|
|
|
|
// final IconData? suffixIcon;
|
|
|
|
|
// final Color? suffixIconColor;
|
|
|
|
|
// final Icon? prefixIcon;
|
|
|
|
|
// final VoidCallback? onTap;
|
|
|
|
|
// final TextEditingController? controller;
|
|
|
|
|
// final TextInputType? keyboardType;
|
|
|
|
|
// final FormFieldValidator? validator;
|
|
|
|
|
// final Function? onSaved;
|
|
|
|
|
// final Function? onSuffixTap;
|
|
|
|
|
// final Function? onChanged;
|
|
|
|
|
// final Function? onSubmit;
|
|
|
|
|
// final bool? readOnly;
|
|
|
|
|
// final int? maxLength;
|
|
|
|
|
// final int? minLines;
|
|
|
|
|
// final int? maxLines;
|
|
|
|
|
// final bool? maxLengthEnforced;
|
|
|
|
|
// final bool? bare;
|
|
|
|
|
// final TextInputAction? inputAction;
|
|
|
|
|
// final double? fontSize;
|
|
|
|
|
// final FontWeight? fontWeight;
|
|
|
|
|
// final bool? keepPadding;
|
|
|
|
|
// final TextCapitalization? textCapitalization;
|
|
|
|
|
// final List<TextInputFormatter>? inputFormatters;
|
|
|
|
|
// final EdgeInsets? padding;
|
|
|
|
|
// final bool? focus;
|
|
|
|
|
// final bool? borderOnlyError;
|
|
|
|
|
// final Color? hintColor;
|
|
|
|
|
// final Color? fillColor;
|
|
|
|
|
//
|
|
|
|
|
// @override
|
|
|
|
|
// _TextFieldsState createState() => _TextFieldsState();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// class _TextFieldsState extends State<TextFields> {
|
|
|
|
|
// final FocusNode _focusNode = FocusNode();
|
|
|
|
|
// bool? focus = false;
|
|
|
|
|
// bool? view = false;
|
|
|
|
|
//
|
|
|
|
|
// @override
|
|
|
|
|
// void initState() {
|
|
|
|
|
// super.initState();
|
|
|
|
|
// _focusNode.addListener(() {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// focus = _focusNode.hasFocus;
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @override
|
|
|
|
|
// void didUpdateWidget(TextFields oldWidget) {
|
|
|
|
|
// if (widget.focus != null) _focusNode.requestFocus();
|
|
|
|
|
// super.didUpdateWidget(oldWidget);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @override
|
|
|
|
|
// void dispose() {
|
|
|
|
|
// _focusNode.dispose();
|
|
|
|
|
// super.dispose();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// Widget _buildSuffixIcon() {
|
|
|
|
|
// switch (widget.type) {
|
|
|
|
|
// case "password":
|
|
|
|
|
// return Padding(
|
|
|
|
|
// padding: const EdgeInsets.only(right: 8.0),
|
|
|
|
|
// child: view!
|
|
|
|
|
// ? InkWell(
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// this.setState(
|
|
|
|
|
// () {
|
|
|
|
|
// view = false;
|
|
|
|
|
// },
|
|
|
|
|
// );
|
|
|
|
|
// },
|
|
|
|
|
// child: Icon(
|
|
|
|
|
// Icons.remove_red_eye_sharp,
|
|
|
|
|
// size: 24.0,
|
|
|
|
|
// color: Color.fromRGBO(78, 62, 253, 1.0),
|
|
|
|
|
// ),
|
|
|
|
|
// )
|
|
|
|
|
// : InkWell(
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// this.setState(() {
|
|
|
|
|
// view = true;
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// child: Icon(Icons.remove_red_eye_sharp,
|
|
|
|
|
// size: 24.0, color: Colors.grey[500]),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// default:
|
|
|
|
|
// if (widget.suffixIcon != null)
|
|
|
|
|
// return InkWell(
|
|
|
|
|
// onTap: widget.onSuffixTap,
|
|
|
|
|
// child: Icon(widget.suffixIcon,
|
|
|
|
|
// size: 22.0,
|
|
|
|
|
// color: widget.suffixIconColor != null
|
|
|
|
|
// ? widget.suffixIconColor
|
|
|
|
|
// : Colors.grey[500]),
|
|
|
|
|
// );
|
|
|
|
|
// else
|
|
|
|
|
// return null;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// bool _determineReadOnly() {
|
|
|
|
|
// if (widget.readOnly != null && widget.readOnly!) {
|
|
|
|
|
// _focusNode.unfocus();
|
|
|
|
|
// return true;
|
|
|
|
|
// } else {
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @override
|
|
|
|
|
// Widget build(BuildContext context) {
|
|
|
|
|
// return (AnimatedContainer(
|
|
|
|
|
// duration: Duration(milliseconds: 300),
|
|
|
|
|
// decoration: widget.bare!
|
|
|
|
|
// ? null
|
|
|
|
|
// : BoxDecoration(boxShadow: [
|
|
|
|
|
// // BoxShadow(
|
|
|
|
|
// // color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0),
|
|
|
|
|
// // offset: Offset(0.0, 13.0),
|
|
|
|
|
// // blurRadius: focus ? 34.0 : 12.0)
|
|
|
|
|
// BoxShadow(
|
|
|
|
|
// color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0),
|
|
|
|
|
// offset: Offset(0.0, 13.0),
|
|
|
|
|
// blurRadius: focus ? 34.0 : 12.0)
|
|
|
|
|
// ]),
|
|
|
|
|
// child: TextFormField(
|
|
|
|
|
// keyboardAppearance: Theme.of(context).brightness,
|
|
|
|
|
// scrollPhysics: BouncingScrollPhysics(),
|
|
|
|
|
// textCapitalization: widget.textCapitalization,
|
|
|
|
|
// onFieldSubmitted: widget.inputAction == TextInputAction.next
|
|
|
|
|
// ? (widget.onSubmit != null
|
|
|
|
|
// ? widget.onSubmit
|
|
|
|
|
// : (val) {
|
|
|
|
|
// _focusNode.nextFocus();
|
|
|
|
|
// })
|
|
|
|
|
// : widget.onSubmit,
|
|
|
|
|
// textInputAction: widget.inputAction,
|
|
|
|
|
// minLines: widget.minLines ?? 1,
|
|
|
|
|
// maxLines: widget.maxLines ?? 1,
|
|
|
|
|
// // maxLengthEnforcement: widget.maxLengthEnforced,
|
|
|
|
|
// initialValue: widget.initialValue,
|
|
|
|
|
// onChanged: widget.onChanged,
|
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
|
// maxLength: widget.maxLength ?? null,
|
|
|
|
|
// controller: widget.controller,
|
|
|
|
|
// keyboardType: widget.keyboardType,
|
|
|
|
|
// readOnly: _determineReadOnly(),
|
|
|
|
|
// obscureText: widget.type == "password" && !view ? true : false,
|
|
|
|
|
// autofocus: widget.autoFocus ?? false,
|
|
|
|
|
// validator: widget.validator,
|
|
|
|
|
// onSaved: widget.onSaved,
|
|
|
|
|
// style: Theme.of(context)
|
|
|
|
|
// .textTheme
|
|
|
|
|
// .bodyText1
|
|
|
|
|
// .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
|
|
|
|
|
// inputFormatters: widget.keyboardType == TextInputType.phone
|
|
|
|
|
// ? <TextInputFormatter>[
|
|
|
|
|
// FilteringTextInputFormatter.digitsOnly,
|
|
|
|
|
// _mobileFormatter,
|
|
|
|
|
// ]
|
|
|
|
|
// : widget.inputFormatters,
|
|
|
|
|
// decoration: InputDecoration(
|
|
|
|
|
// counterText: "",
|
|
|
|
|
// hintText: widget.hintText,
|
|
|
|
|
// hintStyle: TextStyle(
|
|
|
|
|
// fontSize: widget.fontSize,
|
|
|
|
|
// fontWeight: widget.fontWeight,
|
|
|
|
|
// color: widget.hintColor ?? Theme.of(context).hintColor,
|
|
|
|
|
// ),
|
|
|
|
|
// contentPadding: widget.padding != null
|
|
|
|
|
// ? widget.padding
|
|
|
|
|
// : EdgeInsets.symmetric(
|
|
|
|
|
// vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0,
|
|
|
|
|
// horizontal: 16.0),
|
|
|
|
|
// filled: true,
|
|
|
|
|
// fillColor: widget.bare
|
|
|
|
|
// ? Colors.transparent
|
|
|
|
|
// : Theme.of(context).backgroundColor,
|
|
|
|
|
// suffixIcon: _buildSuffixIcon(),
|
|
|
|
|
// prefixIcon: widget.prefixIcon,
|
|
|
|
|
// errorStyle: TextStyle(
|
|
|
|
|
// fontSize: 14.0,
|
|
|
|
|
// fontWeight: widget.fontWeight,
|
|
|
|
|
// height: widget.borderOnlyError ? 0.0 : null),
|
|
|
|
|
// errorBorder: OutlineInputBorder(
|
|
|
|
|
// borderSide: BorderSide(
|
|
|
|
|
// color: Theme.of(context)
|
|
|
|
|
// .errorColor
|
|
|
|
|
// .withOpacity(widget.bare ? 0.0 : 0.5),
|
|
|
|
|
// width: 1.0),
|
|
|
|
|
// borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)),
|
|
|
|
|
// focusedErrorBorder: OutlineInputBorder(
|
|
|
|
|
// borderSide: BorderSide(
|
|
|
|
|
// color: Theme.of(context)
|
|
|
|
|
// .errorColor
|
|
|
|
|
// .withOpacity(widget.bare ? 0.0 : 0.5),
|
|
|
|
|
// width: 1.0),
|
|
|
|
|
// borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)),
|
|
|
|
|
// focusedBorder: OutlineInputBorder(
|
|
|
|
|
// borderSide: BorderSide(color: Colors.grey, width: 1.0),
|
|
|
|
|
// borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)),
|
|
|
|
|
// disabledBorder: OutlineInputBorder(
|
|
|
|
|
// borderSide: BorderSide(color: Colors.grey, width: 1.0),
|
|
|
|
|
// borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)),
|
|
|
|
|
// enabledBorder: OutlineInputBorder(
|
|
|
|
|
// borderSide: BorderSide(color: Colors.grey, width: 1.0),
|
|
|
|
|
// borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
class TextFields extends StatefulWidget {
|
|
|
|
|
TextFields(
|
|
|
|
|
{Key? key,
|
|
|
|
|
this.type,
|
|
|
|
|
this.hintText,
|
|
|
|
|
this.suffixIcon,
|
|
|
|
|
this.autoFocus,
|
|
|
|
|
this.onChanged,
|
|
|
|
|
this.initialValue,
|
|
|
|
|
this.minLines,
|
|
|
|
|
this.maxLines,
|
|
|
|
|
this.inputFormatters,
|
|
|
|
|
this.padding,
|
|
|
|
|
this.focus = false,
|
|
|
|
|
this.maxLengthEnforced = true,
|
|
|
|
|
this.suffixIconColor,
|
|
|
|
|
this.inputAction,
|
|
|
|
|
this.onSubmit,
|
|
|
|
|
this.keepPadding = true,
|
|
|
|
|
this.textCapitalization = TextCapitalization.none,
|
|
|
|
|
this.controller,
|
|
|
|
|
this.keyboardType,
|
|
|
|
|
this.validator,
|
|
|
|
|
this.borderOnlyError = false,
|
|
|
|
|
this.onSaved,
|
|
|
|
|
this.onSuffixTap,
|
|
|
|
|
this.readOnly= false,
|
|
|
|
|
this.maxLength,
|
|
|
|
|
this.prefixIcon,
|
|
|
|
|
this.bare = false,
|
|
|
|
|
this.onTap,
|
|
|
|
|
this.fontSize = 16.0,
|
|
|
|
|
this.fontWeight = FontWeight.w700,
|
|
|
|
|
this.fillColor,
|
|
|
|
|
this.hintColor})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
final String? hintText;
|
|
|
|
|
final String? initialValue;
|
|
|
|
|
final String? type;
|
|
|
|
|
final bool? autoFocus;
|
|
|
|
|
final IconData? suffixIcon;
|
|
|
|
|
final Color? suffixIconColor;
|
|
|
|
|
final Icon? prefixIcon;
|
|
|
|
|
final VoidCallback? onTap;
|
|
|
|
|
final TextEditingController? controller;
|
|
|
|
|
final TextInputType? keyboardType;
|
|
|
|
|
final FormFieldValidator? validator;
|
|
|
|
|
final Function(String?)? onSaved;
|
|
|
|
|
final VoidCallback? onSuffixTap;
|
|
|
|
|
final Function(String?)? onChanged;
|
|
|
|
|
final Function(String?)? onSubmit;
|
|
|
|
|
final bool? readOnly;
|
|
|
|
|
final int? maxLength;
|
|
|
|
|
final int? minLines;
|
|
|
|
|
final int? maxLines;
|
|
|
|
|
final bool? maxLengthEnforced;
|
|
|
|
|
final bool? bare;
|
|
|
|
|
final TextInputAction? inputAction;
|
|
|
|
|
final double? fontSize;
|
|
|
|
|
final FontWeight? fontWeight;
|
|
|
|
|
final bool? keepPadding;
|
|
|
|
|
final TextCapitalization? textCapitalization;
|
|
|
|
|
final List<TextInputFormatter>? inputFormatters;
|
|
|
|
|
final EdgeInsets? padding;
|
|
|
|
|
final bool? focus;
|
|
|
|
|
final bool? borderOnlyError;
|
|
|
|
|
final Color? hintColor;
|
|
|
|
|
final Color? fillColor;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_TextFieldsState createState() => _TextFieldsState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _TextFieldsState extends State<TextFields> {
|
|
|
|
|
final FocusNode _focusNode = FocusNode();
|
|
|
|
|
bool? focus = false;
|
|
|
|
|
bool? view = false;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
_focusNode.addListener(() {
|
|
|
|
|
setState(() {
|
|
|
|
|
focus = _focusNode.hasFocus;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void didUpdateWidget(TextFields oldWidget) {
|
|
|
|
|
if (widget.focus != null) _focusNode.requestFocus();
|
|
|
|
|
super.didUpdateWidget(oldWidget);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
_focusNode.dispose();
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildSuffixIcon() {
|
|
|
|
|
switch (widget.type) {
|
|
|
|
|
case "password":
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.only(right: 8.0),
|
|
|
|
|
child: view!
|
|
|
|
|
? InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
this.setState(
|
|
|
|
|
() {
|
|
|
|
|
view = false;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.remove_red_eye_sharp,
|
|
|
|
|
size: 24.0,
|
|
|
|
|
color: Color.fromRGBO(78, 62, 253, 1.0),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
this.setState(() {
|
|
|
|
|
view = true;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Icon(Icons.remove_red_eye_sharp,
|
|
|
|
|
size: 24.0, color: Colors.grey[500]),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
default:
|
|
|
|
|
if (widget.suffixIcon != null)
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: widget.onSuffixTap,
|
|
|
|
|
child: Icon(widget.suffixIcon,
|
|
|
|
|
size: 22.0,
|
|
|
|
|
color: widget.suffixIconColor != null
|
|
|
|
|
? widget.suffixIconColor
|
|
|
|
|
: Colors.grey[500]),
|
|
|
|
|
);
|
|
|
|
|
else
|
|
|
|
|
return SizedBox();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool _determineReadOnly() {
|
|
|
|
|
if (widget.readOnly != null && widget.readOnly!) {
|
|
|
|
|
_focusNode.unfocus();
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return (AnimatedContainer(
|
|
|
|
|
duration: Duration(milliseconds: 300),
|
|
|
|
|
decoration: widget.bare!
|
|
|
|
|
? null
|
|
|
|
|
: BoxDecoration(boxShadow: [
|
|
|
|
|
// BoxShadow(
|
|
|
|
|
// color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0),
|
|
|
|
|
// offset: Offset(0.0, 13.0),
|
|
|
|
|
// blurRadius: focus ? 34.0 : 12.0)
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Color.fromRGBO(110, 68, 80, focus! ? 0.20 : 0),
|
|
|
|
|
offset: Offset(0.0, 13.0),
|
|
|
|
|
blurRadius: focus! ? 34.0 : 12.0)
|
|
|
|
|
]),
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
keyboardAppearance: Theme.of(context).brightness,
|
|
|
|
|
scrollPhysics: BouncingScrollPhysics(),
|
|
|
|
|
textCapitalization: widget.textCapitalization!,
|
|
|
|
|
onFieldSubmitted: widget.inputAction! == TextInputAction.next!
|
|
|
|
|
? (widget.onSubmit! != null
|
|
|
|
|
? widget.onSubmit!
|
|
|
|
|
: (val) {
|
|
|
|
|
_focusNode.nextFocus!();
|
|
|
|
|
})
|
|
|
|
|
: widget.onSubmit!,
|
|
|
|
|
textInputAction: widget.inputAction,
|
|
|
|
|
minLines: widget.minLines ?? 1,
|
|
|
|
|
maxLines: widget.maxLines ?? 1,
|
|
|
|
|
// maxLengthEnforcement: widget.maxLengthEnforced,
|
|
|
|
|
initialValue: widget.initialValue,
|
|
|
|
|
onChanged: widget.onChanged!,
|
|
|
|
|
focusNode: _focusNode,
|
|
|
|
|
maxLength: widget.maxLength ?? null,
|
|
|
|
|
controller: widget.controller,
|
|
|
|
|
keyboardType: widget.keyboardType,
|
|
|
|
|
readOnly: _determineReadOnly(),
|
|
|
|
|
obscureText: widget.type == "password" && !view! ? true : false,
|
|
|
|
|
autofocus: widget.autoFocus ?? false,
|
|
|
|
|
validator: widget.validator,
|
|
|
|
|
onSaved: widget.onSaved,
|
|
|
|
|
style: Theme.of(context)
|
|
|
|
|
.textTheme
|
|
|
|
|
.bodyText1!
|
|
|
|
|
.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
|
|
|
|
|
inputFormatters: widget.keyboardType == TextInputType.phone
|
|
|
|
|
? <TextInputFormatter>[
|
|
|
|
|
FilteringTextInputFormatter.digitsOnly,
|
|
|
|
|
_mobileFormatter,
|
|
|
|
|
]
|
|
|
|
|
: widget.inputFormatters,
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
counterText: "",
|
|
|
|
|
hintText: widget.hintText,
|
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
|
fontSize: widget.fontSize,
|
|
|
|
|
fontWeight: widget.fontWeight,
|
|
|
|
|
color: widget.hintColor ?? Theme.of(context).hintColor,
|
|
|
|
|
),
|
|
|
|
|
contentPadding: widget.padding != null
|
|
|
|
|
? widget.padding
|
|
|
|
|
: EdgeInsets.symmetric(
|
|
|
|
|
vertical: (widget.bare! && !widget.keepPadding!) ? 0.0 : 10.0,
|
|
|
|
|
horizontal: 16.0),
|
|
|
|
|
filled: true,
|
|
|
|
|
fillColor: widget.bare!
|
|
|
|
|
? Colors.transparent
|
|
|
|
|
: Theme.of(context).backgroundColor,
|
|
|
|
|
suffixIcon: _buildSuffixIcon(),
|
|
|
|
|
prefixIcon: widget.prefixIcon,
|
|
|
|
|
errorStyle: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
fontWeight: widget.fontWeight,
|
|
|
|
|
height: widget.borderOnlyError! ? 0.0 : null),
|
|
|
|
|
errorBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(
|
|
|
|
|
color: Theme.of(context)
|
|
|
|
|
.errorColor
|
|
|
|
|
.withOpacity(widget.bare! ? 0.0 : 0.5),
|
|
|
|
|
width: 1.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)),
|
|
|
|
|
focusedErrorBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(
|
|
|
|
|
color: Theme.of(context)
|
|
|
|
|
.errorColor
|
|
|
|
|
.withOpacity(widget.bare! ? 0.0 : 0.5),
|
|
|
|
|
width: 1.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)),
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Colors.grey, width: 1.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)),
|
|
|
|
|
disabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Colors.grey, width: 1.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Colors.grey, width: 1.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|