@@ -173,16 +173,6 @@ class InfoBuilder {
173
173
return 'The value of the expression is nullable' ;
174
174
}
175
175
176
- // Text indicating the type of nullable value found.
177
- String nullableValue;
178
- if (node is NullLiteral ) {
179
- nullableValue = "an explicit 'null'" ;
180
- } else if (origin.kind == EdgeOriginKind .dynamicAssignment) {
181
- nullableValue = 'a dynamic value, which is nullable' ;
182
- } else {
183
- nullableValue = 'a nullable value' ;
184
- }
185
-
186
176
if (origin.kind == EdgeOriginKind .listLengthConstructor) {
187
177
return 'A length is specified in the "List()" constructor and the list '
188
178
'items are initialized to null' ;
@@ -205,6 +195,16 @@ class InfoBuilder {
205
195
'$lineNumber , which implicitly returns null.' ;
206
196
}
207
197
198
+ // Text indicating the type of nullable value found.
199
+ String nullableValue;
200
+ if (node is NullLiteral ) {
201
+ nullableValue = "an explicit 'null'" ;
202
+ } else if (origin.kind == EdgeOriginKind .dynamicAssignment) {
203
+ nullableValue = 'a dynamic value, which is nullable' ;
204
+ } else {
205
+ nullableValue = 'a nullable value' ;
206
+ }
207
+
208
208
/// If the [node] is inside the return expression for a function body,
209
209
/// return the function body. Otherwise return `null` .
210
210
FunctionBody findFunctionBody () {
@@ -263,16 +263,19 @@ class InfoBuilder {
263
263
return 'This field is initialized to $nullableValue ' ;
264
264
}
265
265
return 'This variable is initialized to $nullableValue ' ;
266
- } else if (node is ConstructorDeclaration &&
267
- origin.kind == EdgeOriginKind .fieldNotInitialized) {
268
- String constructorName =
269
- node.declaredElement.enclosingElement.displayName;
270
- if (node.declaredElement.displayName.isNotEmpty) {
271
- constructorName =
272
- '$constructorName .${node .declaredElement .displayName }' ;
266
+ } else if (origin.kind == EdgeOriginKind .fieldNotInitialized) {
267
+ if (node is ConstructorDeclaration ) {
268
+ String constructorName =
269
+ node.declaredElement.enclosingElement.displayName;
270
+ if (node.declaredElement.displayName.isNotEmpty) {
271
+ constructorName =
272
+ '$constructorName .${node .declaredElement .displayName }' ;
273
+ }
274
+ return "The constructor '$constructorName ' does not initialize this "
275
+ 'field in its initializer list' ;
276
+ } else {
277
+ return 'This field is not initialized' ;
273
278
}
274
- return "The constructor '$constructorName ' does not initialize this "
275
- 'field in its initializer list' ;
276
279
}
277
280
278
281
String enclosingMemberDescription = buildEnclosingMemberDescription (node);
0 commit comments