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

discontinuedreplaced by: bloc
outdated

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.

example/main.dart

import 'package:cubit/cubit.dart';

class MyCubitObserver extends CubitObserver {
  @override
  void onTransition(Cubit cubit, Transition transition) {
    print(transition);
    super.onTransition(cubit, transition);
  }
}

void main() async {
  Cubit.observer = MyCubitObserver();
  final cubit = CounterCubit()..increment();
  await cubit.close();
}

class CounterCubit extends Cubit<int> {
  CounterCubit() : super(0);

  void increment() => emit(state + 1);
}
118
likes
0
pub points
66%
popularity

Publisher

verified publisherbloc-dev.com

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.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta

More

Packages that depend on cubit