mirror of
https://github.com/Dvorinka/1356.git
synced 2026-06-04 20:12:56 +00:00
main, fix
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../application/auth_controller.dart';
|
||||
import '../../onboarding/application/onboarding_controller.dart';
|
||||
import 'auth_showcase_screen.dart';
|
||||
import '../../onboarding/presentation/onboarding_intro_screen.dart';
|
||||
import '../../countdown/presentation/home_countdown_screen.dart';
|
||||
|
||||
class AuthGate extends ConsumerWidget {
|
||||
const AuthGate({super.key});
|
||||
@@ -10,11 +12,18 @@ class AuthGate extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final authState = ref.watch(authControllerProvider);
|
||||
final onboardingState = ref.watch(onboardingControllerProvider);
|
||||
|
||||
if (authState == null) {
|
||||
return const AuthShowcaseScreen();
|
||||
}
|
||||
|
||||
return const OnboardingIntroScreen();
|
||||
// If user is authenticated but hasn't completed onboarding
|
||||
if (!onboardingState) {
|
||||
return const OnboardingIntroScreen();
|
||||
}
|
||||
|
||||
// User is authenticated and has completed onboarding
|
||||
return const HomeCountdownScreen();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user