Hi I have a BehaviorSubject with a simple type int, I add the value 5 to it and then add another value 5. The stream listener sent me two events. How to force check the values and not send an event if the value is equal to the last value. Sample code:
class TestBloc {
TestBloc(){
testBehavior.stream.listen((event) {
print('Event value = $event');
});
addValueToStream();
addValueToStream();
}
final testBehavior = BehaviorSubject<int>();
void addValueToStream() {
testBehavior.add(5);
}
}