How to pop back from native ios view to flutter view?

Viewed 1316

I'm adding a new view with the storyboard to my existing flutter up. Then push it. The root view is flutter view, so I can pop back whenever native ios view is opened.

How to pop back from native ios view to my flutter view with same UINavigationController from my root view(flutter view)?

this is my code from my flutterchannelmanager swift file to separate it from appdelegate.

self.storyVC = UIStoryboard(name: "StripePayment", bundle: nil)
let stripeVC: StripeViewController = self.storyVC!.instantiateViewController(withIdentifier: "stripe_payment") as! StripeViewController
self.flutterViewController.present(mynavigationController, animated: true, completion: nil)
1 Answers

This is covered in the documentation:

In iOS, to travel between view controllers, you can use a UINavigationController that manages the stack of view controllers to display.

Flutter has a similar implementation, using a Navigator and Routes. A Route is an abstraction for a “screen” or “page” of an app, and a Navigator is a widget that manages routes. A route roughly maps to a UIViewController. The navigator works in a similar way to the iOS UINavigationController, in that it can push() and pop() routes depending on whether you want to navigate to, or back from, a view.

I suggest to check the examples for further details about the implementation. Also, you can check out this blog for a better understanding of navigation between Flutter page and native iOS page using Coordinator pattern.

Related