upgrade "permission_handler" dependency in example app and request correct permission after android 33

This commit is contained in:
Wenqi Li 2023-05-14 02:23:49 +08:00
parent 88e0ad714b
commit eafedcb225
3 changed files with 17 additions and 11 deletions

View File

@ -1,6 +1,6 @@
PODS:
- Flutter (1.0.0)
- "permission_handler (5.1.0+2)":
- permission_handler_apple (9.0.4):
- Flutter
- photo_gallery (0.0.1):
- Flutter
@ -9,15 +9,15 @@ PODS:
DEPENDENCIES:
- Flutter (from `Flutter`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- photo_gallery (from `.symlinks/plugins/photo_gallery/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
EXTERNAL SOURCES:
Flutter:
:path: Flutter
permission_handler:
:path: ".symlinks/plugins/permission_handler/ios"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
photo_gallery:
:path: ".symlinks/plugins/photo_gallery/ios"
video_player_avfoundation:
@ -25,7 +25,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
photo_gallery: 9f95e57747cd22c10676ece3660d1ffe6c603ee5
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126

View File

@ -41,11 +41,17 @@ class _MyAppState extends State<MyApp> {
}
Future<bool> _promptPermissionSetting() async {
if (Platform.isIOS &&
await Permission.storage.request().isGranted &&
await Permission.photos.request().isGranted ||
Platform.isAndroid && await Permission.storage.request().isGranted) {
return true;
if (Platform.isIOS) {
if (await Permission.storage.request().isGranted) {
return true;
}
}
if (Platform.isAndroid) {
if (await Permission.storage.request().isGranted ||
await Permission.photos.request().isGranted &&
await Permission.videos.request().isGranted) {
return true;
}
}
return false;
}

View File

@ -24,7 +24,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
transparent_image: ^2.0.0
permission_handler: ^6.1.1
permission_handler: ^10.2.0
video_player: ^2.6.1
dev_dependencies: