import 'package:flutter/widgets.dart'; import 'window_entry.dart'; import 'window_manager.dart'; /// The floating window some content is in: its entry, the manager, and where /// the content area is drawn in the window host. Absent outside a window, so /// shared content can tell the tiled app from a window. class WindowScope extends InheritedWidget { const WindowScope({ super.key, required this.manager, required this.entry, required this.body, required super.child, }); final WindowManager manager; final WindowEntry entry; /// The content area (the window less its title bar), in the host's /// coordinates. final Rect body; static WindowScope? maybeOf(BuildContext context) => context.dependOnInheritedWidgetOfExactType(); static WindowScope of(BuildContext context) => maybeOf(context)!; @override bool updateShouldNotify(WindowScope oldWidget) => oldWidget.manager != manager || oldWidget.entry != entry || oldWidget.body != body; }