native to flutter navigation is very slow for the first time

48 Views Asked by At

We have native iOS and Android projects. Now we are writing some part of the app in flutter and integrating this into native iOS and android projects. When we navigate from native to flutter, it is first showing black screen and then loading the flutter UI. Whole process is taking around 2-3 seconds.

let flutterViewController = FlutterViewController(engine: FlutterManager.shared.flutterEngine!, nibName: nil, bundle: nil)
        let methodChannel = FlutterMethodChannel(name: "PROFILE_CLICK",
                                                 binaryMessenger: flutterViewController.binaryMessenger)

        methodChannel.invokeMethod("BASE_DATA", arguments: jsonString)
        methodChannel.setMethodCallHandler({
            (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
            // This method is invoked on the UI thread.
            // Handle battery messages.
          })
        navigationController?.pushViewController(flutterViewController, animated: true)

Thank you!

Need a solution to make the transition smooth and fast.

0

There are 0 best solutions below