-
-
Save tolo/f7e6c30cad3ac76085d75255ba509f10 to your computer and use it in GitHub Desktop.
@amerblackbird and @hmbenhaim, please have a look at that branch and the corresponding sample (stateful_shell_route.dart) there, and see if that works better. If not, please add a comment in flutter/packages#2650.
Hi @tolo I have tried this branch and this sample it works amazing so simple and so good and perform very well. I hadn't any issues with it so far I cloned this branch and I'm using it directly once it merge I'll use the library again. Waiting for the merge. Thank you!
Happy to hear @hmbenhaim! 😊
Mate, you are a legend! Thanks a lot! 🍻
Mate, you are a legend! Thanks a lot! 🍻
🙏😊🍻
Here are my 2 cents until the PR adding support for this use case it's merged. If you updated to go_router 6.0.7+ this was introduced:
Use HeroControllerScope for nested Navigator that fixes Hero Widgets not animating in Nested Navigator.
So the above gist won't work until a small change it's made to work with 6.0.7 versions and above.
On the ScaffoldWithNavBar
widget inside the BottomTabBarShellRoute
the currentNavigator
prop can't be casted to Navigator
directly because the builder
method will not return now a Navigator
but instead a HeroControllerScope
.
So in line 128 this change should be done to make the gist work:
ScaffoldWithNavBar(tabs: tabs, key: scaffoldKey,
currentNavigator: (fauxNav as HeroControllerScope).child as Navigator,
currentRouterState: state, routes: routes),
]);
why in StatefulWidget i call @OverRide
void initState() {
super.initState();
print("-----RUN------ ")}
- At tab:: firstly -----RUN------ call double, but since the 2nd time onwards it only calls 1 time. Please help me :(
Here are my 2 cents until the PR adding support for this use case it's merged. If you updated to go_router 6.0.7+ this was introduced:
Use HeroControllerScope for nested Navigator that fixes Hero Widgets not animating in Nested Navigator.
So the above gist won't work until a small change it's made to work with 6.0.7 versions and above. On the
ScaffoldWithNavBar
widget inside theBottomTabBarShellRoute
thecurrentNavigator
prop can't be casted toNavigator
directly because thebuilder
method will not return now aNavigator
but instead aHeroControllerScope
.So in line 128 this change should be done to make the gist work:
ScaffoldWithNavBar(tabs: tabs, key: scaffoldKey, currentNavigator: (fauxNav as HeroControllerScope).child as Navigator, currentRouterState: state, routes: routes), ]);
type '_CustomNavigator' is not a subtype of type 'HeroControllerScope' in type cast
@davidhicks980, actually support for navigation observers (and hero controllers) is being implemented in the PR flutter/packages#2664. Hoping that will be finished soon so flutter/packages#2650 can benefit from it.
My main focus right not is to complete flutter/packages#2650 so it can be merged into go_router. @amerblackbird and @hmbenhaim, please have a look at that branch and the corresponding sample (stateful_shell_route.dart) there, and see if that works better. If not, please add a comment in flutter/packages#2650.