diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 08f44786fb04e..e1399d4cd9d9c 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -120,7 +120,7 @@ - (instancetype)initWithEngine:(FlutterEngine*)engine NSAssert(engine != nil, @"Engine is required"); self = [super initWithNibName:nibName bundle:nibBundle]; if (self) { - _viewOpaque = YES; + _viewOpaque = NO; if (engine.viewController) { FML_LOG(ERROR) << "The supplied FlutterEngine " << [[engine description] UTF8String] << " is already used with FlutterViewController instance " @@ -203,7 +203,7 @@ - (void)sharedSetupWithProject:(nullable FlutterDartProject*)project return; } - _viewOpaque = YES; + _viewOpaque = NO; _weakFactory = std::make_unique>(self); _engine = std::move(engine); _flutterView.reset([[FlutterView alloc] initWithDelegate:_engine opaque:self.isViewOpaque]); diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm index a91101c36807b..e9527d72c16db 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm @@ -168,6 +168,16 @@ - (void)tearDown { self.messageSent = nil; } +- (void)testFlutterViewControllerViewOpaue { + FlutterEngine* mockEngine = OCMPartialMock([[FlutterEngine alloc] init]); + [mockEngine createShell:@"" libraryURI:@"" initialRoute:nil]; + FlutterViewController* viewController = [[FlutterViewController alloc] initWithEngine:mockEngine + nibName:nil + bundle:nil]; + // The FlutterViewController's FlutterViewLayer Opaque default is NO + XCTAssertFalse(viewController.isViewOpaque); +} + - (void)testkeyboardWillChangeFrameWillStartKeyboardAnimation { FlutterEngine* mockEngine = OCMPartialMock([[FlutterEngine alloc] init]); [mockEngine createShell:@"" libraryURI:@"" initialRoute:nil];