Change as Iterable<Map> to .cast<Map>.

This commit is contained in:
Tobe O 2019-01-27 15:04:51 -05:00
parent b4e357efe3
commit 2f15f513a1
3 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,6 @@
# 2.4.1+1
* Change `as Iterable<Map>` to `.cast<Map>`.
# 2.4.1
* Support `serializesTo`.
* Don't emit `@required` if there is a default value.

View file

@ -239,7 +239,8 @@ class SerializerGenerator extends GeneratorForAnnotation<Serializable> {
var rc = new ReCase(type.typeArguments[0].name);
deserializedRepresentation = "map['$alias'] is Iterable"
" ? new List.unmodifiable(((map['$alias'] as Iterable)"
".where((x) => x is Map) as Iterable<Map>)"
".where((x) => x is Map))"
".cast<Map>()"
".map(${rc.pascalCase}Serializer.fromMap))"
" : $defaultValue";
} else if (isMapToModelType(type)) {

View file

@ -1,5 +1,5 @@
name: angel_serialize_generator
version: 2.4.1
version: 2.4.1+1
description: Model serialization generators, designed for use with Angel. Combine with angel_serialize for flexible modeling.
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/serialize