fromEntityPlus static method

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

Implementation

static Future<PostLikeModel?> fromEntityPlus(
    String documentID, PostLikeEntity? entity,
    {String? appId}) 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),
  );
}