build method

  1. @override
InputDecoration build(
  1. InputTextState state, {
  2. bool enableClear = true,
  3. Widget? clearIcon,
  4. InputBorder? allLineBorder,
  5. Widget? icon,
  6. Color? iconColor,
  7. Widget? label,
  8. String? labelText,
  9. TextStyle? labelStyle,
  10. TextStyle? floatingLabelStyle,
  11. String? helperText,
  12. TextStyle? helperStyle,
  13. int? helperMaxLines,
  14. String? hintText,
  15. TextStyle? hintStyle,
  16. TextDirection? hintTextDirection,
  17. int? hintMaxLines,
  18. String? errorText,
  19. TextStyle? errorStyle,
  20. int? errorMaxLines,
  21. FloatingLabelBehavior? floatingLabelBehavior,
  22. FloatingLabelAlignment? floatingLabelAlignment,
  23. EdgeInsetsGeometry? contentPadding,
  24. bool isCollapsed = true,
  25. Widget? prefixIcon,
  26. BoxConstraints? prefixIconConstraints,
  27. Widget? prefix,
  28. String? prefixText,
  29. TextStyle? prefixStyle,
  30. Color? prefixIconColor,
  31. Widget? suffixIcon,
  32. Widget? suffix,
  33. String? suffixText,
  34. TextStyle? suffixStyle,
  35. bool? isDense,
  36. Color? suffixIconColor,
  37. BoxConstraints? suffixIconConstraints,
  38. String? counterText,
  39. Widget? counter,
  40. TextStyle? counterStyle,
  41. bool? filled,
  42. Color? fillColor,
  43. Color? focusColor,
  44. Color? hoverColor,
  45. InputBorder? errorBorder,
  46. InputBorder? focusedBorder,
  47. InputBorder? focusedErrorBorder,
  48. InputBorder? disabledBorder,
  49. InputBorder? enabledBorder,
  50. InputBorder? border,
  51. String? semanticCounterText,
  52. bool? alignLabelWithHint,
  53. BoxConstraints? constraints,
})
override

Implementation

@override
InputDecoration build(
    InputTextState state, {
      bool enableClear = true,
      Widget? clearIcon,
      InputBorder? allLineBorder,
      icon,
      Color? iconColor,
      label,
      String? labelText,
      TextStyle? labelStyle,
      TextStyle? floatingLabelStyle,
      String? helperText,
      TextStyle? helperStyle,
      int? helperMaxLines,
      String? hintText,
      TextStyle? hintStyle,
      TextDirection? hintTextDirection,
      int? hintMaxLines,
      String? errorText,
      TextStyle? errorStyle,
      int? errorMaxLines,
      FloatingLabelBehavior? floatingLabelBehavior,
      FloatingLabelAlignment? floatingLabelAlignment,
      EdgeInsetsGeometry? contentPadding,
      bool isCollapsed = true,
      prefixIcon,
      BoxConstraints? prefixIconConstraints,
      prefix,
      String? prefixText,
      TextStyle? prefixStyle,
      Color? prefixIconColor,
      suffixIcon,
      suffix,
      String? suffixText,
      TextStyle? suffixStyle,
      bool? isDense,
      Color? suffixIconColor,
      BoxConstraints? suffixIconConstraints,
      String? counterText,
      counter,
      TextStyle? counterStyle,
      bool? filled,
      Color? fillColor,
      Color? focusColor,
      Color? hoverColor,
      // Color? hoverColor = const Color(0xffF1F2F6),
      InputBorder? errorBorder,
      InputBorder? focusedBorder,
      InputBorder? focusedErrorBorder,
      InputBorder? disabledBorder,
      InputBorder? enabledBorder,
      InputBorder? border,
      String? semanticCounterText,
      bool? alignLabelWithHint,
      BoxConstraints? constraints,
    }) {
  return InputDecoration(
    isCollapsed: isCollapsed,
    contentPadding: contentPadding,
    filled: filled,
    hintText: hintText,
    fillColor: fillColor,
    enabledBorder:  enabledBorder??allLineBorder,
    border: border??allLineBorder,
    disabledBorder: disabledBorder??allLineBorder,
    focusedErrorBorder: focusedErrorBorder??allLineBorder,
    errorBorder:  errorBorder??allLineBorder,
    focusedBorder: focusedBorder??allLineBorder,
    icon: icon,
    iconColor: iconColor,
    label: label,
    labelText: labelText,
    labelStyle: labelStyle,
    floatingLabelStyle: floatingLabelStyle,
    helperText: helperText,
    helperStyle: helperStyle,
    helperMaxLines: helperMaxLines,
    hintStyle: hintStyle,
    hintTextDirection: hintTextDirection,
    hintMaxLines: hintMaxLines,
    errorText: errorText,
    errorStyle: errorStyle,
    errorMaxLines: errorMaxLines,
    floatingLabelBehavior: floatingLabelBehavior,
    floatingLabelAlignment: floatingLabelAlignment,
    prefixIcon: prefixIcon,
    prefixIconConstraints: prefixIconConstraints,
    prefix: prefix,
    prefixText: prefixText,
    prefixStyle: prefixStyle,
    prefixIconColor: prefixIconColor,
    suffix: suffix,
    suffixText: suffixText,
    suffixStyle: suffixStyle,
    suffixIconColor: suffixIconColor,
    suffixIconConstraints: suffixIconConstraints,
    counter: counter,
    counterText: counterText,
    counterStyle: counterStyle,
    focusColor: focusColor,
    hoverColor: hoverColor,
    semanticCounterText: semanticCounterText,
    alignLabelWithHint: alignLabelWithHint,
    constraints: constraints,
    suffixIcon: (state.getHasContent() && enableClear && state.getIsEnable())
        ? InkWell(
          onTap: (() {
            state.clearContent();
          }),
          child: clearIcon,
        )
        : const Text(""),
  );
}