Can't add same event.. only one time.. and same previous state persists
hey all, I'm having a little problem with dealing with bloc
so I have to blocs [appBloc, FirebaseBloc] and in the [appBloc] when I add an event after absolutely get the initial state.. I get result, but when I add the same event with different data..can't get anything it's like [adding once event only]
Here is the events file

Here is the states file

Here is the bloc file

NOTE: I'm using the bloc extension in VSCode and it generates these files by default except the ChangeAppTheme class and other methods
any solutions??
Hi @abdulmuaz97 馃憢
Thanks for opening an issue!
When you extend Equatable you need to provide all properties which you want to be considered when doing the equality comparison to the props override otherwise different instances of those classes will be considered equal and the bloc will ignore the transitions.
class AppStatus extends AppState {
final String status;
const AppStatus(this.status);
@override
List<Object> get props => [status];
}
class ChangeAppTheme extends AppEvent {
final ThemeData themeData;
const ChangeAppTheme(this.themeData);
@override
List<Object> get props => [themeData];
}
@felangel ok thank you so much for replying to me.. I'll see it right now 鉂わ笍
@felangel it worked just fine.. THANK YOU
@felangel How to deal with none property event, like:
abstract class AppEvent extends Equatable {
const AppEvent();
}
class AppLoadEvent extends AppEvent {
const AppLoadEvent();
@override
List<Object> get props => [];
}
@DDDrop if you have no properties on any of your subclasses you can do
abstract class AppEvent extends Equatable {
@override
List<Object> get props => [];
}
class AppLoadEvent extends AppEvent {}