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,7 +27,7 @@ class DesktopCoupons extends StatefulWidget {
|
||||
}
|
||||
|
||||
class DesktopCouponsState extends State<DesktopCoupons> {
|
||||
List<Coupon> coupons;
|
||||
late List<Coupon> coupons;
|
||||
|
||||
double sideSpace = 0;
|
||||
double mainSpace = 1200;
|
||||
@@ -120,7 +120,7 @@ class DesktopCouponsState extends State<DesktopCoupons> {
|
||||
Container(
|
||||
padding: EdgeInsets.only(right: 5.0),
|
||||
child: coupon.store != null ?
|
||||
Util.showImage('${coupon.store.picUrl}',
|
||||
Util.showImage('${coupon.store!.picUrl}',
|
||||
fit: BoxFit.fill,
|
||||
width: 40.0,
|
||||
) :
|
||||
@@ -137,7 +137,7 @@ class DesktopCouponsState extends State<DesktopCoupons> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
coupon.store != null ? coupon.store.name : S.of(context).general_coupon,
|
||||
coupon.store != null ? coupon.store!.name : S.of(context).general_coupon,
|
||||
style: TextStyle(
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -221,7 +221,7 @@ class DesktopCouponsState extends State<DesktopCoupons> {
|
||||
),
|
||||
Container(
|
||||
child: Text(
|
||||
coupon.minAmount > 0 ?
|
||||
coupon.minAmount! > 0 ?
|
||||
S.of(context).available_for_order_over_token(coupon.minAmount) :
|
||||
S.of(context).no_restriction,
|
||||
style: TextStyle(
|
||||
@@ -259,7 +259,7 @@ class DesktopCouponsState extends State<DesktopCoupons> {
|
||||
children: <Widget>[
|
||||
Container(
|
||||
child: Text(
|
||||
coupon.expirationDate == null || coupon.expirationDate.length == 0 ?
|
||||
coupon.expirationDate == null || coupon.expirationDate!.length == 0 ?
|
||||
S.of(context).no_expiration :
|
||||
S.of(context).expiration_date_token(coupon.expirationDate),
|
||||
style: TextStyle(
|
||||
@@ -284,7 +284,7 @@ class DesktopCouponsState extends State<DesktopCoupons> {
|
||||
),
|
||||
onPressed: () {
|
||||
if (coupon.store != null) {
|
||||
Routes.router.navigateTo(context, '/shop/${coupon.store.id}/na/na/na');
|
||||
Routes.router.navigateTo(context, '/shop/${coupon.store!.id}/na/na/na');
|
||||
} else {
|
||||
Routes.router.navigateTo(context, '/businesses');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user