flutter-unity-view-widget icon indicating copy to clipboard operation
flutter-unity-view-widget copied to clipboard

White screen issue

Open Kiruthika2206 opened this issue 6 months ago • 3 comments

Facing white screen issue while navigating to other screens and whenever we are going and coming back to the application.

Unity version 2021.3.11f1 Flutter version 3.3.10 fuw-2022.1.7f1.unitypackage

Kiruthika2206 avatar Dec 07 '23 15:12 Kiruthika2206

Flutter 3.19.2 • channel stable • https://github.com/flutter/flutter.git Framework • revision 7482962148 (2 weeks ago) • 2024-02-27 16:51:22 -0500 Engine • revision 04817c99c9 Tools • Dart 3.3.0 • DevTools 2.31.1

I found i had the same issue when navigating between views. This is different from the flickering you get, which was solved by setting the MaterialPage Route transition duration to 0.

The white screen occurs a bit randomly, sometime the first view will load and display the unity scene, and the second page will be blank. Sometimes its the other way around, The first screen will be white and the second view will load. Going backand forth shows that one view works and the other doesn.t

I solved this by setting useAndroidViewSurface: true If i set this to false i get this issue even now.

I might add that when i get the white screen, i know the unity scene is runnig, because i can see the logs from a coroutine.

emileswain avatar Mar 14 '24 14:03 emileswain

@emileswain your issue has a different cause.
Flutter 3.19 simply breaks the unitywidget if useAndroidViewSurface: false.

https://github.com/juicycleff/flutter-unity-view-widget/issues/929

This is fixed on the flutter master branch, so it might be in 3.21 or whatever version number that gets.

timbotimbo avatar Mar 14 '24 14:03 timbotimbo

cool, thanks.

emileswain avatar Mar 14 '24 14:03 emileswain