CustomInput constructor

const CustomInput({
  1. Key? key,
  2. TextEditingController? controller,
  3. String? initialValue,
  4. FocusNode? focusNode,
  5. TextInputType? keyboardType,
  6. TextCapitalization textCapitalization = TextCapitalization.none,
  7. TextInputAction? textInputAction,
  8. TextStyle? style,
  9. StrutStyle? strutStyle,
  10. TextDirection? textDirection,
  11. TextAlign textAlign = TextAlign.start,
  12. TextAlignVertical? textAlignVertical,
  13. bool autofocus = false,
  14. bool readOnly = false,
  15. bool? showCursor,
  16. String obscuringCharacter = '*',
  17. bool obscureText = false,
  18. bool autocorrect = true,
  19. SmartDashesType? smartDashesType,
  20. SmartQuotesType? smartQuotesType,
  21. bool enableSuggestions = true,
  22. MaxLengthEnforcement? maxLengthEnforcement,
  23. int? maxLines = 1,
  24. int? minLines,
  25. bool expands = false,
  26. int? maxLength,
  27. ValueChanged<String>? onChanged,
  28. GestureTapCallback? onTap,
  29. TapRegionCallback? onTapOutside,
  30. ValueChanged<String>? onFieldSubmitted,
  31. FormFieldSetter<String>? onSaved,
  32. FormFieldValidator<String>? validator,
  33. List<TextInputFormatter>? inputFormatters,
  34. bool? enabled,
  35. double cursorWidth = 2.0,
  36. double? cursorHeight,
  37. Radius? cursorRadius,
  38. Color? cursorColor,
  39. Brightness? keyboardAppearance,
  40. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  41. bool? enableInteractiveSelection,
  42. TextSelectionControls? selectionControls,
  43. InputCounterWidgetBuilder? buildCounter,
  44. ScrollPhysics? scrollPhysics,
  45. Iterable<String>? autofillHints,
  46. ScrollController? scrollController,
  47. String? restorationId,
  48. bool enableIMEPersonalizedLearning = true,
  49. MouseCursor? mouseCursor,
  50. SpellCheckConfiguration? spellCheckConfiguration,
  51. TextMagnifierConfiguration? magnifierConfiguration,
  52. UndoHistoryController? undoController,
  53. AppPrivateCommandCallback? onAppPrivateCommand,
  54. bool? cursorOpacityAnimates,
  55. BoxHeightStyle selectionHeightStyle = BoxHeightStyle.tight,
  56. BoxWidthStyle selectionWidthStyle = BoxWidthStyle.tight,
  57. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  58. ContentInsertionConfiguration? contentInsertionConfiguration,
  59. Clip clipBehavior = Clip.hardEdge,
  60. bool stylusHandwritingEnabled = true,
  61. bool canRequestFocus = true,
  62. AutovalidateMode? autovalidateMode = AutovalidateMode.onUserInteraction,
  63. InputDecoration? decoration,
  64. CustomInputSize size = CustomInputSize.middle,
  65. bool useCameraScanner = false,
  66. bool showBorder = false,
  67. bool? clearable,
  68. VoidCallback? onClear,
  69. bool? inListTile = false,
})

Input 输入框组件

Implementation

const CustomInput({
  super.key,
  this.controller,
  this.initialValue,
  this.focusNode,
  this.keyboardType,
  this.textCapitalization = TextCapitalization.none,
  this.textInputAction,
  this.style,
  this.strutStyle,
  this.textDirection,
  this.textAlign = TextAlign.start,
  this.textAlignVertical,
  this.autofocus = false,
  this.readOnly = false,
  this.showCursor,
  this.obscuringCharacter = '*',
  this.obscureText = false,
  this.autocorrect = true,
  this.smartDashesType,
  this.smartQuotesType,
  this.enableSuggestions = true,
  this.maxLengthEnforcement,
  this.maxLines = 1,
  this.minLines,
  this.expands = false,
  this.maxLength,
  this.onChanged,
  this.onTap,
  this.onTapOutside,
  this.onFieldSubmitted,
  this.onSaved,
  this.validator,
  this.inputFormatters,
  this.enabled,
  this.cursorWidth = 2.0,
  this.cursorHeight,
  this.cursorRadius,
  this.cursorColor,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.enableInteractiveSelection,
  this.selectionControls,
  this.buildCounter,
  this.scrollPhysics,
  this.autofillHints,
  this.scrollController,
  this.restorationId,
  this.enableIMEPersonalizedLearning = true,
  this.mouseCursor,
  this.spellCheckConfiguration,
  this.magnifierConfiguration,
  this.undoController,
  this.onAppPrivateCommand,
  this.cursorOpacityAnimates,
  this.selectionHeightStyle = BoxHeightStyle.tight,
  this.selectionWidthStyle = BoxWidthStyle.tight,
  this.dragStartBehavior = DragStartBehavior.start,
  this.contentInsertionConfiguration,
  this.clipBehavior = Clip.hardEdge,
  this.stylusHandwritingEnabled = true,
  this.canRequestFocus = true,
  this.autovalidateMode = AutovalidateMode.onUserInteraction,
  this.decoration,
  this.size = CustomInputSize.middle,
  this.useCameraScanner = false,
  this.showBorder = false,
  this.clearable,
  this.onClear,
  this.inListTile = false,
});