Skip to content

[iOS][add2app] : The flutter page shows white screen when setting .navigationBar.isTranslucent = false #165559

@persenzhou

Description

@persenzhou

Steps to reproduce

  1. evn
    [✓] Flutter (Channel stable, 3.24.5, on macOS 14.6 23G80 darwin-arm64 (Rosetta),
    locale en-CN)
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    [✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 2024.2)
    [✓] IntelliJ IDEA Ultimate Edition (version 2023.1.3)
    [✓] VS Code (version 1.97.2)

4.demo is in the zip file

Expected results

Actual results

when add .navigationBar.isTranslucent = false code ,and run object then exchange tab, the flutter page is white screen

Code sample

2.project is a demo on ios and use flutter module
AppDelegate.swift code:

import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

    window = UIWindow(frame: UIScreen.main.bounds)
    window?.backgroundColor = .white
    
    let tab = UITabBarController()
    let v1 = UIViewController();
    v1.title = "title1"
    v1.tabBarItem = UITabBarItem(title: "title1", image: nil, tag: 0)
    let navi1 = UINavigationController(rootViewController: v1)
    navi1.navigationBar.isTranslucent = false
    
    let flutter = JTFlutterViewController(initialRoute: "/test")
    flutter.title = "flutter"
    flutter.tabBarItem = UITabBarItem(title: "flutter", image: nil, tag: 1)
    let navi2 = UINavigationController(rootViewController: flutter)
    navi2.navigationBar.isTranslucent = false
    
    let v2 = UIViewController();
    v2.title = "title2"
    v2.tabBarItem = UITabBarItem(title: "title2", image: nil, tag: 2)
    let navi3 = UINavigationController(rootViewController: v2)
    navi3.navigationBar.isTranslucent = false
    
    tab.viewControllers = [
        navi1,
        navi2,
        navi3,
    ]
  
    window?.rootViewController = tab
    window?.makeKeyAndVisible()

    return true
}

}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

[✓] Flutter (Channel stable, 3.24.5, on macOS 14.6 23G80 darwin-arm64 (Rosetta),
locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.3)
[✓] VS Code (version 1.97.2)

Device is iOS15.2 ,iPhone XR

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: existing-appsIntegration with existing apps via the add-to-app flowfound in release: 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy