handleMethodCall method

Future handleMethodCall(
  1. MethodCall call
)

Implementation

Future<dynamic> handleMethodCall(MethodCall call) async {
  switch (call.method) {
    case 'initWithClientToken':
      logger.init(call);
      if (call.arguments['webRumApplicationId'] != null) {
        rum.init(call);
      }

      return true;
    // tracing is handled natively on the browser
    case 'tracingCreateHeadersForRequest':
      return {};
    case 'tracingInitialize':
      return false;
    case 'tracingFinishSpan':
      return true;
    // trackingConsent is handled by `site:` on the browser
    case 'updateTrackingConsent':
      return false;

    default:
      final result =
          logger.handleMethodCall(call) ?? rum.handleMethodCall(call);
      if (result != null) return result;
      throw PlatformException(
        code: 'Unimplemented',
        details:
            "The datadog_flutter plugin for web doesn't implement '${call.method}'",
      );
  }
}