TextFieldSuperValidation constructor

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

Implementation

const TextFieldSuperValidation({
  this.onlyValidationOnTextChange = false,
  required this.superValidation,
  this.autovalidateMode = AutovalidateMode.disabled,
  this.altValidation,
  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,
})  : 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,
                    )));