My background is in Python where you treat everything as a duck, and free from defining types. I recently started coding in Dart, and here I am facing these type casting issues.
What's wrong with the below code?
The appendCsv function takes a List<List<dynamic>> parameter, getMarks function returns a List<dynamic> list.
I want to call the getMarks in a loop and append all the lists to another list e.g the x. And then pass that list to the appendCsv function.
List<List<dynamic>> x = [];
var v = await etea.getMarks('809', 70740) as Iterable<List<dynamic>>;
x.addAll(v);
print(x);
print(x.runtimeType);
// x = x as List<List<dynamic>>;
print(x.runtimeType);
appendCsv('802', x);
I am getting these kinds of mix errors.
type 'List<Iterable<String>>' is not a subtype of type 'Iterable<List<dynamic>>' in type cast