diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index ae0fc7e..9601848 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -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 diff --git a/example/lib/main.dart b/example/lib/main.dart index 417f0da..0b25270 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -41,11 +41,17 @@ class _MyAppState extends State { } Future _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; } diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 84c038e..ed2e3c4 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -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: