audiobookTrackDurations method
The per-track durations the open audiobook navigator resolved, in
reading-order position, in seconds. An entry is null when that track's
duration is neither declared by the manifest nor readable from the audio.
Empty when no audiobook navigator is open, and on iOS, which reads a
track's length as it plays and so resolves nothing up front. Web throws
UnimplementedError, as it does for the rest of the audiobook API.
Implementation
@override
Future<List<double?>> audiobookTrackDurations() async {
final reply = await methodChannel.invokeListMethod<Object?>(
'audiobookTrackDurations',
);
if (reply == null) return const <double?>[];
return [for (final value in reply) (value as num?)?.toDouble()];
}