//  it should use the AppDelegate class for the application delegate

@UIApplicationDelegateAdaptor

AppDelegate

self

var

appDelegate

var

body

some

Scene

WindowGroup

ContentView

()

Then, in your view, the AppDelegateis accessible as an EnvironmentObject.

import

SwiftUI

import

Flutter

struct

ContentView

View

// Access the AppDelegate using an EnvironmentObject.

@EnvironmentObject

var

appDelegate

AppDelegate

var

body

some

View

Button

"Show Flutter!"