You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Until yesterday the Geolocator positionStream was working just fine.
I can't figure out why the stream does not produce any values even when I use the Extended Controls Tool to change the location of the device.
And the location service has this method for the settings.
LocationSettings getLocationSettings() {
if (defaultTargetPlatform == TargetPlatform.android) {
return AndroidSettings(
distanceFilter: 50,
//(Optional) Set foreground notification config to keep the app alive
//when going to the background
foregroundNotificationConfig: const ForegroundNotificationConfig(
notificationTitle: "Running in Background",
notificationText:
"Example app will continue to receive your location even when you aren't using it",
notificationIcon: AndroidResource(name: 'notification_icon'),
));
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
return AppleSettings(
accuracy: LocationAccuracy.best,
distanceFilter: AppLocationSettings.locationChangeDistance,
activityType: ActivityType.automotiveNavigation,
pauseLocationUpdatesAutomatically: true,
// Only set to true if our app will be started up in the background.
showBackgroundLocationIndicator: true,
);
} else {
return const LocationSettings(
accuracy: LocationAccuracy.best,
distanceFilter: 50,
);
}
}
I am using another provider to listen to the positionStreamProvider:
This is the provider which is not updating anymore.
It is just annoying to spend hours just to figure out why it just stops working.
Maybe I am missing something.
I start the provider by doing the following in one of the screens of the app.
final locationAsync = ref.watch(
positionStreamProvider.select((value) => value.whenData((value) => true)),
);
Basically I would use the Extended Controls Tool of the emulator to change the location and the positionStrean would yield a new value. But that is not happening anymore. The location is change on the map, but nothing happens with positionStream.
I can't see any error logs.
Most of the code come from the deliverzler app.
It did work when I change the myLocationCameraPositionProvider to the following:
This discussion was converted from issue #3303 on March 01, 2024 17:03.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Until yesterday the Geolocator positionStream was working just fine.
I can't figure out why the stream does not produce any values even when I use the Extended Controls Tool to change the location of the device.
Here the riverpod position stream provider
And the location service has this method for the settings.
I am using another provider to listen to the positionStreamProvider:
This is the provider which is not updating anymore.
It is just annoying to spend hours just to figure out why it just stops working.
Maybe I am missing something.
I start the provider by doing the following in one of the screens of the app.
Basically I would use the Extended Controls Tool of the emulator to change the location and the positionStrean would yield a new value. But that is not happening anymore. The location is change on the map, but nothing happens with positionStream.
I can't see any error logs.
Most of the code come from the deliverzler app.
It did work when I change the myLocationCameraPositionProvider to the following:
I don't understand why this version is working and the first one not.
Beta Was this translation helpful? Give feedback.
All reactions