CampaignModel.fromJson constructor
Implementation
factory CampaignModel.fromJson(Map<String, dynamic> json) {
return CampaignModel(
id: json['id'],
text: json['text'],
type: SMSType.fromValue(json['type']),
count: CampaignCountModel.fromJson(json['_count']),
createdAt: DateTime.parse(json['createdAt']),
contactCount: json['contactCount'],
creditUsed: json['creditUsed'],
scheduledDate: json['scheduledDate'] != null
? DateTime.parse(json['scheduledDate'])
: null,
);
}