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:
@@ -27,10 +27,10 @@ class DesktopUserProfile extends StatefulWidget {
|
||||
}
|
||||
|
||||
class DesktopUserProfileState extends State<DesktopUserProfile> {
|
||||
User _user;
|
||||
late User _user;
|
||||
|
||||
bool _showProgress;
|
||||
double _progress;
|
||||
late bool _showProgress;
|
||||
late double _progress;
|
||||
|
||||
double sideSpace = 0;
|
||||
double mainSpace = 1200;
|
||||
@@ -253,7 +253,7 @@ class DesktopUserProfileState extends State<DesktopUserProfile> {
|
||||
),
|
||||
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,
|
||||
),
|
||||
@@ -306,7 +306,7 @@ class DesktopUserProfileState extends State<DesktopUserProfile> {
|
||||
),
|
||||
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,
|
||||
),
|
||||
@@ -425,7 +425,7 @@ class DesktopUserProfileState extends State<DesktopUserProfile> {
|
||||
),
|
||||
autofocus: true,
|
||||
validator: (String? value) {
|
||||
if (value.trim().isEmpty) {
|
||||
if (value!.trim().isEmpty) {
|
||||
return S.of(context).nickname_is_required;
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user