MiTextField constructor

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

Implementation

MiTextField({
  super.key,required this.enable,
  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,
  required this.radius,
  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(0xFFFF0000),
                  width: borderWidth ?? 1),
            )
          : !noInputBorder && !isUnderline
              ? OutlineInputBorder(
                  borderSide: BorderSide(
                      color: errorColor ?? const Color(0xFFFF0000),
                      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;