TextFieldSuperValidationWithIcon constructor

const TextFieldSuperValidationWithIcon({
  1. bool onlyValidationOnTextChange = false,
  2. CounterWidgetBuilder? counterBuilder,
  3. EdgeInsetsGeometry? margin,
  4. Alignment? alignment,
  5. EdgeInsets? padding,
  6. BoxDecoration? containerDecoration,
  7. AutovalidateMode? autovalidateMode = AutovalidateMode.disabled,
  8. SuperValidationA? altValidation,
  9. Widget contextMenuBuilder(
    1. BuildContext,
    2. EditableTextState
    )?,
  10. dynamic onFieldSubmitted(
    1. String
    )?,
  11. required SuperValidation superValidation,
  12. Widget errorIcon = const Icon(Icons.error, color: Colors.red, size: 20),
  13. Widget errorSuffix = const SizedBox(),
  14. Key? key,
  15. TextEditingController? controller,
  16. FocusNode? focusNode,
  17. InputDecoration? decoration = const InputDecoration(),
  18. TextInputType? keyboardType,
  19. TextInputAction? textInputAction,
  20. TextCapitalization textCapitalization = TextCapitalization.none,
  21. TextStyle? style,
  22. StrutStyle? strutStyle,
  23. TextAlign textAlign = TextAlign.start,
  24. TextAlignVertical? textAlignVertical,
  25. TextDirection? textDirection,
  26. bool readOnly = false,
  27. ToolbarOptions? toolbarOptions,
  28. bool? showCursor,
  29. bool autofocus = false,
  30. String obscuringCharacter = '•',
  31. bool obscureText = false,
  32. bool autocorrect = true,
  33. SmartDashesType? smartDashesType,
  34. SmartQuotesType? smartQuotesType,
  35. bool enableSuggestions = true,
  36. int? maxLines = 1,
  37. int? minLines,
  38. bool expands = false,
  39. int? maxLength,
  40. MaxLengthEnforcement? maxLengthEnforcement,
  41. ValueChanged<String>? onChanged,
  42. VoidCallback? onEditingComplete,
  43. ValueChanged<String>? onSubmitted,
  44. AppPrivateCommandCallback? onAppPrivateCommand,
  45. List<TextInputFormatter>? inputFormatters,
  46. bool? enabled,
  47. double cursorWidth = 2.0,
  48. double? cursorHeight,
  49. Radius? cursorRadius,
  50. Color? cursorColor,
  51. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  52. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  53. Brightness? keyboardAppearance,
  54. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  55. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  56. bool? enableInteractiveSelection,
  57. TextSelectionControls? selectionControls,
  58. GestureTapCallback? onTap,
  59. MouseCursor? mouseCursor,
  60. InputCounterWidgetBuilder? buildCounter,
  61. ScrollController? scrollController,
  62. ScrollPhysics? scrollPhysics,
  63. Iterable<String>? autofillHints = const <String>[],
  64. Clip clipBehavior = Clip.hardEdge,
  65. String? restorationId,
  66. bool scribbleEnabled = true,
  67. bool enableIMEPersonalizedLearning = true,
  68. WillPopCallback? onWillPop,
  69. ErrorValidationBuilder? errorValidationBuilder,
})

Implementation

const TextFieldSuperValidationWithIcon(
    {this.onlyValidationOnTextChange = false,
    this.counterBuilder,
    this.margin,
    this.alignment,
    this.padding,
    this.containerDecoration,
    this.autovalidateMode = AutovalidateMode.disabled,
    this.altValidation,
    this.contextMenuBuilder,
    this.onFieldSubmitted,
    required this.superValidation,
    this.errorIcon = const Icon(Icons.error, color: Colors.red, size: 20),
    this.errorSuffix = const SizedBox(),
    super.key,
    this.controller,
    this.focusNode,
    this.decoration = const InputDecoration(),
    TextInputType? keyboardType,
    this.textInputAction,
    this.textCapitalization = TextCapitalization.none,
    this.style,
    this.strutStyle,
    this.textAlign = TextAlign.start,
    this.textAlignVertical,
    this.textDirection,
    this.readOnly = false,
    ToolbarOptions? toolbarOptions,
    this.showCursor,
    this.autofocus = false,
    this.obscuringCharacter = '•',
    this.obscureText = false,
    this.autocorrect = true,
    SmartDashesType? smartDashesType,
    SmartQuotesType? smartQuotesType,
    this.enableSuggestions = true,
    this.maxLines = 1,
    this.minLines,
    this.expands = false,
    this.maxLength,
    this.maxLengthEnforcement,
    this.onChanged,
    this.onEditingComplete,
    this.onSubmitted,
    this.onAppPrivateCommand,
    this.inputFormatters,
    this.enabled,
    this.cursorWidth = 2.0,
    this.cursorHeight,
    this.cursorRadius,
    this.cursorColor,
    this.selectionHeightStyle = ui.BoxHeightStyle.tight,
    this.selectionWidthStyle = ui.BoxWidthStyle.tight,
    this.keyboardAppearance,
    this.scrollPadding = const EdgeInsets.all(20.0),
    this.dragStartBehavior = DragStartBehavior.start,
    bool? enableInteractiveSelection,
    this.selectionControls,
    this.onTap,
    this.mouseCursor,
    this.buildCounter,
    this.scrollController,
    this.scrollPhysics,
    this.autofillHints = const <String>[],
    this.clipBehavior = Clip.hardEdge,
    this.restorationId,
    this.scribbleEnabled = true,
    this.enableIMEPersonalizedLearning = true,
    this.onWillPop,
    this.errorValidationBuilder})
    : smartDashesType = smartDashesType ??
          (obscureText ? SmartDashesType.disabled : SmartDashesType.enabled),
      smartQuotesType = smartQuotesType ??
          (obscureText ? SmartQuotesType.disabled : SmartQuotesType.enabled),
      keyboardType = keyboardType ??
          (maxLines == 1 ? TextInputType.text : TextInputType.multiline),
      enableInteractiveSelection =
          enableInteractiveSelection ?? (!readOnly || !obscureText),
      toolbarOptions = toolbarOptions ??
          (obscureText
              ? (readOnly
                  // No point in even offering "Select All" in a read-only obscured
                  // field.
                  ? const ToolbarOptions()
                  // Writable, but obscured.
                  : const ToolbarOptions(
                      selectAll: true,
                      paste: true,
                    ))
              : (readOnly
                  // Read-only, not obscured.
                  ? const ToolbarOptions(
                      selectAll: true,
                      copy: true,
                    )
                  // Writable, not obscured.
                  : const ToolbarOptions(
                      copy: true,
                      cut: true,
                      selectAll: true,
                      paste: true,
                    )));