onResized property

Stream<MapEntry<Size, Offset>> get onResized

Returns a stream broadcasting the application's window size changes.

Implementation

Stream<MapEntry<Size, Offset>> get onResized {
  StreamController<MapEntry<Size, Offset>>? controller;

  final _WindowListener listener = _WindowListener(
    onResized: (pair) => controller!.add(pair),
  );

  controller = StreamController<MapEntry<Size, Offset>>(
    onListen: () => WindowManager.instance.addListener(listener),
    onCancel: () => WindowManager.instance.removeListener(listener),
  );

  return controller.stream;
}