@@ -25,15 +25,15 @@ abstract class DecodeHelper implements HelperCore {
2525 Map <String , FieldElement > accessibleFields,
2626 Map <String , String > unavailableReasons,
2727 ) {
28- assert (config.createFactory! );
28+ assert (config.createFactory);
2929 final buffer = StringBuffer ();
3030
31- final mapType = config.anyMap! ? 'Map' : 'Map<String, dynamic>' ;
31+ final mapType = config.anyMap ? 'Map' : 'Map<String, dynamic>' ;
3232 buffer.write ('$targetClassReference '
3333 '${prefix }FromJson${genericClassArgumentsImpl (true )}'
3434 '($mapType json' );
3535
36- if (config.genericArgumentFactories! ) {
36+ if (config.genericArgumentFactories) {
3737 for (var arg in element.typeParameters) {
3838 final helperName = fromJsonForType (
3939 arg.instantiate (nullabilitySuffix: NullabilitySuffix .none),
@@ -72,7 +72,7 @@ abstract class DecodeHelper implements HelperCore {
7272 final checks = _checkKeys (accessibleFields.values
7373 .where ((fe) => data.usedCtorParamsAndFields.contains (fe.name)));
7474
75- if (config.checked! ) {
75+ if (config.checked) {
7676 final classLiteral = escapeDartString (element.name);
7777
7878 buffer..write ('''
@@ -131,22 +131,22 @@ abstract class DecodeHelper implements HelperCore {
131131 String constantList (Iterable <FieldElement > things) =>
132132 'const ${jsonLiteralAsDart (things .map (nameAccess ).toList ())}' ;
133133
134- if (config.disallowUnrecognizedKeys! ) {
134+ if (config.disallowUnrecognizedKeys) {
135135 final allowKeysLiteral = constantList (accessibleFields);
136136
137137 args.add ('allowedKeys: $allowKeysLiteral ' );
138138 }
139139
140140 final requiredKeys =
141- accessibleFields.where ((fe) => jsonKeyFor (fe).required ! ).toList ();
141+ accessibleFields.where ((fe) => jsonKeyFor (fe).required ).toList ();
142142 if (requiredKeys.isNotEmpty) {
143143 final requiredKeyLiteral = constantList (requiredKeys);
144144
145145 args.add ('requiredKeys: $requiredKeyLiteral ' );
146146 }
147147
148148 final disallowNullKeys = accessibleFields
149- .where ((fe) => jsonKeyFor (fe).disallowNullValue! )
149+ .where ((fe) => jsonKeyFor (fe).disallowNullValue)
150150 .toList ();
151151 if (disallowNullKeys.isNotEmpty) {
152152 final disallowNullKeyLiteral = constantList (disallowNullKeys);
@@ -173,7 +173,7 @@ abstract class DecodeHelper implements HelperCore {
173173
174174 String value;
175175 try {
176- if (config.checked! ) {
176+ if (config.checked) {
177177 value = contextHelper
178178 .deserialize (
179179 targetType,
@@ -204,7 +204,7 @@ abstract class DecodeHelper implements HelperCore {
204204 final jsonKey = jsonKeyFor (field);
205205 final defaultValue = jsonKey.defaultValue;
206206 if (defaultValue != null ) {
207- if (jsonKey.disallowNullValue! && jsonKey.required ! ) {
207+ if (jsonKey.disallowNullValue && jsonKey.required ) {
208208 log.warning ('The `defaultValue` on field `${field .name }` will have no '
209209 'effect because both `disallowNullValue` and `required` are set to '
210210 '`true`.' );
0 commit comments