SpotikitPlatform class abstract

The interface that implementations of spotikit must implement.

Platform implementations should extend this class rather than implement it as spotikit does not consider newly added methods to be breaking changes. Extending this class ensures that the subclass will get the default implementation, while platform implementations that merely implement the interface will be broken by newly added methods.

Inheritance
  • Object
  • PlatformInterface
  • SpotikitPlatform
Implementers

Constructors

SpotikitPlatform()
Constructs a SpotikitPlatform.

Properties

accessTokenStream Stream<String?>
Stream of access tokens from the native platform.
no setter
authStateStream Stream<AuthState>
Stream of authentication state updates from the native platform.
no setter
hashCode int
The hash code for this object.
no setterinherited
playbackStateStream Stream<SpotifyPlaybackState>
Stream of playback state updates from the native platform.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

authenticateSpotify() Future<bool>
Initiates the Spotify OAuth authentication flow.
connectToSpotify() Future<bool>
Connects to the Spotify App Remote.
disconnect() Future<void>
Disconnects from the Spotify App Remote.
getAccessToken() Future<String?>
Retrieves the current access token.
getPlayingTrackInfo() Future<SpotifyTrackInfo?>
Gets basic information about the currently playing track.
initialize({required String clientId, required String redirectUri, required String clientSecret, required String scope, required bool authenticate, required bool connectToRemote}) Future<void>
Initializes the Spotikit plugin with the required configuration.
isPlaying() Future<bool>
Checks if music is currently playing.
logout() Future<void>
Logs out from Spotify and disconnects the App Remote.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() Future<void>
Pauses the current playback.
playUri({required String spotifyUri}) Future<void>
Plays the specified Spotify URI.
previousTrack() Future<void>
Goes back to the previous track.
resume() Future<void>
Resumes the current playback.
seekTo({required int positionMs}) Future<void>
Seeks to the specified position in the current track.
skipBackward({int seconds = 5}) Future<void>
Skips backward by the specified number of seconds.
skipForward({int seconds = 5}) Future<void>
Skips forward by the specified number of seconds.
skipTrack() Future<void>
Skips to the next track.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance SpotikitPlatform
The default instance of SpotikitPlatform to use.
getter/setter pair