diff --git a/lib/features/authentication/authentication_page_content.dart b/lib/features/authentication/authentication_page_content.dart index 8a4f38c..0aa5fd6 100644 --- a/lib/features/authentication/authentication_page_content.dart +++ b/lib/features/authentication/authentication_page_content.dart @@ -1,9 +1,6 @@ -import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_app/app/navigation/app_router.dart'; import 'package:flutter_app/common/component/custom_button/custom_button_primary.dart'; import 'package:flutter_app/common/extension/async_value.dart'; -import 'package:flutter_app/common/usecase/authentication/sign_in_completion_use_case.dart'; import 'package:flutter_app/features/authentication/authentication_state.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -36,10 +33,7 @@ class _DataStateWidget extends ConsumerWidget { const Spacer(), CustomButtonPrimary( text: 'Mock Sign In', - onPressed: () async { - await ref.read(signInCompletionUseCaseProvider.future); - if (context.mounted) await context.router.replaceAll([const LandingRoute()]); - }, + onPressed: () => ref.read(authenticationStateProvider.notifier).mockSignIn(), ), const SizedBox(height: 48), CustomButtonPrimary( diff --git a/lib/features/authentication/authentication_state.dart b/lib/features/authentication/authentication_state.dart index 49f6b65..31ffccf 100644 --- a/lib/features/authentication/authentication_state.dart +++ b/lib/features/authentication/authentication_state.dart @@ -31,6 +31,10 @@ class AuthenticationStateNotifier extends _$AuthenticationStateNotifier with Aut ); } + Future mockSignIn() async { + await _signInCompletion(Future.value()); + } + Future signInAnonymously() async { final provider = ref.read(signInAnonymouslyUseCaseProvider.future); await _signInCompletion(provider);