From 9a5890ddc68341ffee300e09a97370aad023d144 Mon Sep 17 00:00:00 2001 From: Aulig <32148066+Aulig@users.noreply.github.com> Date: Tue, 16 Apr 2024 11:24:12 +0200 Subject: [PATCH 1/3] Compile out broken references if PICKER_DOCUMENT=false --- ios/Classes/FilePickerPlugin.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ios/Classes/FilePickerPlugin.m b/ios/Classes/FilePickerPlugin.m index 626a0c9c..7e2a869d 100644 --- a/ios/Classes/FilePickerPlugin.m +++ b/ios/Classes/FilePickerPlugin.m @@ -149,11 +149,17 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { details:nil]); #endif } else if([call.method isEqualToString:@"save"]) { +#ifdef PICKER_DOCUMENT NSString *fileName = [arguments valueForKey:@"fileName"]; NSString *fileType = [arguments valueForKey:@"fileType"]; NSString *initialDirectory = [arguments valueForKey:@"initialDirectory"]; FlutterStandardTypedData *bytes = [arguments valueForKey:@"bytes"]; [self saveFileWithName:fileName fileType:fileType initialDirectory:initialDirectory bytes: bytes]; +#else + _result([FlutterError errorWithCode:@"Unsupported function" + message:@"The save function requires the document picker to be compiled in. Remove the Pod::PICKER_DOCUMENT=false statement from your Podfile." + details:nil]); +#endif } else { result(FlutterMethodNotImplemented); _result = nil; @@ -167,6 +173,7 @@ - (NSString*)getDocumentDirectory { #pragma mark - Resolvers +#ifdef PICKER_DOCUMENT - (void)saveFileWithName:(NSString*)fileName fileType:(NSString *)fileType initialDirectory:(NSString*)initialDirectory bytes:(FlutterStandardTypedData*)bytes{ self.isSaveFile = YES; NSFileManager* fm = [NSFileManager defaultManager]; @@ -197,6 +204,7 @@ - (void)saveFileWithName:(NSString*)fileName fileType:(NSString *)fileType initi } [[self viewControllerWithWindow:nil] presentViewController:self.documentPickerController animated:YES completion:nil]; } +#endif // PICKER_DOCUMENT #ifdef PICKER_DOCUMENT - (void)resolvePickDocumentWithMultiPick:(BOOL)allowsMultipleSelection pickDirectory:(BOOL)isDirectory { From 227e2344b9c4da8a4a620f7135d7a4d9bc4baecd Mon Sep 17 00:00:00 2001 From: Aulig <32148066+Aulig@users.noreply.github.com> Date: Tue, 16 Apr 2024 11:50:15 +0200 Subject: [PATCH 2/3] Increment version number --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 4542558a..381b0f75 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A package that allows you to use a native file explorer to pick sin homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker repository: https://github.com/miguelpruivo/flutter_file_picker issue_tracker: https://github.com/miguelpruivo/flutter_file_picker/issues -version: 8.0.0+1 +version: 8.0.1 dependencies: flutter: From d82480f3e9c3d0fdc0008ebb15a7c39a7ea49022 Mon Sep 17 00:00:00 2001 From: Aulig <32148066+Aulig@users.noreply.github.com> Date: Tue, 16 Apr 2024 11:51:14 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41292841..82aaa216 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 8.0.1 +### iOS +Fixes an issue preventing compilation on iOS when using Pod::PICKER_DOCUMENT = false. + ## 8.0.0+1 Removes linter warnings and fixes CI/CD.