Replies: 1 comment 3 replies
-
Yes, but actually no 🤷 The part that triggers a rebuild of a Consumer isn't done through
GoRouter doesn't give you a ref. A Consumer did. What will happen is, the Consumer that gave you the Ref will rebuild. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been in search of a simple solution for integrating
riverpod
with thego_router
package in terms of reacting to authentication state changes. I've since seen a lot of conflicting complicated solutions none of which were satisfactory.It seems that from the
go_router
side the recommended solution is to utilizeBuildContext.dependOnInheritedWidgetOfExactType
inside of theGoRouter.redirect
function. My question then is then twofold:ref.watch()
callBuildContext.dependOnInheritedWidgetOfExactType
internally?ref.watch()
inside of aGoRouter.redirect
?Beta Was this translation helpful? Give feedback.
All reactions