fromEntityPlus static method

Future<FollowingDashboardModel?> fromEntityPlus(
  1. String documentID,
  2. FollowingDashboardEntity? entity, {
  3. String? appId,
})

Implementation

static Future<FollowingDashboardModel?> fromEntityPlus(
    String documentID, FollowingDashboardEntity? entity,
    {String? appId}) async {
  if (entity == null) return null;

  var counter = 0;
  return FollowingDashboardModel(
    documentID: documentID,
    appId: entity.appId ?? '',
    description: entity.description,
    view: toFollowingView(entity.view),
    memberActions: entity.memberActions == null
        ? null
        : List<MemberActionModel>.from(
            await Future.wait(entity.memberActions!.map((item) {
            counter++;
            return MemberActionModel.fromEntityPlus(counter.toString(), item,
                appId: appId);
          }).toList())),
    conditions: await StorageConditionsModel.fromEntityPlus(entity.conditions,
        appId: appId),
  );
}