SearchKitMixin<Q, T> mixin
Search kit provide a encapsulation of search behaviors, includes search, next page, reload, clear.
Use SearchKitWidgetBuilder to display the corresponding widget of various states during search.
Note: A search request will be rejected if previous one is still running, rather than cancel the previous and start the new request.
Concept
Search State:
idleloadingloadingMoredone
Action Callback:
onRejectonNoMoreDataonFetcherFailed
Action:
nextPagereloadPagesearchPageclearPage
Properties
- endStrategy → EndStrategy
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- pageNo → int
-
The number of page to fetch (NOT current page)
no setter
- pageSize → int
-
Default to
20.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
searchKit
→ SearchKitState<
Q, T> -
no setter
- searchTarget → Q?
-
The target to search.
no setter
Methods
-
clearPage(
) → bool - Reset state to initial.
-
fetcher(
Q? target, int pageNo) → Future< Iterable< T> ?> - Implementation of your data acquisition.
-
nextPage(
) → Future< void> - Request the next page with current target
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onFetcherFailed(
) → void -
Callback when the fetcher returns
null(which means failed) -
onNoMoreData(
) → void - Callback when search is triggered while there is no more data
-
onReject(
) → void -
ACTION CALLBACK: a search request is performed while search kit is in loading state (
loading/loadingMore). -
reloadPage(
) → Future< void> - Perform a search with current target from the first page
-
searchPage(
Q searchTarget) → Future< void> - Perform a search with given target from the first page
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited