RoomPreferences class abstract

The current user's private preferences for a room: notification mute, pin-to-top, and hide-from-list.

These are per-user and never visible to other members. Returned by ChatRoomsApi.patchPreferences as the merged server-side state after a partial update, and embedded in RoomDetail for the room info panel.

Available extensions
Annotations
  • @freezed

Constructors

RoomPreferences({@Default.new(false) bool muted, @Default.new(false) bool pinned, @Default.new(false) bool hidden, DateTime? muteUntil})
const
factory

Properties

copyWith → $RoomPreferencesCopyWith<RoomPreferences>
Create a copy of RoomPreferences with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hidden bool
Whether the room is hidden (WhatsApp-style "archive") from the list.
no setterinherited
muted bool
Whether room notifications are silenced. For a timed mute this is true until muteUntil passes; the backend derives it server-side.
no setterinherited
muteUntil DateTime?
When a timed mute expires (UTC). null means a permanent mute (when muted is true) or no mute at all (when muted is false).
no setterinherited
pinned bool
Whether the room is pinned to the top of the room list.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_RoomPreferences value)) → TResult

Available on RoomPreferences, provided by the RoomPreferencesPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_RoomPreferences value)?) → TResult?

Available on RoomPreferences, provided by the RoomPreferencesPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_RoomPreferences value)?, {required TResult orElse()}) → TResult

Available on RoomPreferences, provided by the RoomPreferencesPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(bool muted, bool pinned, bool hidden, DateTime? muteUntil)?, {required TResult orElse()}) → TResult

Available on RoomPreferences, provided by the RoomPreferencesPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(bool muted, bool pinned, bool hidden, DateTime? muteUntil)) → TResult

Available on RoomPreferences, provided by the RoomPreferencesPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(bool muted, bool pinned, bool hidden, DateTime? muteUntil)?) → TResult?

Available on RoomPreferences, provided by the RoomPreferencesPatterns extension

A variant of when that fallback to returning null

Operators

operator ==(Object other) bool
The equality operator.
inherited