InputStoryContent class sealed

This object describes the content of a story to post. Currently, it can be one of

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

Constructors

InputStoryContent.fromJson(Map<String, dynamic> json)
Creates an instance of InputStoryContent from JSON data
factory
InputStoryContent.photo({@JsonKey.new(name: 'type') @Default.new(StoryContentType.photo) StoryContentType type, @JsonKey.new(name: 'photo') @InputFileConverter() required InputFile photo})
Describes a photo to post as a story.
const
factory
InputStoryContent.video({@JsonKey.new(name: 'type') @Default.new(StoryContentType.video) StoryContentType type, @JsonKey.new(name: 'video') @InputFileConverter() required InputFile video, @JsonKey.new(name: 'duration') double? duration, @JsonKey.new(name: 'cover_frame_timestamp') double? coverFrameTimestamp, @JsonKey.new(name: 'is_animation') bool? isAnimation})
Describes a video to post as a story.
const
factory

Properties

copyWith → $InputStoryContentCopyWith<InputStoryContent>
Create a copy of InputStoryContent with the given fields replaced by the non-null parameter values.
no setterinherited
file InputFile
The InputFile getter
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type StoryContentType
Type of the content, always "photo"
no setterinherited

Methods

map<TResult extends Object?>({required TResult photo(InputStoryContentPhoto value), required TResult video(InputStoryContentVideo value)}) → TResult

Available on InputStoryContent, provided by the InputStoryContentPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? photo(InputStoryContentPhoto value)?, TResult? video(InputStoryContentVideo value)?}) → TResult?

Available on InputStoryContent, provided by the InputStoryContentPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult photo(InputStoryContentPhoto value)?, TResult video(InputStoryContentVideo value)?, required TResult orElse()}) → TResult

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

Operators

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