spotify_playback 0.0.6 copy "spotify_playback: ^0.0.6" to clipboard
spotify_playback: ^0.0.6 copied to clipboard

discontinued
outdated

Flutter plugin for using the Spotify Playback library in Flutter. Uses the official Spotify Playback libary.

spotify_playback #

CircleCI

Spotify Playback Plugin.

Getting Started #

Features #

  • Play (track / album / playlist)
  • Play / pause
  • Queue
  • Playback position
  • Seek
  • Play Next
  • Play Previous
  • Repeat
  • Shuffle

Installation #

First, add spotify_playback as a dependency in your pubspec.yaml file.

Then initialize the spotify playback sdk like this

@override
  void initState() {
    super.initState();
    initConnector();
  }

  /// Initialize the spotify playback sdk, by calling spotifyConnect
  Future<void> initConnector() async {
    try {
      await SpotifyPlayback.spotifyConnect(clientId: "", redirectUrl: "").then(
          (connected) {
        if (!mounted) return;
        // If the method call is successful, update the state to reflect this change
        setState(() {
          _connectedToSpotify = connected;
        });
      }, onError: (error) {
        // If the method call trows an error, print the error to see what went wrong
        print(error);
      });
    } on PlatformException {
      print('Failed to connect.');
    }
  }

After this you can use all the available methods

Available methods #

Method description parameters
spotifyConnect Initilizes the spotify playback sdk clientId, redirectUrl
play Play's an spotify track, album or playlist spotify uri
pause Pause's the currently playing track
resume Resumes the currently paused track
queue Adds an track / playlist / album to the queue spotify uri
skipNext Play's the next track
skipPrevious Play's the previous track
seekTo Seeks to the passed time time
toggleShuffle Toggle shuffle options
toggleShuffle Toggle Repeat options
getPlaybackPosition Get's the current tracks playback position

Example #

Demonstrates how to use the spotify_playback plugin.

See the example documentation for more information.

Changelog #

See CHANGELOG.md.

Special Thanks #

Contributing #

Feel free to contribute by opening issues and/or pull requests. Your feedback is very welcome!

License #

MIT License

Copyright (c) [2019] [Joran Dob]

7
likes
0
pub points
0%
popularity

Publisher

verified publisherqreate.io

Flutter plugin for using the Spotify Playback library in Flutter. Uses the official Spotify Playback libary.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on spotify_playback