diff --git a/flutter/lib/src/binding_wrapper.dart b/flutter/lib/src/binding_wrapper.dart index 72055e721..dc1991743 100644 --- a/flutter/lib/src/binding_wrapper.dart +++ b/flutter/lib/src/binding_wrapper.dart @@ -59,7 +59,11 @@ class SentryWidgetsFlutterBinding extends WidgetsFlutterBinding BindingBase.checkInstance(_instance); static SentryWidgetsFlutterBinding? _instance; - // ignore: prefer_constructors_over_static_methods + /// Returns an instance of [SentryWidgetsFlutterBinding]. + /// If no binding has yet been initialized, creates and initializes one. + /// + /// If the binding was already initialized with a different implementation, + /// returns the existing [WidgetsBinding] instance instead. static WidgetsBinding ensureInitialized() { try { if (SentryWidgetsFlutterBinding._instance == null) { @@ -85,8 +89,7 @@ mixin SentryWidgetsBindingMixin on WidgetsBinding { _frameTracker = null; } - static void initializesFramesTracker( - SentryDelayedFramesTracker frameTracker) { + static void initializeFramesTracker(SentryDelayedFramesTracker frameTracker) { _frameTracker ??= frameTracker; } diff --git a/flutter/lib/src/integrations/frames_tracking_integration.dart b/flutter/lib/src/integrations/frames_tracking_integration.dart index f1aef91ef..e145dc609 100644 --- a/flutter/lib/src/integrations/frames_tracking_integration.dart +++ b/flutter/lib/src/integrations/frames_tracking_integration.dart @@ -56,7 +56,7 @@ class FramesTrackingIntegration implements Integration { SentryFlutterOptions options, Duration expectedFrameDuration) { final framesTracker = SentryDelayedFramesTracker(options, expectedFrameDuration); - SentryWidgetsBindingMixin.initializesFramesTracker(framesTracker); + SentryWidgetsBindingMixin.initializeFramesTracker(framesTracker); final collector = SpanFrameMetricsCollector( options, framesTracker,