ReactionType class sealed

This object describes the type of a reaction. It can be one of

  • ReactionTypeEmoji
  • ReactionTypeCustomEmoji
  • ReactionTypePaid
Available extensions
Annotations
  • @Freezed.new(fromJson: true, toJson: true, unionKey: 'type', unionValueCase: FreezedUnionCase.snake)

Constructors

ReactionType.customEmoji({@JsonKey.new(name: 'type') @Default.new(ReactionTypeType.customEmoji) ReactionTypeType type, @JsonKey.new(name: 'custom_emoji_id') required String customEmojiId})
Custom emoji reaction
const
factory
ReactionType.emoji({@Default.new(ReactionTypeType.emoji) ReactionTypeType type, @JsonKey.new(name: 'emoji') required String emoji})
Regular emoji reaction
const
factory
ReactionType.fromJson(Map<String, Object?> json)
factory
ReactionType.paid({})
Paid reaction
const
factory

Properties

copyWith → $ReactionTypeCopyWith<ReactionType>
Create a copy of ReactionType with the given fields replaced by the non-null parameter values.
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
type ReactionTypeType
Type of the reaction, must be "emoji"
no setterinherited

Methods

map<TResult extends Object?>({required TResult emoji(ReactionTypeEmoji value), required TResult customEmoji(ReactionTypeCustomEmoji value), required TResult paid(ReactionTypePaid value)}) → TResult

Available on ReactionType, provided by the ReactionTypePatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? emoji(ReactionTypeEmoji value)?, TResult? customEmoji(ReactionTypeCustomEmoji value)?, TResult? paid(ReactionTypePaid value)?}) → TResult?

Available on ReactionType, provided by the ReactionTypePatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult emoji(ReactionTypeEmoji value)?, TResult customEmoji(ReactionTypeCustomEmoji value)?, TResult paid(ReactionTypePaid value)?, required TResult orElse()}) → TResult

Available on ReactionType, provided by the ReactionTypePatterns extension

A variant of map that fallback to returning orElse.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this ReactionType to a JSON map.
inherited
toString() String
A string representation of this object.
inherited

Operators

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