Hub class

SDK API contract which combines a client and scope management

Implementers

Constructors

Hub(SentryOptions options)
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
isEnabled → bool
Check if the Hub is enabled/active.
no setter
lastEventId → SentryId
Last event id recorded by the Hub
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addBreadcrumb(Breadcrumb crumb, {Hint? hint}) → Future<void>
Adds a breadcrumb to the current Scope
addFeatureFlag(String flag, bool result) → Future<void>
Adds a feature flag evaluation to the current Scope and active span
bindClient(SentryClient client) → void
Binds a different client to the hub
captureEvent(SentryEvent event, {dynamic stackTrace, Hint? hint, ScopeCallback? withScope}) → Future<SentryId>
Captures the event.
captureException(dynamic throwable, {dynamic stackTrace, Hint? hint, SentryMessage? message, ScopeCallback? withScope}) → Future<SentryId>
Captures the exception
captureFeedback(SentryFeedback feedback, {Hint? hint, ScopeCallback? withScope}) → Future<SentryId>
Captures the feedback.
captureLog(SentryLog log) → Future<void>
captureMessage(String? message, {SentryLevel? level, String? template, List? params, Hint? hint, ScopeCallback? withScope}) → Future<SentryId>
Captures the message.
captureMetric(SentryMetric metric) → Future<void>
captureSpan(SentrySpanV2 span) → Future<void>
close() → Future<void>
Flushes out the queue for up to timeout seconds and disable the Hub.
configureScope(ScopeCallback callback) → FutureOr<void>
Configures the scope through the callback.
getSpan() → ISentrySpan?
Gets the current active transaction or span.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAttribute(String key) → void
setAttributes(Map<String, SentryAttribute> attributes) → void
startInactiveSpan(String name, {Map<String, SentryAttribute>? attributes, SentrySpanV2? parentSpan = const UnsetSentrySpanV2(), DateTime? startTimestamp}) → SentrySpanV2
startSpan<T>(String name, Future<T> callback(SentrySpanV2 span), {Map<String, SentryAttribute>? attributes, SentrySpanV2? parentSpan = const UnsetSentrySpanV2(), DateTime? startTimestamp}) → Future<T>
startSpanSync<T>(String name, T callback(SentrySpanV2 span), {Map<String, SentryAttribute>? attributes, SentrySpanV2? parentSpan = const UnsetSentrySpanV2(), DateTime? startTimestamp}) → T
startTransaction(String name, String operation, {String? description, DateTime? startTimestamp, bool? bindToScope, bool? waitForChildren, Duration? autoFinishAfter, bool? trimEnd, OnTransactionFinish? onFinish, Map<String, dynamic>? customSamplingContext}) → ISentrySpan
Creates a Transaction and returns the instance.
startTransactionWithContext(SentryTransactionContext transactionContext, {Map<String, dynamic>? customSamplingContext, DateTime? startTimestamp, bool? bindToScope, bool? waitForChildren, Duration? autoFinishAfter, bool? trimEnd, OnTransactionFinish? onFinish}) → ISentrySpan
Creates a Transaction and returns the instance.
toString() → String
A string representation of this object.
inherited

Operators

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