RawPFile.ofFile constructor

RawPFile.ofFile(
  1. String? path,
  2. PFileToByteStream _readStreamFactory,
  3. int? _size, {
  4. SafeCompleter? completer,
})

This constructor is more low-level because we can't pull in any file dependencies into this code

Implementation

RawPFile.ofFile(
  this.path,
  this._readStreamFactory,
  this._size, {
  SafeCompleter? completer,
})  : _read = completer == null ? null : SafeCompleter.stopped(),
      name = path!.split("/").last {
  if (completer != null) {
    _read!.start();
    completer.future.whenComplete(() {
      _read!.complete(this);
    });
  }
}