ApiDynamicCollectionModel class

Inheritance
Available Extensions

Constructors

ApiDynamicCollectionModel(String endpoint, {List<MapModel>? initialValue, Map<String, String> headers = const {}})

Properties

canNext bool
Returns True if the following reads are possible
no setterinherited
deleteEndpoint String
The endpoint to use when executing the Delete method.
no setterinherited
deleteHeaders Map<String, String>
header when executing the Delete method.
no setterinherited
disposed bool
True if the model is Disposed.
no setterinherited
endpoint String
API endpoints.
finalinherited
first DynamicMap
Returns the first element.
getter/setter pairinherited
getEndpoint String
The endpoint to use when executing the Get method.
no setterinherited
getHeaders Map<String, String>
header when executing the Get method.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
headers Map<String, String>
API Header.
finalinherited
isEmpty bool
Returns true if there are no elements in this collection.
no setterinherited
isNotEmpty bool
Returns true if there is at least one element in this collection.
no setterinherited
iterator Iterator<DynamicMap>
Returns a new Iterator that allows iterating the elements of this Iterable.
no setterinherited
last DynamicMap
Returns the last element.
getter/setter pairinherited
length int
The number of objects in this list.
getter/setter pairinherited
loaded bool
It becomes true after loadOnce is executed.
no setterinherited
loading Future<void>?
Returns itself after the load finishes.
no setterinherited
notifyOnChangeList bool
If this value is true, Notify changes when there are changes in the list itself using list-specific methods.
no setterinherited
notifyOnChangeValue bool
If this value is true, the change will be notified when value itself is changed.
no setterinherited
postEndpoint String
The endpoint to use when executing the Post method.
no setterinherited
postHeaders Map<String, String>
header when executing the Post method.
no setterinherited
putEndpoint String
The endpoint to use when executing the Put method.
no setterinherited
putHeaders Map<String, String>
header when executing the Put method.
no setterinherited
reversed Iterable<DynamicMap>
An Iterable of the objects in this list in reverse order.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
saving Future<void>?
Returns itself after the save/delete finishes.
no setterinherited
single DynamicMap
Checks that this iterable has only one element, and returns that element.
no setterinherited
value List<DynamicMap>
The current value stored in this notifier.
getter/setter pairinherited

Methods

add(DynamicMap value) → void
Adds value to the end of this list, extending the length by one.
inherited
addAll(Iterable<DynamicMap> iterable) → void
Appends all objects of iterable to the end of this list.
inherited
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
any(bool test(DynamicMap element)) bool
Checks whether any element of this iterable satisfies test.
inherited
append(String uid, {DynamicMap? data}) Future<void>
Add a new document to the current collection based on uid.
inherited
appendRequest(DynamicMap data) Future<void>
The actual loading process is done from the API when it is append.
inherited
asMap() Map<int, DynamicMap>
An unmodifiable Map view of this list.
inherited
cast<E>() List<E>
Returns a view of this list as a list of R instances.
inherited
clear() → void
Removes all objects from this list; the length of the list becomes zero.
inherited
contains(Object? element) bool
Whether the collection contains an element equal to element.
inherited
create([Object? id]) DynamicMap
Create a new document.
inherited
createDocument([Object? id]) DynamicMap
Add a process to create a document object.
override
delete(bool test(DynamicMap value)) Future<void>
Remove elements in the collection that are true in test.
inherited
deleteRequest(List<DynamicMap> deleteList) Future<void>
The actual loading process is done from the API when it is deleted.
inherited
dependOn(Listenable listenable, [List<DynamicMap> filter(List<DynamicMap> origin)?]) → void
Sends a notification to itself when the target listenable is updated.
inherited
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 and removeListener will throw after the object is disposed).
inherited
elementAt(int index) DynamicMap
Returns the indexth element.
inherited
every(bool test(DynamicMap element)) bool
Checks whether every element of this iterable satisfies test.
inherited
expand<E>(Iterable<E> f(DynamicMap element)) Iterable<E>
Expands each element of this Iterable into zero or more elements.
inherited
fetch([bool listen = true]) Future<void>
Provides the best data acquisition method to implement during screen build.
inherited
fillRange(int start, int end, [DynamicMap? fillValue]) → void
Overwrites a range of elements with fillValue.
inherited
filterOnLoad(List<Object> loaded) List<Object>
You can filter the loaded content when it is loaded.
inherited
filterOnSave(List<Object> save) List<Object>
You can filter the saving content when it is saving.
inherited
firstWhere(bool test(DynamicMap element), {DynamicMap orElse()?}) DynamicMap
Returns the first element that satisfies the given predicate test.
inherited
fold<E>(E initialValue, E combine(E previousValue, DynamicMap element)) → E
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
inherited
followedBy(Iterable<DynamicMap> other) Iterable<DynamicMap>
Returns the lazy concatenation of this iterable and other.
inherited
forEach(void f(DynamicMap element)) → void
Applies the function f to each element of this collection in iteration order.
inherited
fromCollection(List<Object> list) List<DynamicMap>
Callback for converting the data retrieved from the API as collection data.
override
fromResponse(String json) List<Object>
Callback for converting to a list of objects for a response.
inherited
getRange(int start, int end) Iterable<DynamicMap>
Creates an Iterable that iterates over a range of elements.
inherited
indexOf(DynamicMap element, [int start = 0]) int
The first index of element in this list.
inherited
indexWhere(bool test(DynamicMap element), [int start = 0]) int
The first index in the list that satisfies the provided test.
inherited
initState() → void
The method to be executed when initialization is performed.
inherited
insert(int index, DynamicMap element) → void
Inserts element at position index in this list.
inherited
insertAll(int index, Iterable<DynamicMap> iterable) → void
Inserts all objects of iterable at position index in this list.
inherited
join([String separator = ""]) String
Converts each element to a String and concatenates the strings.
inherited
lastIndexOf(DynamicMap element, [int? start]) int
The last index of element in this list.
inherited
lastIndexWhere(bool test(DynamicMap element), [int? start]) int
The last index in the list that satisfies the provided test.
inherited
lastWhere(bool test(DynamicMap element), {DynamicMap orElse()?}) DynamicMap
Returns the last element that satisfies the given predicate test.
inherited
load() Future<void>
Retrieves data and updates the data in the model.
inherited
loadNextRequest() Future<void>
The actual loading process is done from the API when it is loaded next.
inherited
loadOnce() Future<void>
If the data is empty, load is performed only once.
inherited
loadRequest() Future<void>
The actual loading process is done from the API when it is loaded.
inherited
map<E>(E f(DynamicMap e)) Iterable<E>
Returns a new lazy Iterable with elements that are created by calling f on each element of this Iterable in iteration order.
inherited
next() Future<void>
Load the data on the next page.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onAppend() Future<void>
Callback before the append has been done.
inherited
onCatchResponse(dynamic response) → void
Callback to catch what to do with the response.
inherited
onDelete() Future<void>
Callback before the delete has been done.
inherited
onDidAppend() Future<void>
Callback after the append has been done.
inherited
onDidDelete() Future<void>
Callback after the delete has been done.
inherited
onDidLoad() Future<void>
Callback after the load has been done.
inherited
onDidLoadNext() Future<void>
Callback after the next has been done.
inherited
onDidSave() Future<void>
Callback after the save has been done.
inherited
onLoad() Future<void>
Callback before the load has been done.
inherited
onLoadNext() Future<void>
Callback before the next has been done.
inherited
onSave() Future<void>
Callback before the save has been done.
inherited
reduce(DynamicMap combine(DynamicMap value, DynamicMap element)) DynamicMap
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
inherited
reload() Future<void>
Reload data and updates the data in the model.
inherited
remove(Object? value) bool
Removes the first occurrence of value from this list.
inherited
removeAt(int index) DynamicMap
Removes the object at position index from this list.
inherited
removeLast() DynamicMap
Removes and returns the last object in this list.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeRange(int start, int end) → void
Removes a range of elements from the list.
inherited
removeWhere(bool test(DynamicMap element)) → void
Removes all objects from this list that satisfy test.
inherited
replaceRange(int start, int end, Iterable<DynamicMap> replacement) → void
Replaces a range of elements with the elements of replacement.
inherited
retainWhere(bool test(DynamicMap element)) → void
Removes all objects from this list that fail to satisfy test.
inherited
save() Future<void>
Data stored in the model is stored in a database external to the app that is tied to the model.
inherited
saveRequest() Future<void>
The actual loading process is done from the API when it is saved.
inherited
setAll(int index, Iterable<DynamicMap> iterable) → void
Overwrites elements with the objects of iterable.
inherited
setRange(int start, int end, Iterable<DynamicMap> iterable, [int skipCount = 0]) → void
Writes some elements of iterable into a range of this list.
inherited
shuffle([Random? random]) → void
Shuffles the elements of this list randomly.
inherited
singleWhere(bool test(DynamicMap element), {DynamicMap orElse()?}) DynamicMap
Returns the single element that satisfies test.
inherited
skip(int n) Iterable<DynamicMap>
Returns an Iterable that provides all but the first count elements.
inherited
skipWhile(bool test(DynamicMap value)) Iterable<DynamicMap>
Returns an Iterable that skips leading elements while test is satisfied.
inherited
sort([int compare(DynamicMap a, DynamicMap b)?]) → void
Sorts this list according to the order specified by the compare function.
inherited
sublist(int start, [int? end]) List<DynamicMap>
Returns a new list containing the elements between start and end.
inherited
take(int n) Iterable<DynamicMap>
Returns a lazy iterable of the count first elements of this iterable.
inherited
takeWhile(bool test(DynamicMap value)) Iterable<DynamicMap>
Returns a lazy iterable of the leading elements satisfying test.
inherited
toCollection(List<DynamicMap> list) List<Object>
Callback for converting internal collection data when POSTing to the API.
override
toList({bool growable = true}) List<DynamicMap>
Creates a List containing the elements of this Iterable.
inherited
toNotifier<V>(V converter(List<DynamicMap> value)) ValueNotifier<V>
Generates a value notifier.
inherited
toRequest(List<Object> list) → dynamic
Callback for converting internal list data to request data.
inherited
toSet() Set<DynamicMap>
Creates a Set containing the same elements as this iterable.
inherited
toString() String
A string representation of this object.
inherited
transaction([String? linkedCollectionPath]) CollectionTransactionBuilder
Generate a Transaction for this collection.
inherited
where(bool test(DynamicMap element)) Iterable<DynamicMap>
Returns a new lazy Iterable with all elements that satisfy the predicate test.
inherited
whereType<E>() Iterable<E>
Returns a new lazy Iterable with all elements that have type T.
inherited

Operators

operator +(List<DynamicMap> other) List<DynamicMap>
Returns the concatenation of this list and other.
inherited
operator ==(Object other) bool
The equality operator.
inherited
operator [](int index) DynamicMap
The object at the given index in the list.
inherited
operator []=(int index, DynamicMap value) → void
Sets the value at the given index in the list to value.
inherited