Commit c2c27908 authored by Jidong Chen's avatar Jidong Chen

some fix

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