PlaybackState constructor
PlaybackState({
- AudioProcessingState processingState = AudioProcessingState.idle,
- bool playing = false,
- List<
MediaControl> controls = const [], - List<
int> ? androidCompactActionIndices, - Set<
MediaAction> systemActions = const {}, - Duration updatePosition = Duration.zero,
- Duration bufferedPosition = Duration.zero,
- double speed = 1.0,
- DateTime? updateTime,
- int? errorCode,
- String? errorMessage,
- AudioServiceRepeatMode repeatMode = AudioServiceRepeatMode.none,
- AudioServiceShuffleMode shuffleMode = AudioServiceShuffleMode.none,
- 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();