Skip to content

Commit

Permalink
feat(geolocation): add provider for geolocation service
Browse files Browse the repository at this point in the history
  • Loading branch information
yoannLafore committed Apr 6, 2024
1 parent 1f1c849 commit 23f9fac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/services/geolocation_service.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "package:cloud_firestore/cloud_firestore.dart";
import "package:geolocator/geolocator.dart";
import "package:hooks_riverpod/hooks_riverpod.dart";

class GeoLocationService {
final GeolocatorPlatform _geoLocator;
Expand Down Expand Up @@ -60,3 +61,9 @@ class GeoLocationService {
return GeoPoint(position.latitude, position.longitude);
}
}

final geoLocationServiceProvider = Provider<GeoLocationService>(
(ref) => GeoLocationService(
geoLocator: GeolocatorPlatform.instance,
),
);

0 comments on commit 23f9fac

Please sign in to comment.