Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions lib/features/authentication/authentication_page_content.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions lib/features/authentication/authentication_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class AuthenticationStateNotifier extends _$AuthenticationStateNotifier with Aut
);
}

Future<void> mockSignIn() async {
await _signInCompletion(Future.value());
}

Future<void> signInAnonymously() async {
final provider = ref.read(signInAnonymouslyUseCaseProvider.future);
await _signInCompletion(provider);
Expand Down
Loading