juicycleff / flutter-unity-view-widget

Embeddable unity game engine view for Flutter. Advance demo here https://github.com/juicycleff/flutter-unity-arkit-demo
BSD 3-Clause "New" or "Revised" License
2.09k stars 505 forks source link

Screen Rotation Delay Issue (White screen) #905

Closed hyvnua closed 1 month ago

hyvnua commented 6 months ago

Describe the bug The screen that rotates when rotating the device works later with Unity, so only the white screen of the flutter is visible. If you keep repeating the rotation, the screen pops up completely white.

"E/BufferQueueProducer (4213): [SurfaceTexture-0-4213-0] (id:107500000002, api:0,p:-1,c:4213) dequeueBuffer: BufferQueue has no connected producer" logs continue to occur while the screen is white.

I/BufferQueueProducer( 4213): SurfaceView - @114ef2f@12#27(BLAST Consumer)27 FrameBooster: VULKAN surface was catched D/xample.wireles( 4213): FrameBooster: InterpolationGui: UID 10384 detected as using Vulkan

To Reproduce I followed the example codes "Communicating with and from Unity".

Expected behavior When the device rotates, Unity and Flutter screens move at the same speed, and sliders stacked in stacks on Unity screens should operate.

Unity (please complete the following information):

Flutter

Smartphone (please complete the following information):

timbotimbo commented 6 months ago

This looks like a recurring bug with the way Flutter handles platform views. Behaviour might have changed in newer Flutter versions. Which Flutter version is this?

Can you test this with useAndroidViewSurface parameter set to true? This uses an alternative platform view mode that might prevent this bug.

timbotimbo commented 1 month ago

This should be fixed in Flutter 3.22, which includes changes related to resizing and rotating platform views.