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

Loading…
Cancel
Save