all method Null safety

List<LicenseRecord> all(
  1. String ptr,
  2. {String? origin}
)

Returns all LicenseRecords for a ptr.

Optionally, an origin may be specified. If null origin defaults to the init origin.

The LicenseRecords returned may be expired or not applicable to a specific LicenseUse. To check license validity, use the guard method.

Implementation

List<LicenseRecord> all(String ptr, {String? origin}) {
  ptr = _hashPtr(ptr);
  TitleModel? title = _titleService.getByPtr(ptr, origin: origin);
  if (title == null) return [];
  List<LicenseModel> licenses = _licenseService.getAll(title.transactionId!);
  return licenses.map((license) => _toLicense(title, license)).toList();
}