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
951a88a5
Commit
951a88a5
authored
Sep 18, 2019
by
余玠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化接口封装
parent
62d3504f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
16 deletions
+41
-16
example/ios/Runner/PlatformRouterImp.m
example/ios/Runner/PlatformRouterImp.m
+16
-11
ios/Classes/Boost/FLBPlatform.h
ios/Classes/Boost/FLBPlatform.h
+14
-0
ios/Classes/Engine/FLBFlutterApplication.m
ios/Classes/Engine/FLBFlutterApplication.m
+11
-5
No files found.
example/ios/Runner/PlatformRouterImp.m
View file @
951a88a5
...
...
@@ -21,18 +21,23 @@
completion
:(
void
(
^
)(
BOOL
))
completion
{
BOOL
animated
=
[
exts
[
@"animated"
]
boolValue
];
if
([
params
[
@"present"
]
boolValue
]){
FLBFlutterViewContainer
*
vc
=
FLBFlutterViewContainer
.
new
;
[
vc
setName
:
name
params
:
params
];
[
self
.
navigationController
presentViewController
:
vc
animated
:
animated
completion
:^
{
if
(
completion
)
completion
(
YES
);
}];
}
else
{
FLBFlutterViewContainer
*
vc
=
FLBFlutterViewContainer
.
new
;
[
vc
setName
:
name
params
:
params
];
[
self
.
navigationController
pushViewController
:
vc
animated
:
animated
];
FLBFlutterViewContainer
*
vc
=
FLBFlutterViewContainer
.
new
;
[
vc
setName
:
name
params
:
params
];
[
self
.
navigationController
pushViewController
:
vc
animated
:
animated
];
if
(
completion
)
completion
(
YES
);
}
-
(
void
)
present
:(
NSString
*
)
name
urlParams
:(
NSDictionary
*
)
params
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
{
BOOL
animated
=
[
exts
[
@"animated"
]
boolValue
];
FLBFlutterViewContainer
*
vc
=
FLBFlutterViewContainer
.
new
;
[
vc
setName
:
name
params
:
params
];
[
self
.
navigationController
presentViewController
:
vc
animated
:
animated
completion
:^
{
if
(
completion
)
completion
(
YES
);
}
}
];
}
-
(
void
)
close
:(
NSString
*
)
uid
...
...
ios/Classes/Boost/FLBPlatform.h
View file @
951a88a5
...
...
@@ -51,6 +51,20 @@ NS_ASSUME_NONNULL_BEGIN
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
finished
))
completion
;
/**
* 基于Native平台实现present页面打开,Dart层的页面打开能力依赖于这个函数实现;Native或者Dart侧不建议直接使用这个函数。应直接使用FlutterBoost封装的函数
*
* @param url 打开的页面资源定位符
* @param urlParams 传人页面的参数; 若有特殊逻辑,可以通过这个参数设置回调的id
* @param exts 额外参数
* @param completion 打开页面的即时回调,页面一旦打开即回调
*/
@optional
-
(
void
)
present
:(
NSString
*
)
url
urlParams
:(
NSDictionary
*
)
urlParams
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
finished
))
completion
;
/**
* 基于Native平台实现页面关闭,Dart层的页面关闭能力依赖于这个函数实现;Native或者Dart侧不建议直接使用这个函数。应直接使用FlutterBoost封装的函数
*
...
...
ios/Classes/Engine/FLBFlutterApplication.m
View file @
951a88a5
...
...
@@ -186,11 +186,17 @@
}
_callbackCache
[
cid
]
=
resultCallback
;
[
self
.
platform
open
:
url
urlParams:
urlParams
exts:
exts
completion:
completion
];
if
([
urlParams
[
@"present"
]
respondsToSelector
:
@selector
(
boolValue
)]
&&
[
urlParams
[
@"present"
]
boolValue
]
&&
[
self
.
platform
respondsToSelector
:
@selector
(
present
:
urlParams
:
exts
:
completion
:
)]){
[
self
.
platform
present
:
url
urlParams:
urlParams
exts:
exts
completion:
completion
];
}
else
{
[
self
.
platform
open
:
url
urlParams:
urlParams
exts:
exts
completion:
completion
];
}
}
-
(
void
)
didInitPageContainer
:(
NSString
*
)
url
...
...
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