I\'m successfully printing my response as String from my YouTube JSON url, but when I try to serialize through the \"items\" I get the following error Unhandled exception:
Unhandled exception:
It looks like data['items'] is a List (i.e. a JSON Array), not a Map.
data['items']
List
Map
You can use list comprehension methods to help here:
final items = (data['items'] as List).map((i) => new CardInfo.fromJson(i)); for (final item in items) { print(item.id); }