phase3: nullable fields/methods, casts, ?.call, condition fixes across 11 files. 108->72

This commit is contained in:
2026-08-01 01:16:25 +08:00
parent b8b70a87f9
commit 137eca4c69
12 changed files with 164 additions and 164 deletions

View File

@@ -27,7 +27,7 @@ class DesktopCoupons extends StatefulWidget {
}
class DesktopCouponsState extends State<DesktopCoupons> {
late List<Coupon> coupons;
List<Coupon>? coupons;
double sideSpace = 0;
double mainSpace = 1200;
@@ -56,10 +56,10 @@ class DesktopCouponsState extends State<DesktopCoupons> {
}
Widget w = ListView.builder(
itemCount: coupons.length > 0 ? coupons.length : 1,
itemCount: coupons!.length > 0 ? coupons!.length : 1,
itemBuilder: (BuildContext context, int position) {
if (coupons.length > 0) {
Coupon coupon = coupons[position];
if (coupons!.length > 0) {
Coupon coupon = coupons![position];
return Container(
color: Colors.black12,
child: couponWidget(coupon),
@@ -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,
@@ -169,7 +169,7 @@ class DesktopCouponsState extends State<DesktopCoupons> {
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: !coupon.isPercentage ?
child: coupon.isPercentage != true ?
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,