toStrongRef method

StrongRef toStrongRef()

Returns the StrongRef representation of this record.

Throws StateError if this record has not strong ref.

Implementation

StrongRef toStrongRef() {
  if (hasNotStrongRef) {
    throw StateError(
      'This record has not strong ref. '
      'Check with "hasStrongRef" or "hasNotStrongRef."',
    );
  }

  return StrongRef(cid: cid!, uri: uri);
}