anchor.diff:    );
   }
   
  +// This cannot be a factory constructor in the [GtagExceptionDevTools] class due to
  +// https://github.com/dart-lang/sdk/issues/46967.
  +GtagExceptionDevTools _gtagException(
  +  String errorMessage, {
  +  bool fatal = false,
  +  ScreenAnalyticsMetrics screenMetrics,
  +}) {
  +  return GtagExceptionDevTools(
  +    description: errorMessage,
  +    fatal: fatal,
  +    user_app: userAppType,
  +    user_build: userBuildType,
  +    user_platform: userPlatformType,
  +    devtools_platform: devtoolsPlatformType,
  +    devtools_chrome: devtoolsChrome,
  +    devtools_version: devtoolsVersion,
  +    ide_launched: ideLaunched,
  +    flutter_client_id: flutterClientId,
  +    is_external_build: isExternalBuild,
  +    is_embedded: ideTheme.embed,
  +    ui_duration_micros: screenMetrics is PerformanceScreenMetrics
  +        ? screenMetrics.uiDuration?.inMicroseconds
  +        : null,
  +    raster_duration_micros: screenMetrics is PerformanceScreenMetrics
  +        ? screenMetrics.rasterDuration?.inMicroseconds
  +        : null,
  +    shader_compilation_duration_micros:
  +        screenMetrics is PerformanceScreenMetrics
  +            ? screenMetrics.shaderCompilationDuration?.inMicroseconds
  +            : null,
  +    trace_event_count: screenMetrics is PerformanceScreenMetrics
  +        ? screenMetrics.traceEventCount
  +        : null,
  +    cpu_sample_count: screenMetrics is ProfilerScreenMetrics
  +        ? screenMetrics.cpuSampleCount
  +        : null,
  +    cpu_stack_depth: screenMetrics is ProfilerScreenMetrics
  +        ? screenMetrics.cpuStackDepth
  +        : null,
  +  );
  +}
  +
   @JS()
   @anonymous
   class GtagExceptionDevTools extends GtagException {
     external factory GtagExceptionDevTools({
       String description,
       bool fatal,
  +
  +    // NOTE: Do not reorder any of these. Order here must match the order in the
  +    // Google Analytics console.
  +
       String user_app, // dimension1 (flutter or web)
       String user_build, // dimension2 (debug or profile)
       String user_platform, // dimension3 (android or ios)
  
positive.code:     bool is_embedded, // dimension10 Whether devtools is embedded
  
      // Performance screen metrics. See [PerformanceScreenMetrics].
      int ui_duration_micros,
      int raster_duration_micros,
      int shader_compilation_duration_micros,
      int trace_event_count,
      // Profiler screen metrics. See [ProfilerScreenMetrics].
      int cpu_sample_count,
      int cpu_stack_depth,
    });
  
    @override
  
negative.code: 
    external bool get is_external_build;
  
    external bool get is_embedded;
  
    // Custom metrics:
    external int get ui_duration_micros;
  
  