diff --git a/lib/parser.dart b/lib/parser.dart index fb2a067..bf26684 100644 --- a/lib/parser.dart +++ b/lib/parser.dart @@ -57,7 +57,7 @@ class Parser { ..name = 'toJson' ..returns = new Reference('String') ..body = new Code( - 'json.encode(serializers.serializeWith(${_getPascalCaseClassName( + 'return json.encode(serializers.serializeWith(${_getPascalCaseClassName( name)}.serializer, this));'))) ..methods.add(new Method((b) => b ..name = 'fromJson' @@ -79,10 +79,11 @@ class Parser { ..body = new Code('_\$${ReCase(name).camelCase}Serializer'))) ..constructors.add(new Constructor((b) => b ..factory = true - ..lambda = true - ..body = Code('_\$${_getPascalCaseClassName(name)}') + ..redirect = refer(' _\$${_getPascalCaseClassName(name)}') ..requiredParameters.add(new Parameter((b) => b - ..name = '[updates(${_getPascalCaseClassName(name)}Builder b)]'))))); + ..defaultTo = Code('= _\$${_getPascalCaseClassName(name)}') + ..name = '[updates(${_getPascalCaseClassName(name)}Builder b)]'))),) + ); String classString = topLevelClass.accept(new DartEmitter()).toString(); diff --git a/web/index.html b/web/index.html index 12ec56d..edfcad0 100644 --- a/web/index.html +++ b/web/index.html @@ -7,7 +7,7 @@ - json2builtval + Json to built_value generator @@ -26,14 +26,16 @@ .inline-txtarea { width: 48%; height: 90vh; - border: 2px solid grey; + border: 1px solid #eeeeee; + /* color: #ffffff; */ font-size: 11pt; margin: 0 auto; + /* background-color: #37373F; */ } - + -
+
Json to Dart built_value class converter
@@ -50,8 +52,8 @@

Json to Dart built_value class converter

- - + +
diff --git a/web/styles.css b/web/styles.css index ddca229..172f2c9 100644 --- a/web/styles.css +++ b/web/styles.css @@ -6,10 +6,15 @@ html, body { margin: 0; padding: 0; font-family: 'Roboto', sans-serif; - /* background-color: #EEEEEE; */ + background-color: #33333C; /* background-color: rgba(40, 40, 40, .8); */ } +.header { + background-color: #33333C; + color: #ffffff; +} + #output { padding: 20px; text-align: center;