askForPermission method

dynamic askForPermission(
  1. PermissionStatus permissionStatus,
  2. bool isFromPicker,
  3. PermissionType permissionType,
  4. int index,
)

Ask permission events

Implementation

askForPermission(PermissionStatus permissionStatus, bool isFromPicker,
    PermissionType permissionType, int index) async {
  try {
    if (await Permissions.cameraAndStoragePermissionsGranted()) {
      add(AllowPermissionEvent(isFromPicker, permissionType, index));
    } else {
      add(AskPermissionEvent(isFromPicker, permissionType, index));
    }
  } catch (e) {
    debugPrint('Camera Exception ::: $e');
  }
}