antler119 / system_tray

A Flutter package that makes it easy to customize and work with your Flutter desktop app's system tray.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to get the screen position of the system tray?

SaadArdati opened this issue · comments

Many apps will position their windows right under their system tray icon. I wish to replicate the same behavior using the https://pub.dev/packages/window_manager package, but I need the coordinates of the system tray to be able to do that.

Is it possible to get information back about the tray's position?

would like to know the same,
great plugin shame its so quiet here

anyone figured itout?

system_tray implements something similar

/// The bounds of this tray icon.
  Future<Rect?> getBounds() async {
    final Map<String, dynamic> arguments = {
      'devicePixelRatio': window.devicePixelRatio,
    };
    final Map<dynamic, dynamic>? resultData = await _channel.invokeMethod(
      'getBounds',
      arguments,
    );
    if (resultData == null) {
      return null;
    }
    return Rect.fromLTWH(
      resultData['x'],
      resultData['y'],
      resultData['width'],
      resultData['height'],
    );
  }
}``` im really flutter newbie perhaps something like that can be integrated?

window there is from final SingletonFlutterWindow window = SingletonFlutterWindow._(0, PlatformDispatcher.instance);