Open au-top opened 2 years ago
Hi I have the same problem, did you manage to fix this?
Use setWindowVisibility(visible: true);
of the window_size
package to display the window.
This package is not published to pub.dev, so you need to add it via git.
https://github.com/google/flutter-desktop-embedding/tree/main/plugins/window_size
# pubspec.yaml
dependencies:
window_size:
git:
url: https://github.com/google/flutter-desktop-embedding.git
path: plugins/window_size
void main() {
runApp(MyApp());
doWhenWindowReady(() {
setWindowVisibility(visible: true);
setWindowTitle('My Demo');
});
}
I'm not sure of the difference, in my case it works.
I have fix this using https://github.com/MixinNetwork/flutter-app/pull/838
I have the same Problem. For me it only happens in the Release-Version of the app.
I tried implementing @xioxin's answer, but this did not help.
Since manually resizing the window also fixes the whitescreen for me, I tried to implement a workaround by setting the appWindow.size twice. e.g:
appWindow.size = const Size(1092, 800);
sleep(const Duration(milliseconds: 500));
appWindow.size = const Size(1092, 800);
But unfortunately this also did not help.
Did someone manage to fix this problem?
I fixed it based on @ashutosh2014 suggestion. Here is my code:
doWhenWindowReady(() {
final win = appWindow;
const initialSize = Size(1280, 720);
win.minSize = initialSize;
win.size = initialSize;
win.alignment = Alignment.center;
win.title = "XXX";
WidgetsBinding.instance.scheduleFrameCallback((timeStamp) {
appWindow.size = initialSize + const Offset(0, 1);
});
win.show();
});
When I start on windows, there may be a white screen. I need to resize the window size (I suspect it is forced to let the fluent engine refresh the screen) before it can be displayed