Commit ad1697d8 authored by 余玠's avatar 余玠

cherrypick: 最后一个flutter页面关闭的时候回调对Engine的OwnerViewController清空 efea291c 余玠...

 cherrypick: 最后一个flutter页面关闭的时候回调对Engine的OwnerViewController清空	efea291c	余玠 <xujian.xj@alibaba-inc.com>	2020年3月30日 21:56
parent 0d28a8c1
......@@ -75,6 +75,9 @@ NS_ASSUME_NONNULL_BEGIN
params:(NSDictionary *)params
uniqueId:(NSString *)uniqueId;
- (void)onShownContainerChanged:(NSString *)uniqueId
params:(NSDictionary *)params;
@end
NS_ASSUME_NONNULL_END
......
......@@ -67,8 +67,15 @@
result(@(r));
}];
}else if([@"onShownContainerChanged" isEqualToString:call.method]){
NSString *newName = call.arguments[@"newName"];
NSDictionary *args = [FLBCollectionHelper deepCopyNSDictionary:call.arguments
filter:^bool(id _Nonnull value) {
return ![value isKindOfClass:NSNull.class];
}];
NSString *newName = args[@"newName"];
NSString *uid = args[@"uniqueId"];
if(newName){
[[FlutterBoostPlugin2 sharedInstance].application onShownContainerChanged:uid params:args];
[NSNotificationCenter.defaultCenter postNotificationName:@"flutter_boost_container_showed"
object:newName];
}
......
......@@ -226,4 +226,13 @@
}
}
- (void)onShownContainerChanged:(NSString *)uniqueId
params:(NSDictionary *)params{
NSString *oldName = params[@"oldName"];
NSString *newName = params[@"newName"];
if (oldName!=nil && [newName isEqualToString:@"default"]) {
[self.flutterProvider detach];
}
}
@end
......@@ -268,7 +268,6 @@ static NSUInteger kInstanceCounter = 0;
// [self surfaceUpdated:NO];
// }
[super bridge_viewDidDisappear:animated];
[FLUTTER_APP resume];
}
- (void)installSplashScreenViewIfNecessary {
......
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