fromMap static method
Implementation
static MemberProfileEntity? fromMap(Object? o,
{Map<String, String>? newDocumentIds}) {
if (o == null) return null;
var map = o as Map<String, dynamic>;
var profileBackgroundIdNewDocmentId = map['profileBackgroundId'];
if ((newDocumentIds != null) && (profileBackgroundIdNewDocmentId != null)) {
var profileBackgroundIdOldDocmentId = profileBackgroundIdNewDocmentId;
profileBackgroundIdNewDocmentId = newRandomKey();
newDocumentIds[profileBackgroundIdOldDocmentId] =
profileBackgroundIdNewDocmentId;
}
var memberMediaFromMap = map['memberMedia'];
List<MemberMediumContainerEntity> memberMediaList;
if (memberMediaFromMap != null) {
memberMediaList = (map['memberMedia'] as List<dynamic>)
.map((dynamic item) => MemberMediumContainerEntity.fromMap(
item as Map,
newDocumentIds: newDocumentIds)!)
.toList();
} else {
memberMediaList = [];
}
return MemberProfileEntity(
appId: map['appId'],
feedId: map['feedId'],
authorId: map['authorId'],
profile: map['profile'],
profileBackgroundId: profileBackgroundIdNewDocmentId,
profileOverride: map['profileOverride'],
nameOverride: map['nameOverride'],
accessibleByGroup: map['accessibleByGroup'],
accessibleByMembers: map['accessibleByMembers'] == null
? null
: List.from(map['accessibleByMembers']),
readAccess:
map['readAccess'] == null ? null : List.from(map['readAccess']),
memberMedia: memberMediaList,
);
}