Viewing version 0.0.1. Open the latest package page.

cubit

0.0.1

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.

This package is discontinued upstream.

Download archive

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

VersionPublishedArchiveSHA-256
0.0.1Cached · Upstream SHA-256 matchedDownload079f57b1…226f99
0.0.2Cached · Upstream SHA-256 matchedDownload550fea81…7922f4
0.0.3Cached · Upstream SHA-256 matchedDownloadab88c201…6c8041
0.0.4Cached · Upstream SHA-256 matchedDownloadf4a67d94…bd5876
0.0.5Cached · Upstream SHA-256 matchedDownloadd5696901…51d93a
0.0.6Cached · Upstream SHA-256 matchedDownload73d84229…2abfc8
0.0.7Cached · Upstream SHA-256 matchedDownloadbc21713e…f5615e
0.0.8Cached · Upstream SHA-256 matchedDownload9f5416e3…c307aa
0.0.9Cached · Upstream SHA-256 matchedDownload97d453a5…16439e
0.0.10Cached · Upstream SHA-256 matchedDownloadbc824229…91c69f
0.0.11Cached · Upstream SHA-256 matchedDownloaddad61f71…848bc4
0.0.12Cached · Upstream SHA-256 matchedDownload272e2aaf…c96e94
0.0.13Cached · Upstream SHA-256 matchedDownload60cce409…c6c812
0.0.14Cached · Upstream SHA-256 matchedDownload57389080…ae54d4
0.1.0Cached · Upstream SHA-256 matchedDownload358b6931…b93b64
0.1.1Cached · Upstream SHA-256 matchedDownloaddbc518db…3ccec2
0.1.2Cached · Upstream SHA-256 matchedDownload87a0e33d…bd48b2
0.2.0-dev.1Cached · Upstream SHA-256 matchedDownload3dce5882…766789

Dependencies

meta "^1.1.8"