takeFromMap method
Used for meta-forms in setting deep properties
Implementation
@override
void takeFromMap(Map<String, dynamic>? from, {bool copyEntries = true}) {
if (from == null) return;
super.takeFromMap(from, copyEntries: copyEntries);
for (final entry in from.entries) {
final key = entry.key;
final value = entry.value;
if (value == null) continue;
switch (key) {
case "startDate":
_startDate = value as FlexiDate;
break;
case "endDate":
_endDate = value as FlexiDate;
break;
case "phaseKey":
_phaseKey = value as String;
break;
case "name":
_name = value as String;
break;
case "description":
_description = value as String;
break;
case "mainPhoto":
_mainPhoto = IImageContent.fromJson(value);
break;
case "photos":
_photos = toList(value, (item) => IImageContent.fromJson(item));
break;
case "videos":
_videos = toList(value, (item) => IVideoContent.fromJson(item));
break;
case "location":
_location = IPhysicalLocation.fromJson(value);
break;
default:
break;
}
}
}