spotify 0.2.1 copy "spotify: ^0.2.1" to clipboard
spotify: ^0.2.1 copied to clipboard

outdated

An incomplete dart library for interfacing with the Spotify Web API.

spotify-dart Pub Build Status #

A dart library for interfacing with the Spotify API.

Usage #

A simple usage example:

import 'package:spotify/spotify_io.dart';

main() async {
  var credentials = new SpotifyApiCredentials(clientId, clientSecret);
  var spotify = new SpotifyApi(credentials);

  var artist = await spotify.artists.get('0OdUWJ0sBjDrqHygGUXeCF');
}

For usage in the browser use #

import 'package:spotify/spotify_browser.dart';

Client Credentials Flow #

SpotifyApi getSpotifyApi() {
  final credentials = new SpotifyApiCredentials(clientId, clientSecret);
  return new SpotifyApi(credentials);
}

Authorization Code #

SpotifyApi getSpotifyApi() async {
  final credentials = new SpotifyApiCredentials(clientId, clientSecret);
  grant = SpotifyApi.authorizationCodeGrant(credentials);
  // *** from dart-lang/oauth2 package
  // `redirect` is an imaginary function that redirects the resource
  // owner's browser.
  await redirect(grant.getAuthorizationUrl(redirectUrl));
  // Another imaginary function that listens for a request to `redirectUrl`.
  final requestUri = await listen(redirectUrl);
  // ***
  return SpotifyApi.fromAuthCodeGrant(WelcomeScreen.grant, requestUri);
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Development #

Generating JSON Serializers #

Run pub run build_runner build to generate JSON serilizers via json_serializable.

89
likes
0
pub points
94%
popularity

Publisher

unverified uploader

An incomplete dart library for interfacing with the Spotify Web API.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http, json_annotation, oauth2

More

Packages that depend on spotify