copyWith method
WindowState
copyWith({
- ValueGetter<
Rect> ? bounds, - ValueGetter<
bool> ? minimized, - ValueGetter<
bool> ? alwaysOnTop, - ValueGetter<
bool> ? closable, - ValueGetter<
bool> ? resizable, - ValueGetter<
bool> ? draggable, - ValueGetter<
bool> ? maximizable, - ValueGetter<
bool> ? minimizable, - ValueGetter<
bool> ? enableSnapping, - ValueGetter<
BoxConstraints> ? constraints,
Creates a copy of this state with selectively updated properties.
Uses ValueGetter functions to allow nullable value replacement. Properties not provided (null) retain their current values. When a getter is provided, it's called to obtain the new value.
Note: This method does not allow updating maximized. Use withMaximized instead for that purpose.
Parameters:
bounds: Optional getter for new window boundsminimized: Optional getter for minimized statealwaysOnTop: Optional getter for always-on-top behaviorclosable: Optional getter for closable stateresizable: Optional getter for resizable statedraggable: Optional getter for draggable statemaximizable: Optional getter for maximizable stateminimizable: Optional getter for minimizable stateenableSnapping: Optional getter for snapping enabled stateconstraints: Optional getter for size constraints
Returns a new WindowState instance with updated values.
Implementation
WindowState copyWith({
ValueGetter<Rect>? bounds,
ValueGetter<bool>? minimized,
ValueGetter<bool>? alwaysOnTop,
ValueGetter<bool>? closable,
ValueGetter<bool>? resizable,
ValueGetter<bool>? draggable,
ValueGetter<bool>? maximizable,
ValueGetter<bool>? minimizable,
ValueGetter<bool>? enableSnapping,
ValueGetter<BoxConstraints>? constraints,
}) {
return WindowState(
bounds: bounds == null ? this.bounds : bounds(),
minimized: minimized == null ? this.minimized : minimized(),
alwaysOnTop: alwaysOnTop == null ? this.alwaysOnTop : alwaysOnTop(),
closable: closable == null ? this.closable : closable(),
resizable: resizable == null ? this.resizable : resizable(),
draggable: draggable == null ? this.draggable : draggable(),
maximizable: maximizable == null ? this.maximizable : maximizable(),
minimizable: minimizable == null ? this.minimizable : minimizable(),
enableSnapping:
enableSnapping == null ? this.enableSnapping : enableSnapping(),
constraints: constraints == null ? this.constraints : constraints(),
);
}