EmojiType class sealed

This object describes a regular or a custom emoji. Currently, it can be one of:

  • EmojiTypeEmoji
  • EmojiTypeCustomEmoji
Available extensions
Annotations
  • @Freezed.new(unionKey: 'type', unionValueCase: FreezedUnionCase.snake)

Constructors

EmojiType.customEmoji({@JsonKey.new(name: 'type') @Default.new(EmojiTypeType.customEmoji) EmojiTypeType type, @JsonKey.new(name: 'custom_emoji_id') required String customEmojiId})
A custom emoji.
const
factory
EmojiType.emoji({@JsonKey.new(name: 'type') @Default.new(EmojiTypeType.emoji) EmojiTypeType type, @JsonKey.new(name: 'emoji') required String emoji})
A regular emoji.
const
factory
EmojiType.fromJson(Map<String, dynamic> json)
Creates an EmojiType from JSON.
factory

Properties

copyWith → $EmojiTypeCopyWith<EmojiType>
Create a copy of EmojiType 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 → EmojiTypeType
Type of the emoji, always "emoji"
no setterinherited

Methods

map<TResult extends Object?>({required TResult emoji(EmojiTypeEmoji value), required TResult customEmoji(EmojiTypeCustomEmoji value)}) → TResult

Available on EmojiType, provided by the EmojiTypePatterns extension

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

Available on EmojiType, provided by the EmojiTypePatterns extension

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

Available on EmojiType, provided by the EmojiTypePatterns 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 EmojiType to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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