RelationListProvider class

Owns one relation's full, paginated child rows — the screen RelationSectionWidget's "See all" opens.

A sibling to ResourceListProvider, not a subclass: it fetches through ResourceDataSource.relation() — the same data source, never a closure a host has to hand-wire, per that method's own docblock — and reads its search/sort capabilities from the RelationDescriptor (P11), which since P11 carries the same search/sorts blocks a resource schema does. The search/sort behaviour mirrors ResourceListProvider.search()/sortBy() exactly, including the reset to page one.

Inheritance

Constructors

RelationListProvider({required ResourceDataSource source, required String resourceKey, required Object id, required RelationDescriptor relation})

Properties

activeSort ResourceSort?
no setter
errorMessage String?
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
hasMore bool
no setter
id Object
final
isLoadingMore bool
no setter
isUnauthenticated bool
True when the load failed on a 401 — see FilamentTransportException.statusCode.
no setter
loadMoreFailed bool
no setter
records List<ResourceRecord>
no setter
relation RelationDescriptor
final
resourceKey String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchTerm String
no setter
source ResourceDataSource
The data source this provider fetches through, exposed so the relation list screen can build a row's ResourceFormProvider against the SAME connection — never a second one a host would have to hand-wire.
no setter
status LoadStatus
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
create(Map<String, dynamic> values) Future<WriteResult>
The relation-row writes (P9). Each goes through the relationship on the server (a child that is not this parent's is a 404, never a cross-parent write), returns the server's verdict as data — a 422 keyed by the CHILD resource's field names included, for the caller's form to render — and on success reloads through the list's own refresh: the write changed this page's membership, and re-fetching page one is the refresh the class already owns rather than a client-side row edit the server never confirmed.
delete(Object childId) Future<WriteResult>
A WriteGone refreshes too: the row is gone either way — the same outcome as deleting it ourselves, and ResourceViewScreen's record delete already treats the two as one.
dispose() → void
Discards any resources used by the object.
inherited
load() Future<void>
loadMore() Future<void>
Appends the next page — same trade as ResourceListProvider.loadMore(): a failure here keeps whatever is already on screen, but loadMoreFailed still flips so the trailing row can show a retry instead of a spinner that never resolves into anything the user is told about. A 401 is that method's same exception, for its same reason.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
refresh() Future<void>
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
Mirrors ResourceListProvider.search(): stores the term and refetches from page one. Debouncing lives in the screen, not here — the same division that type documents.
sortBy(ResourceSort sort) Future<void>
Mirrors ResourceListProvider.sortBy(): the new key replaces the default (or the previous pick) and the list refetches from page one.
toString() String
A string representation of this object.
inherited
update(Object childId, Map<String, dynamic> values) Future<WriteResult>
childId is the child's own key value — the relation's recordKey, routinely not id; see ResourceDataSource.updateRelation.

Operators

operator ==(Object other) bool
The equality operator.
inherited