refactor: riverpod 3

This commit is contained in:
cogwheel0
2025-09-28 23:18:24 +05:30
parent d2aeafc773
commit 0ba48030c8
12 changed files with 633 additions and 360 deletions

View File

@@ -124,10 +124,15 @@ class _AuthenticationPageState extends ConsumerState<AuthenticationPage> {
@override
Widget build(BuildContext context) {
// Listen for auth state changes to navigate on successful login
ref.listen<AuthState>(authStateManagerProvider, (previous, next) {
ref.listen<AsyncValue<AuthState>>(authStateManagerProvider, (
previous,
next,
) {
final nextState = next.asData?.value;
final prevState = previous?.asData?.value;
if (mounted &&
next.isAuthenticated &&
previous?.isAuthenticated != true) {
nextState?.isAuthenticated == true &&
prevState?.isAuthenticated != true) {
DebugLogger.auth(
'Authentication successful, initializing background resources',
);