cubit 0.0.8 copy "cubit: ^0.0.8" to clipboard
cubit: ^0.0.8 copied to clipboard

discontinuedreplaced by: bloc
outdated

A cubit is a subset of package:bloc which has no notion of events and relies on methods to emit new states.

example/main.dart

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);
  }
}
118
likes
0
pub points
66%
popularity

Publisher

verified publisherbloc-dev.com

A cubit is a subset of package:bloc which has no notion of events and relies on methods to emit new states.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta

More

Packages that depend on cubit