RixaTextField constructor

RixaTextField({
  1. Key? key,
  2. required String hintText,
  3. required TextEditingController controller,
  4. int maxLines = 1,
  5. int? errorMaxLines,
  6. TextStyle? errorStyle,
  7. String? errorText,
  8. int? minLines,
  9. TextStyle? textStyle,
  10. TextStyle? hintStyle,
  11. Color? errorColor,
  12. Color? color,
  13. double? borderWidth,
  14. double radius = 10.0,
  15. dynamic onChanged(
    1. String
    )?,
  16. FocusNode? focusNode,
  17. Color? enabledColor,
  18. Color? focusedColor,
  19. bool showCursor = true,
  20. String? labelText,
  21. List<TextInputFormatter> inputFormatters = const [],
  22. bool autoFocus = false,
  23. double? width,
  24. Decoration? decoration,
  25. TextStyle? labelStyle,
  26. bool isUnderline = true,
  27. bool expands = false,
  28. TextInputType textInputType = TextInputType.text,
  29. TextInputAction textInputAction = TextInputAction.done,
  30. TextStyle? floatingLabelStyle,
  31. Widget? prefixIcon,
  32. Widget? suffixIcon,
  33. Color? backgroundColor,
  34. String? validator(
    1. String?
    )?,
  35. EdgeInsetsGeometry? padding = EdgeInsets.zero,
  36. EdgeInsetsGeometry? innerPadding,
  37. 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;