MediaItem class

One attachment on a content block.

Constructors

MediaItem({required String type, required String name, required String url, double? size, String? alt, String? thumbnail})
Creates an attachment.
const
MediaItem.fromJson(Map<String, dynamic> json)
Reads an attachment off a post's content block.
factory

Properties

alt → String?
Alt text for accessibility.
final
hashCode → int
The hash code for this object.
no setterinherited
name → String
The file name shown in the composer.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → double?
The asset's size in bytes, when the API reported one.
final
thumbnail → String?
A poster frame for a video.
final
type → String
image, video, or gif.
final
url → String
Where the asset lives.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Renders the attachment for a request body.
toString() → String
A string representation of this object.
override

Operators

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