bolter 1.1.0
bolter: ^1.1.0 copied to clipboard

Dart native js
Flutter Android iOS web

Simplest mutable state manager powered by dart streams and it's extensions

Simplest mutable state manager.

GitHub Logo

Usage #

A simple usage example:

import 'package:bolter/bolter.dart';

abstract class IState {
  IUser get user;
}

class State implements IState {
  @override
  final User user;

  State(this.user);
}

abstract class IUser {
  int get id;
}

class User with EquatableMixin implements IUser {
  @override
  int id;

  User(this.id);

  @override
  List<Object> get props => [id];
}

void main() {
  // domain layer:
  final b = Bolter(State(User(1)));
  b.state.user.id = 2;
  // presentation
  final presenter = Presenter(b);
  presenter.bolter.stream((state) {
    return state.user.id;
  }).listen((event) {
    print('new id is: $event');
  });
  b.shake();
}

class Presenter {
  final Bolter<IState> bolter;
  Presenter(this.bolter);
}
3
likes
110
pub points
47%
popularity

Publisher

renesanse.net

Simplest mutable state manager powered by dart streams and it's extensions

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

equatable, stream_transform

More

Packages that depend on bolter