Refactor code for consistency and readability

- Removed unused imports and commented-out code
- Updated class inheritance for AuthState subclasses
- Reorganized code structure for better readability
- Cleaned up debug print statements and replaced with dart:developer logs
This commit is contained in:
Mohammad Salameh
2024-04-15 12:03:25 +03:00
parent cfc395e210
commit 80d424f114
13 changed files with 162 additions and 77 deletions
@@ -18,8 +18,6 @@ class LoginView extends StatelessWidget {
@override
Widget build(BuildContext context) {
//TODO move to strings manager
return BlocConsumer<AuthCubit, AuthState>(
listener: (context, state) {
if (state is AuthError) {
@@ -28,8 +26,8 @@ class LoginView extends StatelessWidget {
content: Text(state.message),
),
);
} else if (state is AuthSuccess) {
Navigator.popAndPushNamed(context, Routes.homeRoute);
} else if (state is AuthLoginSuccess) {
Navigator.pushNamed(context, Routes.homeRoute);
}
},
builder: (context, state) {