Browse Source

safety

master
fmk 3 years ago
parent
commit
3a79dba08b
  1. 34
      lib/home/home_view/home_banner.dart

34
lib/home/home_view/home_banner.dart

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/retrofit/data/banner.dart'; import 'package:huixiang/retrofit/data/banner.dart';
@ -6,7 +5,6 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class HomeBanner extends StatefulWidget { class HomeBanner extends StatefulWidget {
final List<BannerData> bannerData; final List<BannerData> bannerData;
final SwiperController controller; final SwiperController controller;
@ -16,7 +14,6 @@ class HomeBanner extends StatefulWidget {
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _HomeBanner(); return _HomeBanner();
} }
} }
class _HomeBanner extends State<HomeBanner> { class _HomeBanner extends State<HomeBanner> {
@ -50,7 +47,8 @@ class _HomeBanner extends State<HomeBanner> {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: MImage( child: MImage(
(widget.bannerData != null && position < widget.bannerData.length) (widget.bannerData != null &&
position < widget.bannerData.length)
? widget.bannerData[position].imgUrl ?? "" ? widget.bannerData[position].imgUrl ?? ""
: "", : "",
radius: BorderRadius.circular(8), radius: BorderRadius.circular(8),
@ -76,27 +74,23 @@ class _HomeBanner extends State<HomeBanner> {
// Navigator.of(context).pushNamed('/router/qr_share'); // Navigator.of(context).pushNamed('/router/qr_share');
// break; // break;
case 1: case 1:
Navigator.of(context).pushNamed('/router/integral_store_page', Navigator.of(context).pushNamed(
arguments: {"goodsId": bannerData.content}); '/router/integral_store_page',
arguments: {"goodsId": bannerData.content},
);
break; break;
case 2: case 2:
Navigator.of(context).pushNamed('/router/web_page', arguments: { Navigator.of(context).pushNamed(
"activityId": bannerData.content, '/router/web_page',
}); arguments: {"activityId": bannerData.content},
);
break; break;
case 3: case 3:
Navigator.of(context).pushNamed('/router/web_page', arguments: { Navigator.of(context).pushNamed(
"articleId": bannerData.content, '/router/web_page',
}); arguments: {"articleId": bannerData.content},
);
break; break;
} }
} }
} }

Loading…
Cancel
Save