MediaLibraryItem class

An entry in the browsable media library that media browsers such as Android Auto show.

A library is a tree: the browser first asks for the children of MediaLibraryItem.rootId, then for the children of any item that isBrowsable. Picking an item that isPlayable arrives as a MediaAction.playFromMediaId action carrying its id.

Constructors

MediaLibraryItem({required String id, required String title, String? subtitle, String? artworkUri, bool isBrowsable = false, bool isPlayable = true})
Creates a library entry. By default it is a playable item, not a folder.
const

Properties

artworkUri → String?
Optional artwork, as a content://, file:// or https:// URI.
final
hashCode → int
The hash code for this object.
no setteroverride
id → String
Unique within the library. Passed back in MediaAction.playFromMediaId and in requests for this item's children.
final
isBrowsable → bool
Whether the item has children to browse (a folder).
final
isPlayable → bool
Whether picking the item starts playback.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subtitle → String?
An optional second line (for example an artist, or a chapter).
final
title → String
The main line shown for the item.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this item to a JSON map for the platform side.
toString() → String
A string representation of this object.
override

Operators

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

Constants

rootId → const String
The id the browser asks for first; its children are the library's top level.