setUIProgressBar method

Future<void> setUIProgressBar({
  1. Duration? duration,
  2. Duration? progress,
})

Used if the App wants to control itself the Progress Bar on the lock screen.

By default, this progress bar is handled automaticaly by Flutter Sound. Remark setUIProgressBar() is implemented only on iOS.

Example:


        Duration progress = (await getProgress())['progress'];
        Duration duration = (await getProgress())['duration'];
        setUIProgressBar(progress: Duration(milliseconds: progress.milliseconds - 500), duration: duration)

Implementation

Future<void> setUIProgressBar({
  Duration? duration,
  Duration? progress,
}) async {
  await _lock.synchronized(() async {
    await _setUIProgressBar(progress: progress, duration: duration);
  });
}