ProxySource<T> class

Source whose constructor accepts a value for each operation type.

This is a build-a-source model to adapt an arbitrary data source to the pkg:data_layer system.

Inheritance
Mixed-in types

Constructors

ProxySource({required Bindings<T>? bindings, required SourceType sourceType, GetById<T>? getByIdHandler, GetByIds<T>? getByIdsHandler, GetItems<T>? getItemsHandler, SetItem<T>? setItemHandler, SetItems<T>? setItemsHandler, DeleteItem<T>? deleteHandler, DeleteItems<T>? deleteItemsHandler, SendMessage<T>? sendMessageHandler})
Source whose constructor accepts a value for each operation type.

Properties

bindings ↔ Bindings<T>
All meta information about T necessary to plug arbitrary data types into a Repository.
getter/setter pairinherited
deleteHandler → DeleteItem<T>?
If supplied, used to satisfy deleteItem.
final
deleteItemsHandler → DeleteItems<T>?
If supplied, used to satisfy deleteItems.
final
getByIdHandler → GetById<T>?
If supplied, used to satisfy getById.
final
getByIdsHandler → GetByIds<T>?
If supplied, used to satisfy getByIds.
final
getItemsHandler → GetItems<T>?
If supplied, used to satisfy getItems.
final
hasBindings → bool
Proxy getter for whether bindings has been initialized, either by being passed in via this constructor or by being set by the SourceList.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sendMessageHandler → SendMessage<T>?
If supplied, used to satisfy sendMessage.
final
setItemHandler → SetItem<T>?
If supplied, used to satisfy setItem.
final
setItemsHandler → SetItems<T>?
If supplied, used to satisfy setItems.
final
sourceType → SourceType
Indicator for whether this Source loads data from a store on-device, or off-device.
final
supportedOperations → Set<SourceOperationType>
The operations supported by this loader instance. Defaults to standard CRUD operations.
no setteroverride

Methods

deleteItem(DeleteOperation<T> operation) → Future<DeleteResult<T>>
Clears an item with the given DeleteOperation.itemId if one exists.
override
deleteItems(DeleteListOperation<T> operation) → Future<DeleteResult<T>>
Clears all items matching the given DeleteListOperation.details.
override
getById(ReadOperation<T> operation) → Future<ReadResult<T>>
Loads the instance of T whose primary key is found at ReadOperation.itemId.
override
getByIds(ReadByIdsOperation<T> operation) → Future<ReadListResult<T>>
Loads all instances of T whose primary key is in the set at ReadByIdsOperation.itemIds.
override
getItems(ReadListOperation<T> operation) → Future<ReadListResult<T>>
Loads all instances of T that satisfy any filtes or pagination on ReadListOperation.details.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendMessage(SendMessageOperation<T> operation) → Future<WriteResult<T?>>
Sends a message object (e.g. for patching or decoupled creations).
override
setItem(WriteOperation<T> operation) → Future<WriteResult<T>>
Persists WriteOperation.item.
override
setItems(WriteListOperation<T> operation) → Future<WriteListResult<T>>
Persists all WriteListOperation.items.
override
supports(SourceOperationType type) → bool
Returns whether this instance supports the given SourceOperationType.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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