phase3: nullfix.py batch script — bang/late/param-nullable

Automated null-safety fixes driven by dart analyze (no corruption):
- unchecked_use_of_nullable_value: insert '!' on receiver (property/method/[]/op)
- not_initialized field/var: mark 'late'
- missing_default_value_for_parameter: nullable param
Errors: 2374(peak) -> 907
This commit is contained in:
2026-07-25 18:13:01 +08:00
parent 8f3d3509ea
commit fce670664b
99 changed files with 1013 additions and 838 deletions

View File

@@ -34,13 +34,13 @@ class DesktopNewComment extends StatefulWidget {
}
class DesktopNewCommentState extends State<DesktopNewComment> {
Comment comment;
late Comment comment;
bool _showProgress;
late bool _showProgress;
double _progress;
late double _progress;
double rating;
late double rating;
bool isSubmitting = false;
@@ -203,7 +203,7 @@ class DesktopNewCommentState extends State<DesktopNewComment> {
children: <Widget>[],
);
if (comment != null && comment.images.length > 0) {
if (comment != null && comment.images!.length > 0) {
for (ProductImage image in comment.images) {
row.children.add(
Container(
@@ -275,7 +275,7 @@ class DesktopNewCommentState extends State<DesktopNewComment> {
child: Icon(
Icons.add,
size: 60.0,
color: comment == null || comment.images.length < 3 ? Colors.lightBlue : Colors.black12,
color: comment == null || comment.images!.length < 3 ? Colors.lightBlue : Colors.black12,
),
decoration: BoxDecoration(
color: Colors.white70,
@@ -300,7 +300,7 @@ class DesktopNewCommentState extends State<DesktopNewComment> {
),
),
onTap: () {
if (comment == null || comment.images.length < 3) {
if (comment == null || comment.images!.length < 3) {
showDialog(
context: mainContext,
barrierDismissible: true,