BackgroundType class sealed
This object describes the type of a background.
- Available extensions
- Annotations
-
- @Freezed.new(unionKey: 'type', unionValueCase: FreezedUnionCase.snake)
Constructors
- BackgroundType.chatTheme({@JsonKey.new(name: 'type') @Default.new(BackgroundTypeType.chatTheme) BackgroundTypeType type, @JsonKey.new(name: 'theme_name') required String themeName})
-
The background is taken directly from a built-in chat theme.
constfactory
- BackgroundType.fill({@JsonKey.new(name: 'type') @Default.new(BackgroundTypeType.fill) BackgroundTypeType type, @JsonKey.new(name: 'fill') required BackgroundFill fill, @JsonKey.new(name: 'dark_theme_dimming') @Default.new(0) int darkThemeDimming})
-
The background is automatically filled based on the selected colors.
constfactory
-
BackgroundType.fromJson(Map<
String, Object?> json) -
Create the BackgroundType instance from JSON Map
factory
- BackgroundType.pattern({@JsonKey.new(name: 'type') @Default.new(BackgroundTypeType.pattern) BackgroundTypeType type, @JsonKey.new(name: 'document') required Document document, @JsonKey.new(name: 'fill') required BackgroundFill fill, @JsonKey.new(name: 'intensity') @Default.new(0) int intensity, @JsonKey.new(name: "is_inverted") bool? isInverted, @JsonKey.new(name: "is_moving") bool? isMoving})
-
The background is a .PNG or .TGV (gzipped subset of SVG with MIME type
“application/x-tgwallpattern”) pattern to be combined with the background
fill chosen by the user.
constfactory
- BackgroundType.wallpaper({@JsonKey.new(name: 'type') @Default.new(BackgroundTypeType.wallpaper) BackgroundTypeType type, @JsonKey.new(name: 'document') required Document document, @JsonKey.new(name: "dark_theme_dimming") @Default.new(0) int darkThemeDimming, @JsonKey.new(name: "is_blurred") bool? isBlurred, @JsonKey.new(name: "is_moving") bool? isMoving})
-
The background is automatically filled based on the selected colors.
constfactory
Properties
-
copyWith
→ $BackgroundTypeCopyWith<
BackgroundType> -
Create a copy of BackgroundType
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 → BackgroundTypeType
-
Type of the background - always fill
no setterinherited
Methods
-
map<
TResult extends Object?> ({required TResult fill(BackgroundTypeFill value), required TResult wallpaper(BackgroundTypeWallpaper value), required TResult pattern(BackgroundTypePattern value), required TResult chatTheme(BackgroundTypeChatTheme value)}) → TResult -
Available on BackgroundType, provided by the BackgroundTypePatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> ({TResult? fill(BackgroundTypeFill value)?, TResult? wallpaper(BackgroundTypeWallpaper value)?, TResult? pattern(BackgroundTypePattern value)?, TResult? chatTheme(BackgroundTypeChatTheme value)?}) → TResult? -
Available on BackgroundType, provided by the BackgroundTypePatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> ({TResult fill(BackgroundTypeFill value)?, TResult wallpaper(BackgroundTypeWallpaper value)?, TResult pattern(BackgroundTypePattern value)?, TResult chatTheme(BackgroundTypeChatTheme value)?, required TResult orElse()}) → TResult -
Available on BackgroundType, provided by the BackgroundTypePatterns extension
A variant ofmapthat fallback to returningorElse. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this BackgroundType to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited