I've got a MappedListIterable
than I know to sort
When calling the sort method , I 'm getting
EXCEPTION: NoSuchMethodError: Class 'MappedListIterable' has no instance method 'sort'. Receiver: Instance of 'MappedListIterable' Tried calling: sort(Closure: (dynamic, dynamic) => dynamic)
You get a
MappedListIterable
after calling .map(f) on anIterable
.The Iterable class does not have a
sort()
method. This method is on List.So you first need to get a
List
from yourMappedListIterable
by calling.toList()
for example.Or in one line (code-golf):