pagedDelegate<T> static method
PagedChildBuilderDelegate<T>
pagedDelegate<T>(
- PagingController pagingController,
- ItemWidgetBuilder<
T> itemBuilder
infinite_scroll_pagination
Implementation
static PagedChildBuilderDelegate<T> pagedDelegate<T>(
PagingController pagingController, ItemWidgetBuilder<T> itemBuilder){
return PagedChildBuilderDelegate<T>(
animateTransitions: true,
itemBuilder: itemBuilder,
firstPageErrorIndicatorBuilder: (_) => Center(child: InkResponse(onTap: pagingController.retryLastFailedRequest,
child: const Text("失败,点击重试",style: TextStyle(fontSize: 16),
),),),
newPageErrorIndicatorBuilder: (_) => Center(child: InkResponse(onTap: pagingController.retryLastFailedRequest,
child: const Text("失败,点击重试",style: TextStyle(fontSize: 16),
),),),
firstPageProgressIndicatorBuilder: (_) => Container(alignment: Alignment.center,
child: const SizedBox(width: 30, height: 30, child: CircularProgressIndicator(),),),
newPageProgressIndicatorBuilder: (_) => Container(alignment: Alignment.center,
child: const SizedBox(width: 30, height: 30, child: CircularProgressIndicator(),),),
noItemsFoundIndicatorBuilder: (_) => Container(alignment: Alignment.center,
child: Text("数据为空", style: TextStyle(color: Colors.black.withOpacity(0.5)),),),
noMoreItemsIndicatorBuilder: (_) => Container(alignment: Alignment.center,
padding: const EdgeInsets.symmetric(vertical: 15),
child: Text("没有更多数据", style: TextStyle(color: Colors.black.withOpacity(0.5)),),),
);
}