MapProjection class

A generic map-based projection that applies handler functions.

Each event type maps to a handler that transforms the state.

Inheritance

Constructors

MapProjection(Map<String, Map<String, dynamic> Function(Map<String, dynamic> state, Event event)> handlers)
Creates a MapProjection.

Properties

handlers Map<String, Map<String, dynamic> Function(Map<String, dynamic> state, Event event)>
Handler functions per event type.
final
hashCode int
The hash code for this object.
no setterinherited
initialState Map<String, dynamic>
The initial state before any events are applied.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

apply(Map<String, dynamic> state, Event event) Map<String, dynamic>
Applies an event to the current state and returns the new state.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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