|
@@ -125,11 +125,15 @@ class __CustomItemPageContainerState extends BasePageState<_CustomItemPageContai |
|
|
return BlocConsumer<CustomItemPageBloc, CustomItemPageState>( |
|
|
return BlocConsumer<CustomItemPageBloc, CustomItemPageState>( |
|
|
listener: (context, state) {}, |
|
|
listener: (context, state) {}, |
|
|
buildWhen: (prev, current) { |
|
|
buildWhen: (prev, current) { |
|
|
|
|
|
/// 子Item刷新 |
|
|
|
|
|
if (current is CustomItemPageItemWidgetRefreshState) { |
|
|
|
|
|
/// 子Widget刷新 |
|
|
|
|
|
refreshPage(); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
/// 下拉刷新成功 |
|
|
/// 下拉刷新成功 |
|
|
if (current is CustomItemPageRefreshSuccessState) { |
|
|
if (current is CustomItemPageRefreshSuccessState) { |
|
|
_refreshController?.refreshCompleted(resetFooterState: true); |
|
|
_refreshController?.refreshCompleted(resetFooterState: true); |
|
|
///刷新页面 |
|
|
|
|
|
refreshPage(); |
|
|
|
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
/// 下拉刷新出错 |
|
|
/// 下拉刷新出错 |
|
@@ -191,7 +195,7 @@ class __CustomItemPageContainerState extends BasePageState<_CustomItemPageContai |
|
|
SmartRefresher( |
|
|
SmartRefresher( |
|
|
controller: _refreshController, |
|
|
controller: _refreshController, |
|
|
enablePullDown: true, |
|
|
enablePullDown: true, |
|
|
enablePullUp: true, |
|
|
|
|
|
|
|
|
enablePullUp: _hasProductList(model), |
|
|
onRefresh: _refreshEvent, |
|
|
onRefresh: _refreshEvent, |
|
|
onLoading: _loadEvent, |
|
|
onLoading: _loadEvent, |
|
|
header: RefreshGifHeader(), |
|
|
header: RefreshGifHeader(), |
|
@@ -258,6 +262,21 @@ class __CustomItemPageContainerState extends BasePageState<_CustomItemPageContai |
|
|
return result; |
|
|
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() { |
|
|
Widget _buildEmptyWidget() { |
|
|
return SmartRefresher( |
|
|
return SmartRefresher( |
|
|