Closed ParkerH27 closed 1 year ago
My best guess of the issue is that we are not setting up the pages that need to show when the user is routed to a particular path.
Yeah, I'll take another look soon. The annoying thing is that auto_route
v6
's docs are pretty bad.
It's supposed to have a working example, but it doesn't. There is a PR (Milad-Akarie/auto_route_library#1515) that fixes a minor issue in the guide on the readme though.[^1]
Admittingly, I almost agree with @tostal.[^2][^3]
[^1]: By minor, I mean so minor that even I could figure out the fix. [^2]: Trying hard not to summon a random human as I did on #16. [^3]: Look at the last bullet.
Here be the code that doith not what it ought, we believe.
didChangeDependencies
package:auto_route/src/router/widgets/auto_router.dart
.routeCollection
This code calls the method subCollectionOf
.
subCollectionOf
package:auto_route/src/route/widgets/auto_route_config.dart
.So what does this have to do with us?
AutoRouterConfig
, called NavigationManager.NavigationManager
AutoTabsRouter
, hopefully through NavigationManager
.AutoTabsRouter
AutoTabsRouter
's factory
is just an opaque wrapper for _AutoTabsRouterIndexedStack
.I have no idea! If you happen to know anything, please speak up. The backtraces aren't especially...easy to wade through. I didn't see any of our code, in fact. Hmm, aren't we initiating it?
CC: @ParkerH27 @PetalCat
Boy, do I hate CSS! It hid the start of the error message!
No TabController for TabBar.
When creating a TabBar, you must either
provide an explicit TabController using the
"controller" property, or you must ensure that
there is a DefaultTabController above the TabBar.
In this case, there was neither an explicit
controller nor a default controller.
See also: https://flutter.dev/docs/testing/errors
Quick search:
Doing more looking, and it seems I've isolated a different patch of code:
@RoutePage()
class MyHomePage extends StatelessWidget {
...
// The container for the current page, with its background color
// and subtle switching animation.
var mainArea = ColoredBox(
color: colorScheme.surfaceVariant,
child: AnimatedSwitcher(
duration: Duration(milliseconds: 200),
child: AutoRouter(),
),
);
...
}
Specifically, child: AutoRouter()
.
Flutter 3.10 has a better error message. Barely. Net even enough for me to post it, because I already figured that part out.
Yahoo! As of 3656be1972a7af49f04809240634e6fcd4995206, the app works. Next up, merge in Very Good Core for all of the niceties, write some tests, and make sure the basic app has support for translating to Spanish.[^1] Well, back to #9!
[^1]: Which is why I want to merge in VGCβi18n. And tests. And better CI with pana
. And more lints. Well, maybe it's not just i18n. Oh yeah, and a structure, though maybe Riverpod won't like it. It uses Bloc. Oh, and before I forget, it needs some modification to work with flutter_launcher_icons
, which they suggest using. ~Yikes.~ Now the footnote is ~too long~ still too short.
Useful links:
Code:
ChatGPT description:
Error:
ChatGPT: