toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  final map = <String, dynamic>{};
  if (query != null) {
    map["query"] = query!;
  }
  if (years != null) {
    map["years"] = years!;
  }
  if (runtime != null) {
    map["runtime"] = runtime!;
  }
  if (ratings != null) {
    map["ratings"] = ratings!;
  }

  if (genres != null) {
    map["genres"] = genres!.join(",");
  }
  if (countries != null) {
    map["countries"] = countries!.join(",");
  }
  if (languages != null) {
    map["languages"] = languages!.join(",");
  }

  return map;
}