WindowState class

Complete state configuration for a window instance.

Encapsulates all aspects of a window's current state including position, size, visual state (minimized, maximized), capabilities (resizable, draggable), and behavior settings (snapping, always on top).

Key Properties:

Used primarily with WindowController to manage window state programmatically and provide reactive updates to window appearance and behavior.

Example:

WindowState(
  bounds: Rect.fromLTWH(100, 100, 800, 600),
  resizable: true,
  draggable: true,
  enableSnapping: true,
  constraints: BoxConstraints(minWidth: 400, minHeight: 300),
)

Constructors

WindowState({required Rect bounds, Rect? maximized, bool minimized = false, bool alwaysOnTop = false, bool closable = true, bool resizable = true, bool draggable = true, bool maximizable = true, bool minimizable = true, bool enableSnapping = true, BoxConstraints constraints = kDefaultWindowConstraints})
Creates a window state with the specified configuration.
const

Properties

alwaysOnTop bool
Whether the window should always appear on top of other windows.
final
bounds Rect
Current position and size of the window.
final
closable bool
Whether the window can be closed by the user.
final
constraints BoxConstraints
Size constraints for the window.
final
draggable bool
Whether the window can be moved by dragging its title bar.
final
enableSnapping bool
Whether edge snapping is enabled for this window.
final
hashCode int
The hash code for this object.
no setteroverride
maximizable bool
Whether the window can be maximized to fill the screen.
final
maximized Rect?
Bounds of the window when maximized, or null if not maximized.
final
minimizable bool
Whether the window can be minimized to the taskbar.
final
minimized bool
Whether the window is currently minimized to the taskbar.
final
resizable bool
Whether the window can be resized by dragging its edges or corners.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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}) WindowState
Creates a copy of this state with selectively updated properties.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
withMaximized(Rect? maximized) WindowState
Creates a copy of this state with only the maximized bounds changed.

Operators

operator ==(Object other) bool
The equality operator.
override