trackCustomVariable method

Future<String> trackCustomVariable({
  1. required int index,
  2. required String name,
  3. required String value,
  4. required CustomVariableScope scope,
})

Implementation

Future<String> trackCustomVariable(
    {required int index,
    required String name,
    required String value,
    required CustomVariableScope scope}) async {
  var arguments = <String, dynamic>{};
  arguments['index'] = index;
  arguments['name'] = name;
  arguments['value'] = value;
  if (scope == CustomVariableScope.action) {
    arguments['scope'] = 'action';
  } else if (scope == CustomVariableScope.visit) {
    arguments['scope'] = 'visit';
  }

  final result = await _channel.invokeMethod(trackCustomVariableName, arguments);
  return result;
}