|
|
@ -46,7 +46,8 @@ class _GoodsSearchPage extends State<GoodsSearchPage> |
|
|
|
int _pageIndex = 1; |
|
|
|
int _pageIndex = 1; |
|
|
|
BusinessApiService businessService; |
|
|
|
BusinessApiService businessService; |
|
|
|
List<AdminProductVoList> adminProductVoList = []; |
|
|
|
List<AdminProductVoList> adminProductVoList = []; |
|
|
|
bool _shimmer =true; |
|
|
|
String networkError = ""; |
|
|
|
|
|
|
|
int networkStatus = 0; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void didChangeMetrics() { |
|
|
|
void didChangeMetrics() { |
|
|
@ -91,7 +92,6 @@ class _GoodsSearchPage extends State<GoodsSearchPage> |
|
|
|
status: S.current.zhengzaijiazai, |
|
|
|
status: S.current.zhengzaijiazai, |
|
|
|
maskType: EasyLoadingMaskType.black); |
|
|
|
maskType: EasyLoadingMaskType.black); |
|
|
|
await queryGoodsList(); |
|
|
|
await queryGoodsList(); |
|
|
|
_shimmer = false; |
|
|
|
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
EasyLoading.dismiss(); |
|
|
|
if (!mounted) return; |
|
|
|
if (!mounted) return; |
|
|
|
if (refreshController.isRefresh) refreshController.refreshCompleted(); |
|
|
|
if (refreshController.isRefresh) refreshController.refreshCompleted(); |
|
|
@ -116,8 +116,9 @@ class _GoodsSearchPage extends State<GoodsSearchPage> |
|
|
|
"pageSize": 10, |
|
|
|
"pageSize": 10, |
|
|
|
"status": widget.arguments["onSaleStatus"], |
|
|
|
"status": widget.arguments["onSaleStatus"], |
|
|
|
}).catchError((error) { |
|
|
|
}).catchError((error) { |
|
|
|
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), |
|
|
|
networkError = AppUtils.dioErrorTypeToString(error.type); |
|
|
|
alignment: Alignment.center); |
|
|
|
networkStatus = -1; |
|
|
|
|
|
|
|
setState(() {}); |
|
|
|
refreshController.refreshFailed(); |
|
|
|
refreshController.refreshFailed(); |
|
|
|
refreshController.loadFailed(); |
|
|
|
refreshController.loadFailed(); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -129,6 +130,7 @@ class _GoodsSearchPage extends State<GoodsSearchPage> |
|
|
|
refreshController.loadNoData(); |
|
|
|
refreshController.loadNoData(); |
|
|
|
else |
|
|
|
else |
|
|
|
refreshController.loadComplete(); |
|
|
|
refreshController.loadComplete(); |
|
|
|
|
|
|
|
networkStatus = 1; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
} |
|
|
|
} |
|
|
@ -136,31 +138,32 @@ class _GoodsSearchPage extends State<GoodsSearchPage> |
|
|
|
|
|
|
|
|
|
|
|
///商品下架 |
|
|
|
///商品下架 |
|
|
|
queryGoodsUpdate(productId) async { |
|
|
|
queryGoodsUpdate(productId) async { |
|
|
|
try{ |
|
|
|
try { |
|
|
|
EasyLoading.show( |
|
|
|
EasyLoading.show( |
|
|
|
status: S.current.zhengzaijiazai, |
|
|
|
status: S.current.zhengzaijiazai, |
|
|
|
maskType: EasyLoadingMaskType.black); |
|
|
|
maskType: EasyLoadingMaskType.black); |
|
|
|
if (businessService == null) { |
|
|
|
if (businessService == null) { |
|
|
|
businessService = BusinessApiService(Dio(), |
|
|
|
businessService = BusinessApiService(Dio(), |
|
|
|
context: context, |
|
|
|
context: context, |
|
|
|
token: BusinessInstance.instance.businessToken, |
|
|
|
token: BusinessInstance.instance.businessToken, |
|
|
|
tenant: BusinessInstance.instance.businessTenant, |
|
|
|
tenant: BusinessInstance.instance.businessTenant, |
|
|
|
storeId: widget.arguments["storeId"]); |
|
|
|
storeId: widget.arguments["storeId"]); |
|
|
|
} |
|
|
|
} |
|
|
|
BaseData baseData = |
|
|
|
BaseData baseData = await businessService.goodsUpdate({ |
|
|
|
await businessService.goodsUpdate({ |
|
|
|
"productId": productId, |
|
|
|
"productId": productId, |
|
|
|
"sell": widget.arguments["onSaleStatus"] == "1" ? false : true, |
|
|
|
"sell": widget.arguments["onSaleStatus"] == "1"?false:true, |
|
|
|
}).catchError((error) {}); |
|
|
|
}).catchError((error) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
}); |
|
|
|
_pageIndex = 1; |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
adminProductVoList.clear(); |
|
|
|
_pageIndex = 1; |
|
|
|
await _onRefresh(isShowLoad: false); |
|
|
|
adminProductVoList.clear(); |
|
|
|
SmartDialog.showToast( |
|
|
|
await _onRefresh(isShowLoad: false); |
|
|
|
widget.arguments["onSaleStatus"] == "1" ? "商品下架成功" : "商品上架成功", |
|
|
|
SmartDialog.showToast(widget.arguments["onSaleStatus"] == "1"?"商品下架成功":"商品上架成功", alignment: Alignment.center); |
|
|
|
alignment: Alignment.center); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
}}finally{ |
|
|
|
} |
|
|
|
|
|
|
|
} finally { |
|
|
|
EasyLoading.dismiss(); |
|
|
|
EasyLoading.dismiss(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -184,8 +187,7 @@ class _GoodsSearchPage extends State<GoodsSearchPage> |
|
|
|
Container( |
|
|
|
Container( |
|
|
|
color: Colors.white, |
|
|
|
color: Colors.white, |
|
|
|
margin: EdgeInsets.only(bottom: 16.h), |
|
|
|
margin: EdgeInsets.only(bottom: 16.h), |
|
|
|
child: |
|
|
|
child: Container( |
|
|
|
Container( |
|
|
|
|
|
|
|
height: 40.h, |
|
|
|
height: 40.h, |
|
|
|
margin: EdgeInsets.fromLTRB(18.w, 17.h, 18.w, 10.h), |
|
|
|
margin: EdgeInsets.fromLTRB(18.w, 17.h, 18.w, 10.h), |
|
|
|
alignment: Alignment.center, |
|
|
|
alignment: Alignment.center, |
|
|
@ -208,10 +210,9 @@ class _GoodsSearchPage extends State<GoodsSearchPage> |
|
|
|
decoration: InputDecoration( |
|
|
|
decoration: InputDecoration( |
|
|
|
hintText: "请输入搜索内容", |
|
|
|
hintText: "请输入搜索内容", |
|
|
|
hintStyle: TextStyle( |
|
|
|
hintStyle: TextStyle( |
|
|
|
fontSize: 15.sp, |
|
|
|
fontSize: 15.sp, |
|
|
|
color: Color(0xFF808080), |
|
|
|
color: Color(0xFF808080), |
|
|
|
fontWeight: MyFontWeight.regular |
|
|
|
fontWeight: MyFontWeight.regular), |
|
|
|
), |
|
|
|
|
|
|
|
isCollapsed: true, |
|
|
|
isCollapsed: true, |
|
|
|
prefixIcon: Padding( |
|
|
|
prefixIcon: Padding( |
|
|
|
padding: EdgeInsets.only(left: 5.w, right: 5.w), |
|
|
|
padding: EdgeInsets.only(left: 5.w, right: 5.w), |
|
|
@ -228,63 +229,68 @@ class _GoodsSearchPage extends State<GoodsSearchPage> |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Expanded( |
|
|
|
Expanded( |
|
|
|
child: Container( |
|
|
|
child: networkStatus == -1 |
|
|
|
child: SmartRefresher( |
|
|
|
? noNetwork() |
|
|
|
controller: refreshController, |
|
|
|
: Container( |
|
|
|
enablePullDown: true, |
|
|
|
child: SmartRefresher( |
|
|
|
enablePullUp: true, |
|
|
|
controller: refreshController, |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
enablePullDown: true, |
|
|
|
header: MyHeader( |
|
|
|
enablePullUp: true, |
|
|
|
color: Color(0xFF30415B), |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
), |
|
|
|
header: MyHeader( |
|
|
|
footer: CustomFooter( |
|
|
|
color: Color(0xFF30415B), |
|
|
|
builder: (context, mode) { |
|
|
|
), |
|
|
|
return MyFooter(mode); |
|
|
|
footer: CustomFooter( |
|
|
|
}, |
|
|
|
builder: (context, mode) { |
|
|
|
), |
|
|
|
return MyFooter(mode); |
|
|
|
onRefresh: () { |
|
|
|
}, |
|
|
|
_pageIndex = 1; |
|
|
|
), |
|
|
|
adminProductVoList.clear(); |
|
|
|
onRefresh: () { |
|
|
|
_onRefresh(isShowLoad: false); |
|
|
|
_pageIndex = 1; |
|
|
|
}, |
|
|
|
adminProductVoList.clear(); |
|
|
|
onLoading: () { |
|
|
|
_onRefresh(isShowLoad: false); |
|
|
|
_pageIndex++; |
|
|
|
}, |
|
|
|
_onRefresh(isShowLoad: false); |
|
|
|
onLoading: () { |
|
|
|
}, |
|
|
|
_pageIndex++; |
|
|
|
child: (_shimmer)?ListView.builder( |
|
|
|
_onRefresh(isShowLoad: false); |
|
|
|
padding: EdgeInsets.zero, |
|
|
|
}, |
|
|
|
itemCount: 10, |
|
|
|
child: networkStatus == 0 |
|
|
|
scrollDirection: Axis.vertical, |
|
|
|
? ListView.builder( |
|
|
|
shrinkWrap: true, |
|
|
|
padding: EdgeInsets.zero, |
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
itemCount: 10, |
|
|
|
itemBuilder: (context, position) { |
|
|
|
scrollDirection: Axis.vertical, |
|
|
|
return searchGoodsItemSm(); |
|
|
|
shrinkWrap: true, |
|
|
|
}, |
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
): |
|
|
|
itemBuilder: (context, position) { |
|
|
|
((adminProductVoList == null || |
|
|
|
return searchGoodsItemSm(); |
|
|
|
adminProductVoList.length == 0) |
|
|
|
}, |
|
|
|
? NoDataView( |
|
|
|
) |
|
|
|
src: "assets/image/bs_no data_logo.webp", |
|
|
|
: ((adminProductVoList == null || |
|
|
|
isShowBtn: false, |
|
|
|
adminProductVoList.length == 0) |
|
|
|
text: "未搜索到相关数据", |
|
|
|
? NoDataView( |
|
|
|
fontSize: 16.sp, |
|
|
|
src: "assets/image/bs_no data_logo.webp", |
|
|
|
margin: EdgeInsets.all(20.h), |
|
|
|
isShowBtn: false, |
|
|
|
) |
|
|
|
text: "未搜索到相关数据", |
|
|
|
: Container( |
|
|
|
fontSize: 16.sp, |
|
|
|
margin: EdgeInsets.only(bottom:20.h), |
|
|
|
margin: EdgeInsets.all(20.h), |
|
|
|
child: ListView.builder( |
|
|
|
) |
|
|
|
padding: EdgeInsets.zero, |
|
|
|
: Container( |
|
|
|
itemCount: adminProductVoList?.length ?? 0, |
|
|
|
margin: EdgeInsets.only(bottom: 20.h), |
|
|
|
scrollDirection: Axis.vertical, |
|
|
|
child: ListView.builder( |
|
|
|
shrinkWrap: true, |
|
|
|
padding: EdgeInsets.zero, |
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
itemCount: |
|
|
|
itemBuilder: (context, position) { |
|
|
|
adminProductVoList?.length ?? 0, |
|
|
|
return searchGoodsItem(adminProductVoList[position]); |
|
|
|
scrollDirection: Axis.vertical, |
|
|
|
}, |
|
|
|
shrinkWrap: true, |
|
|
|
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
|
|
|
return searchGoodsItem( |
|
|
|
|
|
|
|
adminProductVoList[position]); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
)), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
@ -390,31 +396,30 @@ class _GoodsSearchPage extends State<GoodsSearchPage> |
|
|
|
), |
|
|
|
), |
|
|
|
)), |
|
|
|
)), |
|
|
|
GestureDetector( |
|
|
|
GestureDetector( |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
onTap: (){ |
|
|
|
onTap: () { |
|
|
|
queryGoodsUpdate(adminProductVoList.id ?? ""); |
|
|
|
queryGoodsUpdate(adminProductVoList.id ?? ""); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child:Container( |
|
|
|
child: Container( |
|
|
|
decoration: BoxDecoration( |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.white, |
|
|
|
color: Colors.white, |
|
|
|
borderRadius: BorderRadius.circular(33), |
|
|
|
borderRadius: BorderRadius.circular(33), |
|
|
|
border: Border.all( |
|
|
|
border: Border.all( |
|
|
|
color: Color(0xFF30415B), |
|
|
|
color: Color(0xFF30415B), |
|
|
|
width: 1, |
|
|
|
width: 1, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
padding: EdgeInsets.symmetric( |
|
|
|
padding: |
|
|
|
vertical: 2.h, horizontal: 12.w), |
|
|
|
EdgeInsets.symmetric(vertical: 2.h, horizontal: 12.w), |
|
|
|
child: Text( |
|
|
|
child: Text( |
|
|
|
widget.arguments["onSaleStatus"] == "1" ? "下架" : "上架", |
|
|
|
widget.arguments["onSaleStatus"] == "1"?"下架":"上架", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontSize: 12.sp, |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
color: Color(0xFF30415B), |
|
|
|
color: Color(0xFF30415B), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
)) |
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
], |
|
|
|
) |
|
|
|
) |
|
|
|
], |
|
|
|
], |
|
|
@ -440,7 +445,7 @@ class _GoodsSearchPage extends State<GoodsSearchPage> |
|
|
|
), |
|
|
|
), |
|
|
|
margin: EdgeInsets.only(bottom: 12.h, left: 16.w, right: 16.w), |
|
|
|
margin: EdgeInsets.only(bottom: 12.h, left: 16.w, right: 16.w), |
|
|
|
padding: |
|
|
|
padding: |
|
|
|
EdgeInsets.only(left: 12.w, top: 12.h, bottom: 12.h, right: 24.w), |
|
|
|
EdgeInsets.only(left: 12.w, top: 12.h, bottom: 12.h, right: 24.w), |
|
|
|
child: Row( |
|
|
|
child: Row( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Shimmer.fromColors( |
|
|
|
Shimmer.fromColors( |
|
|
@ -460,86 +465,136 @@ class _GoodsSearchPage extends State<GoodsSearchPage> |
|
|
|
), |
|
|
|
), |
|
|
|
Expanded( |
|
|
|
Expanded( |
|
|
|
child: Column( |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Padding( |
|
|
|
|
|
|
|
padding: EdgeInsets.only(bottom: 11.h, top: 2.h), |
|
|
|
|
|
|
|
child: Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
width: 124.w, |
|
|
|
|
|
|
|
height: 20.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Padding( |
|
|
|
Shimmer.fromColors( |
|
|
|
padding: EdgeInsets.only(bottom: 11.h, top: 2.h), |
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
child: Shimmer.fromColors( |
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
child: Container( |
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
decoration: BoxDecoration( |
|
|
|
child: Container( |
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
width: 124.w, |
|
|
|
|
|
|
|
height: 20.h, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
width: 43.w, |
|
|
|
|
|
|
|
height: 18.h, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Row( |
|
|
|
SizedBox( |
|
|
|
children: [ |
|
|
|
width: 8.w, |
|
|
|
Shimmer.fromColors( |
|
|
|
), |
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
Shimmer.fromColors( |
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
child: Container( |
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
decoration: BoxDecoration( |
|
|
|
child: Container( |
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
), |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
width: 43.w, |
|
|
|
|
|
|
|
height: 18.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox( |
|
|
|
|
|
|
|
width: 8.w, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
width: 43.w, |
|
|
|
|
|
|
|
height: 18.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
width: 43.w, |
|
|
|
|
|
|
|
height: 18.h, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(height: 7.h,), |
|
|
|
], |
|
|
|
Row( |
|
|
|
), |
|
|
|
children: [ |
|
|
|
SizedBox( |
|
|
|
Shimmer.fromColors( |
|
|
|
height: 7.h, |
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
), |
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
Row( |
|
|
|
child: Container( |
|
|
|
children: [ |
|
|
|
decoration: BoxDecoration( |
|
|
|
Shimmer.fromColors( |
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
), |
|
|
|
child: Container( |
|
|
|
width: 28.w, |
|
|
|
decoration: BoxDecoration( |
|
|
|
height: 20.h, |
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
), |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
), |
|
|
|
), |
|
|
|
Spacer(), |
|
|
|
width: 28.w, |
|
|
|
Shimmer.fromColors( |
|
|
|
height: 20.h, |
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
), |
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
), |
|
|
|
child: Container( |
|
|
|
Spacer(), |
|
|
|
decoration: BoxDecoration( |
|
|
|
Shimmer.fromColors( |
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
), |
|
|
|
child: Container( |
|
|
|
width: 24.w, |
|
|
|
decoration: BoxDecoration( |
|
|
|
height: 18.h, |
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
), |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
width: 24.w, |
|
|
|
) |
|
|
|
height: 18.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
)), |
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget noNetwork() { |
|
|
|
|
|
|
|
return Container( |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
width: double.infinity, |
|
|
|
|
|
|
|
child: Column( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
networkError.substring(0, 4), |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.bold), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Padding( |
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 10.h), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
"请检查网络设置或稍后重试", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
color: Color(0xFF7A797F), |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
|
|
|
onTap: () { |
|
|
|
|
|
|
|
_onRefresh(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
color: Color(0xFF30415B), |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(15), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
"重试", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular), |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
) |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|