SentryFlutterOptions class

This class adds options which are only availble in a Flutter environment. Note that some of these options require native Sentry integration, which is not available on all platforms.

Inheritance

Constructors

SentryFlutterOptions({String? dsn, PlatformChecker? checker})

Properties

anrEnabled bool
Enable or disable ANR (Application Not Responding). Available only for Android. Disabled by default as the stack trace most of the time is hanging on the MessageChannel from Flutter, but you can enable it if you have Java/Kotlin code as well.
getter/setter pair
anrTimeoutIntervalMillis int
ANR Timeout internal in Millis Default is 5000 = 5s Used by AnrIntegration. Available only for Android. See: anrEnabled
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, all the threads are automatically attached to all logged events (Android).
getter/setter pairinherited
autoSessionTrackingIntervalMillis int
The session tracking interval in millis. This is the interval to end a session if the App goes to the background. See: enableAutoSessionTracking
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
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
cacheDirSize int
The cache dir. size for capping the number of events Default is 30. Only available for Android.
getter/setter pair
clock ClockProvider
If clock is provided, it is used to get time instead of the system clock. This is useful in tests. Should be an implementation of ClockProvider.
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
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 disabled.
getter/setter pairinherited
diagnosticLevel SentryLevel
minimum LogLevel to be used if debug is enabled
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
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
enableAutoSessionTracking bool
Enable or disable the Auto session tracking on the Native SDKs (Android/iOS)
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
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
enableOutOfMemoryTracking 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
enablePrintBreadcrumbs bool
Enable this option if you want to record calls to print() as breadcrumbs.
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
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 envirnoment 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
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
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 from 'package: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 from 'package:sentry/sentry.dart'
no setterinherited
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
logger SentryLogger
Logger interface to log useful debugging information if debug is enabled
getter/setter pairinherited
maxBreadcrumbs int
This variable controls the total amount of breadcrumbs that should be captured Default is 100
getter/setter pairinherited
platformChecker PlatformChecker
If platformChecker is provided, it is used get the envirnoment. This is useful in tests. Should be an implementation of PlatformChecker.
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
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
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
sdk SdkVersion
Sdk object that contains the Sentry Client Name and its version
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
getter/setter pairinherited
serverName String?
The server name used in the Sentry messages.
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
addInAppExclude(String inApp) → void
Adds an inAppExclude
inherited
addInAppInclude(String inApp) → 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
enableBreadcrumbTrackingForCurrentPlatform() → void
Automatically set sensible defaults for tracking Breadcrumbs. It considers the current platform and available native integrations.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
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