position property

  1. @override
double get position
override

Get the position of generator.

If generator is not a BufferGenerator, StateError will be thrown.

Implementation

@override
double get position {
  checkDeadSound();
  final g = generator;
  if (g is BufferGenerator) {
    return g.playbackPosition.value;
  }
  throw StateError('Cannot get the playback position for $g.');
}
  1. @override
set position (double value)
override

Set the position of generator.

If generator is not a BufferGenerator, StateError will be thrown.

Implementation

@override
set position(final double value) {
  checkDeadSound();
  final g = generator;
  if (g is BufferGenerator) {
    g.playbackPosition.value = value;
  } else {
    throw StateError('Cannot set the playback position of $g.');
  }
}