A better state and alerts

This commit is contained in:
2026-02-23 20:19:07 +08:00
parent 0b900d3480
commit 1074572905
17 changed files with 673 additions and 428 deletions
+4 -9
View File
@@ -8,6 +8,7 @@ import 'package:go_router/go_router.dart';
import '../../providers/auth_provider.dart';
import '../../widgets/responsive_body.dart';
import '../../utils/snackbar.dart';
class LoginScreen extends ConsumerStatefulWidget {
const LoginScreen({super.key});
@@ -43,15 +44,11 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
if (response.session != null && mounted) {
context.go('/tickets');
} else if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Check your email to confirm sign-in.')),
);
showInfoSnackBar(context, 'Check your email to confirm sign-in.');
}
} on Exception catch (error) {
if (mounted) {
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content: Text('Sign in failed: $error')));
showErrorSnackBar(context, 'Sign in failed: $error');
}
} finally {
if (mounted) {
@@ -75,9 +72,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
}
} on Exception catch (error) {
if (mounted) {
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content: Text('OAuth failed: $error')));
showErrorSnackBar(context, 'OAuth failed: $error');
}
} finally {
if (mounted) {