startTrace static method

Future<String?> startTrace(
  1. String traceKey
)

record duration of application processes returns error or success message

Implementation

static Future<String?> startTrace(String traceKey) async {
  if (!_instance._countlyState.isInitialized) {
    String message = '"initWithConfig" must be called before "startTrace"';
    log('startTrace, $message', logLevel: LogLevel.ERROR);
    return message;
  }
  log('Calling "startTrace":[$traceKey]');
  List<String> args = [];
  args.add(traceKey);

  final String? result = await _channel.invokeMethod('startTrace', <String, dynamic>{'data': json.encode(args)});

  return result;
}