Skip to content

Commit 51245ec

Browse files
committed
refactor(ios): Rename FileUtils to FilePickerUtils
Renames the `FileUtils` class and source files to `FilePickerUtils` in the iOS implementation. This includes updating the class definition, implementation, and the umbrella header import.
1 parent 5988b2c commit 51245ec

File tree

10 files changed

+85
-18
lines changed

10 files changed

+85
-18
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 10.3.9
2+
### iOS
3+
- Rename FileUtils to FilePickerUtils [#1921](https://github.com/miguelpruivo/flutter_file_picker/issues/1921)
4+
15
## 10.3.8
26
### Android
37
- Restores the ms[df] URI handling logic in FileUtils.kt to fix file selection returning null on some devices.

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>12.0</string>
24+
<string>13.0</string>
2525
</dict>
2626
</plist>

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4949
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
5050
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
51+
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; };
5152
/* End PBXFileReference section */
5253

5354
/* Begin PBXFrameworksBuildPhase section */
@@ -65,6 +66,7 @@
6566
9740EEB11CF90186004384FC /* Flutter */ = {
6667
isa = PBXGroup;
6768
children = (
69+
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
6870
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
6971
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7072
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
@@ -309,7 +311,7 @@
309311
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
310312
GCC_WARN_UNUSED_FUNCTION = YES;
311313
GCC_WARN_UNUSED_VARIABLE = YES;
312-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
314+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
313315
MTL_ENABLE_DEBUG_INFO = YES;
314316
ONLY_ACTIVE_ARCH = YES;
315317
SDKROOT = iphoneos;
@@ -358,7 +360,7 @@
358360
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
359361
GCC_WARN_UNUSED_FUNCTION = YES;
360362
GCC_WARN_UNUSED_VARIABLE = YES;
361-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
363+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
362364
MTL_ENABLE_DEBUG_INFO = NO;
363365
SDKROOT = iphoneos;
364366
TARGETED_DEVICE_FAMILY = "1,2";
@@ -383,7 +385,7 @@
383385
"$(PROJECT_DIR)/Flutter",
384386
);
385387
INFOPLIST_FILE = Runner/Info.plist;
386-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
388+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
387389
LD_RUNPATH_SEARCH_PATHS = (
388390
"$(inherited)",
389391
"@executable_path/Frameworks",
@@ -419,7 +421,7 @@
419421
"$(PROJECT_DIR)/Flutter",
420422
);
421423
INFOPLIST_FILE = Runner/Info.plist;
422-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
424+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
423425
LD_RUNPATH_SEARCH_PATHS = (
424426
"$(inherited)",
425427
"@executable_path/Frameworks",

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
buildConfiguration = "Debug"
4545
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4646
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4748
shouldUseLaunchSchemeArgsEnv = "YES">
4849
<MacroExpansion>
4950
<BuildableReference
@@ -61,6 +62,7 @@
6162
buildConfiguration = "Debug"
6263
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
6364
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
65+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
6466
launchStyle = "0"
6567
useCustomWorkingDirectory = "NO"
6668
ignoresPersistentStateOnLaunch = "NO"

example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ios/file_picker/Sources/file_picker/FilePickerPlugin.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#import "FilePickerPlugin.h"
2-
#import "FileUtils.h"
2+
#import "FilePickerUtils.h"
33
#import "ImageUtils.h"
44
#import <Flutter/Flutter.h>
55

@@ -91,7 +91,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
9191
_result = result;
9292

9393
if([call.method isEqualToString:@"clear"]) {
94-
_result([NSNumber numberWithBool: [FileUtils clearTemporaryFiles]]);
94+
_result([NSNumber numberWithBool: [FilePickerUtils clearTemporaryFiles]]);
9595
_result = nil;
9696
return;
9797
}
@@ -120,7 +120,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
120120
self.loadDataToMemory = ((NSNumber*)[arguments valueForKey:@"withData"]).boolValue;
121121

122122
if([call.method isEqualToString:@"any"] || [call.method containsString:@"custom"]) {
123-
self.allowedExtensions = [FileUtils resolveType:call.method withAllowedExtensions: [arguments valueForKey:@"allowedExtensions"]];
123+
self.allowedExtensions = [FilePickerUtils resolveType:call.method withAllowedExtensions: [arguments valueForKey:@"allowedExtensions"]];
124124
if(self.allowedExtensions == nil) {
125125
_result([FlutterError errorWithCode:@"Unsupported file extension"
126126
message:@"If you are providing extension filters make sure that you are only using FileType.custom and the extension are provided without the dot, (ie., jpg instead of .jpg). This could also have happened because you are using an unsupported file extension. If the problem persists, you may want to consider using FileType.any instead."
@@ -137,7 +137,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
137137
}
138138
} else if([call.method isEqualToString:@"video"] || [call.method isEqualToString:@"image"] || [call.method isEqualToString:@"media"]) {
139139
#ifdef PICKER_MEDIA
140-
[self resolvePickMedia:[FileUtils resolveMediaType:call.method] withMultiPick:isMultiplePick withCompressionAllowed:self.allowCompression];
140+
[self resolvePickMedia:[FilePickerUtils resolveMediaType:call.method] withMultiPick:isMultiplePick withCompressionAllowed:self.allowCompression];
141141
#else
142142
_result([FlutterError errorWithCode:@"Unsupported picker type"
143143
message:@"Support for the Media picker is not compiled in. Remove the Pod::PICKER_MEDIA=false statement from your Podfile."
@@ -386,7 +386,7 @@ - (void) resolvePickAudioWithMultiPick:(BOOL)isMultiPick {
386386

387387

388388
- (void) handleResult:(id) files {
389-
_result([FileUtils resolveFileInfo: [files isKindOfClass: [NSArray class]] ? files : @[files] withData:self.loadDataToMemory]);
389+
_result([FilePickerUtils resolveFileInfo: [files isKindOfClass: [NSArray class]] ? files : @[files] withData:self.loadDataToMemory]);
390390
_result = nil;
391391
}
392392

@@ -661,7 +661,7 @@ - (void)mediaPicker: (MPMediaPickerController *)mediaPicker didPickMediaItems:(M
661661
NSMutableArray<NSURL *> * urls = [[NSMutableArray alloc] initWithCapacity:numberOfItems];
662662

663663
for(MPMediaItemCollection * item in [mediaItemCollection items]) {
664-
NSURL * cachedAsset = [FileUtils exportMusicAsset: [item valueForKey:MPMediaItemPropertyAssetURL] withName: [item valueForKey:MPMediaItemPropertyTitle]];
664+
NSURL * cachedAsset = [FilePickerUtils exportMusicAsset: [item valueForKey:MPMediaItemPropertyAssetURL] withName: [item valueForKey:MPMediaItemPropertyTitle]];
665665
[urls addObject: cachedAsset];
666666
}
667667

ios/file_picker/Sources/file_picker/FileUtils.m renamed to ios/file_picker/Sources/file_picker/FilePickerUtils.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//
2-
// FileUtils.m
2+
// FilePickerUtils.m
33
// file_picker
44
//
55
// Created by Miguel Ruivo on 05/12/2018.
66
//
77

8-
#import "FileUtils.h"
8+
#import "FilePickerUtils.h"
99
#import "FileInfo.h"
1010

11-
@implementation FileUtils
11+
@implementation FilePickerUtils
1212

1313
+ (BOOL) clearTemporaryFiles {
1414
NSString *tmpDirectory = NSTemporaryDirectory();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#import <file_picker/FileInfo.h>
22
#import <file_picker/FilePickerPlugin.h>
3-
#import <file_picker/FileUtils.h>
3+
#import <file_picker/FilePickerUtils.h>
44
#import <file_picker/ImageUtils.h>

ios/file_picker/Sources/file_picker/include/file_picker/FileUtils.h renamed to ios/file_picker/Sources/file_picker/include/file_picker/FilePickerUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// FileUtils.h
2+
// FilePickerUtils.h
33
// Pods
44
//
55
// Created by Miguel Ruivo on 05/12/2018.
@@ -19,7 +19,7 @@ typedef NS_ENUM(NSInteger, MediaType) {
1919
MEDIA
2020
};
2121

22-
@interface FileUtils : NSObject
22+
@interface FilePickerUtils : NSObject
2323
+ (BOOL) clearTemporaryFiles;
2424
+ (NSArray<NSString*>*) resolveType:(NSString*)type withAllowedExtensions:(NSArray<NSString*>*)allowedExtensions;
2525
+ (MediaType) resolveMediaType:(NSString*)type;

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: A package that allows you to use a native file explorer to pick sin
33
homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker
44
repository: https://github.com/miguelpruivo/flutter_file_picker
55
issue_tracker: https://github.com/miguelpruivo/flutter_file_picker/issues
6-
version: 10.3.8
6+
version: 10.3.9
77

88
dependencies:
99
flutter:

0 commit comments

Comments
 (0)