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
6547254f
You need to sign in or sign up before continuing.
Commit
6547254f
authored
Feb 27, 2020
by
余玠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
针对flutter页面直接打开native,补充demo
parent
f3299bfd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
example/ios/Runner/PlatformRouterImp.m
example/ios/Runner/PlatformRouterImp.m
+19
-0
example/lib/simple_page_widgets.dart
example/lib/simple_page_widgets.dart
+11
-0
No files found.
example/ios/Runner/PlatformRouterImp.m
View file @
6547254f
...
...
@@ -7,6 +7,7 @@
//
#import "PlatformRouterImp.h"
#import "UIViewControllerDemo.h"
#import <flutter_boost/FlutterBoost.h>
@interface
PlatformRouterImp
()
...
...
@@ -14,12 +15,30 @@
@implementation
PlatformRouterImp
-
(
void
)
openNativeVC
:(
NSString
*
)
name
urlParams
:(
NSDictionary
*
)
params
exts
:(
NSDictionary
*
)
exts
{
UIViewController
*
vc
=
UIViewControllerDemo
.
new
;
BOOL
animated
=
[
exts
[
@"animated"
]
boolValue
];
if
([
params
[
@"present"
]
boolValue
]){
[
self
.
navigationController
presentViewController
:
vc
animated
:
animated
completion
:^
{
}];
}
else
{
[
self
.
navigationController
pushViewController
:
vc
animated
:
animated
];
}
}
#pragma mark - Boost 1.5
-
(
void
)
open
:(
NSString
*
)
name
urlParams
:(
NSDictionary
*
)
params
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
{
if
([
name
isEqualToString
:
@"native"
])
{
//模拟打开native页面
[
self
openNativeVC
:
name
urlParams
:
params
exts
:
exts
];
return
;
}
BOOL
animated
=
[
exts
[
@"animated"
]
boolValue
];
FLBFlutterViewContainer
*
vc
=
FLBFlutterViewContainer
.
new
;
[
vc
setName
:
name
params
:
params
];
...
...
example/lib/simple_page_widgets.dart
View file @
6547254f
...
...
@@ -16,6 +16,17 @@ class FirstRouteWidget extends StatelessWidget {
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
RaisedButton
(
child:
Text
(
'Open native page'
),
onPressed:
()
{
print
(
"open natve page!"
);
FlutterBoost
.
singleton
.
open
(
"native"
).
then
((
Map
value
)
{
print
(
"call me when page is finished. did recieve second route result
$value
"
);
});
},
),
RaisedButton
(
child:
Text
(
'Open second route'
),
onPressed:
()
{
...
...
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