nexus/lib/models/paginate.dart
2026-10-21 22:58:06 -04:00

23 lines
774 B
Dart

import "package:fast_immutable_collections/fast_immutable_collections.dart";
import "package:freezed_annotation/freezed_annotation.dart";
import "package:nexus/models/event.dart";
import "package:nexus/models/read_receipt.dart";
part "paginate.freezed.dart";
part "paginate.g.dart";
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const Paginate({
required final IList<Event> events,
required final IList<Event> relatedEvents,
/// Read receipts for the events, by event ID.
final IMap<String, IList<ReadReceipt>> receipts = const .empty(),
required final bool hasMore,
}) with _$Paginate {
Map<String, Object?> toJson() => _$PaginateToJson(this);
factory Paginate.fromJson(Map<String, Object?> json) =>
_$PaginateFromJson(json);
}