PlaybackEvent default constructor parameters.

This commit is contained in:
Ryan Heise 2020-12-12 00:35:02 +11:00
parent 7a125149d9
commit fb7d33f0c6
1 changed files with 10 additions and 20 deletions

View File

@ -78,17 +78,7 @@ class AudioPlayer {
AudioPlayer._internal(this._id, bool handleInterruptions)
: _platform = _init(_id) {
_playbackEvent = PlaybackEvent(
processingState: ProcessingState.none,
updatePosition: Duration.zero,
updateTime: DateTime.now(),
bufferedPosition: Duration.zero,
duration: null,
icyMetadata: null,
currentIndex: null,
androidAudioSessionId: null,
);
_playbackEventSubject.add(_playbackEvent);
_playbackEventSubject.add(_playbackEvent = PlaybackEvent());
_processingStateSubject.addStream(playbackEventStream
.map((event) => event.processingState)
.distinct()
@ -851,15 +841,15 @@ class PlaybackEvent {
final int androidAudioSessionId;
PlaybackEvent({
@required this.processingState,
@required this.updateTime,
@required this.updatePosition,
@required this.bufferedPosition,
@required this.duration,
@required this.icyMetadata,
@required this.currentIndex,
@required this.androidAudioSessionId,
});
this.processingState = ProcessingState.none,
DateTime updateTime,
this.updatePosition = Duration.zero,
this.bufferedPosition = Duration.zero,
this.duration,
this.icyMetadata,
this.currentIndex,
this.androidAudioSessionId,
}) : this.updateTime = updateTime ?? DateTime.now();
PlaybackEvent copyWith({
ProcessingState processingState,