BucketCampaign.fromJson constructor
BucketCampaign.fromJson(
- Map<String, dynamic> json
)
Implementation
BucketCampaign.fromJson(Map<String, dynamic> json) {
// Set idCampaign
if (json.keys.contains("id")) {
idCampaign = json['id'] as String;
}
// Set idCampaign
if (json.keys.contains("type")) {
type = json['type'] as String;
}
// Set slug
if (json.keys.contains("slug")) {
slug = json['slug'] as String;
}
var list = (json['variationGroups'] ?? []) as List<dynamic>;
variationGroups = list.map((e) {
return VariationGroup.fromJson(e);
}).toList();
}