background_runtime_platform_interface

Platform interface for the background_runtime Flutter plugin.

Defines the Dart API contracts, models, and method channel communication used by all platform implementations.

Do not depend directly on this package. Use background_runtime for the high-level API.

Models

  • BackgroundRuntimeConfig — Configuration flags (downloads, audio, notifications, foreground service).
  • DownloadRequest / DownloadEvent — Download lifecycle (pending → downloading → completed/failed/cancelled).
  • AudioTrack — Audio source with albumArt (Uri?) for lock screen / notification artwork.
  • PlayerState — Playback state with position, duration, track ID.
  • NotificationAction — User-triggered actions (previousAudio, nextAudio, playAudio, pauseAudio, stopAudio, etc.).
  • RuntimeLifecycle — Plugin lifecycle events.
  • Typed exceptions: DownloadFailedException, StorageUnavailableException, etc.

Channels

Direction Channel Description
Dart → Native dev.mixin27.background_runtime/method Commands (initialize, download, play, shutdown)
Native → Dart dev.mixin27.background_runtime/downloadEvents Download progress stream
Native → Dart dev.mixin27.background_runtime/playerState Audio playback state stream
Native → Dart dev.mixin27.background_runtime/lifecycleEvents Lifecycle event stream
Native → Dart dev.mixin27.background_runtime/notificationActionEvents Notification/media action stream