Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto committed Nov 16, 2022
1 parent d368f8d commit 990e85a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 4 additions & 3 deletions flutter/lib/src/sentry_user_interaction_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'package:sentry/sentry.dart';

import 'widget_click/tapped_widget.dart';

// Adapted from https://github.com/ueman/sentry-dart-tools/blob/8e41418c0f2c62dc88292cf32a4f22e79112b744/sentry_flutter_plus/lib/src/widgets/click_tracker.dart

const _tapDeltaArea = 20 * 20;
Element? _clickTrackerElement;

Expand Down Expand Up @@ -121,7 +123,6 @@ class _SentryUserInteractionWidgetState
activeTransaction.scheduleFinish();
return;
} else {
// TODO: status?
activeTransaction.finish();
_hub.configureScope((scope) {
if (scope.span == activeTransaction) {
Expand Down Expand Up @@ -190,8 +191,8 @@ class _SentryUserInteractionWidgetState
}

TappedWidget? _getElementAt(Offset position) {
// ignore: todo
// TODO: figure out why it doesn't work with WidgetsBinding.instance.renderViewElement;
// WidgetsBinding.instance.renderViewElement does not work, using
// the element from createElement
var rootElement = _clickTrackerElement;
if (rootElement == null || rootElement.widget != widget) {
return null;
Expand Down
4 changes: 1 addition & 3 deletions flutter/lib/src/widget_click/tapped_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ class TappedWidget {
return key.value;
} else if (key is ValueKey) {
return key.value?.toString();
} // else if (key is LabeledGlobalKey) {
// return key.toString();
// }
}
return key.toString();
}
}

0 comments on commit 990e85a

Please sign in to comment.