deserializeEntityComponents method
Implementation
@override
Iterable<ComponentRepresentation> deserializeEntityComponents(
EntityRepresentation data,
) {
if (data is Map<String, dynamic>) {
final components = data[componentsField];
if (components is Map<String, dynamic>) {
return components.values.map((e) => e as ComponentRepresentation);
} else {
throw ArgumentError(
'Invalid entity representation: expected Map<String, Map<String, dynamic>> got ${components.runtimeType}');
}
} else {
throw ArgumentError(
'Invalid entity representation: expected Map<String, dynamic>');
}
}