Warning: Experimental feature
- In
Xcode, go toFile→Add Packages...OR select your project in theProject Editor, go to thePackage Dependenciestab, and press the+.
- Enter a
Package URL(e.g. aGitHubrepositoryURL) or a search term in the search field in the upper right.
-
Select the package you want to add. Select a
Dependency Rule. In most cases, you probably want to set this toUp to Next Major Version. ClickAdd Package. -
Instantiate
SnapshotSafeViewFlutterInterceptorand callperformSwitchViewfor intercepting root view:
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
private let snapshotSafeViewInterceptor = SnapshotSafeViewFlutterInterceptor()
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
snapshotSafeViewInterceptor.performSwitchView(in: window)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
