toEntity method

  1. @override
ChatEntity toEntity({
  1. String? appId,
})
override

Implementation

@override
ChatEntity toEntity({String? appId}) {
  return ChatEntity(
    authorId: authorId,
    appId: appId,
    roomId: (roomId != null) ? roomId : null,
    timestamp: (timestamp == null) ? null : timestamp!.millisecondsSinceEpoch,
    saying: (saying != null) ? saying : null,
    accessibleByGroup:
        (accessibleByGroup != null) ? accessibleByGroup!.index : null,
    accessibleByMembers:
        (accessibleByMembers != null) ? accessibleByMembers : null,
    readAccess: (readAccess != null) ? readAccess : null,
    chatMedia: (chatMedia != null)
        ? chatMedia!.map((item) => item.toEntity(appId: appId)).toList()
        : null,
  );
}