modify method Null safety

Future<ConsentModel> modify(
  1. Uint8List ownershipId,
  2. {String? about,
  3. String? reward,
  4. DateTime? expiry,
  5. TikiSdkDestination destination = const TikiSdkDestination.all()}
)

Modify consent by its ownershipId.

Implementation

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