New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Adding a Flutter screen to an Android app' How to specify initialRoute with cache engine #48791
Comments
Hi @xster |
is there any way to initial route with cache engine? i'm working on add flutter into existing app. |
/move flutter/flutter |
@matthew-carroll can we add some clarifications to the website? I know the API isn't ideal right now. Maybe we can just put a workaround in a tip box for now since whether we document it or not, this will be a recurring question. |
To answer the questions in this thread...
When configuring a If you have a requirement that is not covered by a new engine or a cached engine, please let us know what use-cases you're dealing with and we can see if it makes sense to extend the API.
Not necessarily. If you want to configure an initial route using the API for
@xster I'll add instructions to the website guide for setting an initial route when creating a cached engine. I'm not sure where it would be appropriate to add comments in code - we can't really comment on a method that doesn't exist. Also, you mentioned the API isn't ideal. I think this part of the API makes sense. What kind of API do you think would be preferable? |
@matthew-carroll thanks for your reply, but i want to make things clear. |
@zmtzawqlp you can definitely use the same It sounds like what you want is to change the route of a In your case, you'll want to setup a method channel that does the following:
Does that make sense? |
@matthew-carroll yes, I got your point, FlutterA and FlutterB will in the same page stack, but it's difficult to control both native page stack and flutter page stack. Thank you very much for clarification, I'm look forward to that Flutter team will provide official way. |
Yes, It looks similar to the previous solution, Flutter Boost also uses this method, it should be feasible, thank you for your reply! |
Based on conversation in this thread, and @xster's comment near the top, I think the only actionable change is to add some info to Flutter's guides about using initial routes with cached engines. I added docs for that case here: The new initial route info can be found in the following guides: https://flutter.dev/docs/development/add-to-app/android/add-flutter-screen https://flutter.dev/docs/development/add-to-app/android/add-flutter-fragment I'm going to close this issue. |
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 |
Page URL: https://flutter.dev/docs/development/add-to-app/android/add-flutter-screen.html
Page source: https://github.com/flutter/website/tree/master/src/docs/development/add-to-app/android/add-flutter-screen.md
I read this article and found that when I use newEngine I can specify Flutter's initialRoute like this.
But when using cacheEngine, I didn’t find such methods. So can we use both cacheEngine and initialRoute?
The text was updated successfully, but these errors were encountered: