fromEntity static method

Future<AccessModel?> fromEntity(
  1. String documentID,
  2. AccessEntity? entity
)

Implementation

static Future<AccessModel?> fromEntity(
    String documentID, AccessEntity? entity) async {
  if (entity == null) return null;
  return AccessModel(
    documentID: documentID,
    appId: entity.appId ?? '',
    privilegeLevel: toPrivilegeLevel(entity.privilegeLevel),
    points: entity.points,
    blocked: entity.blocked,
    privilegeLevelBeforeBlocked:
        toPrivilegeLevelBeforeBlocked(entity.privilegeLevelBeforeBlocked),
  );
}