Skip to content

Commit

Permalink
Merge pull request #72 from ProximaEPFL/geolocation-provider
Browse files Browse the repository at this point in the history
Add geolocation provider + location permissions
  • Loading branch information
yoannLafore authored Apr 6, 2024
2 parents 1f1c849 + dda5544 commit b38632a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:label="proxima"
android:name="${applicationName}"
Expand Down
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 b38632a

Please sign in to comment.