CurrentListProperty<T> class
An CurrentProperty with similar characteristics as a dart List<T>
Any change to the internal list will send a CurrentStateChanged event by default. This includes automatically triggering a UI rebuild.
- Inheritance
-
- Object
- CurrentProperty<
List< T> > - CurrentListProperty
Constructors
-
CurrentListProperty(List<
T> value, {String? propertyName}) - CurrentListProperty.empty({String? propertyName})
-
Factory constructor for initializing an CurrentListProperty to an empty List.
factory
Properties
- first → T
-
Returns the first element.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDirty → bool
-
Returns true if the value of this CurrentProperty is different from the originalValue.
no setterinherited
- isEmpty → bool
-
Whether this value has no elements.
no setter
- isNotEmpty → bool
-
Whether this value has no elements.
no setter
- isNotNull → bool
-
Returns true if the value of this CurrentProperty is not null.
no setterinherited
- isNull → bool
-
Returns true if the value of this CurrentProperty is null.
no setterinherited
- isPrimitiveType → bool
-
finalinherited
- last → T
-
Returns the last element.
no setter
- length → int
-
The number of objects in this list.
no setter
-
originalValue
→ List<
T> -
no setterinherited
- propertyName ↔ String?
-
getter/setter pairinherited
-
registeredBindings
→ Iterable<
CurrentViewModelBinding> -
Helper bindings registered directly against this property.
no setterinherited
-
reversed
→ List<
T> -
A List of the objects in this list in reverse order.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → T
-
Checks that this has only one element, and returns that element.
no setter
- sourceHashCode → int
-
finalinherited
-
value
↔ List<
T> -
Returns the current value of this CurrentProperty.
Setting the value will update the value of this CurrentProperty and trigger a UI update if the new value is different from the current value.
If
Tis a reference type, setting the value to a new instance ofTwith the same properties as the current value will still trigger a UI update since the reference has changed.getter/setter pairinherited - viewModel → CurrentStateViewModel
-
Returns the instance of the CurrentStateViewModel this
property is associated with.
no setterinherited
Methods
-
add(
T value, {bool notifyChanges = true}) → void -
Adds
valueto the end of this list, extending the length by one. -
addAll(
Iterable< T> values, {bool notifyChanges = true, bool capturePrevious = false}) → void -
Appends all objects of
valuesto the end of the list. -
call(
List< T> value, {bool notifyChange = true, bool setAsOriginal = false}) → void -
Updates the underlying
valuefor this CurrentProperty.inherited -
clear(
{bool notifyChanges = true, bool capturePrevious = false}) → void - Removes all objects from this list; the length of the list becomes zero.
-
contains(
T value) → bool -
Whether the collection contains an element equal to
value. -
elementAt(
int index) → T -
Returns the
indexth element. -
equals(
dynamic other) → bool -
Checks if
otheris equal to the value of this CurrentProperty.inherited -
firstWhere(
bool test(T element), {T orElse()?}) → T -
Returns the first element that satisfies the given predicate
test. -
firstWhereOrNull(
bool test(T element)) → T? -
Returns the first element that satisfies the given predicate
test. -
forEach(
void action(T)) → void -
Invokes
actionon each element of this iterable in iteration order. -
hasValueChanged(
List< T> currentValue, List<T> originalValue) → bool -
Determines whether the current value differs from the original value.
override
-
indexOf(
T value, [int start = 0]) → int -
The first index of
valuein this list. -
indexWhere(
bool test(T element), [int start = 0]) → int -
The first index in the list that satisfies the provided
test. -
insert(
int index, T element, {bool notifyChanges = true}) → void -
Inserts
elementat positionindexin this list. -
insertAll(
int index, Iterable< T> values, {bool notifyChanges = true, bool capturePrevious = false}) → void -
Inserts all objects of
valuesat positionindexin this list. This increases the length of the list by the length ofvaluesand shifts all later objects towards the end of the list. The list must be growable. Theindexmust be a valid index in the list or length. -
insertAllAtEnd(
Iterable< T> values, {bool notifyChanges = true, bool capturePrevious = false}) → void -
Inserts
valuesat the end of this list This increases the length of the list by the length ofvalues -
map<
E> (E toElement(T)) → Iterable< E> -
The current elements of this iterable modified by
toElement.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerBinding(
CurrentViewModelBinding binding) → void -
Registers a helper binding against this property.
inherited
-
remove(
T value, {bool notifyChanges = true}) → bool -
Removes the first occurrence of
valuefrom this list. -
removeAt(
int index, {bool notifyChanges = true}) → T -
Removes the object at position
indexfrom the list. -
reset(
{bool notifyChange = true}) → void -
Resets the value to the originalValue.
override
-
set(
List< T> value, {bool notifyChange = true, bool setAsOriginal = false}) → List<T> -
Updates the property value. Notifies any listeners to the change
inherited
-
setOriginalValueToCurrent(
) → void -
Updates the original value to what the current value of this property is.
inherited
-
setViewModel(
CurrentStateViewModel viewModel) → void -
Links this CurrentProperty instance with an CurrentStateViewModel.
inherited
-
sublist(
int start, [int? end]) → List< T> -
Returns a new list containing the elements between
startandend. -
toString(
) → String -
Returns the current contents of the list as a
formatted String
override
-
where(
bool test(T element)) → Iterable< T> -
Returns a new lazy Iterable with all elements that satisfy the
predicate
test.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int index) → T -
The object at the given
indexin the list.