Commit f096b86d2123794b4c061396ae90bb42d6b2a07c

Authored by wdn127929
1 parent ce4ace9c

部分

{
"dart.flutterCreateOrganization": null
}
\ No newline at end of file
... ...
... ... @@ -111,7 +111,7 @@ dependencies {
implementation 'com.tencent.tpns:xiaomi:1.2.0.3-release' // 小米推送
implementation 'com.tencent.tpns:oppo:1.2.0.3-release' // OPPO 推送
implementation 'com.tencent.tpns:vivo:1.2.0.3-release' // vivo 推送
implementation 'com.amap.api:location:latest.integration'
implementation 'com.amap.api:location:4.7.0'
implementation 'com.zhihu.android:matisse:0.5.3-beta3'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
... ...
... ... @@ -3,6 +3,9 @@ buildscript {
repositories {
google()
jcenter()
// maven { url 'https://maven.aliyun.com/repository/google' }
// maven { url 'https://maven.aliyun.com/repository/jcenter' }
// maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
maven {url 'http://developer.huawei.com/repo/'}
}
... ... @@ -18,6 +21,9 @@ allprojects {
repositories {
google()
jcenter()
// maven { url 'https://maven.aliyun.com/repository/google' }
// maven { url 'https://maven.aliyun.com/repository/jcenter' }
// maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
maven {url 'http://developer.huawei.com/repo/'}
}
... ...
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/coupon_model.dart';
import 'package:one_key/provider/coupon_provider.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/dashed_line_widget.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/v_empty_view.dart';
class CouponItemF extends StatefulWidget {
final String from;
final VoidCallback onPressed;
final VoidCallback onPressedSwich;
final CouponSunModel couponSonModel;
final bool showBtn;
final bool showCheck;
CouponItemF(
{Key key,
this.from,
this.onPressed,
this.onPressedSwich,
this.couponSonModel,
this.showBtn = false,
this.showCheck = false})
: super(key: key);
@override
_CouponItemFState createState() => _CouponItemFState();
}
class _CouponItemFState extends State<CouponItemF> {
// bool showText = false;
@override
Widget build(BuildContext context) {
CouponSunModel sunModel = widget.couponSonModel;
bool notSelect = false;
if (widget.from == 'history') {
notSelect = false;
} else {
notSelect = sunModel.isOpenBool;
}
double explainH = 0.0;
if (ObjectUtil.isNotEmpty(sunModel.explain)) {
explainH = Utils.calculateTextHeight(
'说明:${sunModel.explain}',
ScreenUtil().setSp(24),
FontWeight.normal,
ScreenUtil.screenWidthDp - ScreenUtil().setWidth(92 * 2),
5,
context);
}
return Stack(children: [
InkWell(
onTap: widget.onPressed,
child: Container(
// width: ScreenUtil().setWidth(610),
margin: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(32)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.25),
offset: Offset(0, ScreenUtil().setWidth(8)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: ScreenUtil().setWidth(40),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24)),
decoration: BoxDecoration(
color: notSelect
? MyColours.color_438E93
: MyColours.color_999999,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(16)),
topRight:
Radius.circular(ScreenUtil().setWidth(16)))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'店铺优惠券(核销)',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(24)),
),
InkWell(
onTap: widget.onPressedSwich,
child: Text(
'被领取:${sunModel.receiveNum}张 已使用:${sunModel.useNum}张',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20))),
),
],
),
),
Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(30),
ScreenUtil().setWidth(9 * 2),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(20)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: ScreenUtil().setWidth(232 * 2),
child: Container(
height: ScreenUtil().setWidth(25 * 2),
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(190)),
child: Text(
sunModel.aname,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: notSelect
? MyColours.color_515151
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(36),
fontWeight: FontWeight.bold),
),
)),
Container(
height: ScreenUtil().setWidth(14 * 2),
width: ScreenUtil().setWidth(232 * 2),
child: Text('${sunModel.desc}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: notSelect
? MyColours.color_515151
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
VEmptyView(16),
(ObjectUtil.isNotEmpty(sunModel.stime) &&
sunModel.stime != '0') ||
(ObjectUtil.isNotEmpty(sunModel.etime) &&
sunModel.etime != '0')
? Container(
child: Text(
'使用时间:${ObjectUtil.isNotEmpty(sunModel.stime) ? Utils.getDateStrFromJiekou(sunModel.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.etime) ? Utils.getDateStrFromJiekou(sunModel.etime) : '--'}',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20))),
)
: Container(),
],
),
// widget.from == 'select'
// ? widget.showCheck
// ? Positioned(
// right: 0,
// top: ScreenUtil().setWidth(20),
// child: Image.asset(
// Utils.getImgPath(widget.couponSonModel.isCheck
// ? 'check_r'
// : 'check_un'),
// width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(40),
// ))
// : Container()
// :
),
const MySeparator(
width: 3, color: MyColours.color_f3f3f3),
ObjectUtil.isNotEmpty(sunModel.explain)
? InkWell(
onTap: () {
if (explainH > 19) {
setState(() {
widget.couponSonModel.showText =
!widget.couponSonModel.showText;
});
}
},
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: notSelect
? MyColours.color_ffffff
: MyColours.color_FAFAFA,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(
ScreenUtil().setWidth(20)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(20)))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
widget.couponSonModel.showText
? Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(30),
ScreenUtil().setWidth(14),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(14)),
width: ScreenUtil.screenWidthDp -
ScreenUtil().setWidth(92 * 2),
child: Text('说明:${sunModel.explain}',
maxLines: 5,
style: TextStyle(
color: MyColours.color_999999,
fontSize:
ScreenUtil().setSp(20))),
)
: Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(30),
ScreenUtil().setWidth(14),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(14)),
width: ScreenUtil.screenWidthDp -
ScreenUtil().setWidth(92 * 2) +
ScreenUtil().setWidth(20),
child: Text('说明:${sunModel.explain}',
maxLines: 1,
overflow: TextOverflow.fade,
softWrap: false,
style: TextStyle(
color: MyColours.color_999999,
fontSize:
ScreenUtil().setSp(20))),
),
Spacer(),
explainH > 19
? Container(
margin: EdgeInsets.only(
top: ScreenUtil().setWidth(12)),
child: Image.asset(
!widget.couponSonModel.showText
? Utils.getImgPath('quan_down')
: Utils.getImgPath('quan_up'),
width: ScreenUtil().setWidth(68),
height: ScreenUtil().setWidth(44)),
)
: Container(),
HEmptyView(14)
],
)),
)
: Container(),
],
),
)),
Positioned(
right: ScreenUtil().setWidth(100),
top: ScreenUtil().setWidth(37 * 2),
child: widget.showBtn
? RoundButton(
width: ScreenUtil().setWidth(32 * 2),
height: ScreenUtil().setWidth(21 * 2),
radius: ScreenUtil().setWidth(10),
text: notSelect ? '停用' : '启用',
fontSize: 24,
textColor: notSelect
? MyColours.color_438E93
: MyColours.color_999999,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: notSelect
? MyColours.color_438E93
: MyColours.color_999999,
onPressed: widget.onPressedSwich,
)
: Container())
]);
}
}
... ...
... ... @@ -3,6 +3,7 @@ import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/pages/coupon/coupon_item.dart';
import 'package:one_key/pages/coupon/coupon_item_f.dart';
import 'package:one_key/provider/coupon_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
... ... @@ -26,9 +27,10 @@ class CouponPage extends StatefulWidget {
_CouponPageState createState() => _CouponPageState();
}
class _CouponPageState extends State<CouponPage> {
class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
EasyRefreshController _controller = EasyRefreshController();
CouponProvider couponProvider;
TabController tabController;
///获取优惠券列表数据
_couponNetworkData({bool isShowLoading = true}) async {
... ... @@ -63,6 +65,15 @@ class _CouponPageState extends State<CouponPage> {
void initState() {
// TODO: implement initState
super.initState();
tabController = TabController(length: 3, vsync: this);
tabController.addListener(() {
//点击tab时或滑动tab回调一次
// if (tabController.index.toDouble() == tabController.animation.value) {
// getMessage(index: tabController.index);
// selectIndex = tabController.index;
setState(() {});
// }
});
WidgetsBinding.instance.addPostFrameCallback((_) {
_couponNetworkData();
});
... ... @@ -82,7 +93,7 @@ class _CouponPageState extends State<CouponPage> {
Widget build(BuildContext context) {
couponProvider = Provider.of<CouponProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_fefefe,
backgroundColor: MyColours.color_f3f3f3,
appBar: SystemAppBar('线上券', rightImgName: '历史券', onTap: () {
if (widget.needRefrsh) {
EventBus().emit('refresh_coupon_invitation');
... ... @@ -95,18 +106,52 @@ class _CouponPageState extends State<CouponPage> {
NavigatorUtil.goCouponHistoryPage(context);
}),
body: WillPopScope(
onWillPop: () {
if (widget.needRefrsh) {
EventBus().emit('refresh_coupon_invitation');
} else {
EventBus().emit('changeStatusColor');
}
Navigator.of(context).pop();
},
child: Column(
children: [
Expanded(child: Consumer<CouponProvider>(
builder: (context, model, _) {
onWillPop: () {
if (widget.needRefrsh) {
EventBus().emit('refresh_coupon_invitation');
} else {
EventBus().emit('changeStatusColor');
}
Navigator.of(context).pop();
},
child: Column(
children: <Widget>[
Container(
width: double.infinity,
height: ScreenUtil().setWidth(80),
color: MyColours.color_ffffff,
padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(6)),
child: TabBar(
controller: tabController,
tabs: [
Tab(
text: "全部",
),
Tab(
text: "店铺优惠券",
),
Tab(
text: "我的优惠券",
)
],
indicatorColor: MyColours.color_438E93,
indicatorSize: TabBarIndicatorSize.label,
indicatorWeight: ScreenUtil().setWidth(4),
labelColor: MyColours.color_438E93,
unselectedLabelColor: MyColours.color_999999,
labelStyle: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(28),
fontWeight: FontWeight.bold),
unselectedLabelStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(24),
),
)),
VEmptyView(11),
Expanded(
child: TabBarView(controller: tabController, children: [
Consumer<CouponProvider>(builder: (context, model, _) {
if (model.pageState != PageState.Success) {
return ExceptionPage(
pageState: model.pageState,
... ... @@ -127,29 +172,7 @@ class _CouponPageState extends State<CouponPage> {
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return Container(
margin:
EdgeInsets.all(ScreenUtil().setWidth(40)),
padding:
EdgeInsets.all(ScreenUtil().setWidth(30)),
color: MyColours.color_F0F0F0,
child: Text(
'使用说明:需在结账前出示优惠券二维码,店内工作人员微信扫码核销。超过有效期的券,会自动作废并移出列表。优惠券不可找零、兑现。',
style: TextStyle(
color: MyColours.color_666666,
fontSize: ScreenUtil().setSp(24),
),
strutStyle: StrutStyle(
forceStrutHeight: true,
height: 1,
leading: 0.3),
));
}, childCount: 1),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return CouponItem(
return CouponItemF(
from: 'quan',
couponSonModel:
couponProvider.couponList[index],
... ... @@ -178,31 +201,154 @@ class _CouponPageState extends State<CouponPage> {
// },
);
}
},
)),
VEmptyView(20),
Padding(
padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
child: RoundButton(
onPressed: () async {
bool needRefresh =
await NavigatorUtil.goCouponEditPage(context);
print(needRefresh);
if (needRefresh != null && needRefresh) {
//刷新页面数据
// _controller.callRefresh();
_couponNetworkData();
}
},
text: '创建新券',
fontSize: 34,
isBold: false,
height: ScreenUtil().setWidth(80),
width: double.infinity,
radius: ScreenUtil().setWidth(10),
))
],
)));
}),
Container(
width: 100,
height: 100,
color: Colors.blue,
),
Container(
width: 100,
height: 100,
color: Colors.purple,
)
// MessageOnlineCheckPage()
]),
),
Container(
height: ScreenUtil().setWidth(91 * 2),
width: double.infinity,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(16 * 2),
bottom: ScreenUtil().setWidth(35 * 2),
left: ScreenUtil().setWidth(45 * 2),
right: ScreenUtil().setWidth(45 * 2),
),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.1),
offset: Offset(0, ScreenUtil().setWidth(-2)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
),
),
child: RoundButton(
text: '创建新的优惠券',
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(14),
isBold: false,
fontSize: 28,
onPressed: () {},
),
)
],
),
// child: Column(
// children: [
// Expanded(child: Consumer<CouponProvider>(
// builder: (context, model, _) {
// if (model.pageState != PageState.Success) {
// return ExceptionPage(
// pageState: model.pageState,
// callback: () {
// // offset = 0;
// // getMessage(showLoading: true);
// _couponNetworkData();
// },
// emptyMsg: "暂时没有列表信息哦",
// emptyImg: "empty_search",
// showMsg: "加载中,请稍后...",
// );
// } else {
// return EasyRefresh.custom(
// controller: _controller,
// shrinkWrap: true,
// slivers: [
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int index) {
// return Container(
// margin:
// EdgeInsets.all(ScreenUtil().setWidth(40)),
// padding:
// EdgeInsets.all(ScreenUtil().setWidth(30)),
// color: MyColours.color_F0F0F0,
// child: Text(
// '使用说明:需在结账前出示优惠券二维码,店内工作人员微信扫码核销。超过有效期的券,会自动作废并移出列表。优惠券不可找零、兑现。',
// style: TextStyle(
// color: MyColours.color_666666,
// fontSize: ScreenUtil().setSp(24),
// ),
// strutStyle: StrutStyle(
// forceStrutHeight: true,
// height: 1,
// leading: 0.3),
// ));
// }, childCount: 1),
// ),
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int index) {
// return CouponItem(
// from: 'quan',
// couponSonModel:
// couponProvider.couponList[index],
// showBtn: true,
// onPressedSwich: () {
// couponProvider.couponList[index].isOpenBool =
// !couponProvider
// .couponList[index].isOpenBool;
// _setCustomerActivity(index);
// },
// onPressed: () {
// NavigatorUtil.goCouponDetailPage(context,
// couponProvider.couponList[index]);
// },
// );
// }, childCount: couponProvider.couponList.length),
// )
// ],
// // onRefresh: () async {
// // // offset = 0;
// // // getMessage(showLoading: false);
// // },
// // onLoad: () async {
// // // offset++;
// // // getMessage(showLoading: false);
// // },
// );
// }
// },
// )),
// VEmptyView(20),
// Padding(
// padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
// ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
// child: RoundButton(
// onPressed: () async {
// bool needRefresh =
// await NavigatorUtil.goCouponEditPage(context);
// print(needRefresh);
// if (needRefresh != null && needRefresh) {
// //刷新页面数据
// // _controller.callRefresh();
// _couponNetworkData();
// }
// },
// text: '创建新券',
// fontSize: 34,
// isBold: false,
// height: ScreenUtil().setWidth(80),
// width: double.infinity,
// radius: ScreenUtil().setWidth(10),
// ))
// ],
// )
));
}
}
... ...
// import 'package:flutter/material.dart';
// import 'package:flutter_easyrefresh/easy_refresh.dart';
// import 'package:flutter_screenutil/screenutil.dart';
// import 'package:one_key/constant/state.dart';
// import 'package:one_key/pages/coupon/coupon_item.dart';
// import 'package:one_key/provider/coupon_provider.dart';
// import 'package:one_key/provider/user_model.dart';
// import 'package:one_key/res/colors.dart';
// import 'package:one_key/utils/event_bus.dart';
// import 'package:one_key/route/navigator_util.dart';
// import 'package:one_key/widgets/page_exception.dart';
// import 'package:one_key/widgets/round_button.dart';
// import 'package:one_key/widgets/system_app_bar.dart';
// import 'package:one_key/widgets/v_empty_view.dart';
// import 'package:provider/provider.dart';
// /**
// * 优惠券列表
// */
// class CouponPage extends StatefulWidget {
// final bool needRefrsh;
// CouponPage({Key key, this.needRefrsh = false}) : super(key: key);
// @override
// _CouponPageState createState() => _CouponPageState();
// }
// class _CouponPageState extends State<CouponPage> {
// EasyRefreshController _controller = EasyRefreshController();
// CouponProvider couponProvider;
// ///获取优惠券列表数据
// _couponNetworkData({bool isShowLoading = true}) async {
// Map<String, String> params = {
// "uid": Provider.of<UserModel>(context, listen: false).user.openid,
// // 'is_time': '0'
// };
// await couponProvider.getCustomerActivity(context, params,
// isShowLoading: isShowLoading);
// }
// ///修改活动信息
// _setCustomerActivity(int index) async {
// Map<String, String> params = {
// "id": couponProvider.couponList[index].id,
// "status": couponProvider.couponList[index].isOpenBool ? '1' : '0'
// };
// bool isSuccess = await couponProvider.setCustomerActivity(context, params,
// isShowLoading: false);
// print(isSuccess);
// _couponNetworkData(isShowLoading: false);
// // if (isSuccess) {
// // couponProvider.notifyListeners();
// // } else {
// // couponProvider.couponList[index].isOpenBool =
// // !couponProvider.couponList[index].isOpenBool;
// // couponProvider.notifyListeners();
// // }
// }
// @override
// void initState() {
// // TODO: implement initState
// super.initState();
// WidgetsBinding.instance.addPostFrameCallback((_) {
// _couponNetworkData();
// });
// // bus.on("refresh_coupon_list", (arg) {
// // _couponNetworkData();
// // });
// }
// @override
// void dispose() {
// bus.off('changeStatusColor');
// // bus.off("refresh_coupon_list");
// super.dispose();
// }
// @override
// Widget build(BuildContext context) {
// couponProvider = Provider.of<CouponProvider>(context, listen: true);
// return Scaffold(
// backgroundColor: MyColours.color_fefefe,
// appBar: SystemAppBar('线上券', rightImgName: '历史券', onTap: () {
// if (widget.needRefrsh) {
// EventBus().emit('refresh_coupon_invitation');
// } else {
// EventBus().emit('changeStatusColor');
// }
// Navigator.of(context).pop();
// }, onTapRight: () {
// NavigatorUtil.goCouponHistoryPage(context);
// }),
// body: WillPopScope(
// onWillPop: () {
// if (widget.needRefrsh) {
// EventBus().emit('refresh_coupon_invitation');
// } else {
// EventBus().emit('changeStatusColor');
// }
// Navigator.of(context).pop();
// },
// child: Column(
// children: [
// Expanded(child: Consumer<CouponProvider>(
// builder: (context, model, _) {
// if (model.pageState != PageState.Success) {
// return ExceptionPage(
// pageState: model.pageState,
// callback: () {
// // offset = 0;
// // getMessage(showLoading: true);
// _couponNetworkData();
// },
// emptyMsg: "暂时没有列表信息哦",
// emptyImg: "empty_search",
// showMsg: "加载中,请稍后...",
// );
// } else {
// return EasyRefresh.custom(
// controller: _controller,
// shrinkWrap: true,
// slivers: [
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int index) {
// return Container(
// margin:
// EdgeInsets.all(ScreenUtil().setWidth(40)),
// padding:
// EdgeInsets.all(ScreenUtil().setWidth(30)),
// color: MyColours.color_F0F0F0,
// child: Text(
// '使用说明:需在结账前出示优惠券二维码,店内工作人员微信扫码核销。超过有效期的券,会自动作废并移出列表。优惠券不可找零、兑现。',
// style: TextStyle(
// color: MyColours.color_666666,
// fontSize: ScreenUtil().setSp(24),
// ),
// strutStyle: StrutStyle(
// forceStrutHeight: true,
// height: 1,
// leading: 0.3),
// ));
// }, childCount: 1),
// ),
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int index) {
// return CouponItem(
// from: 'quan',
// couponSonModel:
// couponProvider.couponList[index],
// showBtn: true,
// onPressedSwich: () {
// couponProvider.couponList[index].isOpenBool =
// !couponProvider
// .couponList[index].isOpenBool;
// _setCustomerActivity(index);
// },
// onPressed: () {
// NavigatorUtil.goCouponDetailPage(context,
// couponProvider.couponList[index]);
// },
// );
// }, childCount: couponProvider.couponList.length),
// )
// ],
// // onRefresh: () async {
// // // offset = 0;
// // // getMessage(showLoading: false);
// // },
// // onLoad: () async {
// // // offset++;
// // // getMessage(showLoading: false);
// // },
// );
// }
// },
// )),
// VEmptyView(20),
// Padding(
// padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
// ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
// child: RoundButton(
// onPressed: () async {
// bool needRefresh =
// await NavigatorUtil.goCouponEditPage(context);
// print(needRefresh);
// if (needRefresh != null && needRefresh) {
// //刷新页面数据
// // _controller.callRefresh();
// _couponNetworkData();
// }
// },
// text: '创建新券',
// fontSize: 34,
// isBold: false,
// height: ScreenUtil().setWidth(80),
// width: double.infinity,
// radius: ScreenUtil().setWidth(10),
// ))
// ],
// )));
// }
// }
... ...
import 'package:flutter/material.dart';
class MySeparator extends StatelessWidget {
final double width;
final double height;
final Color color;
const MySeparator(
{this.width = 10.0, this.height = 1, this.color = Colors.black});
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
final boxWidth = constraints.constrainWidth();
final dashWidth = width;
final dashHeight = height;
final dashCount = (boxWidth / (2 * dashWidth)).floor();
return Flex(
children: List.generate(dashCount, (_) {
return SizedBox(
width: dashWidth,
height: dashHeight,
child: DecoratedBox(
decoration: BoxDecoration(color: color),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
);
},
);
}
}
... ...
... ... @@ -130,6 +130,7 @@ dependencies:
# 视频信息获取
video_compress: ^2.1.1
#高德地图
# amap_map_fluttify: ^0.30.1
amap_map_fluttify: 0.25.0
# amap_map_fluttify: ^0.30.1
#虚线边框
... ...