cubit 0.0.11 cubit: ^0.0.11 copied to clipboard
Cubit is a lightweight state management solution. It is a subset of the bloc package that does not rely on events and instead uses methods to emit new states.
import 'package:cubit/cubit.dart';
void main() async {
final cubit = CounterCubit()..increment();
await cubit.close();
}
class CounterCubit extends Cubit<int> {
CounterCubit() : super(0);
void increment() => emit(state + 1);
@override
void onTransition(Transition<int> transition) {
print(transition);
super.onTransition(transition);
}
}