Campaigns.fromJson constructor
Implementation
Campaigns.fromJson(Map<String, dynamic> json) {
// Set visitorId
visitorId = (json['visitorId'] ?? "") as String;
// Set panic
if (json.keys.contains("panic")) {
panic = json['panic'] as bool;
}
var list = (json['campaigns'] ?? []) as List<dynamic>;
campaigns = list.map((e) {
return Campaign.fromJson(e);
}).toList();
}