Skip to content

Commit

Permalink
For constant null, declareFinal is replaced by declareConst
Browse files Browse the repository at this point in the history
Use 'const' for final variables initialized to a constant value. Try replacing 'final' with 'const'. #652
  • Loading branch information
emintolgahanpolat committed Jan 29, 2024
1 parent bf38e05 commit 5a6fc50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion generator/lib/src/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,7 @@ ${bodyName.displayName} == null
);
} else {
blocks.add(
declareFinal(dataVar, type: refer('Map<String, dynamic>?'))
declareConst(dataVar, type: refer('Map<String, dynamic>?'))
.assign(literalNull)
.statement,
);
Expand Down

0 comments on commit 5a6fc50

Please sign in to comment.