transform<S> method
Returns a view on this Vector with all its elements lazily converted
by calling the provided read
transformation. An optionally provided
write
transformation enables writing to the returned vector.
Implementation
Vector<S> transform<S>(S Function(int index, T value) read,
{T Function(int index, S value)? write, DataType<S>? dataType}) =>
TransformedVector<T, S>(
this,
read,
write ?? (i, v) => throw UnsupportedError('Vector is not mutable.'),
dataType ?? DataType.fromType<S>(),
);