Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flutter_boost_1.22.4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
flutter_boost_1.22.4
Commits
1b152753
Commit
1b152753
authored
Sep 18, 2019
by
余玠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构函数命名及添加注释
parent
25a4bc3d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
17 deletions
+41
-17
ios/Classes/Boost/FLBFlutterApplicationInterface.h
ios/Classes/Boost/FLBFlutterApplicationInterface.h
+3
-3
ios/Classes/Boost/FLBPlatform.h
ios/Classes/Boost/FLBPlatform.h
+3
-3
ios/Classes/Boost/FlutterBoostPlugin.h
ios/Classes/Boost/FlutterBoostPlugin.h
+26
-2
ios/Classes/Boost/FlutterBoostPlugin.m
ios/Classes/Boost/FlutterBoostPlugin.m
+5
-5
ios/Classes/Engine/FLBFlutterApplication.m
ios/Classes/Engine/FLBFlutterApplication.m
+4
-4
No files found.
ios/Classes/Boost/FLBFlutterApplicationInterface.h
View file @
1b152753
...
@@ -53,14 +53,14 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -53,14 +53,14 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - handle messages
#pragma mark - handle messages
-
(
void
)
close
:(
NSString
*
)
uid
-
(
void
)
close
:(
NSString
*
)
uid
result
:(
NSDictionary
*
)
result
result
:(
NSDictionary
*
)
result
Data
exts
:(
NSDictionary
*
)
exts
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
;
completion
:(
void
(
^
)(
BOOL
))
completion
;
-
(
void
)
open
:(
NSString
*
)
ur
l
-
(
void
)
open
:(
NSString
*
)
ur
i
urlParams
:(
NSDictionary
*
)
urlParams
urlParams
:(
NSDictionary
*
)
urlParams
exts
:(
NSDictionary
*
)
exts
exts
:(
NSDictionary
*
)
exts
reult
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
onPageFinished
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
completion
:(
void
(
^
)(
BOOL
))
completion
;
completion
:(
void
(
^
)(
BOOL
))
completion
;
...
...
ios/Classes/Boost/FLBPlatform.h
View file @
1b152753
...
@@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
* 基于Native平台实现页面打开,Dart层的页面打开能力依赖于这个函数实现;Native或者Dart侧不建议直接使用这个函数。应直接使用FlutterBoost封装的函数
* 基于Native平台实现页面打开,Dart层的页面打开能力依赖于这个函数实现;Native或者Dart侧不建议直接使用这个函数。应直接使用FlutterBoost封装的函数
*
*
* @param url 打开的页面资源定位符
* @param url 打开的页面资源定位符
* @param urlParams 传人页面的参数
, 注意
* @param urlParams 传人页面的参数
; 若有特殊逻辑,可以通过这个参数设置回调的id
* @param exts 额外参数
* @param exts 额外参数
* @param completion 打开页面的即时回调,页面一旦打开即回调
* @param completion 打开页面的即时回调,页面一旦打开即回调
*/
*/
...
@@ -52,9 +52,9 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -52,9 +52,9 @@ NS_ASSUME_NONNULL_BEGIN
completion
:(
void
(
^
)(
BOOL
finished
))
completion
;
completion
:(
void
(
^
)(
BOOL
finished
))
completion
;
/**
/**
* 基于Native平台实现页面
打开
,Dart层的页面关闭能力依赖于这个函数实现;Native或者Dart侧不建议直接使用这个函数。应直接使用FlutterBoost封装的函数
* 基于Native平台实现页面
关闭
,Dart层的页面关闭能力依赖于这个函数实现;Native或者Dart侧不建议直接使用这个函数。应直接使用FlutterBoost封装的函数
*
*
* @param uid
打开
的页面唯一ID符
* @param uid
关闭
的页面唯一ID符
* @param result 页面要返回的结果(给上一个页面),会作为页面返回函数的回调参数
* @param result 页面要返回的结果(给上一个页面),会作为页面返回函数的回调参数
* @param exts 额外参数
* @param exts 额外参数
* @param completion 关闭页面的即时回调,页面一旦关闭即回调
* @param completion 关闭页面的即时回调,页面一旦关闭即回调
...
...
ios/Classes/Boost/FlutterBoostPlugin.h
View file @
1b152753
...
@@ -30,6 +30,12 @@
...
@@ -30,6 +30,12 @@
#pragma mark - Initializer
#pragma mark - Initializer
+
(
instancetype
)
sharedInstance
;
+
(
instancetype
)
sharedInstance
;
/**
* 初始化FlutterBoost混合栈环境。应在程序使用混合栈之前调用。如在AppDelegate中
*
* @param platform 平台层实现FLBPlatform的对象
* @param callback 启动之后回调
*/
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
...
@@ -46,14 +52,32 @@
...
@@ -46,14 +52,32 @@
forName
:(
NSString
*
)
name
;
forName
:(
NSString
*
)
name
;
#pragma mark - open/close Page
#pragma mark - open/close Page
/**
* 关闭页面,混合栈推荐使用的用于操作页面的接口
*
* @param uniqueId 关闭的页面唯一ID符
* @param resultData 页面要返回的结果(给上一个页面),会作为页面返回函数的回调参数
* @param exts 额外参数
* @param completion 关闭页面的即时回调,页面一旦关闭即回调
*/
+
(
void
)
close
:(
NSString
*
)
uniqueId
+
(
void
)
close
:(
NSString
*
)
uniqueId
result
:(
NSDictionary
*
)
result
result
:(
NSDictionary
*
)
result
Data
exts
:(
NSDictionary
*
)
exts
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
;
completion
:(
void
(
^
)(
BOOL
))
completion
;
/**
* 打开新页面,混合栈推荐使用的用于操作页面的接口
*
* @param url 打开的页面资源定位符
* @param urlParams 传人页面的参数; 若有特殊逻辑,可以通过这个参数设置回调的id
* @param exts 额外参数
* @param resultCallback 当页面结束返回时执行的回调,通过这个回调可以取得页面的返回数据,如close函数传入的resultData
* @param completion 打开页面的即时回调,页面一旦打开即回调
*/
+
(
void
)
open
:(
NSString
*
)
url
+
(
void
)
open
:(
NSString
*
)
url
urlParams
:(
NSDictionary
*
)
urlParams
urlParams
:(
NSDictionary
*
)
urlParams
exts
:(
NSDictionary
*
)
exts
exts
:(
NSDictionary
*
)
exts
reult
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
onPageFinished
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
completion
:(
void
(
^
)(
BOOL
))
completion
;
completion
:(
void
(
^
)(
BOOL
))
completion
;
@end
@end
ios/Classes/Boost/FlutterBoostPlugin.m
View file @
1b152753
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
[[
FlutterBoostPlugin
sharedInstance
].
application
open
:
url
[[
FlutterBoostPlugin
sharedInstance
].
application
open
:
url
urlParams:
urlParams
urlParams:
urlParams
exts:
exts
exts:
exts
reult
:
result
onPageFinished
:
result
completion:
^
(
BOOL
r
)
{}];
completion:
^
(
BOOL
r
)
{}];
}
else
if
([
@"pageOnStart"
isEqualToString
:
call
.
method
]){
}
else
if
([
@"pageOnStart"
isEqualToString
:
call
.
method
]){
NSMutableDictionary
*
pageInfo
=
[
NSMutableDictionary
new
];
NSMutableDictionary
*
pageInfo
=
[
NSMutableDictionary
new
];
...
@@ -163,13 +163,13 @@
...
@@ -163,13 +163,13 @@
}
}
#pragma mark - open/close Page
#pragma mark - open/close Page
+
(
void
)
open
:(
NSString
*
)
url
urlParams
:(
NSDictionary
*
)
urlParams
exts
:(
NSDictionary
*
)
exts
reult
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
completion
:(
void
(
^
)(
BOOL
))
completion
{
+
(
void
)
open
:(
NSString
*
)
url
urlParams
:(
NSDictionary
*
)
urlParams
exts
:(
NSDictionary
*
)
exts
onPageFinished
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
completion
:(
void
(
^
)(
BOOL
))
completion
{
id
<
FLBFlutterApplicationInterface
>
app
=
[[
FlutterBoostPlugin
sharedInstance
]
application
];
id
<
FLBFlutterApplicationInterface
>
app
=
[[
FlutterBoostPlugin
sharedInstance
]
application
];
[
app
open
:
url
urlParams
:
urlParams
exts
:
exts
reult
:
resultCallback
completion
:
completion
];
[
app
open
:
url
urlParams
:
urlParams
exts
:
exts
onPageFinished
:
resultCallback
completion
:
completion
];
}
}
+
(
void
)
close
:(
NSString
*
)
uniqueId
result
:(
NSDictionary
*
)
result
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
{
+
(
void
)
close
:(
NSString
*
)
uniqueId
result
:(
NSDictionary
*
)
result
Data
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
{
id
<
FLBFlutterApplicationInterface
>
app
=
[[
FlutterBoostPlugin
sharedInstance
]
application
];
id
<
FLBFlutterApplicationInterface
>
app
=
[[
FlutterBoostPlugin
sharedInstance
]
application
];
[
app
close
:
uniqueId
result
:
result
exts
:
exts
completion
:
completion
];
[
app
close
:
uniqueId
result
:
result
Data
exts
:
exts
completion
:
completion
];
}
}
@end
@end
ios/Classes/Engine/FLBFlutterApplication.m
View file @
1b152753
...
@@ -152,18 +152,18 @@
...
@@ -152,18 +152,18 @@
}
}
-
(
void
)
close
:(
NSString
*
)
uniqueId
-
(
void
)
close
:(
NSString
*
)
uniqueId
result
:(
NSDictionary
*
)
result
result
:(
NSDictionary
*
)
result
Data
exts
:(
NSDictionary
*
)
exts
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
completion
:(
void
(
^
)(
BOOL
))
completion
{
{
[
self
.
platform
close
:
uniqueId
[
self
.
platform
close
:
uniqueId
result:
result
result:
result
Data
exts:
exts
exts:
exts
completion:
completion
];
completion:
completion
];
if
(
_pageResultCallbacks
[
uniqueId
]){
if
(
_pageResultCallbacks
[
uniqueId
]){
void
(
^
cb
)(
NSDictionary
*
)
=
_pageResultCallbacks
[
uniqueId
];
void
(
^
cb
)(
NSDictionary
*
)
=
_pageResultCallbacks
[
uniqueId
];
cb
(
result
);
cb
(
result
Data
);
[
_pageResultCallbacks
removeObjectForKey
:
uniqueId
];
[
_pageResultCallbacks
removeObjectForKey
:
uniqueId
];
}
}
}
}
...
@@ -171,7 +171,7 @@
...
@@ -171,7 +171,7 @@
-
(
void
)
open
:(
NSString
*
)
url
-
(
void
)
open
:(
NSString
*
)
url
urlParams
:(
NSDictionary
*
)
urlParams
urlParams
:(
NSDictionary
*
)
urlParams
exts
:(
NSDictionary
*
)
exts
exts
:(
NSDictionary
*
)
exts
reult
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
onPageFinished
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
completion
:(
void
(
^
)(
BOOL
))
completion
completion
:(
void
(
^
)(
BOOL
))
completion
{
{
NSString
*
cid
=
urlParams
[
kPageCallBackId
];
NSString
*
cid
=
urlParams
[
kPageCallBackId
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment