requestPermission method

Future<PermissionState> requestPermission()

Implementation

Future<PermissionState> requestPermission() {
  if (permissionStateLock != null) {
    return permissionStateLock!.future;
  }
  final lock = Completer<PermissionState>();
  permissionStateLock = lock;
  Future(
    () => PhotoManager.requestPermissionExtend(
      requestOption: widget.permissionRequestOption,
    ),
  ).then(lock.complete).catchError(lock.completeError).whenComplete(() {
    permissionStateLock = null;
  });
  return lock.future;
}