Closed sigurdm closed 6 years ago
I solved the problem. //=======================
@interface XXFlutterViewController : FlutterViewController
@EnD
(void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. FlutterEngine *flutterEngine = self.engine;
[GeneratedPluginRegistrant registerWithRegistry:flutterEngine]; //custom futter plugin [XXXFlutterBridge registerWithRegistry:flutterEngine]; }
//open flutter vc XXFlutterViewController *flutterViewController = [[XXFlutterViewController alloc] init]; [flutterViewController setInitialRoute:@"xxxxx/xxxx"];
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
The isolate is running already when the init-method on FlutterViewController is done running. There is no time to set the route.
This seems to have happened as part of https://github.com/flutter/engine/commit/58e84c8bf0b6304649340e6eaad988602961d7f6
Before engine connection was made in
-viewWillAppear
leaving time for the initial route to be set: https://github.com/flutter/engine/commit/58e84c8bf0b6304649340e6eaad988602961d7f6#diff-366c592b71736b6c5519e04346bf325cL339Moving
from
-setupShell
to-viewWillAppear
seems to solve the issue...cc @chinmaygarde