getConsent method Null safety

ConsentModel? getConsent(
  1. String source,
  2. {String? origin}
)

Gets latest consent given for a source and origin.

It does not validate if the consent is expired or if it can be applied to a specifi destination. For that, applyConsent should be used instead.

Implementation

ConsentModel? getConsent(String source, {String? origin}) {
  OwnershipModel? ownershipModel =
      _ownershipService.getBySource(source, origin: origin);
  if (ownershipModel == null) return null;
  return _consentService.getByOwnershipId(ownershipModel.transactionId!);
}