AdaptiveTextInput constructor
const
AdaptiveTextInput({
- Key? key,
- String? placeholder,
- TextEditingController? controller,
- ValueChanged<
String> ? onChanged, - FocusNode? focusNode,
- BoxDecoration? decoration,
- TextInputType? keyboardType,
- TextInputAction? textInputAction,
- TextCapitalization textCapitalization = TextCapitalization.none,
- TextStyle? style,
- StrutStyle? strutStyle,
- TextAlign textAlign = TextAlign.start,
- TextAlignVertical? textAlignVertical,
- bool readOnly = false,
- bool? showCursor,
- bool autofocus = false,
- String obscuringCharacter = '•',
- bool obscureText = false,
- bool autocorrect = true,
- SmartDashesType? smartDashesType,
- SmartQuotesType? smartQuotesType,
- bool enableSuggestions = true,
- int? maxLines = 1,
- int? minLines,
- bool expands = false,
- int? maxLength,
- MaxLengthEnforcement? maxLengthEnforcement,
- VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onSubmitted, - List<
TextInputFormatter> ? inputFormatters, - bool? enabled,
- double cursorWidth = 2.0,
- double? cursorHeight,
- Radius? cursorRadius,
- Color? cursorColor,
- BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
- BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
- Brightness? keyboardAppearance,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- bool? enableInteractiveSelection,
- TextSelectionControls? selectionControls,
- GestureTapCallback? onTap,
- ScrollController? scrollController,
- ScrollPhysics? scrollPhysics,
- Iterable<
String> ? autofillHints = const <String>[], - String? restorationId,
- EditableTextContextMenuBuilder? contextMenuBuilder,
Implementation
const AdaptiveTextInput({
super.key,
this.placeholder,
this.controller,
this.onChanged,
// this.groupId = EditableText,
// this.controller,
this.focusNode,
// this.undoController,
this.decoration,
TextInputType? keyboardType,
this.textInputAction,
this.textCapitalization = TextCapitalization.none,
this.style,
this.strutStyle,
this.textAlign = TextAlign.start,
this.textAlignVertical,
// this.textDirection,
this.readOnly = false,
// @Deprecated(
// 'Use `contextMenuBuilder` instead. '
// 'This feature was deprecated after v3.3.0-0.5.pre.',
// )
// this.toolbarOptions,
this.showCursor,
this.autofocus = false,
// this.statesController,
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.onEditingComplete,
this.onSubmitted,
// this.onAppPrivateCommand,
this.inputFormatters,
this.enabled,
// this.ignorePointers,
this.cursorWidth = 2.0,
this.cursorHeight,
this.cursorRadius,
// this.cursorOpacityAnimates,
this.cursorColor,
// this.cursorErrorColor,
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.onTapAlwaysCalled = false,
// this.onTapOutside,
// this.mouseCursor,
// this.buildCounter,
this.scrollController,
this.scrollPhysics,
this.autofillHints = const <String>[],
// this.contentInsertionConfiguration,
// this.clipBehavior = Clip.hardEdge,
this.restorationId,
// this.scribbleEnabled = true,
// this.enableIMEPersonalizedLearning = true,
this.contextMenuBuilder,
// this.canRequestFocus = true,
// this.spellCheckConfiguration,
// this.magnifierConfiguration,
}) : 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);