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

@@ -16,9 +16,9 @@ import '../../utils/util_web.dart'
if (dart.library.io) '../../utils/util_io.dart';
import '../../utils/utils.dart';
MediaQueryData mediaQuery;
double statusBarHeight;
double screenHeight;
late MediaQueryData mediaQuery;
late double statusBarHeight;
late double screenHeight;
class DesktopMe extends StatefulWidget {
final Key? key;
@@ -32,11 +32,11 @@ class DesktopMe extends StatefulWidget {
}
class DesktopMeState extends State<DesktopMe> {
int userId;
String accessToken;
late int userId;
late String accessToken;
bool isLoading;
User _user;
late bool isLoading;
late User _user;
double sideSpace = 0;
double mainSpace = 1200;
@@ -81,7 +81,7 @@ class DesktopMeState extends State<DesktopMe> {
children: <Widget>[
Container(
margin: EdgeInsets.only(right: 5.0),
child: _user != null && _user.avatarUrl.isNotEmpty
child: _user != null && _user.avatarUrl!.isNotEmpty
? Util.showImage(
'https:${_user.avatarUrl}',
width: 60,
@@ -182,7 +182,7 @@ class DesktopMeState extends State<DesktopMe> {
Container(
child: Text(
_user != null
? '${_user.wallet.toStringAsFixed(2)}'
? '${_user.wallet!.toStringAsFixed(2)}'
: '0.00',
style: TextStyle(
fontSize: 24.0,