I'm trying to render a list of widgets. To do this, I'm creating a list of RowDataEntry objects that looks like this:
class RowDataEntry {
final Map<String, dynamic> values;
RowDataEntry(this.values);
}
I then want to instantiate the list of entries like this like this:
final List<RowDataEntry> data = args['data'].subFunds.map((subFund) {
final name = subFund.parameters["subFundName"];
return RowDataEntry({"fundName": name, "status": Status('pass')});
}).toList();
However, the "toList()" converts the list into a list of type dynamic, rather than of type RowDataEntry, and so I'm getting a compilation error.
I've tried casting but I can't get it to work. It would be great if someone could show me where I'm going wrong.
Thanks.
EDIT======================
I think the issue is with the args object. It looks like this:
final Map<String, dynamic> args = ModalRoute.of(context).settings.arguments;