ref.watch(currentUserAccountProvider).when(
data: (user) {
if (user != null) {
return const HomeView();
}
return const SignUpView();
},
error: (error, st) => ErrorPage(
error: error.toString(),
),
loading: () => const LoadingPage(),
);
how can I convert it or do the same function with go_route package flutter
I tried to pass ref as parameter to read the value of the the provider and make redirection with the value but I can not find a way to read it
Once you have defined the router, like
you can navigate with
so you can change your code