Flutter location doesn't return data after use onLocationChanged

633 Views Asked by At

I have two separate screen home.dart and track.dart

In home.dart

location.getLocation()

In track.dart I'm listening location

location.onLocationChanged.listen((LocationData loc) { // do something })

When I navigate to track.dart screen and return to home.dart location.getLocation doesn't return any data and not giving any error at all.

How can I implement such feature and what is the best solution for this problem.

Flatform: android Flutter location version: 4.3.0

0

There are 0 best solutions below