fromEntity static method

Future<PostLikeModel?> fromEntity(
  1. String documentID,
  2. PostLikeEntity? entity
)

Implementation

static Future<PostLikeModel?> fromEntity(
    String documentID, PostLikeEntity? entity) async {
  if (entity == null) return null;
  return PostLikeModel(
    documentID: documentID,
    postId: entity.postId ?? '',
    postCommentId: entity.postCommentId,
    memberId: entity.memberId ?? '',
    timestamp: entity.timestamp == null
        ? null
        : DateTime.fromMillisecondsSinceEpoch((entity.timestamp as int)),
    appId: entity.appId ?? '',
    likeType: toLikeType(entity.likeType),
  );
}