RixaTextField constructor
RixaTextField({
- Key? key,
- required String hintText,
- required TextEditingController controller,
- int maxLines = 1,
- int? errorMaxLines,
- TextStyle? errorStyle,
- String? errorText,
- int? minLines,
- TextStyle? textStyle,
- TextStyle? hintStyle,
- Color? errorColor,
- Color? color,
- double? borderWidth,
- double radius = 10.0,
- dynamic onChanged()?,
- FocusNode? focusNode,
- Color? enabledColor,
- Color? focusedColor,
- bool showCursor = true,
- String? labelText,
- List<
TextInputFormatter> inputFormatters = const [], - bool autoFocus = false,
- double? width,
- Decoration? decoration,
- TextStyle? labelStyle,
- bool isUnderline = true,
- bool expands = false,
- TextInputType textInputType = TextInputType.text,
- TextInputAction textInputAction = TextInputAction.done,
- TextStyle? floatingLabelStyle,
- Widget? prefixIcon,
- Widget? suffixIcon,
- Color? backgroundColor,
- String? validator()?,
- EdgeInsetsGeometry? padding = EdgeInsets.zero,
- EdgeInsetsGeometry? innerPadding,
- bool noInputBorder = false,
Implementation
RixaTextField({
super.key,
required this.hintText,
required this.controller,
this.maxLines = 1,
this.errorMaxLines,
this.errorStyle,
this.errorText,
this.minLines,
this.textStyle,
this.hintStyle,
this.errorColor,
this.color,
this.borderWidth,
this.radius = 10.0,
this.onChanged,
this.focusNode,
this.enabledColor,
this.focusedColor,
this.showCursor = true,
this.labelText,
this.inputFormatters = const [],
this.autoFocus = false,
this.width,
this.decoration,
this.labelStyle,
this.isUnderline = true,
this.expands = false,
this.textInputType = TextInputType.text,
this.textInputAction = TextInputAction.done,
this.floatingLabelStyle,
this.prefixIcon,
this.suffixIcon,
this.backgroundColor,
this.validator,
this.padding = EdgeInsets.zero,
EdgeInsetsGeometry? innerPadding,
this.noInputBorder = false,
}) : innerPadding =
innerPadding ?? const EdgeInsets.symmetric(horizontal: 10),
enabledBorder = !noInputBorder && isUnderline
? UnderlineInputBorder(
borderSide: BorderSide(
color: enabledColor ?? Colors.black,
width: borderWidth ?? 1),
)
: !noInputBorder && !isUnderline
? OutlineInputBorder(
borderSide: BorderSide(
color: enabledColor ?? Colors.black,
width: borderWidth ?? 1),
borderRadius: BorderRadius.circular(radius))
: InputBorder.none,
errorBorder = !noInputBorder && isUnderline
? UnderlineInputBorder(
borderSide: BorderSide(
color: errorColor ?? const Color(0xFFFF5494),
width: borderWidth ?? 1),
)
: !noInputBorder && !isUnderline
? OutlineInputBorder(
borderSide: BorderSide(
color: errorColor ?? const Color(0xFFFF5494),
width: borderWidth ?? 1),
borderRadius: BorderRadius.circular(radius))
: InputBorder.none,
focusedBorder = !noInputBorder && isUnderline
? UnderlineInputBorder(
borderSide: BorderSide(
color: focusedColor ?? Colors.cyan,
width: borderWidth ?? 1),
)
: !noInputBorder && !isUnderline
? OutlineInputBorder(
borderSide: BorderSide(
color: focusedColor ?? Colors.cyan,
width: borderWidth ?? 1),
borderRadius: BorderRadius.circular(radius))
: InputBorder.none;