fix: update initial route to '/login' and use context.go for navigation in LoginScreen
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import '../data/auth_providers.dart';
|
||||
|
||||
class LoginScreen extends ConsumerStatefulWidget {
|
||||
@@ -28,7 +29,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
|
||||
if (mounted) {
|
||||
final state = ref.read(authStateProvider);
|
||||
if (state is AsyncData && state.value != null) {
|
||||
if (context.mounted) Navigator.of(context).pushReplacementNamed('/recipes');
|
||||
if (context.mounted) context.go('/recipes');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user