toMap method
Convert state to a map for serialization.
Override in subclasses to include state-specific data. This is called by the snapshot serializer, so it is part of the public surface.
Implementation
Map<String, dynamic> toMap() {
return {
'version': _version,
'lastModified': _lastModified.toIso8601String(),
'type': typeName,
};
}