seek method

Future<int> seek({
  1. required int position,
  2. SeekFlag flags = const SeekFlag(SeekFlag.defaultFlags),
})

Implementation

Future<int> seek(
    {required int position,
    SeekFlag flags = const SeekFlag(SeekFlag.defaultFlags)}) async {
  if (!(_seeked?.isCompleted ?? true)) {
    _seeked?.complete(-2);
  }
  _seeked = Completer<int>();
  if (!Libfvp.seek(nativeHandle, position, flags.rawValue,
      NativeApi.postCObject.cast(), _receivePort.sendPort.nativePort)) {
    _seeked!.complete(-10);
  }
  return _seeked!.future;
}