# cubit 0.0.13

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.




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'cubit:0.0.13'
```
Published: 2020-06-23T22:43:29.163348Z
Expected archive SHA-256: 60cce409da6a660befd333f582d26957a022df39e5401419ce9ce07139c6c812
Discontinued upstream.
Available in cache; verification: upstream_checksum
## Direct dependencies
- meta: ^1.1.8

## Package README (untrusted upstream documentation)
<p align="center"><img src="https://raw.githubusercontent.com/felangel/cubit/master/assets/cubit_full.png" height="100" alt="Cubit"></p>

<p align="center">
<a href="https://pub.dev/packages/cubit"><img src="https://img.shields.io/pub/v/cubit.svg" alt="Pub"></a>
<a href="https://github.com/felangel/cubit/actions"><img src="https://github.com/felangel/cubit/workflows/build/badge.svg" alt="build"></a>
<a href="https://github.com/felangel/cubit/actions"><img src="https://raw.githubusercontent.com/felangel/cubit/master/packages/cubit/coverage_badge.svg" alt="coverage"></a>
<a href="https://github.com/felangel/cubit"><img src="https://img.shields.io/github/stars/felangel/cubit.svg?style=flat&logo=github&colorB=deeppink&label=stars" alt="Star on GitHub"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-purple.svg" alt="License: MIT"></a>
<a href="https://github.com/zepfietje/starware"><img src="https://img.shields.io/badge/Starware-%E2%AD%90-black?labelColor=%23f9b00d" alt="Starware"></a>
</p>

Cubit is a lightweight state management solution. It is a subset of the [bloc package](https://pub.dev/packages/bloc) 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

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

  void increment() => emit(state + 1);
}
```

## Consuming a Cubit

```dart
void main() async {
  final cubit = CounterCubit()..increment();
  await cubit.close();
}
```

## Dart Versions

- Dart 2: >= 2.7.0

## Maintainers

- [Felix Angelov](https://github.com/felangel)

## 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.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 `initialState` parameter ([related issue](https://github.com/dart-lang/sdk/issues/42438))
- docs: minor logo updates

# 0.0.7

- feat: add `onTransition` to `cubit`
- feat: `Cubit` extends `CubitStream`

# 0.0.6

- **BREAKING**: ignore duplicate states

# 0.0.5

- feat: allow `initialState` to be `null`

# 0.0.4

- **BREAKING**: use named parameter for `initialState`

# 0.0.3

- **BREAKING**: remove `initialState` getter and instead require initial state via constructor

# 0.0.2

- **BREAKING**: update `emit` to be a `void` function
- **BREAKING**: remove artifical wait to guarantee `initialState` is emitted
- **BREAKING**: `close` drains the internal `Stream`
- tests: 100% test coverage

# 0.0.1

- feat: initial release







 
