diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm index fb52763303e08..71940926f4a3d 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm @@ -203,12 +203,10 @@ - (void)popSystemNavigator { UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController; if ([viewController isKindOfClass:[UINavigationController class]]) { [((UINavigationController*)viewController) popViewControllerAnimated:NO]; - [_engine.get() setViewController:nil]; } else { auto engineViewController = static_cast([_engine.get() viewController]); if (engineViewController != viewController) { [engineViewController dismissViewControllerAnimated:NO completion:nil]; - [_engine.get() setViewController:nil]; } } }