StateImporter typedef
Function signature for importing application state from a JSON-serializable map.
The importer function restores the state of a state contributor from a previously exported map.
Idempotency Requirement: The importer function must be idempotent - calling it multiple times with the same data should produce the same result. This ensures that restore operations are safe to retry and that the restore process is deterministic.
Example:
StateImporter importer = (Map<String, dynamic> json) {
userState.name = json['name'] as String;
userState.age = json['age'] as int;
userState.email = json['email'] as String;
};
Implementation
typedef StateImporter = void Function(Map<String, dynamic>);