currentPosition property

  1. @override
Future<double?> get currentPosition
override

Retrieves the current playback position of the audio.

This method sends a request to the platform to retrieve the current playback position of the currently playing audio.

Implementation

@override
Future<double?> get currentPosition async {
  try {
    return await methodChannel.invokeMethod<double>('currentPosition') ?? 0;
  } on PlatformException catch (e) {
    log("Failed to seekTo: '${e.message}'.");
    return null;
  }
}