简体   繁体   English

Flutter 休眠或按电源键黑屏

[英]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.我总是需要 hover 到应用程序历史记录,然后再次 select 应用程序才能看到应用程序顺利运行。 here's a sample video of the issue App Black Screen这是问题应用程序黑屏的示例视频

Here's also the result of flutter doctor:这也是 flutter 医生的结果:

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?还有其他人遇到过这个吗?

it seems this bug is not visible in channel master.似乎这个错误在频道大师中不可见。 so flutter channel master does the trick in fixing this issue.所以flutter channel master解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM