Im getting error under the GeolocationStatus Enum. what seem to be the problem `
return FutureBuilder<GeolocationStatus>(
future: Geolocator.isLocationServiceEnabled(),
builder:
(BuildContext context, AsyncSnapshot<GeolocationStatus> snapshot) {
if (!snapshot.hasData) {
return const Center(child: CircularProgressIndicator());
}
if (snapshot.data == GeolocationStatus.denied) {
}
`
Is there solution to this?
Geolocator.isLocationServiceEnabled
is a function that has a return type ofFuture<bool>
. It does not return the status of location service, but a bool value whether it is enabled or not.Try to create the
FutureBuilder
like this: