fixed block flow

This commit is contained in:
hannathkadher
2025-01-02 17:55:04 +04:00
parent 65ad9c5edf
commit 80dea5c12d

View File

@ -239,11 +239,15 @@ class SpaceManagementBloc
SelectCommunityEvent event, SelectCommunityEvent event,
Emitter<SpaceManagementState> emit, Emitter<SpaceManagementState> emit,
) async { ) async {
_handleCommunitySpaceStateUpdate( try {
emit: emit, _handleCommunitySpaceStateUpdate(
selectedCommunity: event.selectedCommunity, emit: emit,
selectedSpace: null, selectedCommunity: event.selectedCommunity,
); selectedSpace: null,
);
} catch (e) {
emit(SpaceManagementError('Error updating state: $e'));
}
} }
void _onSelectSpace( void _onSelectSpace(
@ -267,7 +271,8 @@ class SpaceManagementBloc
try { try {
if (previousState is SpaceManagementLoaded || if (previousState is SpaceManagementLoaded ||
previousState is BlankState) { previousState is BlankState ||
previousState is SpaceModelLoaded) {
final communities = List<CommunityModel>.from( final communities = List<CommunityModel>.from(
(previousState as dynamic).communities, (previousState as dynamic).communities,
); );