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
e10b101d
Commit
e10b101d
authored
Sep 18, 2019
by
Jim
Committed by
GitHub
Sep 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add files via upload
parent
32d6b643
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
0 deletions
+77
-0
example/ios/Runner/PlatformRouterImp.h
example/ios/Runner/PlatformRouterImp.h
+25
-0
example/ios/Runner/PlatformRouterImp.m
example/ios/Runner/PlatformRouterImp.m
+52
-0
No files found.
example/ios/Runner/PlatformRouterImp.h
0 → 100644
View file @
e10b101d
//
// DemoRouter.h
// Runner
//
// Created by Jidong Chen on 2018/10/22.
// Copyright © 2018年 The Chromium Authors. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <flutter_boost/FlutterBoost.h>
NS_ASSUME_NONNULL_BEGIN
@protocol
FLBPlatform
;
/**
* 实现平台侧的页面打开和关闭,不建议直接使用用于页面打开,建议使用FlutterBoostPlugin中的open和close方法来打开或关闭页面;
* FlutterBoostPlugin带有页面返回数据的能力
*/
@interface
PlatformRouterImp
:
NSObject
<
FLBPlatform
>
@property
(
nonatomic
,
strong
)
UINavigationController
*
navigationController
;
@end
NS_ASSUME_NONNULL_END
example/ios/Runner/PlatformRouterImp.m
0 → 100644
View file @
e10b101d
//
// DemoRouter.m
// Runner
//
// Created by Jidong Chen on 2018/10/22.
// Copyright © 2018年 The Chromium Authors. All rights reserved.
//
#import "PlatformRouterImp.h"
#import <flutter_boost/FlutterBoost.h>
@interface
PlatformRouterImp
()
@end
@implementation
PlatformRouterImp
#pragma mark - Boost 1.5
-
(
void
)
open
:(
NSString
*
)
name
urlParams
:(
NSDictionary
*
)
params
exts
:(
NSDictionary
*
)
exts
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
];
if
(
completion
)
completion
(
YES
);
}
}
-
(
void
)
close
:(
NSString
*
)
uid
result
:(
NSDictionary
*
)
result
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
{
BOOL
animated
=
[
exts
[
@"animated"
]
boolValue
];
animated
=
YES
;
FLBFlutterViewContainer
*
vc
=
(
id
)
self
.
navigationController
.
presentedViewController
;
if
([
vc
isKindOfClass
:
FLBFlutterViewContainer
.
class
]
&&
[
vc
.
uniqueIDString
isEqual
:
uid
]){
[
vc
dismissViewControllerAnimated
:
animated
completion
:
^
{}];
}
else
{
[
self
.
navigationController
popViewControllerAnimated
:
animated
];
}
}
@end
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