After generation of .g.dart for following classes:
@CopyWith()
class MyList {
final List<int> integers;
final List<String> strings;
final List<MyTypeInList> customType;
final List<dynamic> dynamicType;
final List<dynamic> expDynamicType;
MyList({
required this.integers,
required this.strings,
required this.customType,
required this.dynamicType,
required this.expDynamicType,
});
}
@CopyWith()
class MyTypeInList {
final int val;
MyTypeInList({
required this.val,
});
}
@CopyWith()
class MyOtherInList {
final String str;
MyOtherInList({
required this.str,
});
}
I got several warnings in console while compiling project:
lib/src/model/list_test.g.dart:77:20: Warning: Operand of null-aware operation '!' has type 'List<int>' which excludes null.
- 'List' is from 'dart:core'.
? _value.integers!
^
lib/src/model/list_test.g.dart:82:20: Warning: Operand of null-aware operation '!' has type 'List<String>' which excludes null.
- 'List' is from 'dart:core'.
? _value.strings!
^
lib/src/model/list_test.g.dart:88:24: Warning: Operand of null-aware operation '!' has type 'List<MyTypeInList>' which excludes null.
- 'List' is from 'dart:core'.
- 'MyTypeInList' is from 'package:example/src/model/list_test.dart' ('lib/src/model/list_test.dart').
? _value.customType!
^
lib/src/model/list_test.g.dart:94:24: Warning: Operand of null-aware operation '!' has type 'List<dynamic>' which excludes null.
- 'List' is from 'dart:core'.
? _value.dynamicType!
^
lib/src/model/list_test.g.dart:100:20: Warning: Operand of null-aware operation '!' has type 'List<dynamic>' which excludes null.
- 'List' is from 'dart:core'.
? _value.expDynamicType!
^
lib/src/model/list_test.g.dart:150:20: Warning: Operand of null-aware operation '!' has type 'int' which excludes null.
? _value.val!
^
lib/src/model/list_test.g.dart:200:20: Warning: Operand of null-aware operation '!' has type 'String' which excludes null.
? _value.str!
^
After generation of
.g.dart
for following classes:I got several warnings in console while compiling project:
Package version
Expected behavior: No warnings in auto generated code.