提交 f1d40b32 编写于 作者: A Adam Barth 提交者: GitHub

Conform to platform protocol (#3485)

The Android and iOS versions of this function had diverged. This patch
makes the iOS version match the Android version (and what the framework
expects).

Fixes https://github.com/flutter/flutter/issues/8878
上级 c4edec74
......@@ -13,12 +13,12 @@ namespace {
constexpr char kTextPlainFormat[] = "text/plain";
NSDictionary* GetDirectoryOfType(NSSearchPathDirectory dir) {
NSString* GetDirectoryOfType(NSSearchPathDirectory dir) {
NSArray* paths =
NSSearchPathForDirectoriesInDomains(dir, NSUserDomainMask, YES);
if (paths.count == 0)
return nil;
return @{ @"path": paths.firstObject };
return paths.firstObject;
}
} // namespaces
......@@ -191,11 +191,11 @@ using namespace shell;
pasteboard.string = data[@"text"];
}
- (NSDictionary*)getPathProviderTemporaryDirectory {
- (NSString*)getPathProviderTemporaryDirectory {
return GetDirectoryOfType(NSCachesDirectory);
}
- (NSDictionary*)getPathProviderApplicationDocumentsDirectory {
- (NSString*)getPathProviderApplicationDocumentsDirectory {
return GetDirectoryOfType(NSDocumentDirectory);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册