SpeedEx class

A lightweight and simple state management solution for Flutter.

SpeedEx offers global state handling with minimal boilerplate, allowing for easy state manipulation, computed values, middleware, and more.

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

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

Static Methods

addListener(String key, VoidCallback listener) → void
Adds a listener for a specific state key.
addMiddleware(SpeedExMiddleware middleware) → void
Adds a middleware function to be run before state changes.
clearAll() → void
Clears all state, listeners, history, and persistent storage.
containsKey(String key) bool
Checks if a key exists in the global state.
deserialize(String data) Future<void>
Deserializes a JSON string and updates the state.
getHistory() List<Map<String, dynamic>>
Retrieves the state change history.
getValue<T>(String key) → T?
Retrieves a value from the global state.
initialize() Future<void>
Initializes the SpeedEx state management system.
removeListener(String key, VoidCallback listener) → void
Removes a listener for a specific state key.
removeState(String key) Future<void>
Removes a state from the global state and persistent storage.
serialize() String
Serializes the current state to a JSON string.
setComputedValue<T>(String key, T compute()) → void
Sets a computed value in the global state.
setValue<T>(String key, T value, {bool persist = false}) Future<void>
Sets a value in the global state.
undo() Future<bool>
Undoes the last state change.