window_manager icon indicating copy to clipboard operation
window_manager copied to clipboard

windowManager.show() doesn't work

Open dangluan343 opened this issue 1 year ago • 3 comments

I have just started with window_manager. WindowManager.show() must show a window but not thing shows up when I do this in the main function:

  WidgetsFlutterBinding.ensureInitialized();
  await windowManager.ensureInitialized();
  WindowOptions windowOptions = WindowOptions(
    size: Size(800, 600),
    center: true,
    backgroundColor: Colors.transparent,
    skipTaskbar: false,
    titleBarStyle: TitleBarStyle.hidden,
  );
  windowManager.waitUntilReadyToShow(windowOptions, () async {
    await windowManager.show();
    await windowManager.focus();
  });
runApp(MyApp());

dangluan343 avatar Jan 12 '23 15:01 dangluan343

I bet Its actually showing up, Few things to do here

  • Remove the color.transparent 😅
  • Remove TitleBarStyle.hidden 😅
  • Add 'await' on here below, like this await windowManager.waitUntilReadyToShow ...
  • run flutter clean -> flutter pub get
  • and then try it 👍

JohnF17 avatar Mar 22 '23 06:03 JohnF17

What platform does the problem occur on? Is it a Release Mode?

lijy91 avatar Jul 01 '23 05:07 lijy91

Hey @lijy91, i believe Its actually just the combination of a transparent border with a hidden titlebar style causing it not to show, pretty much self explanatory if i must say 🙂 and a closed issue (but i understand it would be better if @dangluan343 affirms this)

JohnF17 avatar Jul 03 '23 07:07 JohnF17