Viewing version 0.0.7. Open the latest package page.
cubit
0.0.7A cubit is a subset of package:bloc which has no notion of events and relies on methods to emit new states.
This package is discontinued upstream.
Readme
WARNING: This is highly experimental
A cubit is a subset of bloc which has no notion of events and relies on methods to emit new states.
Every cubit requires an initialState which will be the state of the cubit before emit has been called.
The current state of a cubit can be accessed via the state getter.
Creating a Cubit
class CounterCubit extends Cubit<int> {
CounterCubit() : super(initialState: 0);
void increment() => emit(state + 1);
}
Consuming a Cubit
void main() async {
final cubit = CounterCubit()..increment();
await cubit.close();
}
Dart Versions
- Dart 2: >= 2.7.0
Maintainers
Changelog
0.0.7
- feat: add
onTransitiontocubit - feat:
CubitextendsCubitStream
0.0.6
- BREAKING: ignore duplicate states
0.0.5
- feat: allow
initialStateto benull
0.0.4
- BREAKING: use named parameter for
initialState
0.0.3
- BREAKING: remove
initialStategetter and instead require initial state via constructor
0.0.2
- BREAKING: update
emitto be avoidfunction - BREAKING: remove artifical wait to guarantee
initialStateis emitted - BREAKING:
closedrains the internalStream - tests: 100% test coverage
0.0.1
- feat: initial release
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'cubit:0.0.7'pubspec.yaml
name: cubit
description: A cubit is a subset of package:bloc which has no notion of events and relies on methods to emit new states.
repository: https://github.com/felangel/cubit
issue_tracker: https://github.com/felangel/cubit/issues
homepage: https://github.com/felangel/cubit
version: 0.0.7
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
meta: ^1.1.8
dev_dependencies:
test: ^1.14.6
test_coverage: ^0.4.1
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"