FreezedList<T> class

Implemented types
Available Extensions
Annotations
  • @Freezed(genericArgumentFactories: true, toJson: false, fromJson: false, copyWith: false, map: FreezedMapOptions.none)

Constructors

FreezedList([Iterable iterable = const []])
factory
FreezedList.fromJson(List json, T fromJsonT(Object?))
factory
FreezedList.of(List<T> list)
const
factory

Properties

copyWith $FreezedListCopyWith<T, FreezedList<T>>
no setter
first → T
The first element.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Whether this collection has no elements.
no setteroverride
isNotEmpty bool
Whether this collection has at least one element.
no setteroverride
iterator Iterator<T>
A new Iterator that allows iterating the elements of this Iterable.
no setteroverride
last → T
The last element.
no setteroverride
length int
As List.length.
no setteroverride
list List<T>
no setterinherited
reversed Iterable<T>
As List.reversed.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single → T
Checks that this iterable has only one element, and returns that element.
no setteroverride

Methods

any(bool test(T)) bool
Checks whether any element of this iterable satisfies test.
override
asList() List<T>
Returns as an immutable list.
asMap() Map<int, T>
As List.asMap.
cast<E>() Iterable<E>
A view of this iterable as an iterable of R instances.
override
contains(Object? element) bool
Whether the collection contains an element equal to element.
override
elementAt(int index) → T
Returns the indexth element.
override
every(bool test(T)) bool
Checks whether every element of this iterable satisfies test.
override
expand<E>(Iterable<E> f(T)) Iterable<E>
Expands each element of this Iterable into zero or more elements.
override
firstWhere(bool test(T), {T orElse()?}) → T
The first element that satisfies the given predicate test.
override
fold<E>(E initialValue, E combine(E, T)) → E
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
override
followedBy(Iterable<T> other) Iterable<T>
Creates the lazy concatenation of this iterable and other.
override
forEach(void f(T)) → void
Invokes action on each element of this iterable in iteration order.
override
getRange(int start, int end) Iterable<T>
As List.getRange.
indexOf(T element, [int start = 0]) int
As List.indexOf.
indexWhere(bool test(T), [int start = 0]) int
As List.indexWhere.
join([String separator = '']) String
Converts each element to a String and concatenates the strings.
override
lastIndexOf(T element, [int? start]) int
As List.lastIndexOf.
lastIndexWhere(bool test(T), [int? start]) int
As List.lastIndexWhere.
lastWhere(bool test(T), {T orElse()?}) → T
The last element that satisfies the given predicate test.
override
map<E>(E f(T)) Iterable<E>
The current elements of this iterable modified by toElement.
override
maybeWhen<TResult extends Object?>({TResult of(List<T> list)?, required TResult orElse()}) → TResult
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reduce(T combine(T, T)) → T
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
override
singleWhere(bool test(T), {T orElse()?}) → T
The single element that satisfies test.
override
skip(int n) Iterable<T>
Creates an Iterable that provides all but the first count elements.
override
skipWhile(bool test(T)) Iterable<T>
Creates an Iterable that skips leading elements while test is satisfied.
override
sublist(int start, [int? end]) FreezedList<T>
As List.sublist but returns a FreezedList<T>.
take(int n) Iterable<T>
Creates a lazy iterable of the count first elements of this iterable.
override
takeWhile(bool test(T)) Iterable<T>
Creates a lazy iterable of the leading elements satisfying test.
override
toJson() List
toList({bool growable = true}) List<T>
As Iterable.toList.
override
toSet() Set<T>
Creates a Set containing the same elements as this iterable.
override
toString() String
A string representation of this object.
override
when<TResult extends Object?>({required TResult of(List<T> list)}) → TResult
inherited
whenOrNull<TResult extends Object?>({TResult of(List<T> list)?}) → TResult?
inherited
where(bool test(T)) Iterable<T>
Creates a new lazy Iterable with all elements that satisfy the predicate test.
override
whereType<E>() Iterable<E>
Creates a new lazy Iterable with all elements that have type T.
override

Operators

operator +(FreezedList<T> other) FreezedList<T>
As List.+.
operator ==(Object other) bool
The equality operator.
inherited
operator [](int index) → T
As List.elementAt.