-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Description
Description
Every time I use an app built by Flutter the Xcode indicates a very high energy impact.
I first noticed this reaction when playing a flare animation. But later I noticed it appears in every render of the UI. Am I using it wrong? Does everybody see this in their projects?
The GPU average usage meter may seem legit, since it’s an average there’s a good explanation for that. But why does it affect the battery so much? I want to build an app for production usage but doesn't seem quite healthy.
Uploaded this demo clip:
https://www.youtube.com/watch?v=I_VacxqDKDg
Downloadable code (Flutter, iOS & Android projects), in case you'll find some mistake there:
https://www.dropbox.com/s/dt32jpuihcg7gm4/battery_impact_example.zip?dl=0
Thanks a lot!
Preconditions
- The app should have a scrollable scroll view (even an empty one would reproduce this issue).
- You can have a lite endless animation instead.
- Build the app using Flutter.
- Use a real device (in my case I used iPhone Xs).
Steps to Reproduce
- Run the iOS app from your Xcode.
- Go to "Debug Navigator" pane.
- Scroll the UI back and forth / observe the endless animation.
- While scrolling / animation is playing, observe the battery impact and the GPU usage.
Expected result
A production app shouldn't impact the battery so much.
Actual result
According to Xcode's profiler, the app consumes too much battery.