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
auto_route 1.0.0-beta #283
Comments
Super excited for this... Can't wait to try it out! Thanks Milad!! |
Thanks for putting this out so quickly ... I'm excited to explore it and learn. I needed to use: ScaffoldMessenger environment: With this config, there are quite a few build errors ... you may want to check it out or I'll report back as I learn more as to what's going on. |
Hey @dgaedcke |
It was totally user error ... I've not worked with Dart codegen before & I neglected to run pub get inside the generator directory ... looks good now ... about to start testing!! |
It's looking really good so far ... working beautifully!! First a question: Would it make sense to use the Dart "part of" syntax (in generated file) so that the file with my live RouterConfig (app state) can ALSO export the generated Argument classes?? Or do I need to be importing the generated file everywhere in my project (along with my RouterConfig). One issue I've hit (that I can work around) but others may need this....
Ah doh, I've switched to using the argument wrapper ... like this: but I'm still getting this error: Unhandled Exception: DashboardArgs can not be null because it has required parameters |
The part-of syntax does not work because the generated file does alot of imports. Part files can not have their own imports. |
You don't need to use a route provider to set initial destination. P.s root back button dispatcher is provided by material App by default |
ah beautiful ... that makes perfect sense ... thanks!! |
Has anyone tried using this with Firebase auth? Don't know if it's me or not but the load time to redirect and check for auth, or not is too long also when I refresh the login screen shows then the home screen will show as I am logged in. This works great without the router guards and the need for a redirect |
I'm sure this is a beginner mistake, but my Snackbars are showing behind the soft keyboard. Since no one on Stack Overflow seems to have had that specific problem in over 2-3 years, I'm guessing it's something I'm doing wrong. I'm using the "currentContext" of your navigatorKey and since it's "UP" the widget tree by 3 or 4 screens (meaning it's NOT the context of my current top screen), I'm guessing that is my problem?? Is there any best practice you'd recommend for showing Snackbars when I'm outside of the build-context?? Or does auto-router have any tricks to do it??? |
This might be a bug ... From my generated code: when I look at source for AutoRouterConfig, I see this: so it seems that root is not being initialized?? all thoughts welcome! ah ... nevermind ... I just learned about IMPLICIT superclass execution ... so that explains the no "on null" error but not why nav is not happening... |
@rlee1990 Are you you doing a network call inside of AutoRouteGuard? please share some code. |
@dgaedcke Exactly, no-param super constructors will be called implicitly. |
@dgaedcke I'm not sure I understand the issue here but your App can not display anything above The System's keyboard unless maybe a system toast(Android). |
A new build is published on pub, it includes TabsRouter support + some changes. |
Thanks for the update!! What happened to the "copyWith" method on route arguments?? We need this for when an incomplete route is passed?? And do you have any tricks for solving the issue of the xxx.g.dart file being out of sync with the new package so the project won't build?? I just commented out all the places causing build errors but that's a bit cumbersome. |
@dgaedcke you need to upgrade the generator as well. Args are merged with route info now. |
Yeah, my question was not very clear ... let me try rephrasing it. The widget tree looks (roughly) like this:
So here's the question: |
Do you plan to implement deferred/lazy loading for the TabsRouter? Currently, all widgets that are passed to the router are initialized at once. @Milad-Akarie |
@dgaedcke how are you obtaining the context of the navigator? |
@jonasbeyer as a matter of fact I did and it's now an option in AutoTabsRouter and is set to true by default. |
I'm reading it right off the generated router as follows: |
I'm getting an issue when running the generation:
EDIT: Working now. It appears I needed to change my @QueryParam() and @PathParam() imports to match the newest version. |
So the issue is for me. I use firebase auth and use route guards
My Issue is when I using this package there is a delay and it first will return false then true and on web it will always return false when closing the browser even in prod. When I set up navigation using https://www.filledstacks.com/post/flutter-web-advanced-navigation/ instructions it works the way it should with this code |
@Milad-Akarie is there a suggested way to integrate a splash page with this library? what do you use along with the new auto_rote for instance. I have many blocs living above the MaterialPage and I want to show the splash page while some of the async calls are finished and UI is ready to be showed. At that point I want to route to the related page |
You can wrap your |
@aytunch what @theweiweiway suggested is very valid but when I don't have a fancy splash screen with animations and stuff, refer to this link to see how you can add a native splash screen to your Flutter App Future<void> main() async {
// native splash screen is on
await initliazation...
// flutter will draw first frame after this point
// and native splash screen will disappear
//
// you can decide what route to start with and
// pass it to your App
runApp(MyApp(initialRoute: MyInitialRoute()));
} and your App should look something like this class MyApp extends StatelessWidget {
final PageRouteInfo initialRoute;
MyApp({Key key, this.initialRoute}) : super(key: key);
final appRouter = AppRouter();
@override
Widget build(BuildContext context) {
return MaterialApp.router(
// pass your route here
routerDelegate: appRouter.delegate(initialRoutes: [initialRoute]),
routeInformationParser: appRouter.defaultRouteParser(),
..... |
I'm probably not using this right, but using Riverpod, I'm set up like this:
On beta-6, "AutoRouterConfig" is no longer available. |
closing due to:
@dgaedcke if you are still having problems, please feel free to open a new issue |
I just published auto_route
1.0.0-beta
with very little documentation, There's still alot of work to be done Docs, Testing and improvements.I don't seem to get alot of free time lately so I'm asking you to bare with me.
as I said I didn't get the chance to write the docs but If you've used auto_route before, finding your way around shouldn't be hard.
I promise to be more responsive so if you have any questions about the new auto_route you can ask me here.
Thank you all for your patience.
https://pub.dev/packages/auto_route/versions/1.0.0-beta
Highlights
_ much more...
The text was updated successfully, but these errors were encountered: