feat: integrate ErrorService for consistent error display and standardize bloc error messages.

This commit is contained in:
Van Leemput Dayron
2025-12-02 13:59:40 +01:00
parent 1e70b9e09f
commit 6757cb013a
24 changed files with 927 additions and 608 deletions

View File

@@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import '../blocs/auth/auth_bloc.dart';
import '../blocs/auth/auth_event.dart';
import '../blocs/auth/auth_state.dart';
import '../services/error_service.dart';
class ForgotPasswordPage extends StatefulWidget {
const ForgotPasswordPage({super.key});
@@ -56,20 +57,13 @@ class _ForgotPasswordPageState extends State<ForgotPasswordPage> {
body: BlocListener<AuthBloc, AuthState>(
listener: (context, state) {
if (state is AuthPasswordResetSent) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Email de réinitialisation envoyé !'),
backgroundColor: Colors.green,
),
ErrorService().showSnackbar(
message: 'Email de réinitialisation envoyé !',
isError: false,
);
Navigator.pop(context);
} else if (state is AuthError) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(state.message),
backgroundColor: Colors.red,
),
);
ErrorService().showError(message: state.message);
}
},
child: SafeArea(