RixaTextField constructor
RixaTextField({
- Key? key,
- required String hintText,
- required TextEditingController controller,
- int maxLines = 1,
- int? minLines,
- TextStyle? textStyle,
- TextStyle? hintStyle,
- Color? color,
- Color? borderColor,
- double? borderWidth,
- double radius = 10.0,
- dynamic onChanged()?,
- Color? enabledColor,
- Color? focusedColor,
- String? labelText,
- double? width,
- TextStyle? labelStyle,
- bool isUnderline = true,
- bool expands = false,
- TextInputType textInputType = TextInputType.text,
- Widget? prefixIcon,
- Color? backgroundColor,
- EdgeInsetsGeometry? padding = EdgeInsets.zero,
- EdgeInsetsGeometry? innerPadding,
- bool noInputBorder = false,
Implementation
RixaTextField({
super.key,
required this.hintText,
required this.controller,
this.maxLines = 1,
this.minLines,
TextStyle? textStyle,
TextStyle? hintStyle,
this.color,
this.borderColor,
this.borderWidth,
this.radius = 10.0,
this.onChanged,
Color? enabledColor,
Color? focusedColor,
this.labelText,
this.width,
TextStyle? labelStyle,
this.isUnderline = true,
this.expands = false,
this.textInputType = TextInputType.text,
this.prefixIcon,
this.backgroundColor,
this.padding = EdgeInsets.zero,
EdgeInsetsGeometry? innerPadding,
this.noInputBorder = false,
}) : innerPadding =
innerPadding ?? const EdgeInsets.symmetric(horizontal: 10),
textStyle = textStyle ?? Get.find<AppFonts>().S(),
labelStyle = labelStyle ?? Get.find<AppFonts>().S(),
hintStyle = hintStyle ??
Get.find<AppFonts>().S(color: Get.find<AppColors>().hintColor),
enabledColor = enabledColor ?? Get.find<AppColors>().textColor,
focusedColor = focusedColor ?? Colors.cyan,
enabledBorder = !noInputBorder && isUnderline
? UnderlineInputBorder(
borderSide: BorderSide(
color: enabledColor ?? Get.find<AppColors>().textColor),
)
: !noInputBorder && !isUnderline
? OutlineInputBorder(
borderSide: BorderSide(
color: enabledColor ?? Get.find<AppColors>().textColor),
borderRadius: BorderRadius.circular(radius))
: null,
focusedBorder = !noInputBorder && isUnderline
? UnderlineInputBorder(
borderSide: BorderSide(color: focusedColor ?? Colors.cyan),
)
: !noInputBorder && !isUnderline
? OutlineInputBorder(
borderSide: BorderSide(color: focusedColor ?? Colors.cyan),
borderRadius: BorderRadius.circular(radius))
: null,
border = borderColor != null || borderWidth != null
? Border.all(
width: borderWidth ?? 1,
color: borderColor ?? Get.find<AppColors>().textColor)
: null;