Skip to content

Instantly share code, notes, and snippets.

@yaizudamashii
Created March 23, 2021 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaizudamashii/1121ed7e6fc2e28aff845b8adebae06a to your computer and use it in GitHub Desktop.
Save yaizudamashii/1121ed7e6fc2e28aff845b8adebae06a to your computer and use it in GitHub Desktop.
import Flutter
import FlutterPluginRegistrant
@UIApplicationMain
class AppDelegate: FlutterAppDelegate {
// other AppDelegate properties
// create multiple Flutter Engines
lazy var passcodeFlutterEngine = FlutterEngine(name: "my flutter engine")
lazy var informationTabFlutterEngine = FlutterEngine(name: "my flutter engine 2")
lazy var qrcodeFlutterEngine = FlutterEngine(name: "my flutter engine 3")
override func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
flutterEngine.run()
informationTabFlutterEngine.run()
qrcodeFlutterEngine.run()
// other app initializations
// need to register all packages used in Flutter with each instance of FlutterEngine
GeneratedPluginRegistrant.register(with: self.flutterEngine)
GeneratedPluginRegistrant.register(with: self.informationTabFlutterEngine)
GeneratedPluginRegistrant.register(with: self.qrcodeFlutterEngine)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment