Hint class
Hints are used in BeforeSendCallback, BeforeBreadcrumbCallback and event processors.
Event and breadcrumb hints are objects containing various information used to put together an event or a breadcrumb. Typically hints hold the original exception so that additional data can be extracted or grouping can be affected.
Example:
options.beforeSend = (event, hint) {
final syntheticException = hint.get(TypeCheckHint.syntheticException);
if (syntheticException is FlutterErrorDetails) {
// Do something with hint data
}
return event;
};
}
The Hint can also be used to add attachments to events.
Example:
import 'dart:convert';
options.beforeSend = (event, hint) {
final text = 'This event should not be sent happen in prod. Investigate.';
final textAttachment = SentryAttachment.fromIntList(
utf8.encode(text),
'event_info.txt',
contentType: 'text/plain',
);
hint.attachments.add(textAttachment);
return event;
};
Constructors
- Hint()
- Hint.withAttachment(SentryAttachment attachment)
-
factory
-
Hint.withAttachments(List<
SentryAttachment> attachments) -
factory
-
Hint.withMap(Map<
String, dynamic> map) -
factory
- Hint.withScreenshot(SentryAttachment screenshot)
-
factory
- Hint.withViewHierarchy(SentryAttachment viewHierarchy)
-
factory
Properties
-
attachments
→ List<
SentryAttachment> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- screenshot ↔ SentryAttachment?
-
getter/setter pair
- viewHierarchy ↔ SentryAttachment?
-
getter/setter pair
Methods
-
addAll(
Map< String, dynamic> keysAndValues) → void -
clear(
) → void -
get(
String key) → dynamic -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
String key) → void -
set(
String key, dynamic value) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited