Error running the project in the child window
Using desktop_multi_window package crated a new window from a flutter windows application and when created and opened new window with this browser component it fails with this error
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method initialize on channel io.jns.webview.win) #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:313:7)
https://github.com/jnschulze/flutter-webview-windows/issues/1 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:518:43)
https://github.com/jnschulze/flutter-webview-windows/issues/2 WebviewController.initialize (package:webview_windows/src/webview.dart:172:11)
Any thing i missed or any suggestions.
@vusarath Hi, any chance you managed to solve this?
If you need to use a plugin within a sub-window, you must manually register it in main.cpp or flutter_window.cpp when the sub-window is created.
The code you provided demonstrates the correct method for this:
DesktopMultiWindowSetWindowCreatedCallback([](void *controller) { auto *flutter_controller_sub_ = reinterpret_cast<flutter::FlutterViewController *>(controller); auto *registry = flutter_controller_sub_->engine(); // Manual registration of native plugins for the sub-window WindowManagerPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("WindowManagerPlugin")); FlutterInappwebviewWindowsPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi")); ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi")); DesktopDropPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("DesktopDropPlugin")); WebviewWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("WebviewWindowsPlugin")); });