setSecret method Null safety

TransactionBuilder setSecret(
  1. dynamic secret
)

Implementation

TransactionBuilder setSecret(secret) {
  if (!(secret is Uint8List) && !(secret is String)) {
    throw "'secret' must be a string or Uint8List";
  }

  if (secret is String) {
    if (isHex(secret)) {
      secret = hexToUint8List(secret);
    } else {
      secret = Uint8List.fromList(utf8.encode(secret));
    }
  }
  this.data!.keys!.secret = secret;
  return this;
}