cubit 0.0.5 cubit: ^0.0.5 copied to clipboard
An experimental Dart library which expose a cubit. A cubit is a reimagined bloc (from package:bloc) which removes events and relies on methods to emit new states instead.
import 'package:cubit/cubit.dart';
void main() async {
final cubit = CounterCubit()
..listen(print)
..increment();
await cubit.close();
}
class CounterCubit extends Cubit<int> {
CounterCubit() : super(initialState: 0);
void increment() => emit(state + 1);
}