skip to Main Content

Authetication using Go Routers with flutter

class AuthGate extends StatelessWidget { const AuthGate({super.key}); @override Widget build(BuildContext context) { final AuthService authService = AuthService(); final userProvider = context.read<UserProvider>(); WidgetsBinding.instance.addPostFrameCallback((_) async { await authService.getUserData(context: context); if (userProvider.userModel.token.isNotEmpty) { context.go(AppRouterName.homeView.path); } else { context.go(AppRouterName.signInView.path); } }); return const Scaffold(…

VIEW QUESTION
Back To Top
Search