PaidMedia class sealed

This object describes paid media. It can be one of

  • PaidMediaPreview
  • PaidMediaPhoto
  • PaidMediaVideo
Annotations
  • @Freezed(unionKey: 'type', unionValueCase: FreezedUnionCase.snake)

Constructors

PaidMedia.fromJson(Map<String, dynamic> json)
Creates Paid Media from JSON
factory
PaidMedia.photo({@Default(PaidMediaType.photo) @JsonKey(name: 'type') PaidMediaType type, @JsonKey(name: 'photo') required List<PhotoSize> photo})
Photo paid media
const
factory
PaidMedia.preview({@Default(PaidMediaType.preview) @JsonKey(name: 'type') PaidMediaType type, @JsonKey(name: 'width') int? width, @JsonKey(name: 'height') int? height, @JsonKey(name: 'duration') int? duration})
Preview of paid media
const
factory
PaidMedia.video({@Default(PaidMediaType.video) @JsonKey(name: 'type') PaidMediaType type, @JsonKey(name: 'video') required Video video})
Video paid media
const
factory

Properties

copyWith → $PaidMediaCopyWith<PaidMedia>
Create a copy of PaidMedia 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 PaidMediaType
Type of the paid media, must be "preview"
no setterinherited

Methods

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

Operators

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