class CounterBloc extends Bloc<CounterEvent, CounterState> {
CounterBloc() : super(CounterState()) {
on<CounterIncrementEvent>((event, emit) {
emit(state.copyWith(count: state.count++));
// if i use state.count+1 its working.
});
on<CounterDecrementEvent>((event, emit) {
emit(state.copyWith(count: state.count--));
// if i use state.count-1 its working.
});
}
}
ao usar __ ou ++ não funciona e quando altero state.count+1 ou state.count-1 funciona... então qual é o problema?