Commit c2c27908 authored by Jidong Chen's avatar Jidong Chen

some fix

parent 7aa36cef
......@@ -21,7 +21,7 @@
return instance;
}
// Boost 2 switch
//AB Boost 2 switch
- (BOOL)useBoost2
{
return YES;
......@@ -57,7 +57,7 @@
BOOL animated = [exts[@"animated"] boolValue];
animated = YES;
FLBFlutterViewContainer *vc = (id)self.navigationController.presentedViewController;
if([vc isKindOfClass:FLBFlutterViewContainer.class] && [vc.uniqueIDString isEqual: uid]){
if([vc isKindOfClass:FLB2FlutterViewContainer.class] && [vc.uniqueIDString isEqual: uid]){
[vc dismissViewControllerAnimated:animated completion:^{}];
}else{
[self.navigationController popViewControllerAnimated:animated];
......@@ -93,9 +93,6 @@
}
}
- (void)closePage:(NSString *)uid animated:(BOOL)animated params:(NSDictionary *)params completion:(void (^)(BOOL))completion
{
if([self useBoost2]){
......
......@@ -25,13 +25,19 @@
- (IBAction)pushFlutterPage:(id)sender {
[DemoRouter.sharedRouter openPage:@"first" params:@{} animated:YES completion:^(BOOL f){
[DemoRouter.sharedRouter openPage:@"first"
params:@{}
animated:YES
completion:^(BOOL f){
}];
}
- (IBAction)present:(id)sender {
[DemoRouter.sharedRouter openPage:@"second" params:@{@"present":@(YES)} animated:YES completion:^(BOOL f){}];
[DemoRouter.sharedRouter openPage:@"second"
params:@{@"present":@(YES)}
animated:YES
completion:^(BOOL f){}];
// [self dismissViewControllerAnimated:YES completion:completion];
}
......
......@@ -39,10 +39,6 @@ class SecondRouteWidget extends StatelessWidget {
// Navigate back to first route when tapped.
BoostContainerSettings settings = BoostContainer.of(context).settings;
if(settings.params.containsKey("result_id")){
String rid = settings.params["result_id"];
}
FlutterBoost.singleton.close(settings.uniqueId,result: {"result":"data from second"});
},
child: Text('Go back with result!'),
......
......@@ -30,7 +30,6 @@
NS_ASSUME_NONNULL_BEGIN
#define RELEASE_1_0 1
@protocol FLB2FlutterProvider <FLBFlutterViewProvider>
......
......@@ -29,6 +29,8 @@
#import "BoostMessageChannel.h"
#import "FlutterBoostPlugin_private.h"
#define NSNull2Nil(_x_) if([_x_ isKindOfClass: NSNull.class]) _x_ = nil;
@interface FlutterBoostPlugin()
@end
......@@ -53,6 +55,9 @@
NSDictionary *exts = args[@"exts"];
NSString *uid = args[@"uniqueId"];
NSDictionary *resultData = args[@"result"];
NSNull2Nil(exts);
NSNull2Nil(resultData);
NSNull2Nil(uid);
[[FlutterBoostPlugin sharedInstance].application close:uid
result:resultData
exts:exts
......@@ -70,6 +75,9 @@
NSString *url = args[@"url"];
NSDictionary *urlParams = args[@"urlParams"];
NSDictionary *exts = args[@"exts"];
NSNull2Nil(url);
NSNull2Nil(urlParams);
NSNull2Nil(exts);
[[FlutterBoostPlugin sharedInstance].application open:url
urlParams:urlParams
exts:exts
......@@ -87,7 +95,6 @@
}
+ (instancetype)sharedInstance
{
static id _instance = nil;
......@@ -119,12 +126,12 @@
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
if([platform respondsToSelector:@selector(useBoost2)] && platform.useBoost2){
_factory = FLB2Factory.new;
self->_factory = FLB2Factory.new;
}else{
_factory = FLBFactory.new;
self->_factory = FLBFactory.new;
}
_application = [_factory createApplication:platform];
[_application startFlutterWithPlatform:platform
self->_application = [self->_factory createApplication:platform];
[self->_application startFlutterWithPlatform:platform
onStart:callback];
});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment