...
@override
void dispose() {
// Remove the app lifecycle observer.
WidgetsBinding.instance.removeObserver(this);
// Stop location updates when the widget is disposed.
_locationDataSource.stop();
super.dispose();
}