phase3: targeted local-var nullable (strict type) + nullfix cascade. 379->309
This commit is contained in:
@@ -129,7 +129,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
|
||||
return ListView.builder(
|
||||
itemCount: orders != null && orders.length > 0 ? orders.length : 1,
|
||||
itemBuilder: (BuildContext context, int position) {
|
||||
Order order;
|
||||
Order? order;
|
||||
if (orders != null && orders.length > 0) {
|
||||
order = orders[position];
|
||||
}
|
||||
@@ -193,7 +193,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.push(context, MaterialPageRoute(
|
||||
builder: (BuildContext context) => OrderDetail(order.id!, fromOrders: true,),
|
||||
builder: (BuildContext context) => OrderDetail(order!.id!, fromOrders: true,),
|
||||
));
|
||||
},
|
||||
),
|
||||
@@ -208,7 +208,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
|
||||
S.of(context).comment,
|
||||
),
|
||||
onPressed: () {
|
||||
Routes.router.navigateTo(context, '/new-comment/${order.id}');
|
||||
Routes.router.navigateTo(context, '/new-comment/${order!.id}');
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -237,7 +237,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
|
||||
backgroundColor: Colors.redAccent,
|
||||
),
|
||||
onPressed: () {
|
||||
Routes.router.navigateTo(context, '/paynow/${order.id}');
|
||||
Routes.router.navigateTo(context, '/paynow/${order!.id}');
|
||||
},
|
||||
));
|
||||
} else {
|
||||
@@ -252,7 +252,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
),
|
||||
onPressed: () {
|
||||
Utils.orderAgain(context, order.cartInfo!);
|
||||
Utils.orderAgain(context, order!.cartInfo!);
|
||||
},
|
||||
));
|
||||
}
|
||||
@@ -269,7 +269,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
),
|
||||
onPressed: () {
|
||||
Utils.orderAgain(context, order.cartInfo!);
|
||||
Utils.orderAgain(context, order!.cartInfo!);
|
||||
},
|
||||
));
|
||||
}
|
||||
@@ -329,7 +329,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(context, MaterialPageRoute(
|
||||
builder: (BuildContext context) => OrderDetail(order.id!, fromOrders: true,),
|
||||
builder: (BuildContext context) => OrderDetail(order!.id!, fromOrders: true,),
|
||||
));
|
||||
},
|
||||
),
|
||||
@@ -375,7 +375,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(context, MaterialPageRoute(
|
||||
builder: (BuildContext context) => OrderDetail(order.id!, fromOrders: true,),
|
||||
builder: (BuildContext context) => OrderDetail(order!.id!, fromOrders: true,),
|
||||
));
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user