AdaptiveTextInput constructor

const AdaptiveTextInput({
  1. Key? key,
  2. String? placeholder,
  3. TextEditingController? controller,
  4. ValueChanged<String>? onChanged,
  5. FocusNode? focusNode,
  6. BoxDecoration? decoration,
  7. TextInputType? keyboardType,
  8. TextInputAction? textInputAction,
  9. TextCapitalization textCapitalization = TextCapitalization.none,
  10. TextStyle? style,
  11. StrutStyle? strutStyle,
  12. TextAlign textAlign = TextAlign.start,
  13. TextAlignVertical? textAlignVertical,
  14. bool readOnly = false,
  15. bool? showCursor,
  16. bool autofocus = false,
  17. String obscuringCharacter = '•',
  18. bool obscureText = false,
  19. bool autocorrect = true,
  20. SmartDashesType? smartDashesType,
  21. SmartQuotesType? smartQuotesType,
  22. bool enableSuggestions = true,
  23. int? maxLines = 1,
  24. int? minLines,
  25. bool expands = false,
  26. int? maxLength,
  27. MaxLengthEnforcement? maxLengthEnforcement,
  28. VoidCallback? onEditingComplete,
  29. ValueChanged<String>? onSubmitted,
  30. List<TextInputFormatter>? inputFormatters,
  31. bool? enabled,
  32. double cursorWidth = 2.0,
  33. double? cursorHeight,
  34. Radius? cursorRadius,
  35. Color? cursorColor,
  36. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  37. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  38. Brightness? keyboardAppearance,
  39. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  40. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  41. bool? enableInteractiveSelection,
  42. TextSelectionControls? selectionControls,
  43. GestureTapCallback? onTap,
  44. ScrollController? scrollController,
  45. ScrollPhysics? scrollPhysics,
  46. Iterable<String>? autofillHints = const <String>[],
  47. String? restorationId,
  48. 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);