Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/src/impl/type_registry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class _TypeRegistry {
'Type is not registered. Did you forget to register it?',
);
}
if (json is Map<String, dynamic>) {
if (json is Map<String, dynamic> || json is List) {
value = handler.fromJson(json);
} else {
throw ArgumentError('Type mismatch. Expected Map<String,dynamic> '
Expand Down Expand Up @@ -72,7 +72,7 @@ class _TypeRegistry {
}
}

T? _noop<T>(Map<String, dynamic> json) {
T? _noop<T>(dynamic json) {
throw UnimplementedError();
}

Expand All @@ -85,7 +85,7 @@ class _TypeHandler<T> {

final int? typeId;

final T? Function(Map<String, dynamic> json) fromJson;
final T? Function(dynamic json) fromJson;

bool handlesValue(dynamic value) {
return value is T;
Expand Down