Chat constructor

Chat(
  1. ChatId id, {
  2. ChatAvatar? avatar,
  3. ChatName? name,
  4. List<ChatMember> members = const [],
  5. int kindIndex = 0,
  6. bool isHidden = false,
  7. MuteDuration? muted,
  8. ChatDirectLink? directLink,
  9. PreciseDateTime? createdAt,
  10. PreciseDateTime? updatedAt,
  11. List<LastChatRead> lastReads = const [],
  12. PreciseDateTime? lastDelivery,
  13. ChatItem? firstItem,
  14. ChatItem? lastItem,
  15. ChatItemId? lastReadItem,
  16. int unreadCount = 0,
  17. int totalCount = 0,
  18. ChatCall? ongoingCall,
  19. ChatFavoritePosition? favoritePosition,
  20. int membersCount = 0,
})

Implementation

Chat(
  this.id, {
  this.avatar,
  this.name,
  this.members = const [],
  this.kindIndex = 0,
  this.isHidden = false,
  this.muted,
  this.directLink,
  PreciseDateTime? createdAt,
  PreciseDateTime? updatedAt,
  this.lastReads = const [],
  PreciseDateTime? lastDelivery,
  this.firstItem,
  this.lastItem,
  this.lastReadItem,
  this.unreadCount = 0,
  this.totalCount = 0,
  this.ongoingCall,
  this.favoritePosition,
  this.membersCount = 0,
}) : createdAt = createdAt ?? PreciseDateTime.now(),
     updatedAt = updatedAt ?? PreciseDateTime.now(),
     lastDelivery = lastDelivery ?? PreciseDateTime.now();