Viewing version 0.0.1. Open the latest package page.
cubit
0.0.1An 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.
This package is discontinued upstream.
Readme
WARNING: This is highly experimental
An experimental Dart library which exposes a cubit. A cubit is a reimagined bloc (from package:bloc) which removes events and relies on methods to emit new states instead.
Creating a Cubit
class CounterCubit extends Cubit<int> {
@override
int get initialState => 0;
Future<void> increment() => emit(state + 1);
Future<void> decrement() => emit(state - 1);
}
Consuming a Cubit
void main() async {
final counterCubit = CounterCubit()..listen(print);
await counterCubit.increment();
await counterCubit.decrement();
}
The above code outputs:
0
1
0
Changelog
0.0.1
Initial Release
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'cubit:0.0.1'pubspec.yaml
name: cubit
description: 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.
repository: https://github.com/felangel/cubit
issue_tracker: https://github.com/felangel/cubit/issues
homepage: https://github.com/felangel/cubit
version: 0.0.1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
meta: ^1.1.8
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.0.1 | Cached · Upstream SHA-256 matched | Download | 079f57b1…226f99 |
| 0.0.2 | Cached · Upstream SHA-256 matched | Download | 550fea81…7922f4 |
| 0.0.3 | Cached · Upstream SHA-256 matched | Download | ab88c201…6c8041 |
| 0.0.4 | Cached · Upstream SHA-256 matched | Download | f4a67d94…bd5876 |
| 0.0.5 | Cached · Upstream SHA-256 matched | Download | d5696901…51d93a |
| 0.0.6 | Cached · Upstream SHA-256 matched | Download | 73d84229…2abfc8 |
| 0.0.7 | Cached · Upstream SHA-256 matched | Download | bc21713e…f5615e |
| 0.0.8 | Cached · Upstream SHA-256 matched | Download | 9f5416e3…c307aa |
| 0.0.9 | Cached · Upstream SHA-256 matched | Download | 97d453a5…16439e |
| 0.0.10 | Cached · Upstream SHA-256 matched | Download | bc824229…91c69f |
| 0.0.11 | Cached · Upstream SHA-256 matched | Download | dad61f71…848bc4 |
| 0.0.12 | Cached · Upstream SHA-256 matched | Download | 272e2aaf…c96e94 |
| 0.0.13 | Cached · Upstream SHA-256 matched | Download | 60cce409…c6c812 |
| 0.0.14 | Cached · Upstream SHA-256 matched | Download | 57389080…ae54d4 |
| 0.1.0 | Cached · Upstream SHA-256 matched | Download | 358b6931…b93b64 |
| 0.1.1 | Cached · Upstream SHA-256 matched | Download | dbc518db…3ccec2 |
| 0.1.2 | Cached · Upstream SHA-256 matched | Download | 87a0e33d…bd48b2 |
| 0.2.0-dev.1 | Cached · Upstream SHA-256 matched | Download | 3dce5882…766789 |
Dependencies
meta "^1.1.8"