create method Null safety

Future<Uint8List> create(
  1. Uint8List ownershipId,
  2. {String? about,
  3. String? reward,
  4. TikiSdkDestination destinations = const TikiSdkDestination.all()}
)

Modify consent for a OwnershipModel by its ownershipId.

Implementation

Future<Uint8List> create(Uint8List ownershipId,
    {String? about,
    String? reward,
    TikiSdkDestination destinations = const TikiSdkDestination.all()}) async {
  ConsentModel consentModel =
      ConsentModel(ownershipId, destinations, about: about, reward: reward);
  Uint8List contents = consentModel.serialize();
  TransactionModel transaction = await _nodeService.write(contents);
  consentModel.transactionId = transaction.id!;
  _repository.save(consentModel);
  return _repository.getByOwnershipId(ownershipId)!.transactionId!;
}