phase3: nullable fields/methods, casts, ?.call, pinput/YoutubePlayer v5, buttonColor, dead-code removal. 72->16
This commit is contained in:
@@ -24,7 +24,7 @@ class MobileCoupons extends StatefulWidget {
|
||||
}
|
||||
|
||||
class MobileCouponsState extends State<MobileCoupons> {
|
||||
late List<Coupon> coupons;
|
||||
List<Coupon>? coupons;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -54,10 +54,10 @@ class MobileCouponsState extends State<MobileCoupons> {
|
||||
),
|
||||
),
|
||||
body: 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),
|
||||
|
||||
Reference in New Issue
Block a user