BugsnagClient class abstract

Implementers
Available Extensions

Constructors

BugsnagClient()

Properties

errorHandler → void Function(dynamic error, StackTrace? stack)
An utility error handling function that will send reported errors to Bugsnag as unhandled. The errorHandler is suitable for use with common Dart error callbacks such as runZonedGuarded or Future.onError.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addFeatureFlag(String name, [String? variant]) Future<void>
Add a single feature flag with an optional variant. If there is an existing feature flag with the same name, it will be overwritten with the new variant.
addFeatureFlags(List<BugsnagFeatureFlag> featureFlags) Future<void>
Add a collection of feature flags. This has the same effect as calling addFeatureFlag for each value passed, but it typically faster when there are more than one FeatureFlag.
addMetadata(String section, Map<String, Object> metadata) Future<void>
Adds a map of multiple metadata key-value pairs to the specified section.
addOnError(BugsnagOnErrorCallback onError) → void
Add a "on error" callback, to execute code at the point where an error report is captured in Bugsnag.
clearFeatureFlag(String name) Future<void>
Remove a single feature flag regardless of its current status. This will stop the specified feature flag from being reported. If the named feature flag does not exist this will have no effect.
clearFeatureFlags() Future<void>
Clear all of the feature flags. This will stop all feature flags from being reported.
clearMetadata(String section, [String? key]) Future<void>
If key is not null: removes data with the specified key from the specified section. Otherwise remove all the data from the specified section.
getBreadcrumbs() Future<List<BugsnagBreadcrumb>>
Returns the current buffer of breadcrumbs that will be sent with captured events. This ordered list represents the most recent breadcrumbs to be captured up to the limit set in start.
getContext() Future<String?>
Bugsnag uses the concept of “contexts” to help display and group your errors. The context represents what was happening in your application at the time an error occurs and is given high visual prominence in the dashboard.
getLastRunInfo() Future<BugsnagLastRunInfo?>
Retrieves information about the last launch of the application, if it has been run before.
getMetadata(String section) Future<Map<String, Object>?>
Returns a map of data in the specified section.
getUser() Future<BugsnagUser>
Returns the currently set User information.
leaveBreadcrumb(String message, {Map<String, Object>? metadata, BugsnagBreadcrumbType type = BugsnagBreadcrumbType.manual}) Future<void>
Leave a "breadcrumb" log message, representing an action that occurred in your app, to aid with debugging.
markLaunchCompleted() Future<void>
Informs Bugsnag that the application has finished launching. Once this has resolved BugsnagAppWithState.isLaunching will always be false in any new error reports, and synchronous delivery will not be attempted on the next launch for any fatal crashes.
networkInstrumentation(dynamic data) → dynamic
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify(dynamic error, StackTrace? stackTrace, {BugsnagOnErrorCallback? callback}) Future<void>
Notify Bugsnag of a handled exception.
pauseSession() Future<void>
Pauses tracking of a session. You should disable automatic session by setting autoTrackSessions to false in start.
removeOnError(BugsnagOnErrorCallback onError) → void
Removes a previously added "on error" callback.
resumeSession() Future<bool>
Resumes a session which has previously been paused, or starts a new session if none exists. If a session has already been resumed or started and has not been paused, calling this method will have no effect. You should disable automatic session by setting autoTrackSessions to false in start if you call this method.
setContext(String? context) Future<void>
Bugsnag uses the concept of “contexts” to help display and group your errors. The context represents what was happening in your application at the time an error occurs and is given high visual prominence in the dashboard.
setUser({String? id, String? email, String? name}) Future<void>
Sets the user information to be associated with events
startSession() Future<void>
Starts tracking a new session. You should disable automatic session by setting autoTrackSessions to false in start.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited