create method Null safety
- Uint8List ownershipId,
- {String? about,
- String? reward,
- 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!;
}