bitsdojo / bitsdojo_window

A Flutter package that makes it easy to customize and work with your Flutter desktop app window.
http://www.youtube.com/watch?v=bee2AHQpGK4
MIT License
806 stars 230 forks source link

on Run white screen comes [ windows ] #193

Open ashutosh2014 opened 2 years ago

ashutosh2014 commented 2 years ago

On Running on Windows, Somes times white screen comes and on clicking maximise button UI becomes visible

image

flutter doctor -v

[√] Flutter (Channel stable, 3.3.0, on Microsoft Windows [Version 10.0.19044.1889], locale en-IN)
    • Flutter version 3.3.0 on channel stable at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffccd96b62 (35 hours ago), 2022-08-29 17:28:57 -0700
    • Engine revision 5e9e0e0aa8
    • Dart version 2.18.0
    • DevTools version 2.15.0

[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\ashut\AppData\Local\Android\sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.1)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.3.32811.315
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] VS Code (version 1.70.2)
    • VS Code at C:\**\Programs\Microsoft VS Code
    • Flutter extension version 3.46.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19044.1889]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 104.0.5112.102
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 104.0.1293.70

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.
jiangtian616 commented 2 years ago

Similar issue here with Flutter 3.3.0 & bitsdojo_window 0.1.2 on Windows. UI is totally stuck after launching app, and can be solved by maximize the window.

muhleder commented 2 years ago

Seeing the same on Flutter 3.3.0 if size is not set on app startup. Using this as a workaround.

     doWhenWindowReady(() {
        Size mySize = appWindow.size;
        appWindow.size = Size(mySize.width, mySize.height + 0.001);
        appWindow.size = Size(mySize.width, mySize.height);
      });

Need to stop and restart the app fully to trigger/fix the bug. Hot restart only shows the behavior that was present on initial app startup.

ljnhst commented 4 months ago

In Windows, show() will call forceChildRefresh. forceChildRefresh will calling SetWindowPos twice in this method will cause a white screen problem. I think this is the reason for the white screen. My solution is to directly call setWindowPos in the flutter to display the window, instead of using the show in the plug-in.

Santaer commented 4 months ago

@ljnhst Looks working well after I delete one SetWindowPos from forceChildRefresh

lan2000 commented 3 months ago

bitsdojo_window: ^0.1.6 Flutter version 3.19.5 Dart version 3.3.3 Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本 10.0.19042.630]

I also have this white screen issue