Skip to content

Commit c6a4625

Browse files
committed
cleanup & improve existing code
1 parent b8bff54 commit c6a4625

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

dart/lib/src/protocol/breadcrumb.dart

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,17 @@ class Breadcrumb {
9696
String? viewId,
9797
String? viewClass,
9898
}) {
99-
final newData = data ?? {};
100-
if (viewId != null) {
101-
newData['view.id'] = viewId;
102-
}
103-
if (viewClass != null) {
104-
newData['view.class'] = viewClass;
105-
}
106-
10799
return Breadcrumb(
108100
message: message,
109101
level: level,
110102
category: 'ui.$subCategory',
111103
type: 'user',
112104
timestamp: timestamp,
113-
data: newData,
105+
data: {
106+
if (viewId != null) 'view.id': viewId,
107+
if (viewClass != null) 'view.class': viewClass,
108+
if (data != null) ...data,
109+
},
114110
);
115111
}
116112

flutter/lib/src/sentry_flutter_options.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ class SentryFlutterOptions extends SentryOptions {
184184
///
185185
/// Requires adding the [SentryUserInteractionWidget] to the widget tree.
186186
/// Example:
187-
/// runApp(SentryUserInteractionWidget(child: App()));
187+
/// runApp(SentryWidget(child: App()));
188188
bool enableUserInteractionBreadcrumbs = true;
189189

190190
/// Enables the Auto instrumentation for user interaction tracing.
191191
///
192192
/// Requires adding the [SentryUserInteractionWidget] to the widget tree.
193193
/// Example:
194-
/// runApp(SentryUserInteractionWidget(child: App()));
194+
/// runApp(SentryWidget(child: App()));
195195
bool enableUserInteractionTracing = true;
196196

197197
/// Enable or disable the tracing of time to full display (TTFD).

flutter/lib/src/user_interaction/sentry_user_interaction_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Element? _clickTrackerElement;
223223
/// Mostly for onPressed, onTap, and onLongPress events
224224
///
225225
/// Example on how to set up:
226-
/// runApp(SentryUserInteractionWidget(child: App()));
226+
/// runApp(SentryWidget(child: App()));
227227
///
228228
/// For transactions, enable it in the [SentryFlutterOptions.enableUserInteractionTracing].
229229
/// The idle timeout can be configured in the [SentryOptions.idleTimeout].

0 commit comments

Comments
 (0)