copyWith method
SelectableTextTheme
copyWith({
- ValueGetter<
double?> ? cursorWidth, - ValueGetter<
double?> ? cursorHeight, - ValueGetter<
Radius?> ? cursorRadius, - ValueGetter<
Color?> ? cursorColor, - ValueGetter<
BoxHeightStyle?> ? selectionHeightStyle, - ValueGetter<
BoxWidthStyle?> ? selectionWidthStyle, - ValueGetter<
bool?> ? enableInteractiveSelection,
Creates a copy of this theme with optionally replaced values.
Uses ValueGetter functions to allow nullable value replacement. Properties not provided retain their current values.
Parameters:
cursorWidth: Optional getter for new cursor widthcursorHeight: Optional getter for new cursor heightcursorRadius: Optional getter for new cursor radiuscursorColor: Optional getter for new cursor colorselectionHeightStyle: Optional getter for new selection height styleselectionWidthStyle: Optional getter for new selection width styleenableInteractiveSelection: Optional getter for new interactive selection state
Returns a new SelectableTextTheme with updated values.
Implementation
SelectableTextTheme copyWith({
ValueGetter<double?>? cursorWidth,
ValueGetter<double?>? cursorHeight,
ValueGetter<Radius?>? cursorRadius,
ValueGetter<Color?>? cursorColor,
ValueGetter<ui.BoxHeightStyle?>? selectionHeightStyle,
ValueGetter<ui.BoxWidthStyle?>? selectionWidthStyle,
ValueGetter<bool?>? enableInteractiveSelection,
}) {
return SelectableTextTheme(
cursorWidth: cursorWidth == null ? this.cursorWidth : cursorWidth(),
cursorHeight: cursorHeight == null ? this.cursorHeight : cursorHeight(),
cursorRadius: cursorRadius == null ? this.cursorRadius : cursorRadius(),
cursorColor: cursorColor == null ? this.cursorColor : cursorColor(),
selectionHeightStyle: selectionHeightStyle == null
? this.selectionHeightStyle
: selectionHeightStyle(),
selectionWidthStyle: selectionWidthStyle == null
? this.selectionWidthStyle
: selectionWidthStyle(),
enableInteractiveSelection: enableInteractiveSelection == null
? this.enableInteractiveSelection
: enableInteractiveSelection(),
);
}