felangel / bloc

A predictable state management library that helps implement the BLoC design pattern
https://bloclibrary.dev
MIT License
11.53k stars 3.37k forks source link

ignore emit in closed cubit #4187

Closed ra48ad closed 3 weeks ago

ra48ad commented 3 weeks ago

Status

IN DEVELOPMENT

Breaking Changes

YES

Description

This change will solve the inconsistency between Bloc and Cubit if emit is used after the Bloc/Cubit is closed. (Issue #4165) The added emit override makes sure no error is thrown if emit is called and the cubit is already closed. Instead, the emit will be simply ignored just like a Bloc.

Type of Change