Repository: flutter/flutter
File: examples/multiple_windows/lib/app/models.dart (Dart)

Code before:
  final BaseWindowController controller;
}

/// Provides access to the windows created by the application.
///
/// The window manager manages a flat list of all of the [BaseWindowController]s
/// that have been created by the application as well as which controller is
/// currently selected by the UI.
class WindowManager extends ChangeNotifier {
  WindowManager({required List<KeyedWindow> initialWindows})
    : _windows = initialWindows;

  final List<KeyedWindow> _windows;
  List<KeyedWindow> get windows => _windows;

  void add(KeyedWindow window) {
    _windows.add(window);
    notifyListeners();
  }

  void remove(UniqueKey key) {
    _windows.removeWhere((KeyedWindow window) => window.key == key);
    notifyListeners();
  }

  Iterable<KeyedWindow> getChildrenOf(BaseWindowController? parent) {
    return _windows.where((KeyedWindow window) => window.parent == parent);
  }
}

/// Provides access to the [WindowManager] from the widget tree.
class WindowManagerAccessor extends InheritedNotifier<WindowManager> {
  const WindowManagerAccessor({
    super.key,
    required super.child,
    required WindowManager windowManager,
  }) : super(notifier: windowManager);

  static WindowManager of(BuildContext context) {
    final WindowManagerAccessor? result = context
        .dependOnInheritedWidgetOfExactType<WindowManagerAccessor>();
    assert(result != null, 'No WindowManager found in context');
    return result!.notifier!;
  }
}

class TooltipSettings {}

/// Settings that control the behavior of newly created windows.
class WindowSettings {
  WindowSettings({

Review comment (suggestion):
We often use the `Of` suffix to signify a method depends on an inherited widget and can add new sources of rebuilds. I'd consider avoiding the `Of` suffix here.

Also, I see you use `getChildrenOf(null)` to get the root windows. That seems not ideal since these are top-level windows - not child windows - and it's not clear what `null` means.

What do you think of switching this `getWindows({required BaseWindowController? parent})`?

```
windowManager.getWindows(parent: null); // Get top-level windows
windowManager.getWindows(parent: myWindow); // Get child windows
```

Code after:
  final BaseWindowController controller;
}

/// Provides access to the windows created by the application.
///
/// The window manager manages a flat list of all of the [BaseWindowController]s
/// that have been created by the application as well as which controller is
/// currently selected by the UI.
class WindowManager extends ChangeNotifier {
  WindowManager({required List<KeyedWindow> initialWindows})
    : _windows = initialWindows;

  final List<KeyedWindow> _windows;
  List<KeyedWindow> get windows => _windows;

  void add(KeyedWindow window) {
    _windows.add(window);
    notifyListeners();
  }

  void remove(UniqueKey key) {
    _windows.removeWhere((KeyedWindow window) => window.key == key);
    notifyListeners();
  }

  Iterable<KeyedWindow> getWindows({required BaseWindowController? parent}) {
    return _windows.where((KeyedWindow window) => window.parent == parent);
  }
}

/// Provides access to the [WindowManager] from the widget tree.
class WindowManagerAccessor extends InheritedNotifier<WindowManager> {
  const WindowManagerAccessor({
    super.key,
    required super.child,
    required WindowManager windowManager,
  }) : super(notifier: windowManager);

  static WindowManager of(BuildContext context) {
    final WindowManagerAccessor? result = context
        .dependOnInheritedWidgetOfExactType<WindowManagerAccessor>();
    assert(result != null, 'No WindowManager found in context');
    return result!.notifier!;
  }
}

class TooltipSettings {}

/// Settings that control the behavior of newly created windows.
class WindowSettings {
  WindowSettings({