AbstractBlocListExtensions<T> extension

Extension methods for non-nullable lists of type T.

on

Methods

addIf(bool condition, T element, [dynamic callbackIfTrue(T)?]) → void

Available on List<T>, provided by the AbstractBlocListExtensions extension

Adds an element to the list if the specified condition is true. Optionally, a callback can be executed if the element is added.
firstOrDefault([bool test(T element)?]) → T?

Available on List<T>, provided by the AbstractBlocListExtensions extension

Returns the first element in the list that satisfies the optional test function. If the test function is not provided, it returns the first element or null.
removeLastItems(int amount) → void

Available on List<T>, provided by the AbstractBlocListExtensions extension

Removes the last amount of items from the list.
toggle(T element, [bool test(T element)?]) int

Available on List<T>, provided by the AbstractBlocListExtensions extension

Toggles the presence of an element in the list based on an optional test function. Returns -1 if the element was removed, and 1 if it was added.