no_bloc 0.1.0 no_bloc: ^0.1.0 copied to clipboard
Making blocs easy again. A simplified library for the original bloc approach.
import 'package:no_bloc/no_bloc.dart';
class CounterBloc extends Bloc<CounterBloc, int> {
CounterBloc() : super(initialState: 0);
void increment() => setState(value + 1);
void decrement() => setState(value - 1);
}
void main() {
final bloc = CounterBloc();
bloc.state.listen((s) => print(s));
bloc.increment();
bloc.decrement();
}