ListExtensions<T> extension

Provides extended methods for List in T.

TList用の拡張メソッドを提供します。

on

Properties

isJsonEncodable bool
If this object is Json encodable, true is returned.
no setter

Methods

containsIndex(int index) bool
Returns true if index is within the range of elements in List.
fill(int length, [T? value]) List<T?>
If the number of elements in List is less than length, it is filled with value up to the length elements.
get<E>(int index, E defaultValue) → E
Get the indexth element.
getRandom([int? seed]) → T?
Get a random element from List.
insertFirst(T element) List<T>
Insert element at the beginning of List.
insertLast(T element) List<T>
Insert element at the end of List.
insertWhere(T element, bool test(T? prev, T? current, T? next)) List<T>
Inserts element before the first element in List for which the return value of test is true.
sortTo([int compare(T a, T b)?]) List<T>
Sorts this list according to the order specified by the compare function.