bloc architecture flutter code example
Example 1: bloc flutter
dependencies:
flutter_bloc: ^4.0.1
Example 2: bloc lib flutter
class CounterCubit extends Cubit<int> {
CounterCubit() : super(0);
void increment() => emit(state + 1);
void decrement() => emit(state - 1);
}