Skip to content

LucaCoduriV/wayland_multi_window

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wayland_multi_window

Pub

A flutter plugin that create and manage multi window in wayland.

Usage

To use this plugin, add wayland_multi_window as a dependency in your pubspec.yaml file.

Example

Create and Show another window.

final window = await WaylandMultiWindow.createWindow(jsonEncode({
  'args1': 'Sub window',
  'args2': 100,
  'args3': true,
  'bussiness': 'bussiness_test',
}));
window
  ..setFrame(const Offset(0, 0) & const Size(1280, 720))
  ..center()
  ..setTitle('Another window')
  ..show();

Invoke remote window method.

The windows run on different flutter engine. So we need use WaylandMultiWindow.invokeMethod and WaylandMultiWindow.invokeMethod to handle method calls between windows.

WaylandMultiWindow.setMethodCallHandler((call, fromWindowId) async {
  debugPrint('${call.method} ${call.arguments} $fromWindowId');
  return "result";
});
final result =
    await DesktopMultiWindow.invokeMethod(windowId!, "method_name", "arguments");
debugPrint("onSend result: $result");

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published