don't annotate initializing formals
This commit is contained in:
parent
03cf34b779
commit
f479212675
5 changed files with 5 additions and 5 deletions
|
@ -4,6 +4,7 @@
|
||||||
* Support pulling fields from parent classes and interfaces.
|
* Support pulling fields from parent classes and interfaces.
|
||||||
* Only generate `const` constructors if *all*
|
* Only generate `const` constructors if *all*
|
||||||
fields lack a setter.
|
fields lack a setter.
|
||||||
|
* Don't type-annotate initializing formals.
|
||||||
|
|
||||||
# 2.4.4
|
# 2.4.4
|
||||||
* Remove unnecessary `new` and `const`.
|
* Remove unnecessary `new` and `const`.
|
||||||
|
|
|
@ -141,7 +141,7 @@ class JsonModelGenerator extends GeneratorForAnnotation<Serializable> {
|
||||||
|
|
||||||
if (!isListOrMapType(field.type)) {
|
if (!isListOrMapType(field.type)) {
|
||||||
b.toThis = true;
|
b.toThis = true;
|
||||||
} else {
|
} else if (!b.toThis) {
|
||||||
b.type = convertTypeReference(field.type);
|
b.type = convertTypeReference(field.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ part of 'goat.dart';
|
||||||
|
|
||||||
@generatedSerializable
|
@generatedSerializable
|
||||||
class Goat implements _Goat {
|
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
|
@override
|
||||||
final int integer;
|
final int integer;
|
||||||
|
|
|
@ -8,7 +8,7 @@ part of 'has_map.dart';
|
||||||
|
|
||||||
@generatedSerializable
|
@generatedSerializable
|
||||||
class HasMap implements _HasMap {
|
class HasMap implements _HasMap {
|
||||||
const HasMap({@required Map<dynamic, dynamic> this.value});
|
const HasMap({@required this.value});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final Map<dynamic, dynamic> value;
|
final Map<dynamic, dynamic> value;
|
||||||
|
|
|
@ -8,8 +8,7 @@ part of 'with_enum.dart';
|
||||||
|
|
||||||
@generatedSerializable
|
@generatedSerializable
|
||||||
class WithEnum implements _WithEnum {
|
class WithEnum implements _WithEnum {
|
||||||
const WithEnum(
|
const WithEnum({this.type = WithEnumType.b, this.finalList, this.imageBytes});
|
||||||
{this.type = WithEnumType.b, List<int> this.finalList, this.imageBytes});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final WithEnumType type;
|
final WithEnumType type;
|
||||||
|
|
Loading…
Reference in a new issue