Search code examples
androidfluttersleeponresume

Flutter black screen after phone sleeps or by pressing the power button


I want my app to run even if the screen closes to avoid accidental press and to consume less battery. But whenever I resume the app, it always displays a black screen even though I can still hear the app working as intended. I always needed to hover to the app history and select the app again to see the app running smoothly. here's a sample video of the issue App Black Screen

Here's also the result of flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.5, on macOS 12.3 21E230 darwin-arm, locale en-PH)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.66.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!

Has anyone else experiencing this?


Solution

  • it seems this bug is not visible in channel master. so flutter channel master does the trick in fixing this issue.