r/flutterhelp • u/kiruP3 • Jun 29 '26
OPEN Help with app draining battery rapidly.
I'm working a huge project which purpose is to provide application for employees that helps them login and register their work location and also track them for petrol allowance based ontheir route travelled.
This is huge and battery consuming I understand that but its way too much - 40 percent in 1 hours like that
5
Upvotes
2
u/RandalSchwartz Jun 29 '26
Are you using Geofencing? That should keep your app from using any CPU as long as you haven't moved far.
2
u/Noor_378 Jun 29 '26
Why not cache the latitude and longitude locally first, then send them to the backend in batches, or at the end of the work instead of making a request for every location update? Also, use medium location accuracy instead of high accuracy all the time, and use stream builder really carefully, all this should reduce battery usage.
1
u/Routine-Arm-8803 Jun 29 '26
Have you checked profiler to see what's causing it?