Refactor email and password validation logic in LoginForm widget

Update email and password validation logic in the LoginForm widget to only
perform validation when the state is not AuthTokenError. This ensures that
validation is skipped when there is an authentication token error.
This commit is contained in:
Mohammad Salameh
2024-04-02 18:09:23 +03:00
parent ef41940333
commit 9cc479ba17
13 changed files with 57 additions and 60 deletions

View File

@ -18,17 +18,18 @@ part 'home_state.dart';
class HomeCubit extends Cubit<HomeState> {
// Create a private static instance variable
static HomeCubit? _instance;
HomeCubit._() : super(HomeInitial()) {
if (selectedSpace == null) {
fetchSpaces().then((value) {
if (selectedSpace != null) {
print('selectedSpace: ${selectedSpace!.name}');
fetchRooms(selectedSpace!);
}
});
}
}
static HomeCubit? _instance;
static HomeCubit getInstance() {
// If an instance already exists, return it
_instance ??= HomeCubit._();