GgListValue<T> class

Represents a list value including special updates

Inheritance

Constructors

GgListValue({List<T> seed = const [], bool spam = false, bool compare(List<T> a, List<T> b)?, List<T> transform(List<T>)?, bool isOk(List<T>)?, List<T> parse(String)?, String stringify(List<T>)?, String? name})

Properties

changeStream Stream<GgChange<List<T>>>
no setterinherited
compare → (bool Function(List<T> a, List<T> b)?)
Set a custom comparison operator
finalinherited
hashCode int
The hashcode of a GgValue is calculated based on the value.
no setterinherited
isOk → (bool Function(List<T>)?)
Use that callback to perform some validation
finalinherited
isSynced bool
no setterinherited
jsonDecodedValue ↔ dynamic
Returns int, double and bool and string as they are.
getter/setter pairinherited
name String?
An optional name.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seed List<T>
The default value
no setterinherited
spam bool
Allows reducing the number of updates delivered when the value is changed multiple times.
getter/setter pairinherited
stream → _GgValueStream<List<T>>
Returns a stream informing about changes on the value
no setterinherited
stringValue String
Converts the value into a string value and returns the result.
getter/setter pairinherited
syncStream → _GgValueStream<List<T>>
Returns a sync stream informing about changes on the value
no setterinherited
transform → (List<T> Function(List<T>)?)
Is used to transform assigned values to other ones, e.g. to keep the value in a given range.
finalinherited
value List<T>
Returns the value
getter/setter pairinherited

Methods

add(T newVal) → void
Adds a new item to the list
dispose() → void
Call this method when the value is about to be released.
inherited
forceUpdate() → void
Informs all listeners about a change.
inherited
insertAfter(int index, T newVal) → void
Inserts a new value after a given index
insertBefore(int index, T newVal) → void
Inserts a new value before a given index
move({required int fromIndex, required int toIndex}) → void
Moves an element in a list to another position.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(T val) → void
Removes the first occurence of the item
removeAt(int index) → void
Removes an item from the list
reset() → void
inherited
syncWith(GgValue<List<T>> other) → void
Two way sync this value with another value
inherited
toString() String
Returns a string representation of the GgValue.
inherited
unsync() → void
Remove the synchronization with another element
inherited

Operators

operator ==(Object other) bool
This operator compares to GgValue objects based on the value. When given, the compare function is used to make the comparison.
inherited