setUserData method

Future<void> setUserData(
  1. String key,
  2. String value
)

Sets a key-value pair identifier that will be included with this tracker. This identifier can be used to add String types.

The key must be unique across your application. The key namespace is distinct for each user data type. Re-using the same key overwrites the previous value. The key is limited to Instrumentation.maxUserDataStringLength characters.

The value is also limited to Instrumentation.maxUserDataStringLength characters.

Method might throw Exception.

Implementation

Future<void> setUserData(
  String key,
  String value,
) async {
  try {
    final args = {"id": id, "key": key, "value": value};
    await channel.invokeMethod<void>('setRequestTrackerUserData', args);
  } on PlatformException catch (e) {
    throw Exception(e.details);
  }
}