copyWith method

TextField copyWith({
  1. Key? key,
  2. TextEditingController? controller,
  3. FocusNode? focusNode,
  4. InputDecoration? decoration = const InputDecoration(),
  5. TextInputType? keyboardType,
  6. TextInputAction? textInputAction,
  7. TextCapitalization? textCapitalization,
  8. TextStyle? style,
  9. StrutStyle? strutStyle,
  10. TextAlign? textAlign,
  11. TextAlignVertical? textAlignVertical,
  12. TextDirection? textDirection,
  13. bool? readOnly,
  14. ToolbarOptions? toolbarOptions,
  15. bool? showCursor,
  16. bool? autofocus,
  17. String? obscuringCharacter,
  18. bool? obscureText,
  19. bool? autocorrect,
  20. SmartDashesType? smartDashesType,
  21. SmartQuotesType? smartQuotesType,
  22. bool? enableSuggestions,
  23. int? maxLines = 1,
  24. int? minLines,
  25. bool? expands,
  26. int? maxLength,
  27. bool? maxLengthEnforced,
  28. MaxLengthEnforcement? maxLengthEnforcement,
  29. void onChanged(
    1. String
    )?,
  30. void onEditingComplete()?,
  31. void onSubmitted(
    1. String
    )?,
  32. void onAppPrivateCommand(
    1. String,
    2. Map
    )?,
  33. List<TextInputFormatter>? inputFormatters,
  34. bool? enabled,
  35. double? cursorWidth,
  36. double? cursorHeight,
  37. Radius? cursorRadius,
  38. Color? cursorColor,
  39. BoxHeightStyle? selectionHeightStyle,
  40. BoxWidthStyle? selectionWidthStyle,
  41. Brightness? keyboardAppearance,
  42. EdgeInsets? scrollPadding,
  43. DragStartBehavior? dragStartBehavior,
  44. bool? enableInteractiveSelection,
  45. TextSelectionControls? selectionControls,
  46. void onTap()?,
  47. MouseCursor? mouseCursor,
  48. Widget? buildCounter(
    1. BuildContext, {
    2. required int currentLength,
    3. required bool isFocused,
    4. required int? maxLength,
    })?,
  49. ScrollController? scrollController,
  50. ScrollPhysics? scrollPhysics,
  51. Iterable<String>? autofillHints,
  52. Clip? clipBehavior,
  53. String? restorationId,
  54. bool? enableIMEPersonalizedLearning,
})

Implementation

TextField copyWith({
  Key? key,
  TextEditingController? controller,
  FocusNode? focusNode,
  InputDecoration? decoration = const InputDecoration(),
  TextInputType? keyboardType,
  TextInputAction? textInputAction,
  TextCapitalization? textCapitalization,
  TextStyle? style,
  StrutStyle? strutStyle,
  TextAlign? textAlign,
  TextAlignVertical? textAlignVertical,
  TextDirection? textDirection,
  bool? readOnly,
  ToolbarOptions? toolbarOptions,
  bool? showCursor,
  bool? autofocus,
  String? obscuringCharacter,
  bool? obscureText,
  bool? autocorrect,
  SmartDashesType? smartDashesType,
  SmartQuotesType? smartQuotesType,
  bool? enableSuggestions,
  int? maxLines = 1,
  int? minLines,
  bool? expands,
  int? maxLength,
  bool? maxLengthEnforced,
  MaxLengthEnforcement? maxLengthEnforcement,
  void Function(String)? onChanged,
  void Function()? onEditingComplete,
  void Function(String)? onSubmitted,
  void Function(String, Map)? onAppPrivateCommand,
  List<TextInputFormatter>? inputFormatters,
  bool? enabled,
  double? cursorWidth,
  double? cursorHeight,
  Radius? cursorRadius,
  Color? cursorColor,
  BoxHeightStyle? selectionHeightStyle,
  BoxWidthStyle? selectionWidthStyle,
  Brightness? keyboardAppearance,
  EdgeInsets? scrollPadding,
  DragStartBehavior? dragStartBehavior,
  bool? enableInteractiveSelection,
  TextSelectionControls? selectionControls,
  void Function()? onTap,
  MouseCursor? mouseCursor,
  Widget? Function(BuildContext,
          {required int currentLength, required bool isFocused, required int? maxLength})?
      buildCounter,
  ScrollController? scrollController,
  ScrollPhysics? scrollPhysics,
  Iterable<String>? autofillHints,
  Clip? clipBehavior,
  String? restorationId,
  bool? enableIMEPersonalizedLearning,
}) {
  return TextField(
    key: key ?? this.key,
    controller: controller ?? this.controller,
    focusNode: focusNode ?? this.focusNode,
    decoration: decoration ?? this.decoration,
    keyboardType: keyboardType ?? this.keyboardType,
    textInputAction: textInputAction ?? this.textInputAction,
    textCapitalization: textCapitalization ?? this.textCapitalization,
    style: style ?? this.style,
    strutStyle: strutStyle ?? this.strutStyle,
    textAlign: textAlign ?? this.textAlign,
    textAlignVertical: textAlignVertical ?? this.textAlignVertical,
    textDirection: textDirection ?? this.textDirection,
    readOnly: readOnly ?? this.readOnly,
    toolbarOptions: toolbarOptions ?? this.toolbarOptions,
    showCursor: showCursor ?? this.showCursor,
    autofocus: autofocus ?? this.autofocus,
    obscuringCharacter: obscuringCharacter ?? this.obscuringCharacter,
    obscureText: obscureText ?? this.obscureText,
    autocorrect: autocorrect ?? this.autocorrect,
    smartDashesType: smartDashesType ?? this.smartDashesType,
    smartQuotesType: smartQuotesType ?? this.smartQuotesType,
    enableSuggestions: enableSuggestions ?? this.enableSuggestions,
    maxLines: maxLines ?? this.maxLines,
    minLines: minLines ?? this.minLines,
    expands: expands ?? this.expands,
    maxLength: maxLength ?? this.maxLength,
    maxLengthEnforcement: maxLengthEnforcement ?? this.maxLengthEnforcement,
    onChanged: onChanged ?? this.onChanged,
    onEditingComplete: onEditingComplete ?? this.onEditingComplete,
    onSubmitted: onSubmitted ?? this.onSubmitted,
    onAppPrivateCommand: onAppPrivateCommand ?? this.onAppPrivateCommand,
    inputFormatters: inputFormatters ?? this.inputFormatters,
    enabled: enabled ?? this.enabled,
    cursorWidth: cursorWidth ?? this.cursorWidth,
    cursorHeight: cursorHeight ?? this.cursorHeight,
    cursorRadius: cursorRadius ?? this.cursorRadius,
    cursorColor: cursorColor ?? this.cursorColor,
    selectionHeightStyle: selectionHeightStyle ?? this.selectionHeightStyle,
    selectionWidthStyle: selectionWidthStyle ?? this.selectionWidthStyle,
    keyboardAppearance: keyboardAppearance ?? this.keyboardAppearance,
    scrollPadding: scrollPadding ?? this.scrollPadding,
    dragStartBehavior: dragStartBehavior ?? this.dragStartBehavior,
    enableInteractiveSelection: enableInteractiveSelection ?? this.enableInteractiveSelection,
    selectionControls: selectionControls ?? this.selectionControls,
    onTap: onTap ?? this.onTap,
    mouseCursor: mouseCursor ?? this.mouseCursor,
    buildCounter: buildCounter ?? this.buildCounter,
    scrollController: scrollController ?? this.scrollController,
    scrollPhysics: scrollPhysics ?? this.scrollPhysics,
    autofillHints: autofillHints ?? this.autofillHints,
    clipBehavior: clipBehavior ?? this.clipBehavior,
    restorationId: restorationId ?? this.restorationId,
    enableIMEPersonalizedLearning:
        enableIMEPersonalizedLearning ?? this.enableIMEPersonalizedLearning,
  );
}