Window.controlled constructor

Window.controlled({
  1. Widget? title,
  2. Widget? actions = const WindowActions(),
  3. Widget? content,
  4. required WindowController? controller,
})

Creates a controlled window with behavior managed by a WindowController.

This constructor creates a window whose state (position, size, minimized, maximized) is entirely controlled programmatically through the provided controller. All state properties are null and managed via the controller.

Parameters:

  • title (Widget?): Title widget for the title bar
  • actions (Widget?): Custom action widgets, defaults to WindowActions()
  • content (Widget?): Main content widget
  • controller (WindowController, required): Controller for programmatic management

Example:

Window.controlled(
  controller: myWindowController,
  title: Text('Controlled Window'),
  content: MyContentWidget(),
)

Implementation

Window.controlled({
  this.title,
  this.actions = const WindowActions(),
  this.content,
  required this.controller,
})  : bounds = null,
      maximized = null,
      minimized = null,
      alwaysOnTop = null,
      resizable = null,
      draggable = null,
      maximizable = null,
      minimizable = null,
      enableSnapping = null,
      closable = null,
      constraints = null;