don't annotate initializing formals

This commit is contained in:
Tobe O 2019-07-04 14:36:39 -04:00
parent 03cf34b779
commit f479212675
5 changed files with 5 additions and 5 deletions

View file

@ -4,6 +4,7 @@
* Support pulling fields from parent classes and interfaces.
* Only generate `const` constructors if *all*
fields lack a setter.
* Don't type-annotate initializing formals.
# 2.4.4
* Remove unnecessary `new` and `const`.

View file

@ -141,7 +141,7 @@ class JsonModelGenerator extends GeneratorForAnnotation<Serializable> {
if (!isListOrMapType(field.type)) {
b.toThis = true;
} else {
} else if (!b.toThis) {
b.type = convertTypeReference(field.type);
}

View file

@ -8,7 +8,7 @@ part of 'goat.dart';
@generatedSerializable
class Goat implements _Goat {
const Goat({this.integer = 34, List<int> this.list = const [34, 35]});
const Goat({this.integer = 34, this.list = const [34, 35]});
@override
final int integer;

View file

@ -8,7 +8,7 @@ part of 'has_map.dart';
@generatedSerializable
class HasMap implements _HasMap {
const HasMap({@required Map<dynamic, dynamic> this.value});
const HasMap({@required this.value});
@override
final Map<dynamic, dynamic> value;

View file

@ -8,8 +8,7 @@ part of 'with_enum.dart';
@generatedSerializable
class WithEnum implements _WithEnum {
const WithEnum(
{this.type = WithEnumType.b, List<int> this.finalList, this.imageBytes});
const WithEnum({this.type = WithEnumType.b, this.finalList, this.imageBytes});
@override
final WithEnumType type;