Want to push a UIViewController from FlutterViewController? You need to embed FlutterViewController in container UINavigationController programmatically or in storyboard, then you will be able to push your next controller.
Here is example how to embed programmatically:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | @interface AppDelegate() @property (nonatomic, strong) UINavigationController *navigationController; @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [GeneratedPluginRegistrant registerWithRegistry:self]; UIViewController *flutterViewController = [[FlutterViewController alloc] init]; self.navigationController = [[UINavigationController alloc] initWithRootViewController:flutterViewController]; [self.navigationController setNavigationBarHidden:YES]; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.rootViewController = self.navigationController; [self.window makeKeyAndVisible]; return true; } - (void)pushExample { UIViewController *viewController = [[UIViewController alloc] init]; [self.navigationController pushViewController:viewController animated:true]; } @end |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.