ListProvider<T> constructor
ListProvider<T> ({
- PagingController<
T> ? pagingController, - FilterController<
T> ? filterController, - Widget? noData,
Implementation
ListProvider({
this.pagingController,
this.filterController,
this.noData,
}) {
helper = pagingController?.pagingHelper;
pagingController?.addListener(() {
setListType(ListType.PAGING);
notifyListeners();
});
filterController?.addListener(() {
if (filterController!.searchQuery.isEmpty) {
setListType(ListType.PAGING);
}
if (filterController?.filterStatus == FilterStatus.FILTER_IDLE &&
filterController?.listStatus == ListStatus.IDLE) {
setListType(ListType.PAGING);
} else if (
// filterController?.filterStatus == FilterStatus.FILTER_LOADED &&
filterController?.listStatus != ListStatus.IDLE) {
setListType(ListType.FILTERING);
}
notifyListeners();
});
}