hasPermissions method

Future<bool> hasPermissions()

Evaluates whether all required permissions have been granted.

Returns false by default.

Implementation

Future<bool> hasPermissions() async {
  var statusStorage = await Permission.storage.status;
  var statusManageStorage = await Permission.manageExternalStorage.status;

  if (useManageExternalStoragePermission) {
    if (statusStorage.isGranted && statusManageStorage.isGranted) return true;
  } else {
    if (statusStorage.isGranted) return true;
  }

  return false;
}