WindowWidget constructor

const WindowWidget({
  1. Key? key,
  2. Widget? title,
  3. Widget? actions,
  4. Widget? content,
  5. double? titleBarHeight,
  6. double? resizeThickness,
  7. bool resizable = true,
  8. bool draggable = true,
  9. bool closable = true,
  10. bool maximizable = true,
  11. bool minimizable = true,
  12. bool enableSnapping = true,
  13. required Rect bounds,
  14. Rect? maximized,
  15. bool minimized = false,
  16. BoxConstraints constraints = kDefaultWindowConstraints,
})

Creates a window with direct state management.

All window state properties (bounds, minimized, etc.) are managed directly through widget properties. State changes require rebuilding the widget with new property values.

Parameters:

  • title: Title bar content
  • actions: Action buttons area content
  • content: Main window content
  • titleBarHeight: Custom title bar height (optional)
  • resizeThickness: Custom resize border thickness (optional)
  • resizable: Enable resizing (defaults to true)
  • draggable: Enable dragging (defaults to true)
  • closable: Enable closing (defaults to true)
  • maximizable: Enable maximizing (defaults to true)
  • minimizable: Enable minimizing (defaults to true)
  • enableSnapping: Enable edge snapping (defaults to true)
  • bounds: Initial window bounds (required)
  • maximized: Initial maximized bounds (optional)
  • minimized: Start minimized (defaults to false)
  • constraints: Size constraints (defaults to kDefaultWindowConstraints)

Implementation

const WindowWidget({
  super.key,
  this.title,
  this.actions,
  this.content,
  this.titleBarHeight,
  this.resizeThickness,
  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 Rect this.bounds,
  this.maximized,
  bool this.minimized = false,
  BoxConstraints this.constraints = kDefaultWindowConstraints,
}) : controller = null;