getPermissionStatus static method

dynamic getPermissionStatus(
  1. PermissionRequestType type
)

Implementation

static getPermissionStatus(PermissionRequestType type) async {
  _channel.invokeMethod("getPermissionStatus",{"type": type.name});
  var value = await _checkPermission();
  try{
    return PermissionStatus.values.firstWhere((element) => element.value==value);
  }catch(e){
    return PermissionStatus.granted;
  }
}