Skip to content

Commit 671e996

Browse files
authored
[desktop_multi_window] update readme for register plugin in sub window
1 parent 985d816 commit 671e996

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/desktop_multi_window/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,15 @@ final result =
4949
await DesktopMultiWindow.invokeMethod(windowId!, "method_name", "arguments");
5050
debugPrint("onSend result: $result");
5151
```
52+
53+
### Use plugins in Sub window
54+
55+
Because each window created by this plugin has its own dedicated Flutter engine, and method channels cannot be shared between engines, the new window cannot directly call plugins registered with the main Flutter engine.
56+
57+
The solution is to manually register the required plugins.
58+
59+
https://github.com/MixinNetwork/flutter-plugins/blob/985d81661d00715a37ba1767ab2d22ff64641d43/packages/desktop_multi_window/example/windows/runner/flutter_window.cpp#L32-L38
60+
61+
https://github.com/MixinNetwork/flutter-plugins/blob/985d81661d00715a37ba1767ab2d22ff64641d43/packages/desktop_multi_window/example/macos/Runner/MainFlutterWindow.swift#L15-L18
62+
63+
https://github.com/MixinNetwork/flutter-plugins/blob/985d81661d00715a37ba1767ab2d22ff64641d43/packages/desktop_multi_window/example/linux/my_application.cc#L65-L69

0 commit comments

Comments
 (0)