storey 0.2.2

  • Installing
  • Versions
  • 45


Pub Travis CI CircleCI codecov

Redux like store but hierarchical.


A simple usage example:

import 'dart:async';

import 'package:storey/storey.dart';

class StringState {
  String str;

class OverwriteAction extends Action {
  const OverwriteAction(this.str);

  final String str;

StringState _handleOverwriteAction(StringState state, OverwriteAction action) {
  return state..str = action.str;

class ExchangeAction extends RequestAction<String> {
  final String str;

StringState _handleExchangeAction(StringState state, ExchangeAction action) {
  action.result = state.str;
  return state..str = action.str;

Reducer<StringState> _reducer = new MergedTypedReducer<StringState>(
      new ProxyTypedReducer<StringState, OverwriteAction>(_handleOverwriteAction),
      new ProxyTypedReducer<StringState, ExchangeAction>(_handleExchangeAction),

Store<StringState> createStore(String initialStr) {
  return new Store<StringState>(
    name: 'app',
    initialState: new StringState(initialStr),
    reducer: _reducer,
    middlewares: <Middleware>[thunkMiddleware],

Future<Null> main() async {
  Store<StringState> store = createStore('foo');
  assert(store.state.str == 'foo');

  store.dispatch(const OverwriteAction('bar'));
  assert(store.state.str == 'bar');

  ExchangeAction request = new ExchangeAction('foobar');
  assert(store.state.str == 'foobar');
  assert(request.result == 'bar');


Released under The MIT License (MIT). See LICENSE for the full license text.

View Bindings





  • Fix test coverage


  • Add factory constructor Action.empty() to construct empty action
  • Throw StateError if multiple reducers accept the dispatching action


  • Refactor thunk as a function that accepts a store and returns a value


  • Align store a name
  • Rename TypedMiddlewareBinding to ProxyTypedMiddleware
  • Fix skipped typed middleware due to null state
  • Add tests and CI support


  • Initial version

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  storey: "^0.2.2"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:storey/storey.dart';
Version Uploaded Documentation Archive
0.2.2 Dec 10, 2017 Go to the documentation of storey 0.2.2 Download storey 0.2.2 archive
0.2.1 Dec 10, 2017 Go to the documentation of storey 0.2.1 Download storey 0.2.1 archive
0.2.0 Dec 10, 2017 Go to the documentation of storey 0.2.0 Download storey 0.2.0 archive
0.1.0 Dec 9, 2017 Go to the documentation of storey 0.1.0 Download storey 0.1.0 archive
0.0.1 Dec 7, 2017 Go to the documentation of storey 0.0.1 Download storey 0.0.1 archive


We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
0 / 100
Code health derived from static analysis. [more]
82 / 100
Reflects how tidy and up-to-date the package is. [more]
99 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:storey/storey.dart.


  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 error 3 hints.

    Strong-mode analysis of lib/src/store.dart failed with the following error:

    line: 234 col: 52
    The argument type '(Store<dynamic>) → String' can't be assigned to the parameter type '(dynamic) → dynamic'.

    Run dartfmt to format lib/src/thunk.dart.

    Similar analysis of the following files failed:

    • lib/storey.dart (hint)
  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use storey.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
meta ^1.1.1 1.1.5
Dev dependencies
coverage ^0.9.3
test ^0.12.0