runFullstoryApp function
Runs the given app inside a Fullstory-instrumented binding.
This is equivalent to calling the standard runApp, but allows Fullstory to capture data needed for session replay using FullstoryBinding.
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 and some custom
painters are rasterized into PNGs at playback. Each rasterization incurs
some network bandwidth cost for upload. Images are cached remotely, so only
the first session to encounter an image incurs this cost. Images less than
50 logical pixels in width or height will not be rasterized.
capturePainters controlls whether CustomPaint widgets over 50 logical
pixels in both dimensions are rasterized into PNGs for capture. Disabled by
default, always false if captureImages is false.
rasterizers configures render objects that should be captured as raster
images, for custom-drawn widgets (such as third-party charts) that
Fullstory can't otherwise capture. Empty by default, and only applies when
captureImages is true. See Rasterizer for what is safe to rasterize.
logLevel is deprecated. Instead, set the logLevel for the Android and iOS
SDKs.
Implementation
void runFullstoryApp(
Widget app, {
LogLevel logLevel = LogLevel.note,
bool logScanMetrics = kDebugMode,
bool shortenSelectors = true,
bool captureImages = true,
bool capturePainters = false,
Set<Rasterizer> rasterizers = const {},
}) {
final WidgetsBinding binding = FullstoryBinding.ensureInitialized();
Kernel.instance
?..init()
..logScanMetrics = logScanMetrics
..hideElements = shortenSelectors
..captureImages = captureImages
..capturePainters = capturePainters
..rasterizers = rasterizers;
_runWidget(
binding.wrapWithDefaultView(app),
binding,
'runFullstoryApp',
logLevel: logLevel,
);
}