I'm getting a type error when running the following code in DartPad.
void main() {
List<int> list = [10, 20, 30];
List<int> squares = list.map((x) => x * x);
squares.forEach((x) => print(x));
}
Getting the following error
Uncaught exception:
TypeError: Instance of 'MappedListIterable<int, int>':
type 'MappedListIterable<int, int>' is not a subtype of
type 'List<int>'
What could be wrong here?