A new Flutter plugin.
A new Flutter plugin.Spotidy Sdk which handles authorization as well as playing playlist of your choice free.
This project is a starting point for a Flutter Just go to the spotify developers site login and register your application. plug-in package, You just need to follow and prepare your environment from Quick Start . a specialized package that includes platform-specific implementation code for Android
Set redirect uri
as spotify-sdk://auth
and app name as your app name
and android section package name and debug,release fingerprint
in registration.
Your registreation is complete.
you will be provided with client id
.
1 . Download this 2 folder spotify_auth and spotify_app_remote
after click on above folder-name(links) new page opens click > ' Download All ' and unzip them as spotify-auth and spotify-app-remote respectively.
and just move them in your <project-name>/android
folder
2 . Now in your settings.gradle
make sure you add
include 'spotify_auth'
inlcude 'spotify_app_remote'
Done ! , You are ready to create Awesome apps
await Spotifire.init(clientid: "Your client id");
await Spotifire.connectRemote.then(print);
if (await Spotifire.isRemoteConnected)
await Spotifire.playPlaylist(
playlistUri: "spotify:playlist:37i9dQZF1DX3rxVfibe1L0");
if (await Spotifire.isRemoteConnected) await Spotifire.disconnectRemote;
await Spotifire.playPlaylist(
playlistUri: "spotify:playlist:37i9dQZF1DX3rxVfibe1L0");
You can get playlistUrl
from spotify App and convert it easily with Spotifire's getSpotifyUri method passing it
the url and directly play it.without specifically getting the uris from dekstop app.
await Spotifire.playPlaylist(
playlistUri: Spotifire.getSpotifyUri(spotify_url));
await Spotifire.pauseMusic ;
await Spotifire.resumeMusic;
await Spotifire.skipPrevious;
await Spotifire.skipNext;
await Spotifire.seekTo(Duration position);
Spotifire.musicStream.listen((music) {
// print("Music" + music.runtimeType.toString());
if (mounted && music is Music)
setState(() {
_music = music;
});
}).onError((error) {
print(error);
});
Spotifire.positonStream.listen(print)