addUserMetadata method

void addUserMetadata(
  1. String key,
  2. Uint8List userMetadata
)

Save arbitrary binary user metadata into the current log.

Attach a binary blob under the provided string key. Call before stopping the recording so the data is included in the saved log.

Parameters

  • key: The string identifier for the metadata entry.
  • userMetadata: Binary data to store (as Uint8List).

See also:

Implementation

void addUserMetadata(final String key, final Uint8List userMetadata) {
  final dynamic dataBufferPointer = GemKitPlatform.instance.toNativePointer(
    userMetadata,
  );
  objectMethod(
    pointerId,
    'Recorder',
    'addUserMetadata',
    args: <String, dynamic>{
      'key': key,
      'dataBuffer': dataBufferPointer.address,
      'dataBufferSize': userMetadata.length,
    },
  );

  GemKitPlatform.instance.freeNativePointer(dataBufferPointer);
}