Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[desktop_multi_window] In the created window can not call other plugins #58

Closed
SiongSng opened this issue Feb 5, 2022 · 4 comments
Closed

Comments

@SiongSng
Copy link

SiongSng commented Feb 5, 2022

In the created window can not call other plug-ins, it will throw MissingPluginException, but the main window can be called.

operating system: ubuntu 21.10

@SiongSng
Copy link
Author

SiongSng commented Feb 5, 2022

I found the solution

@SiongSng SiongSng closed this as completed Feb 5, 2022
@cbenhagen
Copy link

@SiongSng what was the solution?

@SiongSng
Copy link
Author

SiongSng commented Mar 7, 2022

@cbenhagen
This is the solution, manually register each plugin here

Windows:

DesktopMultiWindowSetWindowCreatedCallback([](void *controller) {

Linux:
desktop_multi_window_plugin_set_window_created_callback([](FlPluginRegistry* registry){

macOS:
FlutterMultiWindowPlugin.setOnWindowCreatedCallback { controller in

@provokateurin
Copy link

So what I did was just calling

inside

desktop_multi_window_plugin_set_window_created_callback([](FlPluginRegistry* registry){
g_autoptr(FlPluginRegistrar) desktop_lifecycle_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopLifecyclePlugin");
desktop_lifecycle_plugin_register_with_registrar(desktop_lifecycle_registrar);
});

and it just works. No need to specify each plugin manually. I guess the same can be done for macOS and Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants