SORICampaign.fromMap constructor
Implementation
factory SORICampaign.fromMap(Map<String, Object?> map) {
final traitMap = _stringKeyedMap(map['trait']);
return SORICampaign(
id: (map['id'] ?? map['_id'] ?? '').toString(),
name: (map['name'] ?? map['title'] ?? '').toString(),
description: map['description'] as String?,
imageUrl: (map['imageUrl'] ?? map['image']) as String?,
actionUrl: (map['actionUrl'] ?? map['action_url']) as String?,
createdAt: map['createdAt'] is int ? map['createdAt'] as int : null,
materialId: (map['materialId'] ?? map['material_id']) as String?,
trait: traitMap == null ? null : SORIActivityTrait.fromMap(traitMap),
);
}