NotificationService class

Note: this is an iOS only feature (so far). Does not work with android/ web/macOS.

This bundles together all the notification related features from AP.

Constructors

NotificationService(Future<void> platformChannelInvoke(String, Map<String, dynamic>))

Properties

hashCode int
The hash code for this object.
no setterinherited
onPlayerCommand Stream<PlayerControlCommand>
Stream of remote player command sent by native side
no setter
platformChannelInvoke Future<void> Function(String, Map<String, dynamic>)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearNotification() Future<void>
dispose() Future<void>
monitorStateChanges(void callback(PlayerState value)) Future<void>
Start getting significant audio updates through callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyNextTrack() → void
notifyPreviousTrack() → void
setNotification({String title = '', String albumTitle = '', String artist = '', String imageUrl = '', Duration forwardSkipInterval = Duration.zero, Duration backwardSkipInterval = Duration.zero, Duration duration = Duration.zero, Duration elapsedTime = Duration.zero, bool enablePreviousTrackButton = false, bool enableNextTrackButton = false}) Future<void>
Sets the notification bar for lock screen and notification area in iOS for now.
startHeadlessService() Future<void>
This should be called after initiating AudioPlayer only if you want to listen for notification changes in the background.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

enableNotificationService bool
Enable the notifications feature. This is a global toggle.
getter/setter pair