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
0
Merge Requests
0
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
f44b7392
Commit
f44b7392
authored
Sep 18, 2019
by
余玠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update documents
parent
adcb0e5b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
12 deletions
+48
-12
README.md
README.md
+23
-5
README_CN.md
README_CN.md
+24
-5
example/lib/simple_page_widgets.dart
example/lib/simple_page_widgets.dart
+1
-2
No files found.
README.md
View file @
f44b7392
...
@@ -86,16 +86,16 @@ Use FLBFlutterAppDelegate as the superclass of your AppDelegate
...
@@ -86,16 +86,16 @@ Use FLBFlutterAppDelegate as the superclass of your AppDelegate
Implement FLBPlatform protocol methods for your App.
Implement FLBPlatform protocol methods for your App.
```
objc
```
objc
@interface
DemoRouter
:
NSObject
<
FLBPlatform
>
@interface
PlatformRouterImp
:
NSObject
<
FLBPlatform
>
@property
(
nonatomic
,
strong
)
UINavigationController
*
navigationController
;
@property
(
nonatomic
,
strong
)
UINavigationController
*
navigationController
;
+
(
DemoRouter
*
)
sharedRouter
;
+
(
PlatformRouterImp
*
)
sharedRouter
;
@end
@end
@implementation
DemoRouter
@implementation
PlatformRouterImp
-
(
void
)
openPage
:(
NSString
*
)
name
-
(
void
)
openPage
:(
NSString
*
)
name
params
:(
NSDictionary
*
)
params
params
:(
NSDictionary
*
)
params
...
@@ -129,11 +129,12 @@ Implement FLBPlatform protocol methods for your App.
...
@@ -129,11 +129,12 @@ Implement FLBPlatform protocol methods for your App.
Initialize FlutterBoost with FLBPlatform at the beginning of your App.
Initialize FlutterBoost with FLBPlatform at the beginning of your App
, such as AppDelegate
.
```
objc
```
objc
PlatformRouterImp
*
router
=
[
PlatformRouterImp
new
];
[
FlutterBoostPlugin
.
sharedInstance
startFlutterWithPlatform
:
router
[
FlutterBoostPlugin
.
sharedInstance
startFlutterWithPlatform
:
router
onStart:
^
(
id
engine
)
{
onStart:
^
(
FlutterEngine
*
engine
)
{
}];
}];
```
```
...
@@ -202,6 +203,23 @@ iOS
...
@@ -202,6 +203,23 @@ iOS
[
vc
setName
:
name
params
:
params
];
[
vc
setName
:
name
params
:
params
];
[
self
.
navigationController
presentViewController
:
vc
animated
:
animated
completion
:^
{}];
[
self
.
navigationController
presentViewController
:
vc
animated
:
animated
completion
:^
{}];
```
```
However, in this way, you cannot get the page data result after the page finished. We suggest you implement the platform page router like the way mentioned above. And finally open/close the VC as following:
```
objc
//push the page
[
FlutterBoostPlugin
open
:
@"first"
urlParams
:@{
kPageCallBackId
:
@"MycallbackId#1"
}
exts
:
@{
@"animated"
:
@
(
YES
)}
onPageFinished
:^
(
NSDictionary
*
result
)
{
NSLog
(
@"call me when page finished, and your result is:%@"
,
result
);
}
completion
:^
(
BOOL
f
)
{
NSLog
(
@"page is opened"
);
}];
//prsent the page
[
FlutterBoostPlugin
open
:
@"second"
urlParams
:@{
@"present"
:
@
(
YES
),
kPageCallBackId
:
@"MycallbackId#2"
}
exts
:
@{
@"animated"
:
@
(
YES
)}
onPageFinished
:^
(
NSDictionary
*
result
)
{
NSLog
(
@"call me when page finished, and your result is:%@"
,
result
);
}
completion
:^
(
BOOL
f
)
{
NSLog
(
@"page is presented"
);
}];
//close the page
[
FlutterBoostPlugin
close
:
yourUniqueId
result
:
yourdata
exts
:
exts
completion
:
nil
];
```
Android
Android
...
...
README_CN.md
View file @
f44b7392
...
@@ -82,16 +82,16 @@ class _MyAppState extends State<MyApp> {
...
@@ -82,16 +82,16 @@ class _MyAppState extends State<MyApp> {
为您的应用程序实现FLBPlatform协议方法。
为您的应用程序实现FLBPlatform协议方法。
```
objectivec
```
objectivec
@interface
DemoRouter
:
NSObject
<
FLBPlatform
>
@interface
PlatformRouterImp
:
NSObject
<
FLBPlatform
>
@property
(
nonatomic
,
strong
)
UINavigationController
*
navigationController
;
@property
(
nonatomic
,
strong
)
UINavigationController
*
navigationController
;
+
(
DemoRouter
*
)
sharedRouter
;
+
(
PlatformRouterImp
*
)
sharedRouter
;
@end
@end
@implementation
DemoRouter
@implementation
PlatformRouterImp
-
(
void
)
openPage
:(
NSString
*
)
name
-
(
void
)
openPage
:(
NSString
*
)
name
params
:(
NSDictionary
*
)
params
params
:(
NSDictionary
*
)
params
...
@@ -127,9 +127,10 @@ class _MyAppState extends State<MyApp> {
...
@@ -127,9 +127,10 @@ class _MyAppState extends State<MyApp> {
在应用程序开头使用FLBPlatform初始化FlutterBoost。
在应用程序开头使用FLBPlatform初始化FlutterBoost。
```
的ObjectiveC
```
objc
PlatformRouterImp
*
router
=
[
PlatformRouterImp
new
];
[
FlutterBoostPlugin
.
sharedInstance
startFlutterWithPlatform
:
router
[
FlutterBoostPlugin
.
sharedInstance
startFlutterWithPlatform
:
router
onStart:^(
id
engine){
onStart
:
^
(
FlutterEngine
*
engine
)
{
}
];
}
];
```
```
...
@@ -193,6 +194,24 @@ public class MyApplication extends FlutterApplication {
...
@@ -193,6 +194,24 @@ public class MyApplication extends FlutterApplication {
[
self
.
navigationController
presentViewController
:
vc
animated
:
animated
completion
:^
{}];
[
self
.
navigationController
presentViewController
:
vc
animated
:
animated
completion
:^
{}];
```
```
但是,这种方式无法获取页面返回的数据,建议你按上面的example实现类似于PlatformRouterImp这样的路由器,然后通过以下方式来打开/关闭页面
```
objc
//push the page
[
FlutterBoostPlugin
open
:
@"first"
urlParams
:@{
kPageCallBackId
:
@"MycallbackId#1"
}
exts
:
@{
@"animated"
:
@
(
YES
)}
onPageFinished
:^
(
NSDictionary
*
result
)
{
NSLog
(
@"call me when page finished, and your result is:%@"
,
result
);
}
completion
:^
(
BOOL
f
)
{
NSLog
(
@"page is opened"
);
}];
//prsent the page
[
FlutterBoostPlugin
open
:
@"second"
urlParams
:@{
@"present"
:
@
(
YES
),
kPageCallBackId
:
@"MycallbackId#2"
}
exts
:
@{
@"animated"
:
@
(
YES
)}
onPageFinished
:^
(
NSDictionary
*
result
)
{
NSLog
(
@"call me when page finished, and your result is:%@"
,
result
);
}
completion
:^
(
BOOL
f
)
{
NSLog
(
@"page is presented"
);
}];
//close the page
[
FlutterBoostPlugin
close
:
yourUniqueId
result
:
yourdata
exts
:
exts
completion
:
nil
];
```
Android
Android
```
java
```
java
...
...
example/lib/simple_page_widgets.dart
View file @
f44b7392
...
@@ -14,8 +14,7 @@ class FirstRouteWidget extends StatelessWidget {
...
@@ -14,8 +14,7 @@ class FirstRouteWidget extends StatelessWidget {
onPressed:
()
{
onPressed:
()
{
print
(
"open second page!"
);
print
(
"open second page!"
);
FlutterBoost
.
singleton
.
open
(
"second"
).
then
((
Map
value
)
{
FlutterBoost
.
singleton
.
open
(
"second"
).
then
((
Map
value
)
{
print
(
"did recieve second route result"
);
print
(
"call me when page is finished. did recieve second route result
$value
"
);
print
(
"did recieve second route result
$value
"
);
});
});
},
},
),
),
...
...
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