MediaService class


MediaService({required AbstractTwitterClient client})


client AbstractTwitterClient
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited


metadataCreate() Future<void>
This endpoint can be used to provide additional information about the uploaded mediaId. This feature is currently only supported for images and GIFs.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
subtitlesCreate() Future<void>
Use this endpoint to associate uploaded subtitles to an uploaded video. You can associate subtitles to video before or after Tweeting.
subtitlesDelete() Future<void>
Use this endpoint to dissociate subtitles from a video and delete the subtitles. You can dissociate subtitles from a video before or after Tweeting.
toString() String
A string representation of this object.
uploadAppend({required String mediaId, required List<int> media, required int segmentIndex}) Future<void>
The APPEND command is used to upload a chunk (consecutive byte range) of the media file. For example, a 3 MB file could be split into 3 chunks of size 1 MB, and uploaded using 3 APPEND command requests. After the entire file is uploaded, the next step is to call the FINALIZE command.
uploadFinalize({required String mediaId, TransformResponse<UploadFinalize> transform = defaultUploadFinalizeTransform}) Future<UploadFinalize>
The FINALIZE command should be called after the entire media file is uploaded using APPEND commands. If and (only if) the response of the FINALIZE command contains a UploadFinalize.processinginfo field, it may also be necessary to use a STATUS command and wait for it to return success before proceeding to Tweet creation.
uploadInit({required int totalBytes, required String mediaType, String? mediaCategory, List<String>? additionalOwners, TransformResponse<UploadInit> transform = defaultUploadInitTransform}) Future<UploadInit>
The INIT command request is used to initiate a file upload session. It returns a mediaId which should be used to execute all subsequent requests. The next step after a successful return from INIT command is the APPEND command.
uploadStatus({required String mediaId, TransformResponse<UploadStatus> transform = defaultUploadStatusTransform}) Future<UploadStatus>
The STATUS command is used to periodically poll for updates of media processing operation. After the STATUS command response returns succeeded, you can move on to the next step which is usually create Tweet with mediaId.


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