Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
2114a88b
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2114a88b
编写于
3月 21, 2018
作者:
S
Sarah Zakarias
提交者:
GitHub
3月 21, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Provide asset lookup key on ios (#4817)
上级
ca572216
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
92 addition
and
1 deletion
+92
-1
shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h
...latform/darwin/ios/framework/Headers/FlutterDartProject.h
+20
-0
shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h
shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h
+20
-0
shell/platform/darwin/ios/framework/Headers/FlutterViewController.h
...form/darwin/ios/framework/Headers/FlutterViewController.h
+20
-0
shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm
...latform/darwin/ios/framework/Source/FlutterAppDelegate.mm
+9
-0
shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm
...latform/darwin/ios/framework/Source/FlutterDartProject.mm
+14
-1
shell/platform/darwin/ios/framework/Source/FlutterViewController.mm
...form/darwin/ios/framework/Source/FlutterViewController.mm
+9
-0
未找到文件。
shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h
浏览文件 @
2114a88b
...
...
@@ -23,6 +23,26 @@ FLUTTER_EXPORT
-
(
instancetype
)
initFromDefaultSourceForConfiguration
;
/**
Returns the file name for the given asset.
The returned file name can be used to access the asset in the application's main bundle.
- Parameter asset: The name of the asset. The name can be hierarchical.
- Returns: the file name to be used for lookup in the main bundle.
*/
+
(
NSString
*
)
lookupKeyForAsset
:(
NSString
*
)
asset
;
/**
Returns the file name for the given asset which originates from the specified package.
The returned file name can be used to access the asset in the application's main bundle.
- Parameters:
- asset: The name of the asset. The name can be hierarchical.
- package: The name of the package from which the asset originates.
- Returns: the file name to be used for lookup in the main bundle.
*/
+
(
NSString
*
)
lookupKeyForAsset
:(
NSString
*
)
asset
fromPackage
:(
NSString
*
)
package
;
@end
#endif // FLUTTER_FLUTTERDARTPROJECT_H_
shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h
浏览文件 @
2114a88b
...
...
@@ -183,6 +183,26 @@ NS_ASSUME_NONNULL_BEGIN
- Parameters delegate: The receiving object, such as the plugin's main class.
*/
-
(
void
)
addApplicationDelegate
:(
NSObject
<
FlutterPlugin
>*
)
delegate
;
/**
Returns the file name for the given asset.
The returned file name can be used to access the asset in the application's main bundle.
- Parameter asset: The name of the asset. The name can be hierarchical.
- Returns: the file name to be used for lookup in the main bundle.
*/
-
(
NSString
*
)
lookupKeyForAsset
:(
NSString
*
)
asset
;
/**
Returns the file name for the given asset which originates from the specified package.
The returned file name can be used to access the asset in the application's main bundle.
- Parameters:
- asset: The name of the asset. The name can be hierarchical.
- package: The name of the package from which the asset originates.
- Returns: the file name to be used for lookup in the main bundle.
*/
-
(
NSString
*
)
lookupKeyForAsset
:(
NSString
*
)
asset
fromPackage
:(
NSString
*
)
package
;
@end
/**
...
...
shell/platform/darwin/ios/framework/Headers/FlutterViewController.h
浏览文件 @
2114a88b
...
...
@@ -22,6 +22,26 @@ FLUTTER_EXPORT
-
(
void
)
handleStatusBarTouches
:(
UIEvent
*
)
event
;
/**
Returns the file name for the given asset.
The returned file name can be used to access the asset in the application's main bundle.
- Parameter asset: The name of the asset. The name can be hierarchical.
- Returns: the file name to be used for lookup in the main bundle.
*/
-
(
NSString
*
)
lookupKeyForAsset
:(
NSString
*
)
asset
;
/**
Returns the file name for the given asset which originates from the specified package.
The returned file name can be used to access the asset in the application's main bundle.
- Parameters:
- asset: The name of the asset. The name can be hierarchical.
- package: The name of the package from which the asset originates.
- Returns: the file name to be used for lookup in the main bundle.
*/
-
(
NSString
*
)
lookupKeyForAsset
:(
NSString
*
)
asset
fromPackage
:(
NSString
*
)
package
;
/**
Sets the first route that the Flutter app shows. The default is "/".
...
...
shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm
浏览文件 @
2114a88b
...
...
@@ -284,4 +284,13 @@
-
(
void
)
addApplicationDelegate
:(
NSObject
<
FlutterPlugin
>*
)
delegate
{
[
_appDelegate
.
pluginDelegates
addObject
:
delegate
];
}
-
(
NSString
*
)
lookupKeyForAsset
:(
NSString
*
)
asset
{
return
[
FlutterDartProject
lookupKeyForAsset
:
asset
];
}
-
(
NSString
*
)
lookupKeyForAsset
:(
NSString
*
)
asset
fromPackage
:(
NSString
*
)
package
{
return
[
FlutterDartProject
lookupKeyForAsset
:
asset
fromPackage
:
package
];
}
@end
shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm
浏览文件 @
2114a88b
...
...
@@ -146,16 +146,29 @@ static NSURL* URLForSwitch(const fxl::StringView name) {
#pragma mark - Assets-related utilities
+
(
NSString
*
)
pathForFlutterAssetsFromBundl
e
:(
NSBundle
*
)
bundle
{
+
(
NSString
*
)
flutterAssetsNam
e
:(
NSBundle
*
)
bundle
{
NSString
*
flutterAssetsName
=
[
bundle
objectForInfoDictionaryKey
:
@"FLTAssetsPath"
];
if
(
flutterAssetsName
==
nil
)
{
// Default to "flutter_assets"
flutterAssetsName
=
@"flutter_assets"
;
}
return
flutterAssetsName
;
}
+
(
NSString
*
)
pathForFlutterAssetsFromBundle
:(
NSBundle
*
)
bundle
{
NSString
*
flutterAssetsName
=
[
FlutterDartProject
flutterAssetsName
:
bundle
];
return
[
bundle
pathForResource
:
flutterAssetsName
ofType
:
nil
];
}
+
(
NSString
*
)
lookupKeyForAsset
:(
NSString
*
)
asset
{
NSString
*
flutterAssetsName
=
[
FlutterDartProject
flutterAssetsName
:
[
NSBundle
mainBundle
]];
return
[
NSString
stringWithFormat
:
@"%@/%@"
,
flutterAssetsName
,
asset
];
}
+
(
NSString
*
)
lookupKeyForAsset
:(
NSString
*
)
asset
fromPackage
:(
NSString
*
)
package
{
return
[
self
lookupKeyForAsset
:[
NSString
stringWithFormat
:
@"packages/%@/%@"
,
package
,
asset
]];
}
#pragma mark - Launching the project in a preconfigured engine.
static
NSString
*
NSStringFromVMType
(
VMType
type
)
{
...
...
shell/platform/darwin/ios/framework/Source/FlutterViewController.mm
浏览文件 @
2114a88b
...
...
@@ -908,4 +908,13 @@ constexpr CGFloat kStandardStatusBarHeight = 20.0;
-
(
void
)
textureFrameAvailable
:(
int64_t
)
textureId
{
_platformView
->
MarkTextureFrameAvailable
(
textureId
);
}
-
(
NSString
*
)
lookupKeyForAsset
:(
NSString
*
)
asset
{
return
[
FlutterDartProject
lookupKeyForAsset
:
asset
];
}
-
(
NSString
*
)
lookupKeyForAsset
:(
NSString
*
)
asset
fromPackage
:(
NSString
*
)
package
{
return
[
FlutterDartProject
lookupKeyForAsset
:
asset
fromPackage
:
package
];
}
@end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录