|
|
@@ -271,8 +271,18 @@ class AnalysisController extends BaseController {
|
|
|
// final exifInfo = await ClassifyPhoto().getPhotoExif(file!.path);
|
|
|
// print(exifInfo);
|
|
|
}
|
|
|
+ } else if (status == PermissionStatus.denied) {
|
|
|
+ var result = await Permission.photos.request();
|
|
|
+ if (result.isGranted) {
|
|
|
+ openGallery();
|
|
|
+ } else if (result.isPermanentlyDenied) {
|
|
|
+ ToastUtil.show("Please enable the photo permission first.");
|
|
|
+ openAppSettings();
|
|
|
+ } else {
|
|
|
+ ToastUtil.show("Please enable the photo permission first.");
|
|
|
+ }
|
|
|
} else {
|
|
|
- ToastUtil.show("Please enable the album permission first.");
|
|
|
+ openAppSettings();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -288,7 +298,15 @@ class AnalysisController extends BaseController {
|
|
|
await saveAndRefreshAssets([entity]);
|
|
|
}
|
|
|
} else {
|
|
|
- ToastUtil.show("Please enable the camera permission first.");
|
|
|
+ var result = await Permission.camera.request();
|
|
|
+ if (result.isGranted) {
|
|
|
+ openCamera();
|
|
|
+ } else if (result.isPermanentlyDenied) {
|
|
|
+ ToastUtil.show("Please enable the camera permission first.");
|
|
|
+ openAppSettings();
|
|
|
+ } else{
|
|
|
+ ToastUtil.show("Please enable the camera permission first.");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|