Skip to content
This repository was archived by the owner on May 11, 2024. It is now read-only.

Latest commit

 

History

History
39 lines (27 loc) · 1.27 KB

File metadata and controls

39 lines (27 loc) · 1.27 KB

Flutter

Warning: Experimental feature

  1. In Xcode, go to FileAdd Packages... OR select your project in the Project Editor, go to the Package Dependencies tab, and press the +.

  1. Enter a Package URL (e.g. a GitHub repository URL) or a search term in the search field in the upper right.

  1. Select the package you want to add. Select a Dependency Rule. In most cases, you probably want to set this to Up to Next Major Version. Click Add Package.

  2. Instantiate SnapshotSafeViewFlutterInterceptor and call performSwitchView for 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)
    }

}

Example: