RxReducer class abstract

The layer responsible for making business decisions to perform actions and modify RxNotifiers;


final counterState = RxNotifier<int>(0);
final incrementState = RxAction();

class CounterReducer extends RxReducer {
  final HomeState state;

  CounterReducer(this.state) {
    on(() => [counterState], _increment);
  }

  void _increment() {
    counterState.value++;
  }
}

// in widget:

Text('$counter.value'),
...
onPressed: () => increment();

Constructors

RxReducer()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
dispose all registers
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on(List<Object?> rxValues(), void reducer(), {bool filter()?}) → void
reducer register:
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited