@@ -25,15 +25,15 @@ abstract class DecodeHelper implements HelperCore {
25
25
Map <String , FieldElement > accessibleFields,
26
26
Map <String , String > unavailableReasons,
27
27
) {
28
- assert (config.createFactory! );
28
+ assert (config.createFactory);
29
29
final buffer = StringBuffer ();
30
30
31
- final mapType = config.anyMap! ? 'Map' : 'Map<String, dynamic>' ;
31
+ final mapType = config.anyMap ? 'Map' : 'Map<String, dynamic>' ;
32
32
buffer.write ('$targetClassReference '
33
33
'${prefix }FromJson${genericClassArgumentsImpl (true )}'
34
34
'($mapType json' );
35
35
36
- if (config.genericArgumentFactories! ) {
36
+ if (config.genericArgumentFactories) {
37
37
for (var arg in element.typeParameters) {
38
38
final helperName = fromJsonForType (
39
39
arg.instantiate (nullabilitySuffix: NullabilitySuffix .none),
@@ -72,7 +72,7 @@ abstract class DecodeHelper implements HelperCore {
72
72
final checks = _checkKeys (accessibleFields.values
73
73
.where ((fe) => data.usedCtorParamsAndFields.contains (fe.name)));
74
74
75
- if (config.checked! ) {
75
+ if (config.checked) {
76
76
final classLiteral = escapeDartString (element.name);
77
77
78
78
buffer..write ('''
@@ -131,22 +131,22 @@ abstract class DecodeHelper implements HelperCore {
131
131
String constantList (Iterable <FieldElement > things) =>
132
132
'const ${jsonLiteralAsDart (things .map (nameAccess ).toList ())}' ;
133
133
134
- if (config.disallowUnrecognizedKeys! ) {
134
+ if (config.disallowUnrecognizedKeys) {
135
135
final allowKeysLiteral = constantList (accessibleFields);
136
136
137
137
args.add ('allowedKeys: $allowKeysLiteral ' );
138
138
}
139
139
140
140
final requiredKeys =
141
- accessibleFields.where ((fe) => jsonKeyFor (fe).required ! ).toList ();
141
+ accessibleFields.where ((fe) => jsonKeyFor (fe).required ).toList ();
142
142
if (requiredKeys.isNotEmpty) {
143
143
final requiredKeyLiteral = constantList (requiredKeys);
144
144
145
145
args.add ('requiredKeys: $requiredKeyLiteral ' );
146
146
}
147
147
148
148
final disallowNullKeys = accessibleFields
149
- .where ((fe) => jsonKeyFor (fe).disallowNullValue! )
149
+ .where ((fe) => jsonKeyFor (fe).disallowNullValue)
150
150
.toList ();
151
151
if (disallowNullKeys.isNotEmpty) {
152
152
final disallowNullKeyLiteral = constantList (disallowNullKeys);
@@ -173,7 +173,7 @@ abstract class DecodeHelper implements HelperCore {
173
173
174
174
String value;
175
175
try {
176
- if (config.checked! ) {
176
+ if (config.checked) {
177
177
value = contextHelper
178
178
.deserialize (
179
179
targetType,
@@ -204,7 +204,7 @@ abstract class DecodeHelper implements HelperCore {
204
204
final jsonKey = jsonKeyFor (field);
205
205
final defaultValue = jsonKey.defaultValue;
206
206
if (defaultValue != null ) {
207
- if (jsonKey.disallowNullValue! && jsonKey.required ! ) {
207
+ if (jsonKey.disallowNullValue && jsonKey.required ) {
208
208
log.warning ('The `defaultValue` on field `${field .name }` will have no '
209
209
'effect because both `disallowNullValue` and `required` are set to '
210
210
'`true`.' );
0 commit comments