fetchAndSaveLocationProvider top-level property
Fetches current location and persists when successful.
Implementation
final fetchAndSaveLocationProvider =
FutureProvider.autoDispose<LocationFlowResult>((ref) async {
final kit = ref.watch(locationKitProvider);
final storage = ref.watch(locationStorageProvider);
final result = await kit.fetchCurrentLocation();
if (result is LocationFlowSuccess) {
await storage.save(result.fix);
}
return result;
});