# cubit 0.0.9

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.9'
```
Published: 2020-06-23T16:55:21.670738Z
Expected archive SHA-256: 97d453a53f6a956ded105adb7b3f21256715cb5c6c5f3273c3cf6e61f816439e
Discontinued upstream.
Available in cache; verification: upstream_checksum
## Direct dependencies
- meta: ^1.1.8

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

[![Pub](https://img.shields.io/pub/v/cubit.svg)](https://pub.dev/packages/cubit)
[![build](https://github.com/felangel/cubit/workflows/build/badge.svg)](https://github.com/felangel/cubit/actions)
[![coverage](https://github.com/felangel/cubit/blob/master/packages/cubit/coverage_badge.svg)](https://github.com/felangel/cubit/actions)

**WARNING: This is highly experimental**

`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)

## Changelog
# 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







 
