Check out example codes for "how to parse an array of json objects in flutter". It will help you in understanding the concepts better.

Code Example 1

//pass your decoded json
Map<String, dynamic> json = jsonDecode(rawJson);

List<Location> locations = List<Location>.from(json["locations"].map((x) => Location.fromJson(x)))
//Location class => days is a premitive list and can be deserialized below
class Location {

  String name;
  List<int> days;

  factory Location.fromJson(Map<String, dynamic> json) => Location(
    name: json["name"],
    days: List<int>.from(json["days"].map((x) => x)),

  Map<String, dynamic> toJson() => {
    "name": name,
    "days": List<dynamic>.from( => x)),

Learn ReactJs, React Native from