StateExporter typedef

StateExporter = Map<String, dynamic> Function()

Function signature for exporting application state to a JSON-serializable map.

The exporter function captures the current state of a state contributor and returns it as a map that can be serialized to JSON.

Purity Requirement: The exporter function must be pure - it should not have side effects and should return the same result when called multiple times with the same application state. The function should only read state, not modify it.

Example:

StateExporter exporter = () => {
  return {
    'name': userState.name,
    'age': userState.age,
    'email': userState.email,
  };
};

Implementation

typedef StateExporter = Map<String, dynamic> Function();