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

@@ -22,10 +22,10 @@ class MobileChangePasswordState extends State<MobileChangePassword> {
final passwordController = TextEditingController();
final passwordAgainController = TextEditingController();
bool passwordVisible;
bool passwordAgainVisible;
late bool passwordVisible;
late bool passwordAgainVisible;
bool canReset;
late bool canReset;
@override
void initState() {
@@ -88,7 +88,7 @@ class MobileChangePasswordState extends State<MobileChangePassword> {
fontSize: 18.0
),
validator: (String? value) {
if (value.trim().isEmpty) {
if (value!.trim().isEmpty) {
return S.of(context).current_password_is_required;
}
return null;
@@ -142,7 +142,7 @@ class MobileChangePasswordState extends State<MobileChangePassword> {
fontSize: 18.0
),
validator: (String? value) {
if (value.trim().isEmpty) {
if (value!.trim().isEmpty) {
return S.of(context).password_is_required;
}
return null;
@@ -196,10 +196,10 @@ class MobileChangePasswordState extends State<MobileChangePassword> {
fontSize: 18.0
),
validator: (String? value) {
if (value.trim().isEmpty) {
if (value!.trim().isEmpty) {
return S.of(context).password_is_required;
}
if (value.trim() != passwordController.text.trim()) {
if (value!.trim() != passwordController.text.trim()) {
return S.of(context).password_is_not_match_password_again;
}
return null;
@@ -276,7 +276,7 @@ class MobileChangePasswordState extends State<MobileChangePassword> {
},
isFormData: true,
body: {
'id': store.state.user.id,
'id': store.state.user!.id,
'old_password': oldPasswordController.text.trim(),
'password': passwordController.text.trim(),
}