kisrs 2.1.0

  • Readme
  • Changelog
  • Installing
  • 42

kisrs - Keep It Simple, Reactive State #

First, make a class for your state. If your class has a dispose() Function, it will be called on disposal.

class MyStore implements StoreData {

    final _x = DataPoint<int>(initial: 0);
    PublicDataPoint get x => _x.public;
    void increment(){
        _x.value = _x.value + 1;

    void dispose(){

You can then attach an object of your class to a Store or StoreManager.

  • Store<T> just passes your data down the Widget tree
  • StoreManager<T> contains a Store and automatically calls the dispose() function when the Store is being disposed. Use this for cleanup.

You can access your Store with Store.of<T>(context).

DataPoints are how your store data in your state.

  • DataPoint<T>() creates a new DataPoint of a given Type that will be null initially.
  • DataPoint<T>(initial: x) creates a new DataPoint of a given Type that contains initial data.

datapoint.value = 'Hello' sets the value of datapoint to 'Hello' and sends the new value to the stream.

datapoint.value is the current value. is is a stream of value changes. When you listen to it, it immediately sends the value.

datapoint.dispose() releases the memory used for the DataPoint. You must do this in order to prevent memory leaks!

[2.1.0] - Sat Apr 20 2019

  • Add ReactiveTextField

[2.0.1] - Sat Mar 16 2019

  • Fix null check of StoreManager disposer

[2.0.0] - Sat Mar 16 2019

  • Fix several conceptual flaws of older versions.

[1.0.5] - Sat Mar 16 2019

  • If DataPoint.value == null, allow any mutation

[1.0.4] - Mon Mar 12 2019

  • Make DataPoint.onChange async

[1.0.3] - Mon Mar 12 2019

  • DataPoint.onChange now gets executed before the data is being added to the sink. You can modify the data. If you want to refuse a change, return null.

[1.0.2] - Mon Mar 12 2019

  • Define DataPoint.onChange return type.

[1.0.1] - Mon Mar 11 2019

  • Added DataPoint onChange

[1.0.0] - Mon Mar 11 2019

  • Initial Release

Use this package as a library

1. Depend on it

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

  kisrs: ^2.1.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:kisrs/kisrs.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 25, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Fix lib/kisrs.dart. (-0.50 points)

Analysis of lib/kisrs.dart reported 1 hint:

line 69 col 16: 'inheritFromWidgetOfExactType' is deprecated and shouldn't be used. Use dependOnInheritedWidgetOfExactType instead. This feature was deprecated after v1.12.1..

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field was unreachable.

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (rxdart).

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and kisrs.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
rxdart ^0.21.0 0.21.0 0.23.1
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies