photos static method
相册权限
Implementation
static Future<bool> photos(String reason) async {
if (!Platform.isIOS) {
BaseToast.showToast(reason, isAutoDismiss: false);
}
final status = await Permission.photos.request();
if (!Platform.isIOS) {
BaseToast.cancel();
}
if (status.isGranted || status.isLimited) {
return true;
} else {
BaseToast.showToast("未获取相册权限,请在设置中获取相册权限");
return false;
}
}