MediaItem class

Metadata about an audio item that can be played, or a folder containing audio items.

Constructors

MediaItem({@required String id, @required String album, @required String title, String artist, String genre, Duration duration, String artUri, bool playable: true, String displayTitle, String displaySubtitle, String displayDescription, Rating rating, Map<String, dynamic> extras})
Creates a MediaItem. [...]
const
MediaItem.fromJson(Map raw)
Creates a MediaItem from a map of key/value pairs corresponding to fields of this class.
factory

Properties

album String
The album this media item belongs to.
final
artist String
The artist of this media item.
final
artUri String
The artwork for this media item as a uri.
final
displayDescription String
Override the default description for display purposes.
final
displaySubtitle String
Override the default subtitle for display purposes.
final
displayTitle String
Override the default title for display purposes.
final
duration Duration
The duration of this media item.
final
extras Map<String, dynamic>
A map of additional metadata for the media item. [...]
final
genre String
The genre of this media item.
final
hashCode int
The hash code for this object. [...]
read-only, override
id String
A unique id.
final
playable bool
Whether this is playable (i.e. not a folder).
final
rating Rating
The rating of the MediaItem.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
title String
The title of this media item.
final

Methods

copyWith({String id, String album, String title, String artist, String genre, Duration duration, String artUri, bool playable, String displayTitle, String displaySubtitle, String displayDescription, Rating rating, Map extras}) MediaItem
Creates a copy of this MediaItem but with with the given fields replaced by new values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toJson() Map<String, dynamic>
Converts this MediaItem to a map of key/value pairs corresponding to the fields of this class.
toString() String
Returns a string representation of this object.
override

Operators

operator ==(dynamic other) bool
The equality operator. [...]
override