feat: integrate ErrorService for consistent error display and standardize bloc error messages.
This commit is contained in:
@@ -4,6 +4,7 @@ import '../blocs/auth/auth_bloc.dart';
|
||||
import '../blocs/auth/auth_event.dart';
|
||||
import '../blocs/auth/auth_state.dart';
|
||||
import 'package:sign_in_button/sign_in_button.dart';
|
||||
import '../services/error_service.dart';
|
||||
|
||||
/// Login page widget for user authentication.
|
||||
///
|
||||
@@ -89,12 +90,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
if (state is AuthAuthenticated) {
|
||||
Navigator.pushReplacementNamed(context, '/home');
|
||||
} else if (state is AuthError) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(state.message),
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
);
|
||||
ErrorService().showError(message: state.message);
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
|
||||
Reference in New Issue
Block a user