copyWith method

Supergroup copyWith({
  1. int? id,
  2. Usernames? usernames()?,
  3. int? date,
  4. ChatMemberStatus? status,
  5. int? memberCount,
  6. int? boostLevel,
  7. bool? hasLinkedChat,
  8. bool? hasLocation,
  9. bool? signMessages,
  10. bool? joinToSendMessages,
  11. bool? joinByRequest,
  12. bool? isSlowModeEnabled,
  13. bool? isChannel,
  14. bool? isBroadcastGroup,
  15. bool? isForum,
  16. bool? isVerified,
  17. String? restrictionReason,
  18. bool? isScam,
  19. bool? isFake,
  20. bool? hasActiveStories,
  21. bool? hasUnreadActiveStories,
  22. dynamic extra,
  23. int? clientId,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

Supergroup copyWith({
  int? id,
  Usernames? Function()? usernames,
  int? date,
  ChatMemberStatus? status,
  int? memberCount,
  int? boostLevel,
  bool? hasLinkedChat,
  bool? hasLocation,
  bool? signMessages,
  bool? joinToSendMessages,
  bool? joinByRequest,
  bool? isSlowModeEnabled,
  bool? isChannel,
  bool? isBroadcastGroup,
  bool? isForum,
  bool? isVerified,
  String? restrictionReason,
  bool? isScam,
  bool? isFake,
  bool? hasActiveStories,
  bool? hasUnreadActiveStories,
  dynamic extra,
  int? clientId,
}) =>
    Supergroup(
      id: id ?? this.id,
      usernames: usernames != null ? usernames() : this.usernames,
      date: date ?? this.date,
      status: status ?? this.status,
      memberCount: memberCount ?? this.memberCount,
      boostLevel: boostLevel ?? this.boostLevel,
      hasLinkedChat: hasLinkedChat ?? this.hasLinkedChat,
      hasLocation: hasLocation ?? this.hasLocation,
      signMessages: signMessages ?? this.signMessages,
      joinToSendMessages: joinToSendMessages ?? this.joinToSendMessages,
      joinByRequest: joinByRequest ?? this.joinByRequest,
      isSlowModeEnabled: isSlowModeEnabled ?? this.isSlowModeEnabled,
      isChannel: isChannel ?? this.isChannel,
      isBroadcastGroup: isBroadcastGroup ?? this.isBroadcastGroup,
      isForum: isForum ?? this.isForum,
      isVerified: isVerified ?? this.isVerified,
      restrictionReason: restrictionReason ?? this.restrictionReason,
      isScam: isScam ?? this.isScam,
      isFake: isFake ?? this.isFake,
      hasActiveStories: hasActiveStories ?? this.hasActiveStories,
      hasUnreadActiveStories:
          hasUnreadActiveStories ?? this.hasUnreadActiveStories,
      extra: extra ?? this.extra,
      clientId: clientId ?? this.clientId,
    );