pub repository
mirror.p-hatan.comcubit
0.0.14Cubit 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.
This package is discontinued upstream.
Readme
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.
Every cubit requires an initial state 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(0);
void increment() => emit(state + 1);
}
Using a Cubit
void main() async {
final cubit = CounterCubit()..increment();
await cubit.close();
}
Dart Versions
- Dart 2: >= 2.7.0
Maintainers
Starware
Cubit is Starware.
This means you're free to use the project, as long as you star its GitHub repository.
Your appreciation makes us grow and glow up. ⭐
Changelog
0.0.14
- feat: add
CubitObserversupport - docs: minor documentation improvements
0.0.13
- docs: various documentation updates
0.0.12
- docs: fix coverage badge
0.0.11
- docs: various documentation updates
0.0.10
- docs: various documentation updates
0.0.9
- docs: documentation and logo updates
0.0.8
- BREAKING: revert named
initialStateparameter (related issue) - docs: minor logo updates
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.com
flutter pub add cubitpubspec.yaml
name: cubit
description: 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: https://github.com/felangel/cubit
issue_tracker: https://github.com/felangel/cubit/issues
homepage: https://github.com/felangel/cubit
version: 0.0.14
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
meta: ^1.1.8
dev_dependencies:
mockito: ^4.1.1
test: ^1.14.6
test_coverage: ^0.4.1
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.0.1 | 2020-06-04T05:55:57.727961Z | Download | 079f57b12178d6f095abc9c95630394748d65da39be0f9cda37f0a64a1226f99 |
| 0.0.2 | 2020-06-06T04:32:19.230635Z | Download | 550fea81678f0ef851609af4cb392dd6d8ba536a68af425ab4ffa7c3df7922f4 |
| 0.0.3 | 2020-06-07T06:17:57.682631Z | Download | ab88c201363a68f338b53d59f176103ce0f985ab4a3483a29d568e3dcb6c8041 |
| 0.0.4 | 2020-06-15T21:48:55.168879Z | Download | f4a67d94ffe75538424b95de122e853e23da053d5ca409bf031d08e73fbd5876 |
| 0.0.5 | 2020-06-16T05:21:19.350436Z | Download | d56969016343cbdab0379768a98f65559ba6c67c9441c1f931ad6cf7e451d93a |
| 0.0.6 | 2020-06-16T19:52:12.134212Z | Download | 73d842299307a6c6787328387bcbff5a8e36a2c5ca66a6402fcb0750e62abfc8 |
| 0.0.7 | 2020-06-19T19:24:45.452869Z | Download | bc21713e8d86bb85e44108e3a0a589d1da32033d8c750ba3bbf049c8a2f5615e |
| 0.0.8 | 2020-06-22T17:43:32.729350Z | Download | 9f5416e34fafce735563d43ce099c50f26bec23ca9b3b12942f0fe861ac307aa |
| 0.0.9 | 2020-06-23T16:55:21.670738Z | Download | 97d453a53f6a956ded105adb7b3f21256715cb5c6c5f3273c3cf6e61f816439e |
| 0.0.10 | 2020-06-23T19:01:56.870357Z | Download | bc8242294ac4df6262e17910d2543ab7d3f05beff848c0505212c496a791c69f |
| 0.0.11 | 2020-06-23T22:34:30.083919Z | Download | dad61f7109f1408f74193149bd6ab67b2761ba7b43892a08fbba8b4e2f848bc4 |
| 0.0.12 | 2020-06-23T22:41:43.875858Z | Download | 272e2aaf634f651d50d94ba28a3968d811d79346e4bfed810e24a84973c96e94 |
| 0.0.13 | 2020-06-23T22:43:29.163348Z | Download | 60cce409da6a660befd333f582d26957a022df39e5401419ce9ce07139c6c812 |
| 0.0.14 | 2020-06-27T01:48:04.045972Z | Download | 573890801c38ca57530032f464ad8d5a63fe6a75d48854911f1e6572d1ae54d4 |
| 0.1.0 | 2020-07-01T15:26:05.706024Z | Download | 358b693136e3280e0d8b2ac62fb9c150b590b9b2664d706c37a682ce42b93b64 |
| 0.1.1 | 2020-07-05T22:27:23.071429Z | Download | dbc518db887ad8c2bca8ccf1026580f1545424930df8d698016a2497b53ccec2 |
| 0.1.2 | 2020-07-06T00:10:54.737736Z | Download | 87a0e33da05fbfcdd43aedb9f3156f04523f0624ab3a3bd06e8b9b67fdbd48b2 |
| 0.2.0-dev.1 | 2020-07-06T04:31:26.968656Z | Download | 3dce5882a2f83f93ec7ef95465046d295dd4d2e775460f4e158d5f9f50766789 |
Dependencies
meta "^1.1.8"