toObservableList<T> function
Null safety
Converts the Iterable to an ObservableList.
If value
is already Observable, it will be returned unmodified.
By default this performs a deep conversion, but you can set deep
to false
for a shallow conversion. This does not handle circular data structures.
If a conversion is peformed, mutations are only observed to the result of
this function. Changing the original collection will not affect it.
Implementation
ObservableList<T> toObservableList<T>(Iterable<T> value, {bool deep = true}) {
if (value is ObservableList<T>) return value;
return (deep ? _toObservableDeepIterable(value) : _toObservableShallow(value))
as ObservableList<T>;
}