Flutter-Auto-Technologies / CarPlay-Flutter-Widgets

Proof of concept of Flutter running on CarPlay
MIT License
14 stars 2 forks source link

App shows blank Screen when opens #2

Open sharadAimonk opened 2 years ago

sharadAimonk commented 2 years ago

Hey, I have tried to run this app but I was getting some path issues, so I created a sample app and sample module and copy code from here to dedicated files. But when I run the app it just shows blank screen. How I copied the code:

jeffmilanes commented 2 years ago

Hello @sharadAimonk ,

I've encountered this issue as well, i fixed this by adding the SceneDelegate.swift, have you add the swift file directly to vscode? if so, we should add the swift files directly to xcode.

SceneDelegate.swift

@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
    var window: UIWindow?

    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        guard let windowScene = scene as? UIWindowScene else { return }

        window = UIWindow(windowScene: windowScene)

        let flutterEngine = FlutterEngine(name: "SceneDelegateEngine")
        flutterEngine.run()
        GeneratedPluginRegistrant.register(with: flutterEngine)
        let controller = FlutterViewController.init(engine: flutterEngine, nibName: nil, bundle: nil)
        window?.rootViewController = controller
        window?.makeKeyAndVisible()
    }
}
fotiDim commented 1 year ago

@sharadAimonk can give some details about the path issues?