copyWith method

EditorField copyWith({
  1. Key? key,
  2. void onChanged(
    1. String
    )?,
  3. dynamic onSubmitted,
  4. void onTap()?,
  5. dynamic onEditingComplete,
  6. void onTapOutside(
    1. PointerDownEvent
    )?,
  7. TextInputType? keyboardType,
  8. TextInputAction? textInputAction,
  9. List<TextInputFormatter>? inputFormatters,
  10. TextCapitalization? textCapitalization,
  11. bool? obscureText,
  12. dynamic enableSuggestions,
  13. dynamic autocorrect,
  14. InputDecoration? decoration,
  15. TextAlign? textAlign,
  16. TextStyle? style,
  17. TextDirection? textDirection,
  18. TextAlignVertical? textAlignVertical,
  19. bool? expands,
  20. int? maxLines,
  21. dynamic minLines,
  22. dynamic maxLength,
  23. MaxLengthEnforcement? maxLengthEnforcement,
  24. bool? showCursor,
  25. double? cursorWidth,
  26. dynamic cursorHeight,
  27. Radius? cursorRadius,
  28. Color? cursorColor,
  29. bool? enableInteractiveSelection,
  30. TextSelectionControls? selectionControls,
  31. ScrollPhysics? scrollPhysics,
  32. ScrollController? scrollController,
  33. SmartQuotesType? smartQuotesType,
  34. SmartDashesType? smartDashesType,
  35. Iterable<String>? autofillHints,
  36. String? restorationId,
  37. MouseCursor? mouseCursor,
  38. EditableTextContextMenuBuilder? contextMenuBuilder,
})

Creates a copy of this EditorField with the given fields replaced by the new values.

Implementation

EditorField copyWith({
  Key? key,
  void Function(String)? onChanged,
  onSubmitted,
  void Function()? onTap,
  onEditingComplete,
  void Function(PointerDownEvent)? onTapOutside,

  // Keyboard & input
  TextInputType? keyboardType,
  TextInputAction? textInputAction,
  List<TextInputFormatter>? inputFormatters,
  TextCapitalization? textCapitalization,
  bool? obscureText,
  enableSuggestions,
  autocorrect,

  // Layout & appearance
  InputDecoration? decoration,
  TextAlign? textAlign,
  TextStyle? style,
  TextDirection? textDirection,
  TextAlignVertical? textAlignVertical,
  bool? expands,
  int? maxLines,
  minLines,
  maxLength,
  MaxLengthEnforcement? maxLengthEnforcement,

  // Cursor & selection
  bool? showCursor,
  double? cursorWidth,
  cursorHeight,
  Radius? cursorRadius,
  Color? cursorColor,
  bool? enableInteractiveSelection,
  TextSelectionControls? selectionControls,

  // Misc
  ScrollPhysics? scrollPhysics,
  ScrollController? scrollController,
  SmartQuotesType? smartQuotesType,
  SmartDashesType? smartDashesType,
  Iterable<String>? autofillHints,
  String? restorationId,
  MouseCursor? mouseCursor,
  EditableTextContextMenuBuilder? contextMenuBuilder,
}) {
  return EditorField(
    key: key ?? this.key,
    onChanged: onChanged ?? this.onChanged,
    onSubmitted: onSubmitted ?? this.onSubmitted,
    onTap: onTap ?? this.onTap,
    onEditingComplete: onEditingComplete ?? this.onEditingComplete,
    onTapOutside: onTapOutside ?? this.onTapOutside,
    keyboardType: keyboardType ?? this.keyboardType,
    textInputAction: textInputAction ?? this.textInputAction,
    inputFormatters: inputFormatters ?? this.inputFormatters,
    textCapitalization: textCapitalization ?? this.textCapitalization,
    obscureText: obscureText ?? this.obscureText,
    enableSuggestions: enableSuggestions ?? this.enableSuggestions,
    autocorrect: autocorrect ?? this.autocorrect,
    decoration: decoration ?? this.decoration,
    textAlign: textAlign ?? this.textAlign,
    style: style ?? this.style,
    textDirection: textDirection ?? this.textDirection,
    textAlignVertical: textAlignVertical ?? this.textAlignVertical,
    expands: expands ?? this.expands,
    maxLines: maxLines ?? this.maxLines,
    minLines: minLines ?? this.minLines,
    maxLength: maxLength ?? this.maxLength,
    maxLengthEnforcement: maxLengthEnforcement ?? this.maxLengthEnforcement,
    showCursor: showCursor ?? this.showCursor,
    cursorWidth: cursorWidth ?? this.cursorWidth,
    cursorHeight: cursorHeight ?? this.cursorHeight,
    cursorRadius: cursorRadius ?? this.cursorRadius,
    cursorColor: cursorColor ?? this.cursorColor,
    enableInteractiveSelection:
        enableInteractiveSelection ?? this.enableInteractiveSelection,
    selectionControls: selectionControls ?? this.selectionControls,
    scrollPhysics: scrollPhysics ?? this.scrollPhysics,
    scrollController: scrollController ?? this.scrollController,
    smartQuotesType: smartQuotesType ?? this.smartQuotesType,
    smartDashesType: smartDashesType ?? this.smartDashesType,
    autofillHints: autofillHints ?? this.autofillHints,
    restorationId: restorationId ?? this.restorationId,
    mouseCursor: mouseCursor ?? this.mouseCursor,
    contextMenuBuilder: contextMenuBuilder ?? this.contextMenuBuilder,
  );
}