runFullstoryWidget function

void runFullstoryWidget(
  1. Widget app, {
  2. LogLevel logLevel = LogLevel.note,
  3. bool logScanMetrics = kDebugMode,
  4. bool shortenSelectors = true,
  5. bool captureImages = false,
})

Runs the given app inside a Fullstory-instrumented binding.

This is equivalent to calling the standard runWidget, but allows Fullstory to capture data needed for session replay using FullstoryBinding.

Like with runWidget, this will not wrap the passed app with a default View, so be sure to provide your own!

logLevel sets the defaul verbosity of Fullstory loggging, defaulting to note. This is a temporary field to be replaced by use of the native SDK's logging configuration.

logScanMetrics indicates whether to log view scan metrics to the console. This is intended for debugging and performance tuning, and will negatively impact performance if enabled in production. By default, enabled in debug only.

shortenSelectors indicates whether some widgets which are typically implementation details of others are hidden from the selectors created during scans. This defaults to true, and typically should only be set to false for debugging, as there is a performance cost associated with deeper selectors.

captureImages controls whether images, icon glyphs, and chart painters are rasterized into color grids for playback. Adds CPU overhead (~50% in profiling). Defaults to false while the feature stabilizes; set to true to enable.

Implementation

void runFullstoryWidget(
  Widget app, {
  LogLevel logLevel = LogLevel.note,
  bool logScanMetrics = kDebugMode,
  bool shortenSelectors = true,
  bool captureImages = false,
}) {
  final WidgetsBinding binding = FullstoryBinding.ensureInitialized();
  Kernel.instance
    ?..init()
    ..logScanMetrics = logScanMetrics
    ..hideElements = shortenSelectors
    ..captureImages = captureImages;

  _runWidget(app, binding, 'runFullstoryWidget', logLevel: logLevel);
}