DataSet<T extends DataClass> class

This class provides all functionality related to sending and fetching to and from the API and manages all data loaded as a repository

Inheritance
Mixed in types

Constructors

DataSet({required DataClassBuilder<T> instanceBuilder, required String route, IdentifierGetter<T>? idFieldGetter})
DataSet.withOptions(DataOption<T> options)

Properties

builder DataClassBuilder<T>
The instance builder for this type
no setter
data ↔ T
This object stores typed data fetched by a data provider or set by other source
getter/setter pairinherited
fetcher DataFetcher
This property is responsible to communicate to the API
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
idFieldGetter IdentifierGetter<T>?
The function that selects the id property of this dataset
no setter
list List<T>
This list stores data fetched by a data provider or set by other source
getter/setter pairinherited
loadStatus ValueNotifier<LoadStatus>
This value notifier is used to notify the fetch status of the dataset
getter/setter pairinherited
local Map<String, dynamic>
This property stores, well, whatever you want. But we recommend using it for storing views or selected instances of the DataClass, according to your needs
getter/setter pairinherited
localViews Map<String, dynamic>
This property stores whichever views from the main list. We recommend using it for storing functions that return a different perspective of the list property
getter/setter pairinherited
modelName String
The name of the type passed as type parameter
no setter
options DataOption<T>
This property stores everything that configures this dataset
final
route String
The route to this endpoint
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
totalRecords int
Total records available in the remote server;
getter/setter pairinherited

Methods

add([T? model]) Future<void>
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
child<Z extends DataClass>({String relationName = 'default', dynamic parentId, bool clear = true}) DataSet<Z>
Returns the dataset that was stored as a child under the relation name passed as parameter
create([T? model]) → void
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
get({Map<String, dynamic> filters = const {}, bool cache = true, bool store = true}) Future<List<T>>
getOne(dynamic uniqueID, {bool override = true}) Future<T>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
remove(dynamic uniqueID) Future<void>
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
replicate() DataSet<T>
run<Z extends DataClass>(DataOperation operation, String route, {Map<String, dynamic>? query, Z? model, required dynamic then(DataWaiter<Z>)}) Future<void>
toString() String
A string representation of this object.
inherited
update(dynamic uniqueID, [T? model]) Future<void>
withChild<Z extends DataClass>(DataSet<Z> child, [String identifier = 'default']) DataSet<T>
This method registers a DataSet that will have direct relation to the dataset already instantiated. For that, it uses a relation name as a key for retrieving it later

Operators

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

Static Methods

of<T extends DataClass>() DataSet<T>
Retrieves the dataset of certain type