Where you create a FlutterEngine depends on your host app.

SwiftUI

UIKit-Swift

UIKit-ObjC

In this example, we create a FlutterEngine object inside a SwiftUI ObservableObject. 
We then pass this FlutterEngine into a ContentView using the 
 environmentObject() property.

In MyApp.swift:

import

SwiftUI

import

Flutter

// The following library connects plugins with iOS platform code to this app.

import

FlutterPluginRegistrant

class

FlutterDependencies

ObservableObject

let

flutterEngine

FlutterEngine

name

"my flutter engine"

init

(){