Window constructor
Window({
- Widget? title,
- Widget? actions = const WindowActions(),
- Widget? content,
- bool resizable = true,
- bool draggable = true,
- bool closable = true,
- bool maximizable = true,
- bool minimizable = true,
- bool enableSnapping = true,
- required Rect? bounds,
- Rect? maximized,
- bool minimized = false,
- bool alwaysOnTop = false,
- BoxConstraints constraints = kDefaultWindowConstraints,
Creates a window with explicit state and configuration.
This constructor creates a window with directly specified state properties rather than using a controller. The window's initial position, size, and capabilities are defined through the constructor parameters.
Parameters:
title(Widget?): Title widget for the title baractions(Widget?): Custom action widgets, defaults toWindowActions()content(Widget?): Main content widgetresizable(bool): Whether window can be resized, defaults to truedraggable(bool): Whether window can be dragged, defaults to trueclosable(bool): Whether window can be closed, defaults to truemaximizable(bool): Whether window can be maximized, defaults to trueminimizable(bool): Whether window can be minimized, defaults to trueenableSnapping(bool): Whether snapping is enabled, defaults to truebounds(Rect, required): Initial window bounds (position and size)maximized(Rect?): Bounds when maximizedminimized(bool): Whether starts minimized, defaults to falsealwaysOnTop(bool): Whether always on top, defaults to falseconstraints(BoxConstraints): Size constraints, defaults tokDefaultWindowConstraints
Example:
Window(
title: Text('My Window'),
bounds: Rect.fromLTWH(100, 100, 400, 300),
resizable: true,
content: MyContentWidget(),
)
Implementation
Window({
this.title,
this.actions = const WindowActions(),
this.content,
bool this.resizable = true,
bool this.draggable = true,
bool this.closable = true,
bool this.maximizable = true,
bool this.minimizable = true,
bool this.enableSnapping = true,
required this.bounds,
this.maximized,
bool this.minimized = false,
bool this.alwaysOnTop = false,
BoxConstraints this.constraints = kDefaultWindowConstraints,
}) : controller = null;