FlutterAudioQuery class

This class provides an interface for access audio data info.

Constructors

FlutterAudioQuery()

Properties

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

Methods

getAlbums({AlbumSortType sortType = AlbumSortType.DEFAULT}) Future<List<AlbumInfo>>
This method returns a list of albums with all albums available in device storage. sortType The type sorting.The default type is AlbumSortType.DEFAULT
getAlbumsById({required List<String> ids, AlbumSortType sortType = AlbumSortType.DEFAULT}) Future<List<AlbumInfo>>
Fetch album by IDs. To return data sorted in the same order that ids appears on ids list parameter use sortType param with AlbumSortType.CURRENT_IDs_ORDER value.
getAlbumsFromArtist({required String artist, AlbumSortType sortType = AlbumSortType.DEFAULT}) Future<List<AlbumInfo>>
This method returns all albums info from a specific artist using his name. artist Artist name must be non null.
getAlbumsFromGenre({required String genre, AlbumSortType sortType = AlbumSortType.DEFAULT}) Future<List<AlbumInfo>>
This method returns a list with all albums that appears on specific genre
getArtists({ArtistSortType sortType = ArtistSortType.DEFAULT}) Future<List<ArtistInfo>>
This method returns all artists info available on device storage
getArtistsById({required List<String> ids, ArtistSortType sortType = ArtistSortType.DEFAULT}) Future<List<ArtistInfo>>
Fetch artist by IDs. To return data sorted in the same order that ids appears on ids list parameter use sortType param with ArtistSortType.CURRENT_IDs_ORDER value.
getArtistsFromGenre({required String genre, ArtistSortType sortType = ArtistSortType.DEFAULT}) Future<List<ArtistInfo>>
This method returns a list with all artists that appears on specific genre.
getArtwork({required ResourceType type, required String id, required Size? size}) Future<Uint8List>
This method fetchs an artowrk for ARSTIS, ALBUM or SONG based on content id. It must be used on Android >= Q as scoped storage does not allow load images using absolute file path.
getGenres({GenreSortType sortType = GenreSortType.DEFAULT}) Future<List<GenreInfo>>
This method returns a list of genre info with all genres available in device storage.
getPlaylists({PlaylistSortType sortType = PlaylistSortType.DEFAULT}) Future<List<PlaylistInfo>>
This method returns a list of PlaylistInfo with all playlists available in device storage.
getSongs({SongSortType sortType = SongSortType.DEFAULT}) Future<List<SongInfo>>
This method returns a list with all songs available on device storage.
getSongsById({required List<String> ids, SongSortType sortType = SongSortType.DEFAULT}) Future<List<SongInfo>>
This method fetch songs by Id. To return data sorted in the same order that ids appears on ids list parameter use sortType param with SongSortType.CURRENT_IDs_ORDER value.
getSongsFromAlbum({required String albumId, SongSortType sortType = SongSortType.DEFAULT}) Future<List<SongInfo>>
This method returns a list of SongInfo with all songs that appears in specifiedalbum. If you want to show all songs that appears on album no matter what artist it belongs you should use this method. But if you have an album that has multiple songs for multiple artists and you wanna fetch only that songs that belongs to an specified artist you should use getSongsFromArtistAlbum call.
getSongsFromArtist({required String artistId, SongSortType sortType = SongSortType.DEFAULT}) Future<List<SongInfo>>
This method returns list with all songs info from a specific artist. using his name. artistId Artist id must be non null
getSongsFromArtistAlbum({required String albumId, required String artist, SongSortType sortType = SongSortType.DEFAULT}) Future<List<SongInfo>>
This method should be used when we want to fetch artist specific songs that appears in album. Sometimes we can have an album with multiple artists songs if make senses show only the songs for a specific artist that appears on album so this is the appropriated method. If you want to show all songs that appears on album no matter what artist it belongs you should use getSongsFromAlbum method.
getSongsFromGenre({required String genre, SongSortType sortType = SongSortType.DEFAULT}) Future<List<SongInfo>>
This method returns a list fo songs info which all songs are from specified genre name.
getSongsFromPlaylist({required PlaylistInfo playlist}) Future<List<SongInfo>>
This method return a List with SongInfo instances that appears in playlist. The song order is the same that the playlist defines. An empty list is returned if the playlist has no songs.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
searchAlbums({required String query, AlbumSortType sortType = AlbumSortType.DEFAULT}) Future<List<AlbumInfo>>
This method search for Albums which album title property starts or match with query param. It returns a List of AlbumInfo instances or an empty list if no results.
searchArtists({required String query, ArtistSortType sortType = ArtistSortType.DEFAULT}) Future<List<ArtistInfo>>
This method search for artists which name property starts or match with query param. It returns a List of ArtistInfo instances or an empty list if no results.
searchGenres({required String query, GenreSortType sortType = GenreSortType.DEFAULT}) Future<List<GenreInfo>>
This method search for genres which name property starts or match with query param. It returns a List of GenreInfo instances or an empty list if no results.
searchPlaylists({required String query, PlaylistSortType sortType = PlaylistSortType.DEFAULT}) Future<List<PlaylistInfo>>
This method search for playlist which name property starts or match with query param. It returns a List of PlaylistInfo instances or an empty list if no results.
searchSongs({required String query, SongSortType sortType = SongSortType.DEFAULT}) Future<List<SongInfo>>
This method search for songs which title property starts or match with query string. It returns a List of SongInfo objects or an empty list if no results.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

createPlaylist({required String playlistName}) Future<PlaylistInfo>
This method creates a new empty playlist named playlistName. If already exist a playlist with same name as playlistName an exception is throw.
removePlaylist({required PlaylistInfo playlist}) Future<void>
Removes an specific playlist. playlist playlist to be removed.

Constants

channel → const MethodChannel
PLAYLIST_METHOD_TYPE → const String
QUERY_KEY → const String
SORT_TYPE → const String
SOURCE_ALBUM → const String
SOURCE_ARTIST → const String
SOURCE_ARTWORK → const String
SOURCE_GENRE → const String
SOURCE_KEY → const String
key used for delegate type param.
SOURCE_PLAYLIST → const String
SOURCE_SONGS → const String