window_manager
window_manager copied to clipboard
windowManager.show() doesn't work
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());
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 👍
What platform does the problem occur on? Is it a Release Mode?
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)