diff --git a/example/bin/main_json_serializable.dart b/example/bin/main_json_serializable.dart index eb7fccfc..0d09e8f8 100644 --- a/example/bin/main_json_serializable.dart +++ b/example/bin/main_json_serializable.dart @@ -60,12 +60,12 @@ Future authHeader(Request request) async => applyHeader( "42", ); -typedef T JsonFactory(Map json); +typedef JsonFactory = T Function(Map json); class JsonSerializableConverter extends JsonConverter { final Map factories; - JsonSerializableConverter(this.factories); + const JsonSerializableConverter(this.factories); T? _decodeMap(Map values) { /// Get jsonFactory using Type parameters @@ -82,10 +82,10 @@ class JsonSerializableConverter extends JsonConverter { List _decodeList(Iterable values) => values.where((v) => v != null).map((v) => _decode(v)).toList(); - dynamic _decode(dynamic entity) { - if (entity is Iterable) return _decodeList(entity); + dynamic _decode(entity) { + if (entity is Iterable) return _decodeList(entity as List); - if (entity is Map) return _decodeMap(entity); + if (entity is Map) return _decodeMap(entity as Map); return entity; }