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

MissingPluginException(No implementation found for method ensureInitialized on channel window_manager_plus) #1

Open
CaoGiaHieu-dev opened this issue Oct 11, 2024 · 3 comments

Comments

@CaoGiaHieu-dev
Copy link

Hi . im just follow document and get this issue

════════ Exception caught by Flutter framework ═════════════════════════════════
The following MissingPluginException was thrown:
MissingPluginException(No implementation found for method ensureInitialized on channel window_manager_plus)

When the exception was thrown, this was the stack:
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7)
platform_channel.dart:332
<asynchronous suspension>
#1      WindowManagerPlus.ensureInitialized (package:window_manager_plus/src/window_manager.dart:283:5)
window_manager.dart:283
<asynchronous suspension>
#2      _setDesktopWindow (package:super_up/main.dart:172:3)
main.dart:172
<asynchronous suspension>
#3      main.<anonymous closure> (package:super_up/main.dart:35:7)
main.dart:35
<asynchronous suspension>
════════════════════════════════════════════════════════════════════════════════

code example

Future<void> _setDesktopWindow(List<String> args) async {
  // await the initialization of the plugin.
  // Here is an example of how to use ensureInitialized in the main function:
  await WindowManagerPlus.ensureInitialized(
      args.isEmpty ? 0 : int.tryParse(args[0]) ?? 0);

  // Now you can use the plugin, such as WindowManagerPlus.current
  WindowOptions windowOptions = WindowOptions(
    minimumSize: const Size(800, 600),
    size: const Size(1500, 1000),
    backgroundColor: Colors.transparent,
    skipTaskbar: true,
    title: SConstants.appName,
    titleBarStyle: VPlatforms.isWindows ? null : TitleBarStyle.hidden,
    fullScreen: false,
  );

  WindowManagerPlus.current.waitUntilReadyToShow(windowOptions, () async {
    await WindowManagerPlus.current.center();
    await WindowManagerPlus.current.show();
    await WindowManagerPlus.current.focus();
  });
}
void main(List<String> args) async {
  runZonedGuarded(() async {
    WidgetsFlutterBinding.ensureInitialized();

    if (VPlatforms.isDeskTop) {
      await _setDesktopWindow(args);
    }
....
@CaoGiaHieu-dev
Copy link
Author

sorry . wrong setup on macos

@CaoGiaHieu-dev
Copy link
Author

it happen on hot reload

@sennraf
Copy link

sennraf commented Oct 31, 2024

I get a MissingPluginException just on hot restart.

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

No branches or pull requests

2 participants