BasePaginatedController<T, F> class
- Inheritance
-
- Object
- StateNotifier<
PaginatedState< T> > - BasePaginatedController
Constructors
-
BasePaginatedController({required SearchProvider<
T, F> searchProvider, required int batchSize, required F currentFilter, Duration debounceDuration = const Duration(milliseconds: 500)})
Properties
- batchSize → int
-
final
- currentFilter ↔ F
-
getter/setter pair
- debounceDuration → Duration
-
final
-
debugState
→ PaginatedState<
T> -
A development-only way to access
state
outside ofStateNotifier
.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
If a listener has been added using
addListener
and hasn't been removed yet.no setterinherited - hasNoMoreItems ↔ bool
-
getter/setter pair
-
items
→ List<
T> -
final
- lastItemOrNull → T?
-
no setter
- mounted → bool
-
Whether
dispose
was called or not.no setterinherited - onError ↔ ErrorListener?
-
A callback for error reporting if one of the listeners added with
addListener
throws.getter/setter pairinherited - page ↔ int
-
getter/setter pair
- query → String
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchController → TextEditingController
-
final
-
searchProvider
→ SearchProvider<
T, F> -
final
-
state
↔ PaginatedState<
T> -
The current "state" of this
StateNotifier
.getter/setter pairinherited -
stream
→ Stream<
PaginatedState< T> > -
A broadcast stream representation of a
StateNotifier
.no setterinherited
Methods
-
addListener(
Listener< PaginatedState< listener, {bool fireImmediately = true}) → RemoveListenerT> > -
Subscribes to this object.
inherited
-
dispose(
) → void -
Frees all the resources associated with this object.
inherited
-
fetchNextBatch(
{int addToPage = 1}) → Future< void> -
Fetch the next set of items from the same search
addToPage
is 0 when you call init since it shouldn't increase the page count you are querying the first page -
init(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
) → void -
search(
{bool searchIfEmpty = false}) → void - searches for the content inside the searchController resets all the other class variables such as items, hasNoMoreItems, and page
-
setFilter(
F filter, {bool performSearch = true}) → void - set the filter and do a search
-
toString(
) → String -
A string representation of this object.
inherited
-
updateItems(
List< T> results) → void -
updateShouldNotify(
PaginatedState< T> old, PaginatedState<T> current) → bool -
Whether to notify listeners or not when
state
changesinherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited