PlaybackState constructor

PlaybackState({
  1. AudioProcessingState processingState = AudioProcessingState.idle,
  2. bool playing = false,
  3. List<MediaControl> controls = const [],
  4. List<int>? androidCompactActionIndices,
  5. Set<MediaAction> systemActions = const {},
  6. Duration updatePosition = Duration.zero,
  7. Duration bufferedPosition = Duration.zero,
  8. double speed = 1.0,
  9. DateTime? updateTime,
  10. int? errorCode,
  11. String? errorMessage,
  12. AudioServiceRepeatMode repeatMode = AudioServiceRepeatMode.none,
  13. AudioServiceShuffleMode shuffleMode = AudioServiceShuffleMode.none,
  14. bool captioningEnabled = false,
  15. int? queueIndex,
})

Creates a PlaybackState with given field values, and with updateTime defaulting to DateTime.now.

Implementation

PlaybackState({
  this.processingState = AudioProcessingState.idle,
  this.playing = false,
  this.controls = const [],
  this.androidCompactActionIndices,
  this.systemActions = const {},
  this.updatePosition = Duration.zero,
  this.bufferedPosition = Duration.zero,
  this.speed = 1.0,
  DateTime? updateTime,
  this.errorCode,
  this.errorMessage,
  this.repeatMode = AudioServiceRepeatMode.none,
  this.shuffleMode = AudioServiceShuffleMode.none,
  this.captioningEnabled = false,
  this.queueIndex,
})  : assert(androidCompactActionIndices == null ||
          androidCompactActionIndices.length <= 3),
      updateTime = updateTime ?? clock.now();