Browse Source

safety

master
fmk 3 years ago
parent
commit
9088465f2e
  1. 34
      lib/store/store_view/store_activity.dart

34
lib/store/store_view/store_activity.dart

@ -1,15 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
class StoreActivity extends StatefulWidget {
final Map<String, dynamic> arguments;
final List<Activity> activitys;
@ -19,13 +16,19 @@ class StoreActivity extends StatefulWidget {
State<StatefulWidget> createState() {
return _StoreActivity();
}
}
class _StoreActivity extends State<StoreActivity> {
@override
Widget build(BuildContext context) {
return Container(
return (widget.activitys == null || widget.activitys.length == 0)
? NoDataView(
isShowBtn: false,
text: "还没有活动~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 180.h),
)
: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
color: Colors.white,
@ -36,10 +39,12 @@ class _StoreActivity extends State<StoreActivity> {
return InkWell(
onTap: () {
if (widget.arguments["source"] != null &&
widget.arguments["source"] == widget.activitys[position].id) {
widget.arguments["source"] ==
widget.activitys[position].id) {
Navigator.of(context).pop();
} else {
Navigator.of(context).pushNamed('/router/web_page', arguments: {
Navigator.of(context).pushNamed('/router/web_page',
arguments: {
"activityId": widget.activitys[position].id,
"source": widget.arguments["id"]
});
@ -88,7 +93,8 @@ class _StoreActivity extends State<StoreActivity> {
children: [
Text(
(widget.activitys != null &&
widget.activitys.length > position)
widget.activitys.length >
position)
? widget.activitys[position].storeName
: "",
style: TextStyle(
@ -102,7 +108,8 @@ class _StoreActivity extends State<StoreActivity> {
),
Text(
(widget.activitys != null &&
widget.activitys.length > position)
widget.activitys.length >
position)
? widget.activitys[position].mainTitle
: "",
style: TextStyle(
@ -135,7 +142,8 @@ class _StoreActivity extends State<StoreActivity> {
child: Text(
(widget.activitys != null &&
widget.activitys.length > position)
? widget.activitys[position].startTime.split(" ")[0]
? widget.activitys[position].startTime
.split(" ")[0]
: "",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
@ -150,11 +158,11 @@ class _StoreActivity extends State<StoreActivity> {
),
);
},
itemCount: (widget.activitys != null && widget.activitys.length > 0)
itemCount:
(widget.activitys != null && widget.activitys.length > 0)
? widget.activitys.length
: 0,
),
);
}
}
Loading…
Cancel
Save