MEphemeral class abstract
Represents the ephemeral events of a room.
The events field contains a list of ephemeral events.
This class corresponds to the ephemeral object defined in the Matrix API specification. For more details, refer to the API documentation at https://matrix.org/docs/spec/client_server/latest#ephemeral-object.
To create an instance of Ephemeral, use the provided factory constructors or the fromJson method.
It is also possible to create an initial instance of Ephemeral using the initial factory constructor.
Example usage:
final ephemeral = Ephemeral.fromJson(jsonData);
final events = ephemeral.events;
- Available extensions
- Annotations
-
- @Freezed.new(makeCollectionsUnmodifiable: false)
Constructors
-
MEphemeral({@JsonKey.new(name: 'events') List<
MMessage?> ? events}) -
Creates an MEphemeral instance.
factory
-
MEphemeral.fromJson(Map<
String, dynamic> json) -
Creates an MEphemeral instance from a JSON map.
factory
- MEphemeral.initial()
-
Creates an initial MEphemeral instance.
factory
Properties
-
copyWith
→ $MEphemeralCopyWith<
MEphemeral> -
Create a copy of MEphemeral
with the given fields replaced by the non-null parameter values.
no setterinherited
-
events
→ List<
MMessage?> ? -
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_MEphemeral value)) → TResult -
Available on MEphemeral, provided by the MEphemeralPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_MEphemeral value)?) → TResult? -
Available on MEphemeral, provided by the MEphemeralPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_MEphemeral value)?, {required TResult orElse()}) → TResult -
Available on MEphemeral, provided by the MEphemeralPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(List< MMessage?> ? events)?, {required TResult orElse()}) → TResult -
Available on MEphemeral, provided by the MEphemeralPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this MEphemeral to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(List< MMessage?> ? events)) → TResult -
Available on MEphemeral, provided by the MEphemeralPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(List< MMessage?> ? events)?) → TResult? -
Available on MEphemeral, provided by the MEphemeralPatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited