Starting using geolocation.
This commit is contained in:
parent
f5058c506a
commit
8c73ba088b
@ -6,13 +6,12 @@ part 'location.g.dart';
|
||||
@riverpod
|
||||
class MyLocation extends _$MyLocation {
|
||||
|
||||
MyLocation() {
|
||||
/*
|
||||
Future<void> _detertimeLocation() async {
|
||||
bool serviceEnabled;
|
||||
LocationPermission permission;
|
||||
|
||||
// Test if location services are enabled.
|
||||
serviceEnabled = Geolocator.isLocationServiceEnabled().then(onValue);
|
||||
serviceEnabled = await Geolocator.isLocationServiceEnabled();
|
||||
if (!serviceEnabled) {
|
||||
// Location services are not enabled don't continue
|
||||
// accessing the position and request users of the
|
||||
@ -37,11 +36,13 @@ class MyLocation extends _$MyLocation {
|
||||
// Permissions are denied forever, handle appropriately.
|
||||
return Future.error(
|
||||
'Location permissions are permanently denied, we cannot request permissions.');
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Position> build() async{
|
||||
await _detertimeLocation();
|
||||
|
||||
Position l = Position(longitude: 0, latitude: 0,
|
||||
timestamp: DateTime.timestamp(), accuracy: 0, altitude: 0,
|
||||
altitudeAccuracy: 0, heading: 0, headingAccuracy: 0,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user