toPermissionLevel function

LocationPermissionLevel toPermissionLevel(
  1. GeolocationPermission permission
)

Translates a GeolocationPermission object to a LocationPermissionLevel object.

Implementation

LocationPermissionLevel toPermissionLevel(GeolocationPermission permission) {
  switch (permission) {
    case GeolocationPermission.locationAlways:
      return LocationPermissionLevel.locationAlways;
    case GeolocationPermission.locationWhenInUse:
      return LocationPermissionLevel.locationWhenInUse;
    default:
      return LocationPermissionLevel.location;
  }
}