fromEntity static method

Future<MembershipDashboardModel?> fromEntity(
  1. String documentID,
  2. MembershipDashboardEntity? entity
)

Implementation

static Future<MembershipDashboardModel?> fromEntity(
    String documentID, MembershipDashboardEntity? entity) async {
  if (entity == null) return null;
  var counter = 0;
  return MembershipDashboardModel(
    documentID: documentID,
    appId: entity.appId ?? '',
    description: entity.description,
    memberActions: entity.memberActions == null
        ? null
        : List<MemberActionModel>.from(
            await Future.wait(entity.memberActions!.map((item) {
            counter++;
            return MemberActionModel.fromEntity(counter.toString(), item);
          }).toList())),
    conditions: await StorageConditionsModel.fromEntity(entity.conditions),
  );
}