onMoved property

Stream<Offset> get onMoved

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

Implementation

Stream<Offset> get onMoved {
  StreamController<Offset>? controller;

  final _WindowListener listener = _WindowListener(
    onMoved: (position) => controller!.add(position),
  );

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

  return controller.stream;
}