flet
flet copied to clipboard
Control/Configure Mobile Device Orientation
I make mobile app on Flet and I need to block rotation. What I need to do? Does Flet can fix rotation of the phone ?
Useful links for the dev team:
- https://greymag.medium.com/flutter-orientation-lock-portrait-only-c98910ebd769
- https://stackoverflow.com/questions/49418332/flutter-how-to-prevent-device-orientation-changes-and-force-portrait
That would be nice, I'd also like option to force to an orientation, say for video full screen mode, then set it back afterwards. We desperately need a foreground service plugin for video and audio on android, there are many on pub.dev
We desperately need a foreground service plugin for video and audio on android
What do you mean?
I mean audio_players flutter package needs to be wrapped with audio_service plugin, otherwise without running a foreground service on phone to put an icon/play/stop button on pulldown screen, can no longer acquire background service or wakelocks according to google docs. This means the audio_players plugin would be completely useless on android phone because without foreground service, second you shut your screen off, or background the app, you have limited time before your process is halted and no longer plays.
https://pub.dev/packages/audio_service https://denis-korovitskii.medium.com/flutter-demo-audioplayers-on-background-via-audio-service-c95d65c90ae1
If that was implemented for android, would mean a great deal....
At best we just need a PARTIAL_WAKELOCK, according to docs on android's site, even after adding that to your AndroidManifest.xml for a permission, still cannot acquire the lock without requesting a foreground service first. Could try following that Medium article for ideas, would be needed to be implemented with video player as well.
Maybe best solution would be a custom class for just calling their foreground service API and dealing with it natively, then either audio/video or any additions in future could just utilize it when they need it.