checkPermissionStatus method

Future<PermissionStatus> checkPermissionStatus(
  1. Permission permission
)

Checks the current status of the given Permission.

Implementation

Future<PermissionStatus> checkPermissionStatus(Permission permission) async {
  String webPermissionName;
  switch (permission) {
    case Permission.microphone:
      webPermissionName = _microphonePermissionName;
      break;
    case Permission.camera:
      webPermissionName = _cameraPermissionName;
      break;
    case Permission.notification:
      webPermissionName = _notificationsPermissionName;
      break;
    case Permission.location:
      webPermissionName = _locationPermissionName;
      break;
    default:
      throw UnimplementedError(
        'checkPermissionStatus() has not been implemented for ${permission.toString()} '
        'on web.',
      );
  }
  return _permissionStatusState(webPermissionName, _htmlPermissions);
}