|
|
@@ -125,11 +125,15 @@ class __CustomItemPageContainerState extends BasePageState<_CustomItemPageContai |
|
|
|
return BlocConsumer<CustomItemPageBloc, CustomItemPageState>( |
|
|
|
listener: (context, state) {}, |
|
|
|
buildWhen: (prev, current) { |
|
|
|
/// 子Item刷新 |
|
|
|
if (current is CustomItemPageItemWidgetRefreshState) { |
|
|
|
/// 子Widget刷新 |
|
|
|
refreshPage(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
/// 下拉刷新成功 |
|
|
|
if (current is CustomItemPageRefreshSuccessState) { |
|
|
|
_refreshController?.refreshCompleted(resetFooterState: true); |
|
|
|
///刷新页面 |
|
|
|
refreshPage(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
/// 下拉刷新出错 |
|
|
@@ -191,7 +195,7 @@ class __CustomItemPageContainerState extends BasePageState<_CustomItemPageContai |
|
|
|
SmartRefresher( |
|
|
|
controller: _refreshController, |
|
|
|
enablePullDown: true, |
|
|
|
enablePullUp: true, |
|
|
|
enablePullUp: _hasProductList(model), |
|
|
|
onRefresh: _refreshEvent, |
|
|
|
onLoading: _loadEvent, |
|
|
|
header: RefreshGifHeader(), |
|
|
@@ -258,6 +262,21 @@ class __CustomItemPageContainerState extends BasePageState<_CustomItemPageContai |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/// 判断是否有商品列表,如果没有不进行,上拉更多 |
|
|
|
bool _hasProductList(final List<Map<String, dynamic>> datas) { |
|
|
|
var rlt = false; |
|
|
|
if (!EmptyUtil.isEmpty(datas)) { |
|
|
|
for (int i = 0; i < datas.length; i++) { |
|
|
|
WidgetModel item = WidgetModel.fromJson(Map<String, dynamic>.from(datas[i])); |
|
|
|
if (item.modName == 'product') { |
|
|
|
rlt = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return rlt; |
|
|
|
} |
|
|
|
|
|
|
|
/// 空数据 |
|
|
|
Widget _buildEmptyWidget() { |
|
|
|
return SmartRefresher( |
|
|
|