SentryFlutterOptions class
This class adds options which are only available in a Flutter environment. Note that some of these options require native Sentry integration, which is not available on all platforms.
- Inheritance
-
- Object
- SentryOptions
- SentryFlutterOptions
Constructors
- SentryFlutterOptions.new({String? dsn, Platform? platform, RuntimeChecker? checker})
Properties
-
allowUrls
↔ List<
String> -
(Web only) Events only occurring on these Urls will be handled and sent to sentry.
If an empty list is used, the SDK will send all errors.
allowUrls
uses regex for the matching.getter/setter pair - anrEnabled ↔ bool
-
Enable or disable ANR (Application Not Responding).
Available only for Android. Enabled by default.
getter/setter pair
- anrTimeoutInterval ↔ Duration
-
ANR Timeout internal. Default is 5000 milliseconds or 5 seconds.
Used by Androids AnrIntegration. Available only on Android.
See: anrEnabled
Always uses the given duration as a positiv timespan.
getter/setter pair
- appHangTimeoutInterval ↔ Duration
-
The minimum amount of time an app should be unresponsive to be classified
as an App Hanging. The actual amount may be a little longer. Avoid using
values lower than 100ms, which may cause a lot of app hangs events being
transmitted.
Default to 2s.
Only available on iOS and macOS.
getter/setter pair
- attachScreenshot ↔ bool
-
Automatically attaches a screenshot when capturing an error or exception.
getter/setter pair
- attachStacktrace ↔ bool
-
When enabled, stack traces are automatically attached to all messages logged.
Stack traces are always attached to exceptions;
however, when this option is set, stack traces are also sent with messages.
This option, for instance, means that stack traces appear next to all log messages.
getter/setter pairinherited
- attachThreads ↔ bool
-
When enabled, the current isolate will be attached to the event.
This only applies to Dart:io platforms and only the current isolate.
The Dart runtime doesn't provide information about other active isolates.
getter/setter pairinherited
- attachViewHierarchy ↔ bool
-
Enables the View Hierarchy feature.
getter/setter pair
- autoInitializeNativeSdk ↔ bool
-
Initializes the Native SDKs on init.
Set this to
false
if you have an existing native SDK and don't want to re-initialize.getter/setter pair - autoSessionTrackingInterval ↔ Duration
-
The session tracking interval. This is the interval to end a
session if the App goes to the background.
Default is 30 seconds/30000 milliseconds.
See: enableAutoSessionTracking
Always uses the given duration as a positiv timespan.
getter/setter pair
- beforeBreadcrumb ↔ BeforeBreadcrumbCallback?
-
This function is called with an SDK specific breadcrumb object before the breadcrumb is added
to the scope. When nothing is returned from the function, the breadcrumb is dropped
getter/setter pairinherited
- beforeCaptureScreenshot ↔ BeforeCaptureCallback?
-
Sets a callback which is executed before capturing screenshots. Only
relevant if
attachScreenshot
is set to true. When false is returned from the function, no screenshot will be attached.getter/setter pair - beforeCaptureViewHierarchy ↔ BeforeCaptureCallback?
-
Sets a callback which is executed before capturing view hierarchy. Only
relevant if
attachViewHierarchy
is set to true. When false is returned from the function, no view hierarchy will be attached.getter/setter pair - beforeMetricCallback ↔ BeforeMetricCallback?
-
This function is called right before a metric is about to be emitted.
Can return true to emit the metric, or false to drop it.
getter/setter pairinherited
- beforeSend ↔ BeforeSendCallback?
-
This function is called with an SDK specific event object and can return a modified event
object or nothing to skip reporting the event
getter/setter pairinherited
- beforeSendFeedback ↔ BeforeSendCallback?
-
This function is called with an SDK specific feedback event object and can return a modified
feedback event object or nothing to skip reporting the feedback event
getter/setter pairinherited
- beforeSendLog ↔ BeforeSendLogCallback?
-
This function is called right before a log is about to be sent.
Can return a modified log or null to drop the log.
getter/setter pairinherited
- beforeSendTransaction ↔ BeforeSendTransactionCallback?
-
This function is called with an SDK specific transaction object and can return a modified
transaction object or nothing to skip reporting the transaction
getter/setter pairinherited
- bindingUtils ↔ BindingWrapper
-
Setting this to a custom BindingWrapper allows you to use a custom WidgetsBinding.
getter/setter pair
- captureFailedRequests ↔ bool
-
Configures whether to record exceptions for failed requests.
Examples for captures exceptions are:
getter/setter pairinherited
- compressPayload ↔ bool
-
If compressPayload is
true
the outgoing HTTP payloads are compressed using gzip. Otherwise, the payloads are sent in plain UTF8-encoded JSON text. The compression is enabled by default.getter/setter pairinherited - connectionTimeout ↔ Duration
-
Connection timeout. This will only be synced to the Android native SDK.
getter/setter pair
- considerInAppFramesByDefault ↔ bool
-
Configures whether stack trace frames are considered in app frames by default.
You can use this to essentially make inAppIncludes or inAppExcludes
an allow or deny list.
This value is only used if Sentry can not find the origin of the frame.
getter/setter pairinherited
- debug ↔ bool
-
Turns debug mode on or off. If debug is enabled SDK will attempt to print out useful debugging
information if something goes wrong. Default is enabled in debug mode, otherwise it is disabled.
getter/setter pairinherited
-
denyUrls
↔ List<
String> -
(Web only) Events occurring on these Urls will be ignored and are not sent to sentry.
If an empty list is used, the SDK will send all errors.
denyUrls
uses regex for the matching. In combination withallowUrls
you can block subdomains of the domains listed inallowUrls
.getter/setter pair - diagnosticLevel ↔ SentryLevel
-
minimum LogLevel to be used if debug is enabled
getter/setter pairinherited
- diagnosticLog ↔ DiagnosticLog?
-
getter/setter pairinherited
- dist ↔ String?
-
Sets the distribution. Think about it together with release and environment
getter/setter pairinherited
- dsn ↔ String?
-
The DSN tells the SDK where to send the events to.
If an empty string is used, the SDK will not send any events.
getter/setter pairinherited
- enableAppHangTracking ↔ bool
-
When enabled, the SDK tracks when the application stops responding for a
specific amount of time, See appHangTimeoutInterval.
Only available on iOS and macOS.
getter/setter pair
- enableAppLifecycleBreadcrumbs ↔ bool
-
Consider disabling enableAutoNativeBreadcrumbs if you
enable this. Otherwise you might record app lifecycle events twice.
Also consider using enableBreadcrumbTrackingForCurrentPlatform
instead for more sensible defaults.
getter/setter pair
- enableAutoNativeBreadcrumbs ↔ bool
-
Enable or disable the Automatic breadcrumbs on the Native platforms (Android/iOS)
Screen's lifecycle, App's lifecycle, System events, etc...
getter/setter pair
- enableAutoPerformanceTracing ↔ bool
-
Enable auto performance tracking by default.
getter/setter pair
- enableAutoSessionTracking ↔ bool
-
Enable or disable the Auto session tracking on the Native SDKs (Android/iOS) and Web.
getter/setter pair
- enableBrightnessChangeBreadcrumbs ↔ bool
-
Consider disabling enableAutoNativeBreadcrumbs if you
enable this. Otherwise you might record brightness change events twice.
Also consider using enableBreadcrumbTrackingForCurrentPlatform
instead for more sensible defaults.
getter/setter pair
- enableDartSymbolication ↔ bool
-
Enables Dart symbolication for stack traces in Flutter for Android and Cocoa.
getter/setter pairinherited
- enableDeduplication ↔ bool
-
Whether SentryEvent deduplication is enabled.
Can be further configured with maxDeduplicationItems.
Shoud be set to true if
SentryHttpClient is used to capture failed requests.
getter/setter pairinherited
- enableExceptionTypeIdentification ↔ bool
-
Enables identification of exception types in obfuscated builds.
When true, the SDK will attempt to identify common exception types
to improve readability of obfuscated issue titles.
getter/setter pairinherited
- enableFramesTracking ↔ bool
-
Enable or disable Frames Tracking, which is used to report frame information
for every ISentrySpan.
getter/setter pair
- enableLogs ↔ bool
-
Enable to capture and send logs to Sentry.
getter/setter pairinherited
- enableMemoryPressureBreadcrumbs ↔ bool
-
Consider disabling enableAutoNativeBreadcrumbs if you
enable this. Otherwise you might record memory pressure events twice.
Also consider using enableBreadcrumbTrackingForCurrentPlatform
instead for more sensible defaults.
getter/setter pair
- enableNativeCrashHandling ↔ bool
-
Enable or disable the Crash handling on the Native SDKs, e.g.,
UncaughtExceptionHandler and anrEnabled for Android.
getter/setter pair
- enableNdkScopeSync ↔ bool
-
Enable scope sync from Java to NDK.
Only available on Android.
getter/setter pair
- enablePrintBreadcrumbs ↔ bool
-
Enable this option if you want to record calls to
print()
as breadcrumbs. In a Flutter environment, this setting also toggles recording ofdebugPrint
calls.debugPrint
calls are only recorded in release builds, though.getter/setter pairinherited - enableScopeSync ↔ bool
-
If enabled, scopeObservers will be called when mutating scope.
getter/setter pairinherited
- enableTextScaleChangeBreadcrumbs ↔ bool
-
Consider disabling enableAutoNativeBreadcrumbs if you
enable this. Otherwise you might record text scale change events twice.
Also consider using enableBreadcrumbTrackingForCurrentPlatform
instead for more sensible defaults.
getter/setter pair
- enableTimeToFullDisplayTracing ↔ bool
-
Enable or disable the tracing of time to full display (TTFD).
If
SentryFlutter.reportFullyDisplayed()
is not called within 30 seconds after the creation of the TTFD span, it will finish with the status SpanStatus.deadlineExceeded. This feature requires using the Routing Instrumentation.getter/setter pair - enableUserInteractionBreadcrumbs ↔ bool
-
Enable or disable automatic breadcrumbs for User interactions Using Listener
getter/setter pair
- enableUserInteractionTracing ↔ bool
-
Enables the Auto instrumentation for user interaction tracing.
getter/setter pair
- enableWatchdogTerminationTracking ↔ bool
-
Enables Out of Memory Tracking for iOS and macCatalyst.
See the following link for more information and possible restrictions:
https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/
getter/setter pair
- enableWindowMetricBreadcrumbs ↔ bool
-
Consider disabling enableAutoNativeBreadcrumbs if you
enable this. Otherwise you might record window metric events twice.
Also consider using enableBreadcrumbTrackingForCurrentPlatform
instead for more sensible defaults.
getter/setter pair
- environment ↔ String?
-
Sets the environment. This string is freeform and not set by default. A release can be
associated with more than one environment to separate them in the UI Think staging vs prod or
similar.
See docs for further information
getter/setter pairinherited
- environmentVariables ↔ EnvironmentVariables
-
If environmentVariables is provided, it is used get the environment
variables. This is useful in tests.
getter/setter pairinherited
-
eventProcessors
→ List<
EventProcessor> -
Are callbacks that run for every event. They can either return a new event which in most cases
means just adding data OR return null in case the event will be dropped and not sent.
no setterinherited
-
exceptionTypeIdentifiers
→ List<
ExceptionTypeIdentifier> -
no setterinherited
- groupExceptions ↔ bool
-
Whether to group exceptions hierarchically.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- httpClient ↔ Client
-
If httpClient is provided, it is used instead of the default client to
make HTTP calls to Sentry.io. This is useful in tests.
If you don't need to send events, use
NoOpClient
.getter/setter pairinherited - idleTimeout ↔ Duration?
-
The idle time to wait until the transaction will be finished.
The transaction will use the end timestamp of the last finished span as
the endtime for the transaction.
getter/setter pairinherited
-
ignoredExceptionsForType
→ List<
Type> -
Ignored exception types.
no setterinherited
-
ignoreErrors
↔ List<
String> -
The ignoreErrors tells the SDK which errors should be not sent to the sentry server.
If an null or an empty list is used, the SDK will send all transactions.
To use regex add the
^
and the$
to the string.getter/setter pairinherited -
ignoreTransactions
↔ List<
String> -
The ignoreTransactions tells the SDK which transactions should be not sent to the sentry server.
If null or an empty list is used, the SDK will send all transactions.
To use regex add the
^
and the$
to the string.getter/setter pairinherited -
inAppExcludes
→ List<
String> -
A list of string prefixes of packages names that do not belong to the app, but rather third-party
packages. Packages considered not to be part of the app will be hidden from stack traces by
default.
example :
['sentry']
will exclude exception frompackage:sentry/sentry.dart
no setterinherited -
inAppIncludes
→ List<
String> -
A list of string prefixes of packages names that belong to the app. This option takes precedence
over inAppExcludes.
example:
['sentry']
will include exception frompackage:sentry/sentry.dart
no setterinherited - includeModuleInStackTrace ↔ bool
-
Enables adding the module in SentryStackFrame.module.
This option only has an effect in non-obfuscated builds.
Enabling this option may change grouping.
getter/setter pairinherited
-
integrations
→ List<
Integration< SentryOptions> > -
Code that provides middlewares, bindings or hooks into certain frameworks or environments,
along with code that inserts those bindings and activates them.
no setterinherited
- log → SdkLogCallback
-
Log callback to log useful debugging information if debug is enabled
no setterinherited
- logger → SentryLogger
-
latefinalinherited
- markAutomaticallyCollectedErrorsAsFatal ↔ bool
-
Errors that the SDK automatically collects, for example in
SentryIsolate
, havelevel
SentryLevel.fatal set per default. Settings this tofalse
will set thelevel
to SentryLevel.error.getter/setter pairinherited - maxAttachmentSize ↔ int
-
Maximum allowed file size of attachments, in bytes.
Attachments above this size will be discarded
getter/setter pairinherited
- maxBreadcrumbs ↔ int
-
This variable controls the total amount of breadcrumbs that should be captured Default is 100
getter/setter pairinherited
- maxCacheItems ↔ int
-
Defines the maximal amount of offline stored events. Default is 30.
Only available on Android, iOS and macOS.
getter/setter pair
- maxDeduplicationItems ↔ int
-
Describes how many exceptions are kept to be checked for deduplication.
This should be a small positiv integer in order to keep deduplication
performant.
Is only in effect if enableDeduplication is set to true.
getter/setter pairinherited
- maxQueueSize ↔ int
-
Returns the max number of events Sentry will send when calling capture
methods in a tight loop. Default is 30.
getter/setter pairinherited
- maxRequestBodySize ↔ MaxRequestBodySize
-
Configures up to which size request bodies should be included in events.
This does not change whether an event is captured.
getter/setter pairinherited
- maxSpans ↔ int
-
Returns the maximum number of spans that can be attached to single transaction.
getter/setter pairinherited
-
The navigatorKey is used to add information of the currently used locale to the contexts.
getter/setter pair
-
performanceCollectors
→ List<
PerformanceCollector> -
no setterinherited
- platform ↔ Platform
-
Info on which platform the SDK runs.
getter/setter pairinherited
- privacy → SentryPrivacyOptions
-
Privacy configuration for masking sensitive data in screenshots and Session Replay.
Screen content masking is enabled by default.
final
- profilesSampleRate ↔ double?
-
The sample rate for profiling traces in the range of 0.0 to 1.0.
This is relative to tracesSampleRate - it is a ratio of profiled traces out of all sampled traces.
At the moment, only apps targeting iOS and macOS are supported.
getter/setter pair
- proguardUuid ↔ String?
-
Sets the Proguard uuid for Android platform.
getter/setter pair
- proxy ↔ SentryProxy?
-
Configure a proxy to use for SDK API calls.
getter/setter pairinherited
- readTimeout ↔ Duration
-
Read timeout. This will only be synced to the Android native SDK.
getter/setter pair
- recordHttpBreadcrumbs ↔ bool
-
Whether to records requests as breadcrumbs. This is on by default.
It only has an effect when the SentryHttpClient or dio integration is in
use, or iOS native where it sets the value to
enableNetworkBreadcrumbs
.getter/setter pairinherited - release ↔ String?
-
Sets the release. SDK will try to automatically configure a release out of the box
See docs for further information
getter/setter pairinherited
- replay → SentryReplayOptions
-
Replay recording configuration.
final
- reportPackages ↔ bool
-
Enable or disable reporting of used packages.
getter/setter pair
- reportSilentFlutterErrors ↔ bool
-
By default, we don't report FlutterErrorDetails.silent errors,
but you can by enabling this flag.
See https://api.flutter.dev/flutter/foundation/FlutterErrorDetails/silent.html
getter/setter pair
- reportViewHierarchyIdentifiers ↔ bool
-
Enables collection of view hierarchy element identifiers.
getter/setter pair
- runtimeChecker ↔ RuntimeChecker
-
If runtimeChecker is provided, it is used get the environment.
This is useful in tests. Should be an implementation of RuntimeChecker.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sampleRate ↔ double?
-
Configures the sample rate as a percentage of events to be sent in the range of 0.0 to 1.0. if
1.0 is set it means that 100% of events are sent. If set to 0.1 only 10% of events will be
sent. Events are picked randomly. Default is null (disabled)
getter/setter pairinherited
-
scopeObservers
→ List<
ScopeObserver> -
no setterinherited
- screenshotQuality ↔ SentryScreenshotQuality
-
The quality of the attached screenshot
getter/setter pair
- sdk ↔ SdkVersion
-
Sdk object that contains the Sentry Client Name and its version
getter/setter pairinherited
- sendClientReports ↔ bool
-
Send statistics to sentry when the client drops events.
getter/setter pairinherited
- sendDefaultPii ↔ bool
-
Whether to send personal identifiable information along with events
getter/setter pairinherited
- sentryClientName → String
-
Sentry client name used for the HTTP authHeader and userAgent eg
sentry.{language}.{platform}/{version} eg sentry.java.android/2.0.0 would be a valid case
no setterinherited
- serverName ↔ String?
-
The server name used in the Sentry messages.
getter/setter pairinherited
- spotlight ↔ Spotlight
-
The Spotlight configuration.
Disabled by default.
getter/setter pairinherited
-
tracePropagationTargets
→ List<
String> -
List of strings/regex controlling to which outgoing requests
the SDK will attach tracing headers.
finalinherited
- tracesSampler ↔ TracesSamplerCallback?
-
This function is called by TracesSamplerCallback to determine if transaction is sampled - meant
to be sent to Sentry.
getter/setter pairinherited
- tracesSampleRate ↔ double?
-
Returns the traces sample rate Default is null (disabled)
getter/setter pairinherited
- transport ↔ Transport
-
The transport is an internal construct of the client that abstracts away the event sending.
getter/setter pairinherited
Methods
-
addEventProcessor(
EventProcessor eventProcessor) → void -
Adds an event processor
inherited
-
addExceptionCauseExtractor(
ExceptionCauseExtractor extractor) → void -
Adds ExceptionCauseExtractor in order to extract inner exceptions
inherited
-
addExceptionFilterForType(
Type exceptionType) → void -
Adds exception type to the list of ignored exceptions.
inherited
-
addExceptionStackTraceExtractor(
ExceptionStackTraceExtractor extractor) → void -
Adds ExceptionStackTraceExtractor in order to extract inner exceptions
inherited
-
addExceptionTypeIdentifierByIndex(
int index, ExceptionTypeIdentifier exceptionTypeIdentifier) → void -
inherited
-
addInAppExclude(
String inAppInclude) → void -
Adds an inAppExclude
inherited
-
addInAppInclude(
String inAppExclude) → void -
Adds an inAppIncludes
inherited
-
addIntegration(
Integration< SentryOptions> integration) → void -
Adds an integration
inherited
-
addIntegrationByIndex(
int index, Integration< SentryOptions> integration) → void -
Adds an integration in the given index
inherited
-
addPerformanceCollector(
PerformanceCollector collector) → void -
inherited
-
addScopeObserver(
ScopeObserver scopeObserver) → void -
inherited
-
containsIgnoredExceptionForType(
dynamic exception) → bool -
Check if ignoredExceptionsForType contains an exception.
inherited
-
debugLog(
SentryLevel level, String message, {String? logger, Object? exception, StackTrace? stackTrace}) → void -
inherited
-
enableBreadcrumbTrackingForCurrentPlatform(
) → void - Automatically set sensible defaults for tracking Breadcrumbs. It considers the current platform and available native integrations.
-
exceptionCauseExtractor(
Type type) → ExceptionCauseExtractor? -
Returns a previously added ExceptionCauseExtractor by type
inherited
-
exceptionStackTraceExtractor(
Type type) → ExceptionStackTraceExtractor? -
Returns a previously added ExceptionStackTraceExtractor by type
inherited
-
isTracingEnabled(
) → bool -
Returns if tracing should be enabled. If tracing is disabled, starting transactions returns
NoOpSentrySpan.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
prependExceptionTypeIdentifier(
ExceptionTypeIdentifier exceptionTypeIdentifier) → void -
Adds an exception type identifier to the beginning of the list.
This ensures it is processed first and takes precedence over existing identifiers.
inherited
-
removeEventProcessor(
EventProcessor eventProcessor) → void -
Removes an event processor
inherited
-
removeIntegration(
Integration< SentryOptions> integration) → void -
Removes an integration
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
useFlutterBreadcrumbTracking(
) → void - By using this, you are disabling native Breadcrumb tracking and instead you are just tracking Breadcrumbs which result from events available in the current Flutter environment.
-
useNativeBreadcrumbTracking(
) → void - By using this, you are enabling native Breadcrumb tracking and disabling tracking Breadcrumbs which result from events available in the current Flutter environment.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited