ChatShareTheme class sealed

This object describes the theme of the screen for sharing a link to a user or a chat. Currently, it can be one of:

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

Constructors

ChatShareTheme.emoji({@JsonKey.new(name: 'type') @Default.new(ChatShareThemeType.emoji) ChatShareThemeType type, @JsonKey.new(name: 'emojis') required List<EmojiType> emojis, @JsonKey.new(name: 'background_backdrop_id') int? backgroundBackdropId})
The theme is based on regular or custom emoji.
const
factory
ChatShareTheme.fromJson(Map<String, dynamic> json)
Creates a ChatShareTheme from JSON.
factory
ChatShareTheme.uniqueGift({@JsonKey.new(name: 'type') @Default.new(ChatShareThemeType.uniqueGift) ChatShareThemeType type, @JsonKey.new(name: 'gift') required UniqueGift gift})
The theme is based on a unique gift.
const
factory

Properties

copyWith → $ChatShareThemeCopyWith<ChatShareTheme>
Create a copy of ChatShareTheme 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 → ChatShareThemeType
Type of the theme, always "emoji"
no setterinherited

Methods

map<TResult extends Object?>({required TResult emoji(ChatShareThemeEmoji value), required TResult uniqueGift(ChatShareThemeUniqueGift value)}) → TResult

Available on ChatShareTheme, provided by the ChatShareThemePatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? emoji(ChatShareThemeEmoji value)?, TResult? uniqueGift(ChatShareThemeUniqueGift value)?}) → TResult?

Available on ChatShareTheme, provided by the ChatShareThemePatterns extension

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

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

Operators

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