fromEntity static method
Implementation
static Future<MemberProfileModel?> fromEntity(
String documentID, MemberProfileEntity? entity) async {
if (entity == null) return null;
var counter = 0;
return MemberProfileModel(
documentID: documentID,
appId: entity.appId ?? '',
feedId: entity.feedId,
authorId: entity.authorId,
profile: entity.profile,
profileOverride: entity.profileOverride,
nameOverride: entity.nameOverride,
accessibleByGroup:
toMemberProfileAccessibleByGroup(entity.accessibleByGroup),
accessibleByMembers: entity.accessibleByMembers,
readAccess: entity.readAccess,
memberMedia: entity.memberMedia == null
? null
: List<MemberMediumContainerModel>.from(
await Future.wait(entity.memberMedia!.map((item) {
counter++;
return MemberMediumContainerModel.fromEntity(
counter.toString(), item);
}).toList())),
);
}