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

@@ -27,10 +27,10 @@ class MobileUserProfile extends StatefulWidget {
}
class MobileUserProfileState extends State<MobileUserProfile> {
User _user;
late User _user;
bool _showProgress;
double _progress;
late bool _showProgress;
late double _progress;
@override
Widget build(BuildContext context) {
@@ -229,7 +229,7 @@ class MobileUserProfileState extends State<MobileUserProfile> {
),
Container(
child: Text(
_user.mobile != null && _user.mobile.isNotEmpty ? Utils.safePhoneNumber(_user.mobile) : S.of(context).not_binding,
_user.mobile != null && _user.mobile!.isNotEmpty ? Utils.safePhoneNumber(_user.mobile) : S.of(context).not_binding,
style: TextStyle(
color: Colors.grey,
),
@@ -282,7 +282,7 @@ class MobileUserProfileState extends State<MobileUserProfile> {
),
Container(
child: Text(
_user.email != null && _user.email.isNotEmpty ? Utils.safePhoneNumber(_user.email) : S.of(context).not_binding,
_user.email != null && _user.email!.isNotEmpty ? Utils.safePhoneNumber(_user.email) : S.of(context).not_binding,
style: TextStyle(
color: Colors.grey,
),
@@ -393,7 +393,7 @@ class MobileUserProfileState extends State<MobileUserProfile> {
),
autofocus: true,
validator: (String? value) {
if (value.trim().isEmpty) {
if (value!.trim().isEmpty) {
return S.of(context).nickname_is_required;
}
return null;