ResourceDataSource class abstract interface

Everything the screens need from the server.

Abstract so tests can drive the screens from a fake without a transport, and so a host could substitute a cached or offline implementation later.

Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cachedPanel() Future<PanelSchema?>
The cached panel, if there is a usable one — parsed, never rendered from bytes this build cannot read.
create(String resourceKey, Map<String, dynamic> values) Future<WriteResult>
POST /{resource} — never throws on a 4xx; see WriteResult.
createRelation(String resourceKey, Object id, RelationDescriptor relation, Map<String, dynamic> values) Future<WriteResult>
POST /{resource}/{id}/relations/{relation} — creates one child row through the relationship (P9). Same never-throw contract as create; a 422 carries errors keyed by the CHILD resource's field names.
dashboard() Future<DashboardData>
GET /dashboard — the panel's widgets, values already computed.
deleteRelation(String resourceKey, Object id, RelationDescriptor relation, Object childId) Future<WriteResult>
DELETE /{resource}/{id}/relations/{relation}/{childId} — removes one child row, resolved through the relationship exactly as updateRelation.
destroy(String resourceKey, Object id) Future<WriteResult>
DELETE /{resource}/{id} — never throws on a 4xx; see WriteResult.
list(String resourceKey, {int page, String? search, String? sort, String? direction}) Future<PaginatedRecords>
GET /{resource}
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
options(String resourceKey, {required String field, Object? recordId, required Map<String, dynamic> values, required String query}) Future<OptionsPage>
POST /{resource}/options — the options for a select whose list /schema refused to inline.
panel() Future<PanelSchema>
GET /schema
record(String resourceKey, Object id) Future<ResourceRecord>
GET /{resource}/{id} — the only call that returns per-record permissions.
relation(String resourceKey, Object id, RelationDescriptor relation, {int page, String? search, String? sort, String? direction}) Future<PaginatedRecords>
GET /{resource}/{id}/relations/{relation} — one relation manager's child rows, in the same {data, meta} envelope list uses. The same read path as list against a sibling URL, so it is fetched the same way: through this data source, never a closure a host has to hand-wire.
runAction(String resourceKey, Object id, String action) Future<ActionResult>
POST /{resource}/{id}/actions/{action} — runs one of the record's own RecordActions. Never throws on a 4xx or 5xx; see ActionResult.
state(String resourceKey, {Object? recordId, required Map<String, dynamic> values, required String changed}) Future<List<SchemaComponent>>
POST /{resource}/state — re-evaluates the form against values typed but not yet submitted, so visible/disabled/hidden closures answer on mobile exactly as they do in the web panel.
toString() String
A string representation of this object.
inherited
update(String resourceKey, Object id, Map<String, dynamic> values) Future<WriteResult>
PUT /{resource}/{id} — never throws on a 4xx; see WriteResult.
updateRelation(String resourceKey, Object id, RelationDescriptor relation, Object childId, Map<String, dynamic> values) Future<WriteResult>
PUT /{resource}/{id}/relations/{relation}/{childId} — updates one child row, resolved through the relationship (P9): childId is the related model's own key (the relation's published recordKey), and a child that is not this parent's answers 404, never a cross-parent write.
uploadFile(String resourceKey, String field, {required List<int> bytes, required String filename}) Future<UploadResult>
POST /{resource}/upload — uploads a file for a single-file upload field. field is the field's statePath, so a nested field is addressable.

Operators

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