ListExt<T> extension
- on
-
- List<
T> ?
- List<
Properties
- isNullOrEmpty → bool
-
no setter
- lastIndex → int?
-
no setter
Methods
-
countWhere(
bool test(T)) → int - Counts the elements for whichs the predicate holds.
-
divideListByFunction(
bool condition(T)) → List< List< T> > -
divideListByRange(
int rangeSize) → List< List< ?T> > -
forEachIndexed(
void f(int index, T element)) → void - For each method with provides not only the element but the index as well.
-
random(
{int? seed}) → T? - Return a random element of the list.
-
removeAll(
T item) → void -
Remove all occurrences of
item
from the list. -
separatorEvery(
T separator, {bool start = false, bool end = false}) → List< T> -
toWidgetList(
Widget mapFunc(T value)) → List< Widget> - convert List to List of widget
-
tryGet(
int index) → T? -
Returns the element at the specified
index
, ornull
if the index is out of bounds.