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:
@@ -36,9 +36,9 @@ class MobileNewAddressState extends State<MobileNewAddress> {
|
||||
final faxController = TextEditingController();
|
||||
|
||||
String country = 'CA';
|
||||
Gender _selectedGender;
|
||||
late Gender _selectedGender;
|
||||
|
||||
String _selectedProvince;
|
||||
late String _selectedProvince;
|
||||
|
||||
List<String> provinces = <String>[
|
||||
'Ontario',
|
||||
@@ -97,7 +97,7 @@ class MobileNewAddressState extends State<MobileNewAddress> {
|
||||
labelText: S.of(context).contact_name,
|
||||
),
|
||||
validator: (String? value) {
|
||||
if (value.trim().isEmpty) {
|
||||
if (value!.trim().isEmpty) {
|
||||
return S.of(context).contact_name_is_required;
|
||||
}
|
||||
return null;
|
||||
@@ -141,7 +141,7 @@ class MobileNewAddressState extends State<MobileNewAddress> {
|
||||
labelText: S.of(context).mobile_phone_number,
|
||||
),
|
||||
validator: (String? value) {
|
||||
if (value.trim().isEmpty) {
|
||||
if (value!.trim().isEmpty) {
|
||||
return S.of(context).mobile_phone_number_is_required;
|
||||
}
|
||||
return null;
|
||||
@@ -166,7 +166,7 @@ class MobileNewAddressState extends State<MobileNewAddress> {
|
||||
labelText: S.of(context).street_line_1,
|
||||
),
|
||||
validator: (String? value) {
|
||||
if (value.trim().isEmpty) {
|
||||
if (value!.trim().isEmpty) {
|
||||
return S.of(context).street_line_1_is_required;
|
||||
}
|
||||
return null;
|
||||
@@ -210,7 +210,7 @@ class MobileNewAddressState extends State<MobileNewAddress> {
|
||||
labelText: S.of(context).city,
|
||||
),
|
||||
validator: (String? value) {
|
||||
if (value.trim().isEmpty) {
|
||||
if (value!.trim().isEmpty) {
|
||||
return S.of(context).city_is_required;
|
||||
}
|
||||
return null;
|
||||
@@ -256,7 +256,7 @@ class MobileNewAddressState extends State<MobileNewAddress> {
|
||||
labelText: S.of(context).postal_code,
|
||||
),
|
||||
validator: (String? value) {
|
||||
if (value.trim().isEmpty) {
|
||||
if (value!.trim().isEmpty) {
|
||||
return S.of(context).postal_code_is_required;
|
||||
}
|
||||
return null;
|
||||
@@ -291,7 +291,7 @@ class MobileNewAddressState extends State<MobileNewAddress> {
|
||||
labelText: S.of(context).email,
|
||||
),
|
||||
validator: (String? value) {
|
||||
if (value.isNotEmpty && !EmailValidator.validate(value)) {
|
||||
if (value!.isNotEmpty && !EmailValidator.validate(value)) {
|
||||
return S.of(context).email_is_not_valid;
|
||||
}
|
||||
return null;
|
||||
@@ -354,8 +354,8 @@ class MobileNewAddressState extends State<MobileNewAddress> {
|
||||
cityController.text = widget.locatedAddress.city;
|
||||
postalCodeController.text = widget.locatedAddress.postalCode;
|
||||
streetLine1Controller.text = (widget.locatedAddress.streetNumber != null
|
||||
&& widget.locatedAddress.streetNumber.isNotEmpty
|
||||
? widget.locatedAddress.streetNumber + ' ' : '')
|
||||
&& widget.locatedAddress.streetNumber!.isNotEmpty
|
||||
? widget.locatedAddress.streetNumber! + ' ' : '')
|
||||
+ widget.locatedAddress.streetName;
|
||||
} else {
|
||||
_selectedProvince = 'Ontario';
|
||||
|
||||
Reference in New Issue
Block a user