diff --git a/angel_serialize_generator/lib/serialize.dart b/angel_serialize_generator/lib/serialize.dart index 35c6632c..e9a506c6 100644 --- a/angel_serialize_generator/lib/serialize.dart +++ b/angel_serialize_generator/lib/serialize.dart @@ -64,7 +64,7 @@ class SerializerGenerator extends GeneratorForAnnotation { // Add named parameters for (var field in ctx.fields) { // Skip excluded fields - if (ctx.excluded.containsKey(field.name)) continue; + if (ctx.excluded[field.name] == true) continue; var alias = ctx.resolveFieldName(field.name); diff --git a/angel_serialize_generator/test/models/author.serializer.g.dart b/angel_serialize_generator/test/models/author.serializer.g.dart index 8f0d0015..7a4945ae 100644 --- a/angel_serialize_generator/test/models/author.serializer.g.dart +++ b/angel_serialize_generator/test/models/author.serializer.g.dart @@ -10,6 +10,10 @@ abstract class AuthorSerializer { Map toMap() { return { 'id': id, + 'name': name, + 'age': age, + 'books': books, + 'newest_book': newestBook, 'created_at': createdAt.toIso8601String(), 'updated_at': updatedAt.toIso8601String() }; @@ -20,6 +24,7 @@ abstract class LibrarySerializer { Map toMap() { return { 'id': id, + 'collection': collection, 'created_at': createdAt.toIso8601String(), 'updated_at': updatedAt.toIso8601String() }; diff --git a/angel_serialize_generator/test/models/book.serializer.g.dart b/angel_serialize_generator/test/models/book.serializer.g.dart index 1e069c7e..d6e83f55 100644 --- a/angel_serialize_generator/test/models/book.serializer.g.dart +++ b/angel_serialize_generator/test/models/book.serializer.g.dart @@ -10,6 +10,10 @@ abstract class BookSerializer { Map toMap() { return { 'id': id, + 'author': author, + 'title': title, + 'description': description, + 'page_count': pageCount, 'created_at': createdAt.toIso8601String(), 'updated_at': updatedAt.toIso8601String() };