diff --git a/.gitignore b/.gitignore
index 07086897..009a14b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -74,4 +74,5 @@ logs/
*.pem
.DS_Store
server_log.txt
-ormapp/
\ No newline at end of file
+ormapp/
+backup/
\ No newline at end of file
diff --git a/packages/serialize/.idea/modules.xml b/packages/serialize/.idea/modules.xml
deleted file mode 100644
index 08fe6948..00000000
--- a/packages/serialize/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/serialize/.idea/runConfigurations/tests_in_angel_serialize_generator.xml b/packages/serialize/.idea/runConfigurations/tests_in_angel_serialize_generator.xml
deleted file mode 100644
index e61b9017..00000000
--- a/packages/serialize/.idea/runConfigurations/tests_in_angel_serialize_generator.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/serialize/.idea/runConfigurations/tests_in_enum_test_dart.xml b/packages/serialize/.idea/runConfigurations/tests_in_enum_test_dart.xml
deleted file mode 100644
index 9a4a3357..00000000
--- a/packages/serialize/.idea/runConfigurations/tests_in_enum_test_dart.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/serialize/.idea/serialize.iml b/packages/serialize/.idea/serialize.iml
deleted file mode 100644
index 67079d9b..00000000
--- a/packages/serialize/.idea/serialize.iml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/serialize/.idea/vcs.xml b/packages/serialize/.idea/vcs.xml
deleted file mode 100644
index 94a25f7f..00000000
--- a/packages/serialize/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/serialize/angel_serialize_generator/CHANGELOG.md b/packages/serialize/angel_serialize_generator/CHANGELOG.md
index 73dfdd77..a13163e2 100644
--- a/packages/serialize/angel_serialize_generator/CHANGELOG.md
+++ b/packages/serialize/angel_serialize_generator/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 4.1.2
+
+* Fixed `toMap` method generator
+
## 4.1.1
* Fixed `SerializerGenerator` to recognize nullable class
diff --git a/packages/serialize/angel_serialize_generator/README.md b/packages/serialize/angel_serialize_generator/README.md
index 18ad154e..d3987cc4 100644
--- a/packages/serialize/angel_serialize_generator/README.md
+++ b/packages/serialize/angel_serialize_generator/README.md
@@ -1,6 +1,6 @@
# Angel3 Serialize Generator
-[![version](https://img.shields.io/badge/pub-v4.1.1-brightgreen)](https://pub.dartlang.org/packages/angel3_serialize_generator)
+[![version](https://img.shields.io/badge/pub-v4.1.2-brightgreen)](https://pub.dartlang.org/packages/angel3_serialize_generator)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
diff --git a/packages/serialize/angel_serialize_generator/lib/model.dart b/packages/serialize/angel_serialize_generator/lib/model.dart
index a9995edf..22c245ee 100644
--- a/packages/serialize/angel_serialize_generator/lib/model.dart
+++ b/packages/serialize/angel_serialize_generator/lib/model.dart
@@ -30,7 +30,7 @@ class JsonModelGenerator extends GeneratorForAnnotation {
void generateClass(
BuildContext ctx, LibraryBuilder file, ConstantReader annotation) {
file.body.add(Class((clazz) {
- log.fine('Generate Class: ${ctx.modelClassNameRecase.pascalCase}');
+ //log.fine('Generate Class: ${ctx.modelClassNameRecase.pascalCase}');
clazz
..name = ctx.modelClassNameRecase.pascalCase
..annotations.add(refer('generatedSerializable'));
@@ -50,7 +50,8 @@ class JsonModelGenerator extends GeneratorForAnnotation {
// Generate the fields for the class
for (var field in ctx.fields) {
- log.fine('Generate Field: ${field.name}');
+ //log.fine('Generate Field: ${field.name}');
+
clazz.fields.add(Field((b) {
b
..name = field.name
@@ -106,11 +107,11 @@ class JsonModelGenerator extends GeneratorForAnnotation {
BuildContext ctx, ClassBuilder clazz, LibraryBuilder file) {
clazz.constructors.add(Constructor((constructor) {
// Add all `super` params
- constructor.constant = (ctx.clazz.unnamedConstructor?.isConst == true ||
- shouldBeConstant(ctx)) &&
- ctx.fields.every((f) {
- return f.setter == null && f is! ShimFieldImpl;
- });
+ //constructor.constant = (ctx.clazz.unnamedConstructor?.isConst == true ||
+ // shouldBeConstant(ctx)) &&
+ // ctx.fields.every((f) {
+ // return f.setter == null && f is! ShimFieldImpl;
+ // });
for (var param in ctx.constructorParameters) {
//log.fine('Contructor Parameter: ${param.name}');
diff --git a/packages/serialize/angel_serialize_generator/lib/serialize.dart b/packages/serialize/angel_serialize_generator/lib/serialize.dart
index f92762b6..ed610efa 100644
--- a/packages/serialize/angel_serialize_generator/lib/serialize.dart
+++ b/packages/serialize/angel_serialize_generator/lib/serialize.dart
@@ -8,7 +8,7 @@ class SerializerGenerator extends GeneratorForAnnotation {
@override
Future generateForAnnotatedElement(
Element element, ConstantReader annotation, BuildStep buildStep) async {
- log.fine('Running SerializerGenerator');
+ //log.fine('Running SerializerGenerator');
if (element.kind != ElementKind.CLASS) {
throw 'Only classes can be annotated with a @Serializable() annotation.';
@@ -39,20 +39,20 @@ class SerializerGenerator extends GeneratorForAnnotation {
generateFieldsClass(ctx, b);
});
- var buf = lib.accept(DartEmitter());
+ var buf = lib.accept(DartEmitter(useNullSafetySyntax: true));
return buf.toString();
}
/// Generate a serializer class.
void generateClass(
List serializers, BuildContext ctx, LibraryBuilder file) {
- log.fine('Generate serailizer class');
+ //log.fine('Generate serializer class');
// Generate canonical codecs, etc.
var pascal = ctx.modelClassNameRecase.pascalCase.replaceAll('?', '');
var camel = ctx.modelClassNameRecase.camelCase.replaceAll('?', '');
- log.fine('Pascal = $pascal, camel = $camel');
+ //log.fine('Pascal = $pascal, camel = $camel');
if (ctx.constructorParameters.isEmpty) {
file.body.add(Code('''
@@ -112,6 +112,11 @@ class ${pascal}Decoder extends Converter