From 4fa09ee9494b531daf0bf86030215f86becf832b Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 5 May 2025 15:31:20 +0200 Subject: [PATCH 01/37] Update --- .../src/load_dart_debug_images_integration.dart | 5 +++-- dart/lib/src/utils/obfuscation.dart | 13 +++++++++++++ .../load_native_debug_images_integration.dart | 15 ++++++++++----- 3 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 dart/lib/src/utils/obfuscation.dart diff --git a/dart/lib/src/load_dart_debug_images_integration.dart b/dart/lib/src/load_dart_debug_images_integration.dart index 8043764dba..8c8cfd025d 100644 --- a/dart/lib/src/load_dart_debug_images_integration.dart +++ b/dart/lib/src/load_dart_debug_images_integration.dart @@ -12,13 +12,14 @@ import 'protocol/sentry_event.dart'; import 'protocol/sentry_level.dart'; import 'protocol/sentry_stack_trace.dart'; import 'sentry_options.dart'; +import 'utils/obfuscation.dart'; class LoadDartDebugImagesIntegration extends Integration { - static const integrationName = 'LoadDartDebugImagesIntegration'; + static const integrationName = 'LoadDartDebugImages'; @override void call(Hub hub, SentryOptions options) { - if (options.enableDartSymbolication) { + if (options.enableDartSymbolication && isAppObfuscated()) { options.addEventProcessor(LoadImageIntegrationEventProcessor(options)); options.sdk.addIntegration(integrationName); } diff --git a/dart/lib/src/utils/obfuscation.dart b/dart/lib/src/utils/obfuscation.dart new file mode 100644 index 0000000000..6e1fa6b0f4 --- /dev/null +++ b/dart/lib/src/utils/obfuscation.dart @@ -0,0 +1,13 @@ +bool isAppObfuscated() { + final testObject = _TestClass(); + + // In non-obfuscated builds, this will return "_TestClass" + // In obfuscated builds, this will return something like "a" or other short identifier + final typeName = testObject.runtimeType.toString(); + + // If the type name doesn't contain "TestClass", it's likely obfuscated + return !typeName.contains('TestClass'); +} + +// This class is only used to check its runtime type name +class _TestClass {} diff --git a/flutter/lib/src/integrations/load_native_debug_images_integration.dart b/flutter/lib/src/integrations/load_native_debug_images_integration.dart index 757747c31f..4ae7222d4a 100644 --- a/flutter/lib/src/integrations/load_native_debug_images_integration.dart +++ b/flutter/lib/src/integrations/load_native_debug_images_integration.dart @@ -3,6 +3,8 @@ import 'dart:async'; import 'package:sentry/sentry.dart'; // ignore: implementation_imports import 'package:sentry/src/load_dart_debug_images_integration.dart'; +// ignore: implementation_imports +import 'package:sentry/src/utils/obfuscation.dart'; import '../native/sentry_native_binding.dart'; import '../sentry_flutter_options.dart'; @@ -11,16 +13,19 @@ import '../sentry_flutter_options.dart'; class LoadNativeDebugImagesIntegration extends Integration { final SentryNativeBinding _native; - static const integrationName = 'LoadNativeDebugImagesIntegration'; + static const integrationName = 'LoadNativeDebugImages'; LoadNativeDebugImagesIntegration(this._native); @override void call(Hub hub, SentryFlutterOptions options) { - options.addEventProcessor( - _LoadImageListIntegrationEventProcessor(options, _native), - ); - options.sdk.addIntegration(integrationName); + // ignore: invalid_use_of_internal_member + if (isAppObfuscated()) { + options.addEventProcessor( + _LoadImageListIntegrationEventProcessor(options, _native), + ); + options.sdk.addIntegration(integrationName); + } } } From 90152954cbe648573e075725ae197983d181d6b1 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 5 May 2025 16:05:52 +0200 Subject: [PATCH 02/37] Update --- .../load_dart_debug_images_integration.dart | 4 +-- dart/lib/src/runtime_checker.dart | 8 ++++++ dart/lib/src/utils/obfuscation.dart | 13 ---------- ...ad_dart_debug_images_integration_test.dart | 26 +++++++++++++++++-- dart/test/mocks/mock_runtime_checker.dart | 5 ++++ .../load_native_debug_images_integration.dart | 4 +-- ..._native_debug_images_integration_test.dart | 24 +++++++++++++++++ flutter/test/mocks.dart | 7 ++++- 8 files changed, 70 insertions(+), 21 deletions(-) delete mode 100644 dart/lib/src/utils/obfuscation.dart diff --git a/dart/lib/src/load_dart_debug_images_integration.dart b/dart/lib/src/load_dart_debug_images_integration.dart index 8c8cfd025d..b283535ea0 100644 --- a/dart/lib/src/load_dart_debug_images_integration.dart +++ b/dart/lib/src/load_dart_debug_images_integration.dart @@ -12,14 +12,14 @@ import 'protocol/sentry_event.dart'; import 'protocol/sentry_level.dart'; import 'protocol/sentry_stack_trace.dart'; import 'sentry_options.dart'; -import 'utils/obfuscation.dart'; class LoadDartDebugImagesIntegration extends Integration { static const integrationName = 'LoadDartDebugImages'; @override void call(Hub hub, SentryOptions options) { - if (options.enableDartSymbolication && isAppObfuscated()) { + if (options.enableDartSymbolication && + options.runtimeChecker.isAppObfuscated()) { options.addEventProcessor(LoadImageIntegrationEventProcessor(options)); options.sdk.addIntegration(integrationName); } diff --git a/dart/lib/src/runtime_checker.dart b/dart/lib/src/runtime_checker.dart index 4aee63c8fd..95d6165d39 100644 --- a/dart/lib/src/runtime_checker.dart +++ b/dart/lib/src/runtime_checker.dart @@ -22,6 +22,14 @@ class RuntimeChecker { return const bool.fromEnvironment('dart.vm.profile', defaultValue: false); } + /// Check if the Dart code is obfuscated. + bool isAppObfuscated() { + // In non-obfuscated builds, this will return "RuntimeChecker" + // In obfuscated builds, this will return something like "a" or other short identifier + final typeName = runtimeType.toString(); + return !typeName.contains('RuntimeChecker'); + } + final bool isRootZone; String get compileMode { diff --git a/dart/lib/src/utils/obfuscation.dart b/dart/lib/src/utils/obfuscation.dart deleted file mode 100644 index 6e1fa6b0f4..0000000000 --- a/dart/lib/src/utils/obfuscation.dart +++ /dev/null @@ -1,13 +0,0 @@ -bool isAppObfuscated() { - final testObject = _TestClass(); - - // In non-obfuscated builds, this will return "_TestClass" - // In obfuscated builds, this will return something like "a" or other short identifier - final typeName = testObject.runtimeType.toString(); - - // If the type name doesn't contain "TestClass", it's likely obfuscated - return !typeName.contains('TestClass'); -} - -// This class is only used to check its runtime type name -class _TestClass {} diff --git a/dart/test/load_dart_debug_images_integration_test.dart b/dart/test/load_dart_debug_images_integration_test.dart index 11fdddfa5c..2971f149e2 100644 --- a/dart/test/load_dart_debug_images_integration_test.dart +++ b/dart/test/load_dart_debug_images_integration_test.dart @@ -9,6 +9,7 @@ import 'package:sentry/src/platform/mock_platform.dart'; import 'package:sentry/src/sentry_stack_trace_factory.dart'; import 'package:test/test.dart'; +import 'mocks/mock_runtime_checker.dart'; import 'test_utils.dart'; void main() { @@ -26,6 +27,7 @@ void main() { setUp(() { fixture = Fixture(); fixture.options.platform = platform; + fixture.callIntegration(); }); test('adds itself to sdk.integrations', () { @@ -191,8 +193,27 @@ isolate_dso_base: 10000000 }); } + test('does not add itself to sdk.integrations if app is not obfuscated', () { + final fixture = Fixture() + ..options.runtimeChecker = MockRuntimeChecker(isObfuscated: false); + fixture.callIntegration(); + expect( + fixture.options.sdk.integrations + .contains(LoadDartDebugImagesIntegration.integrationName), + false, + ); + }); + + test('does not add event processor to options if app is not obfuscated', () { + final fixture = Fixture() + ..options.runtimeChecker = MockRuntimeChecker(isObfuscated: false); + fixture.callIntegration(); + expect(fixture.options.eventProcessors.length, 0); + }); + test('debug image is null on unsupported platforms', () async { final fixture = Fixture()..options.platform = MockPlatform.linux(); + fixture.callIntegration(); final event = fixture.newEvent(stackTrace: fixture.parse(''' *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** build_id: 'b680cb890f9e3c12a24b172d050dec73' @@ -205,10 +226,11 @@ isolate_dso_base: 40000000 } class Fixture { - final options = defaultTestOptions(); + final options = defaultTestOptions() + ..runtimeChecker = MockRuntimeChecker(isObfuscated: true); late final factory = SentryStackTraceFactory(options); - Fixture() { + void callIntegration() { final integration = LoadDartDebugImagesIntegration(); integration.call(Hub(options), options); } diff --git a/dart/test/mocks/mock_runtime_checker.dart b/dart/test/mocks/mock_runtime_checker.dart index c7ea74b730..3ce75c9b54 100644 --- a/dart/test/mocks/mock_runtime_checker.dart +++ b/dart/test/mocks/mock_runtime_checker.dart @@ -7,12 +7,14 @@ class MockRuntimeChecker extends RuntimeChecker with NoSuchMethodProvider { this.isDebug = false, this.isProfile = false, this.isRelease = false, + this.isObfuscated = false, bool isRootZone = true, }) : super(isRootZone: isRootZone); final bool isDebug; final bool isProfile; final bool isRelease; + final bool isObfuscated; @override bool isDebugMode() => isDebug; @@ -22,4 +24,7 @@ class MockRuntimeChecker extends RuntimeChecker with NoSuchMethodProvider { @override bool isReleaseMode() => isRelease; + + @override + bool isAppObfuscated() => isObfuscated; } diff --git a/flutter/lib/src/integrations/load_native_debug_images_integration.dart b/flutter/lib/src/integrations/load_native_debug_images_integration.dart index 4ae7222d4a..ad72d34aaf 100644 --- a/flutter/lib/src/integrations/load_native_debug_images_integration.dart +++ b/flutter/lib/src/integrations/load_native_debug_images_integration.dart @@ -3,8 +3,6 @@ import 'dart:async'; import 'package:sentry/sentry.dart'; // ignore: implementation_imports import 'package:sentry/src/load_dart_debug_images_integration.dart'; -// ignore: implementation_imports -import 'package:sentry/src/utils/obfuscation.dart'; import '../native/sentry_native_binding.dart'; import '../sentry_flutter_options.dart'; @@ -20,7 +18,7 @@ class LoadNativeDebugImagesIntegration @override void call(Hub hub, SentryFlutterOptions options) { // ignore: invalid_use_of_internal_member - if (isAppObfuscated()) { + if (options.runtimeChecker.isAppObfuscated()) { options.addEventProcessor( _LoadImageListIntegrationEventProcessor(options, _native), ); diff --git a/flutter/test/integrations/load_native_debug_images_integration_test.dart b/flutter/test/integrations/load_native_debug_images_integration_test.dart index 0c9fcdae9b..eb89726832 100644 --- a/flutter/test/integrations/load_native_debug_images_integration_test.dart +++ b/flutter/test/integrations/load_native_debug_images_integration_test.dart @@ -6,6 +6,7 @@ import 'package:mockito/mockito.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:sentry_flutter/src/integrations/load_native_debug_images_integration.dart'; +import '../mocks.dart'; import 'fixture.dart'; void main() { @@ -26,6 +27,7 @@ void main() { setUp(() async { fixture = IntegrationTestFixture(LoadNativeDebugImagesIntegration.new); + fixture.options.runtimeChecker = MockRuntimeChecker(isObfuscated: true); when(fixture.binding.loadDebugImages(any)) .thenAnswer((_) async => imageList.toList()); await fixture.registerIntegration(); @@ -104,6 +106,28 @@ void main() { verifyNever(fixture.binding.loadDebugImages(any)); }); }); + + test('does not add itself to sdk.integrations if app is not obfuscated', + () async { + final fixture = + IntegrationTestFixture(LoadNativeDebugImagesIntegration.new); + fixture.options.runtimeChecker = MockRuntimeChecker(); + await fixture.registerIntegration(); + expect( + fixture.options.sdk.integrations + .contains(LoadNativeDebugImagesIntegration.integrationName), + false, + ); + }); + + test('does not add event processor to options if app is not obfuscated', + () async { + final fixture = + IntegrationTestFixture(LoadNativeDebugImagesIntegration.new); + fixture.options.runtimeChecker = MockRuntimeChecker(); + await fixture.registerIntegration(); + expect(fixture.options.eventProcessors.length, 0); + }); } SentryEvent _getEvent() { diff --git a/flutter/test/mocks.dart b/flutter/test/mocks.dart index 592b70d886..a6fe71432f 100644 --- a/flutter/test/mocks.dart +++ b/flutter/test/mocks.dart @@ -6,13 +6,13 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:meta/meta.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; +import 'package:sentry/src/platform/platform.dart'; import 'package:sentry/src/sentry_tracer.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:sentry_flutter/src/frames_tracking/sentry_delayed_frames_tracker.dart'; import 'package:sentry_flutter/src/native/sentry_native_binding.dart'; import 'package:sentry_flutter/src/renderer/renderer.dart'; import 'package:sentry_flutter/src/web/sentry_js_binding.dart'; -import 'package:sentry/src/platform/platform.dart'; import 'mocks.mocks.dart'; import 'no_such_method_provider.dart'; @@ -64,10 +64,12 @@ void main() {} class MockRuntimeChecker with NoSuchMethodProvider implements RuntimeChecker { MockRuntimeChecker({ this.buildMode = MockRuntimeCheckerBuildMode.debug, + this.isObfuscated = false, this.isRoot = true, }); final MockRuntimeCheckerBuildMode buildMode; + final bool isObfuscated; final bool isRoot; @override @@ -79,6 +81,9 @@ class MockRuntimeChecker with NoSuchMethodProvider implements RuntimeChecker { @override bool isReleaseMode() => buildMode == MockRuntimeCheckerBuildMode.release; + @override + bool isAppObfuscated() => isObfuscated; + @override bool get isRootZone => isRoot; } From 614249765f67d47b246285247dd632c26ddb5752 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Tue, 6 May 2025 17:29:29 +0200 Subject: [PATCH 03/37] add initial impl --- .../lib/src/web/web_sentry_js_binding.dart | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/flutter/lib/src/web/web_sentry_js_binding.dart b/flutter/lib/src/web/web_sentry_js_binding.dart index 9e85a2d387..65a850e6a4 100644 --- a/flutter/lib/src/web/web_sentry_js_binding.dart +++ b/flutter/lib/src/web/web_sentry_js_binding.dart @@ -19,6 +19,9 @@ class WebSentryJsBinding implements SentryJsBinding { .map((String integration) => _createIntegration(integration)); } _init(options.jsify()); + print('hello'); + print(getFilenameToDebugIdMap().keys.elementAt(1)); + print(getFilenameToDebugIdMap().keys.first); _client = SentryJsClient(); } @@ -93,6 +96,75 @@ class WebSentryJsBinding implements SentryJsBinding { return null; } } + + Map? cachedFilenameDebugIds; + int? lastKeysCount; + Map>? parsedStackResults; + + Map getFilenameToDebugIdMap() { + final debugIdMap = + _globalThis['_sentryDebugIds'].dartify() as Map?; + final stackParser = _stackParser(); + // final debugIdMap = test + if (debugIdMap == null || stackParser == null) { + return {}; + } + + final debugIdKeys = debugIdMap.keys.toList(); + + // Use cached results if available + if (cachedFilenameDebugIds != null && debugIdKeys.length == lastKeysCount) { + return Map.from(cachedFilenameDebugIds!); + } + + lastKeysCount = debugIdKeys.length; + + // Build a map of filename -> debug_id. + cachedFilenameDebugIds = + debugIdKeys.fold>({}, (acc, stackKey) { + parsedStackResults ??= {}; + + final String stackKeyStr = stackKey.toString(); + print(stackKeyStr); + final List? result = parsedStackResults![stackKeyStr]; + + if (result != null) { + acc[result[0]] = result[1]; + } else { + final parsedStack = _stackParser() + ?.callAsFunction(SentryJsClient().getOptions(), stackKeyStr.toJS) + .dartify() as List?; + + if (parsedStack == null) { + return acc; + } + + for (int i = parsedStack.length - 1; i >= 0; i--) { + final stackFrame = parsedStack[i] as Map?; + final filename = stackFrame?['filename']?.toString(); + final debugId = debugIdMap[stackKeyStr]?.toString(); + + if (filename != null && debugId != null) { + acc[filename] = debugId; + parsedStackResults![stackKeyStr] = [filename, debugId]; + break; + } + } + } + + return acc; + }); + + return Map.from(cachedFilenameDebugIds!); + } + + JSFunction? _stackParser() { + final parser = SentryJsClient().getOptions()?['stackParser']; + if (parser != null && parser.isA()) { + return parser as JSFunction; + } + return null; + } } @JS('Sentry.init') From 63b5ed2c631f62a03088e552db4d7cafac757184 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 7 May 2025 14:27:00 +0200 Subject: [PATCH 04/37] Update --- .../lib/src/integrations/integrations.dart | 2 +- .../load_debug_images_integration.dart | 2 + ...native_load_debug_images_integration.dart} | 7 ++- .../web_load_debug_images_integration.dart | 49 +++++++++++++++++++ flutter/lib/src/sentry_flutter.dart | 2 +- .../lib/src/web/noop_sentry_js_binding.dart | 5 ++ flutter/lib/src/web/sentry_js_binding.dart | 2 +- flutter/lib/src/web/sentry_web.dart | 29 +++++++++-- .../lib/src/web/web_sentry_js_binding.dart | 4 +- ..._native_debug_images_integration_test.dart | 2 +- 10 files changed, 92 insertions(+), 12 deletions(-) create mode 100644 flutter/lib/src/integrations/load_debug_images_integration.dart rename flutter/lib/src/integrations/{load_native_debug_images_integration.dart => native_load_debug_images_integration.dart} (90%) create mode 100644 flutter/lib/src/integrations/web_load_debug_images_integration.dart diff --git a/flutter/lib/src/integrations/integrations.dart b/flutter/lib/src/integrations/integrations.dart index bc971f64b3..fbdb180f9c 100644 --- a/flutter/lib/src/integrations/integrations.dart +++ b/flutter/lib/src/integrations/integrations.dart @@ -1,9 +1,9 @@ export 'debug_print_integration.dart'; export 'flutter_error_integration.dart'; export 'load_contexts_integration.dart'; -export 'load_native_debug_images_integration.dart'; export 'load_release_integration.dart'; export 'native_app_start_integration.dart'; +export 'native_load_debug_images_integration.dart'; export 'on_error_integration.dart'; export 'sdk_integration.dart'; export 'widgets_binding_integration.dart'; diff --git a/flutter/lib/src/integrations/load_debug_images_integration.dart b/flutter/lib/src/integrations/load_debug_images_integration.dart new file mode 100644 index 0000000000..b10b449ba2 --- /dev/null +++ b/flutter/lib/src/integrations/load_debug_images_integration.dart @@ -0,0 +1,2 @@ +export 'native_load_debug_images_integration.dart' + if (dart.library.js_interop) 'web_load_debug_images_integration.dart'; diff --git a/flutter/lib/src/integrations/load_native_debug_images_integration.dart b/flutter/lib/src/integrations/native_load_debug_images_integration.dart similarity index 90% rename from flutter/lib/src/integrations/load_native_debug_images_integration.dart rename to flutter/lib/src/integrations/native_load_debug_images_integration.dart index 757747c31f..4fe7210afd 100644 --- a/flutter/lib/src/integrations/load_native_debug_images_integration.dart +++ b/flutter/lib/src/integrations/native_load_debug_images_integration.dart @@ -7,11 +7,16 @@ import 'package:sentry/src/load_dart_debug_images_integration.dart'; import '../native/sentry_native_binding.dart'; import '../sentry_flutter_options.dart'; +Integration createLoadDebugImagesIntegration( + SentryNativeBinding native) { + return LoadNativeDebugImagesIntegration(native); +} + /// Loads the native debug image list from the native SDKs for stack trace symbolication. class LoadNativeDebugImagesIntegration extends Integration { final SentryNativeBinding _native; - static const integrationName = 'LoadNativeDebugImagesIntegration'; + static const integrationName = 'LoadNativeDebugImages'; LoadNativeDebugImagesIntegration(this._native); diff --git a/flutter/lib/src/integrations/web_load_debug_images_integration.dart b/flutter/lib/src/integrations/web_load_debug_images_integration.dart new file mode 100644 index 0000000000..7edbe5d7da --- /dev/null +++ b/flutter/lib/src/integrations/web_load_debug_images_integration.dart @@ -0,0 +1,49 @@ +import 'dart:async'; + +import 'package:sentry/sentry.dart'; + +import '../native/sentry_native_binding.dart'; +import '../sentry_flutter_options.dart'; + +Integration createLoadDebugImagesIntegration( + SentryNativeBinding native) { + return LoadNativeDebugImagesIntegration(native); +} + +/// Loads the debug id injected by Sentry tooling e.g Sentry Dart Plugin +/// This is necessary for symbolication of minified js stacktraces. +class LoadNativeDebugImagesIntegration + extends Integration { + final SentryNativeBinding _native; + static const integrationName = 'LoadWebDebugImages'; + + LoadNativeDebugImagesIntegration(this._native); + + @override + void call(Hub hub, SentryFlutterOptions options) { + options.addEventProcessor( + _LoadDebugIdEventProcessor(_native), + ); + options.sdk.addIntegration(integrationName); + } +} + +class _LoadDebugIdEventProcessor implements EventProcessor { + _LoadDebugIdEventProcessor(this._native); + + final SentryNativeBinding _native; + + @override + Future apply(SentryEvent event, Hint hint) async { + // ignore: invalid_use_of_internal_member + final stackTrace = event.stacktrace; + if (stackTrace == null) { + return event; + } + final debugImages = await _native.loadDebugImages(stackTrace); + if (debugImages != null) { + event.debugMeta = DebugMeta(images: debugImages); + } + return event; + } +} diff --git a/flutter/lib/src/sentry_flutter.dart b/flutter/lib/src/sentry_flutter.dart index 21a8e510d0..a60d13e9a3 100644 --- a/flutter/lib/src/sentry_flutter.dart +++ b/flutter/lib/src/sentry_flutter.dart @@ -181,11 +181,11 @@ mixin SentryFlutter { // We also need to call this before the native sdk integrations so release is properly propagated. integrations.add(LoadReleaseIntegration()); integrations.add(createSdkIntegration(native)); + integrations.add(createLoadDebugImagesIntegration(native)); if (!platform.isWeb) { if (native.supportsLoadContexts) { integrations.add(LoadContextsIntegration(native)); } - integrations.add(LoadNativeDebugImagesIntegration(native)); integrations.add(FramesTrackingIntegration(native)); integrations.add( NativeAppStartIntegration( diff --git a/flutter/lib/src/web/noop_sentry_js_binding.dart b/flutter/lib/src/web/noop_sentry_js_binding.dart index 2fe3bfe53e..5e05723dcc 100644 --- a/flutter/lib/src/web/noop_sentry_js_binding.dart +++ b/flutter/lib/src/web/noop_sentry_js_binding.dart @@ -32,4 +32,9 @@ class NoOpSentryJsBinding implements SentryJsBinding { @override void updateSession({int? errors, String? status}) {} + + @override + Map getFilenameToDebugIdMap() { + return {}; + } } diff --git a/flutter/lib/src/web/sentry_js_binding.dart b/flutter/lib/src/web/sentry_js_binding.dart index 909130d818..b667d6dce5 100644 --- a/flutter/lib/src/web/sentry_js_binding.dart +++ b/flutter/lib/src/web/sentry_js_binding.dart @@ -11,7 +11,7 @@ abstract class SentryJsBinding { Map? getSession(); void updateSession({int? errors, String? status}); void captureSession(); - + Map getFilenameToDebugIdMap(); @visibleForTesting dynamic getJsOptions(); } diff --git a/flutter/lib/src/web/sentry_web.dart b/flutter/lib/src/web/sentry_web.dart index 5e209c0707..eb2c082865 100644 --- a/flutter/lib/src/web/sentry_web.dart +++ b/flutter/lib/src/web/sentry_web.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'dart:typed_data'; -// ignore: implementation_imports import 'package:sentry/src/sentry_item_type.dart'; import '../../sentry_flutter.dart'; @@ -18,8 +17,12 @@ class SentryWeb with SentryNativeSafeInvoker implements SentryNativeBinding { final SentryJsBinding _binding; final SentryFlutterOptions _options; - void _logNotSupported(String operation) => options.logger( - SentryLevel.debug, 'SentryWeb: $operation is not supported'); + void _log(String message) { + _options.logger(SentryLevel.info, logger: '$SentryWeb', message); + } + + void _logNotSupported(String operation) => + _log('$operation is not supported'); @override FutureOr init(Hub hub) { @@ -178,7 +181,25 @@ class SentryWeb with SentryNativeSafeInvoker implements SentryNativeBinding { @override FutureOr?> loadDebugImages(SentryStackTrace stackTrace) { - _logNotSupported('loading debug images'); + final map = _binding.getFilenameToDebugIdMap(); + if (map.isEmpty) { + _log('Could not find debug id in js source file.'); + return null; + } + + // Find the first frame that has an entry in the map. + for (final frame in stackTrace.frames) { + final debugId = map[frame.absPath] ?? map[frame.fileName]; + if (debugId != null) { + final codeFile = + map.containsKey(frame.absPath) ? frame.absPath : frame.fileName; + return [ + DebugImage(debugId: debugId, type: 'sourcemap', codeFile: codeFile) + ]; + } + } + + _log('Could not match any frame against the debug id map.'); return null; } diff --git a/flutter/lib/src/web/web_sentry_js_binding.dart b/flutter/lib/src/web/web_sentry_js_binding.dart index 65a850e6a4..b4eb9febae 100644 --- a/flutter/lib/src/web/web_sentry_js_binding.dart +++ b/flutter/lib/src/web/web_sentry_js_binding.dart @@ -19,9 +19,6 @@ class WebSentryJsBinding implements SentryJsBinding { .map((String integration) => _createIntegration(integration)); } _init(options.jsify()); - print('hello'); - print(getFilenameToDebugIdMap().keys.elementAt(1)); - print(getFilenameToDebugIdMap().keys.first); _client = SentryJsClient(); } @@ -101,6 +98,7 @@ class WebSentryJsBinding implements SentryJsBinding { int? lastKeysCount; Map>? parsedStackResults; + @override Map getFilenameToDebugIdMap() { final debugIdMap = _globalThis['_sentryDebugIds'].dartify() as Map?; diff --git a/flutter/test/integrations/load_native_debug_images_integration_test.dart b/flutter/test/integrations/load_native_debug_images_integration_test.dart index 0c9fcdae9b..b0e1dfecd3 100644 --- a/flutter/test/integrations/load_native_debug_images_integration_test.dart +++ b/flutter/test/integrations/load_native_debug_images_integration_test.dart @@ -4,7 +4,7 @@ library; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; -import 'package:sentry_flutter/src/integrations/load_native_debug_images_integration.dart'; +import 'package:sentry_flutter/src/integrations/native_load_debug_images_integration.dart'; import 'fixture.dart'; From acc4f939d6415830317ecba5b1c78232c5af2003 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 8 May 2025 14:57:14 +0200 Subject: [PATCH 05/37] Update mocks --- flutter/test/mocks.mocks.dart | 3105 +++++++++-------- .../sentry_screenshot_widget_test.mocks.dart | 7 +- 2 files changed, 1672 insertions(+), 1440 deletions(-) diff --git a/flutter/test/mocks.mocks.dart b/flutter/test/mocks.mocks.dart index 6ff796236f..295e34ee00 100644 --- a/flutter/test/mocks.mocks.dart +++ b/flutter/test/mocks.mocks.dart @@ -47,151 +47,151 @@ import 'mocks.dart' as _i13; class _FakeSentrySpanContext_0 extends _i1.SmartFake implements _i2.SentrySpanContext { _FakeSentrySpanContext_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDateTime_1 extends _i1.SmartFake implements DateTime { _FakeDateTime_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeISentrySpan_2 extends _i1.SmartFake implements _i2.ISentrySpan { _FakeISentrySpan_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSentryTraceHeader_3 extends _i1.SmartFake implements _i2.SentryTraceHeader { _FakeSentryTraceHeader_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSentryTracer_4 extends _i1.SmartFake implements _i3.SentryTracer { _FakeSentryTracer_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSentryId_5 extends _i1.SmartFake implements _i2.SentryId { _FakeSentryId_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeContexts_6 extends _i1.SmartFake implements _i2.Contexts { _FakeContexts_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSentryTransaction_7 extends _i1.SmartFake implements _i2.SentryTransaction { _FakeSentryTransaction_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeMethodCodec_8 extends _i1.SmartFake implements _i4.MethodCodec { _FakeMethodCodec_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeBinaryMessenger_9 extends _i1.SmartFake implements _i4.BinaryMessenger { _FakeBinaryMessenger_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWidgetsBinding_10 extends _i1.SmartFake implements _i5.WidgetsBinding { _FakeWidgetsBinding_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSingletonFlutterWindow_11 extends _i1.SmartFake implements _i6.SingletonFlutterWindow { _FakeSingletonFlutterWindow_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformDispatcher_12 extends _i1.SmartFake implements _i6.PlatformDispatcher { _FakePlatformDispatcher_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePointerRouter_13 extends _i1.SmartFake implements _i7.PointerRouter { _FakePointerRouter_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeGestureArenaManager_14 extends _i1.SmartFake implements _i7.GestureArenaManager { _FakeGestureArenaManager_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePointerSignalResolver_15 extends _i1.SmartFake implements _i7.PointerSignalResolver { _FakePointerSignalResolver_15(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDuration_16 extends _i1.SmartFake implements Duration { _FakeDuration_16(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSamplingClock_17 extends _i1.SmartFake implements _i7.SamplingClock { _FakeSamplingClock_17(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeValueNotifier_18 extends _i1.SmartFake implements _i8.ValueNotifier { _FakeValueNotifier_18(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeHardwareKeyboard_19 extends _i1.SmartFake implements _i4.HardwareKeyboard { _FakeHardwareKeyboard_19(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeKeyEventManager_20 extends _i1.SmartFake implements _i4.KeyEventManager { _FakeKeyEventManager_20(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeChannelBuffers_21 extends _i1.SmartFake implements _i6.ChannelBuffers { _FakeChannelBuffers_21(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeRestorationManager_22 extends _i1.SmartFake implements _i4.RestorationManager { _FakeRestorationManager_22(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeImageCache_23 extends _i1.SmartFake implements _i9.ImageCache { _FakeImageCache_23(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeListenable_24 extends _i1.SmartFake implements _i8.Listenable { _FakeListenable_24(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeAccessibilityFeatures_25 extends _i1.SmartFake implements _i6.AccessibilityFeatures { _FakeAccessibilityFeatures_25(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeRenderView_26 extends _i1.SmartFake implements _i10.RenderView { _FakeRenderView_26(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); @override String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => @@ -200,18 +200,18 @@ class _FakeRenderView_26 extends _i1.SmartFake implements _i10.RenderView { class _FakeMouseTracker_27 extends _i1.SmartFake implements _i10.MouseTracker { _FakeMouseTracker_27(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformMenuDelegate_28 extends _i1.SmartFake implements _i9.PlatformMenuDelegate { _FakePlatformMenuDelegate_28(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeFocusManager_29 extends _i1.SmartFake implements _i9.FocusManager { _FakeFocusManager_29(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); @override String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => @@ -220,51 +220,51 @@ class _FakeFocusManager_29 extends _i1.SmartFake implements _i9.FocusManager { class _FakeFuture_30 extends _i1.SmartFake implements _i11.Future { _FakeFuture_30(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeCodec_31 extends _i1.SmartFake implements _i6.Codec { _FakeCodec_31(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSemanticsHandle_32 extends _i1.SmartFake implements _i12.SemanticsHandle { _FakeSemanticsHandle_32(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSemanticsUpdateBuilder_33 extends _i1.SmartFake implements _i6.SemanticsUpdateBuilder { _FakeSemanticsUpdateBuilder_33(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeViewConfiguration_34 extends _i1.SmartFake implements _i10.ViewConfiguration { _FakeViewConfiguration_34(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSceneBuilder_35 extends _i1.SmartFake implements _i6.SceneBuilder { _FakeSceneBuilder_35(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePictureRecorder_36 extends _i1.SmartFake implements _i6.PictureRecorder { _FakePictureRecorder_36(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeCanvas_37 extends _i1.SmartFake implements _i6.Canvas { _FakeCanvas_37(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWidget_38 extends _i1.SmartFake implements _i9.Widget { _FakeWidget_38(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); @override String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => @@ -273,17 +273,17 @@ class _FakeWidget_38 extends _i1.SmartFake implements _i9.Widget { class _FakeSentryOptions_39 extends _i1.SmartFake implements _i2.SentryOptions { _FakeSentryOptions_39(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeScope_40 extends _i1.SmartFake implements _i2.Scope { _FakeScope_40(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeHub_41 extends _i1.SmartFake implements _i2.Hub { _FakeHub_41(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [Callbacks]. @@ -300,8 +300,9 @@ class MockCallbacks extends _i1.Mock implements _i13.Callbacks { dynamic arguments, ]) => (super.noSuchMethod( - Invocation.method(#methodCallHandler, [method, arguments]), - ) as _i11.Future?); + Invocation.method(#methodCallHandler, [method, arguments]), + ) + as _i11.Future?); } /// A class which mocks [Transport]. @@ -315,9 +316,10 @@ class MockTransport extends _i1.Mock implements _i2.Transport { @override _i11.Future<_i2.SentryId?> send(_i2.SentryEnvelope? envelope) => (super.noSuchMethod( - Invocation.method(#send, [envelope]), - returnValue: _i11.Future<_i2.SentryId?>.value(), - ) as _i11.Future<_i2.SentryId?>); + Invocation.method(#send, [envelope]), + returnValue: _i11.Future<_i2.SentryId?>.value(), + ) + as _i11.Future<_i2.SentryId?>); } /// A class which mocks [SentryTracer]. @@ -329,83 +331,93 @@ class MockSentryTracer extends _i1.Mock implements _i3.SentryTracer { } @override - String get name => (super.noSuchMethod( - Invocation.getter(#name), - returnValue: _i14.dummyValue( - this, - Invocation.getter(#name), - ), - ) as String); + String get name => + (super.noSuchMethod( + Invocation.getter(#name), + returnValue: _i14.dummyValue( + this, + Invocation.getter(#name), + ), + ) + as String); @override set name(String? _name) => super.noSuchMethod( - Invocation.setter(#name, _name), - returnValueForMissingStub: null, - ); + Invocation.setter(#name, _name), + returnValueForMissingStub: null, + ); @override _i2.SentryTransactionNameSource get transactionNameSource => (super.noSuchMethod( - Invocation.getter(#transactionNameSource), - returnValue: _i2.SentryTransactionNameSource.custom, - ) as _i2.SentryTransactionNameSource); + Invocation.getter(#transactionNameSource), + returnValue: _i2.SentryTransactionNameSource.custom, + ) + as _i2.SentryTransactionNameSource); @override set transactionNameSource( _i2.SentryTransactionNameSource? _transactionNameSource, - ) => - super.noSuchMethod( - Invocation.setter(#transactionNameSource, _transactionNameSource), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.setter(#transactionNameSource, _transactionNameSource), + returnValueForMissingStub: null, + ); @override set profiler(_i15.SentryProfiler? _profiler) => super.noSuchMethod( - Invocation.setter(#profiler, _profiler), - returnValueForMissingStub: null, - ); + Invocation.setter(#profiler, _profiler), + returnValueForMissingStub: null, + ); @override set profileInfo(_i15.SentryProfileInfo? _profileInfo) => super.noSuchMethod( - Invocation.setter(#profileInfo, _profileInfo), - returnValueForMissingStub: null, - ); + Invocation.setter(#profileInfo, _profileInfo), + returnValueForMissingStub: null, + ); @override - Map get measurements => (super.noSuchMethod( - Invocation.getter(#measurements), - returnValue: {}, - ) as Map); + Map get measurements => + (super.noSuchMethod( + Invocation.getter(#measurements), + returnValue: {}, + ) + as Map); @override - _i2.SentrySpanContext get context => (super.noSuchMethod( - Invocation.getter(#context), - returnValue: _FakeSentrySpanContext_0( - this, - Invocation.getter(#context), - ), - ) as _i2.SentrySpanContext); + _i2.SentrySpanContext get context => + (super.noSuchMethod( + Invocation.getter(#context), + returnValue: _FakeSentrySpanContext_0( + this, + Invocation.getter(#context), + ), + ) + as _i2.SentrySpanContext); @override set origin(String? origin) => super.noSuchMethod( - Invocation.setter(#origin, origin), - returnValueForMissingStub: null, - ); + Invocation.setter(#origin, origin), + returnValueForMissingStub: null, + ); @override - DateTime get startTimestamp => (super.noSuchMethod( - Invocation.getter(#startTimestamp), - returnValue: _FakeDateTime_1( - this, - Invocation.getter(#startTimestamp), - ), - ) as DateTime); + DateTime get startTimestamp => + (super.noSuchMethod( + Invocation.getter(#startTimestamp), + returnValue: _FakeDateTime_1( + this, + Invocation.getter(#startTimestamp), + ), + ) + as DateTime); @override - Map get data => (super.noSuchMethod( - Invocation.getter(#data), - returnValue: {}, - ) as Map); + Map get data => + (super.noSuchMethod( + Invocation.getter(#data), + returnValue: {}, + ) + as Map); @override bool get finished => @@ -413,28 +425,32 @@ class MockSentryTracer extends _i1.Mock implements _i3.SentryTracer { as bool); @override - List<_i2.SentrySpan> get children => (super.noSuchMethod( - Invocation.getter(#children), - returnValue: <_i2.SentrySpan>[], - ) as List<_i2.SentrySpan>); + List<_i2.SentrySpan> get children => + (super.noSuchMethod( + Invocation.getter(#children), + returnValue: <_i2.SentrySpan>[], + ) + as List<_i2.SentrySpan>); @override set throwable(dynamic throwable) => super.noSuchMethod( - Invocation.setter(#throwable, throwable), - returnValueForMissingStub: null, - ); + Invocation.setter(#throwable, throwable), + returnValueForMissingStub: null, + ); @override set status(_i2.SpanStatus? status) => super.noSuchMethod( - Invocation.setter(#status, status), - returnValueForMissingStub: null, - ); + Invocation.setter(#status, status), + returnValueForMissingStub: null, + ); @override - Map get tags => (super.noSuchMethod( - Invocation.getter(#tags), - returnValue: {}, - ) as Map); + Map get tags => + (super.noSuchMethod( + Invocation.getter(#tags), + returnValue: {}, + ) + as Map); @override _i11.Future finish({ @@ -443,38 +459,39 @@ class MockSentryTracer extends _i1.Mock implements _i3.SentryTracer { _i2.Hint? hint, }) => (super.noSuchMethod( - Invocation.method(#finish, [], { - #status: status, - #endTimestamp: endTimestamp, - #hint: hint, - }), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) as _i11.Future); + Invocation.method(#finish, [], { + #status: status, + #endTimestamp: endTimestamp, + #hint: hint, + }), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) + as _i11.Future); @override void removeData(String? key) => super.noSuchMethod( - Invocation.method(#removeData, [key]), - returnValueForMissingStub: null, - ); + Invocation.method(#removeData, [key]), + returnValueForMissingStub: null, + ); @override void removeTag(String? key) => super.noSuchMethod( - Invocation.method(#removeTag, [key]), - returnValueForMissingStub: null, - ); + Invocation.method(#removeTag, [key]), + returnValueForMissingStub: null, + ); @override void setData(String? key, dynamic value) => super.noSuchMethod( - Invocation.method(#setData, [key, value]), - returnValueForMissingStub: null, - ); + Invocation.method(#setData, [key, value]), + returnValueForMissingStub: null, + ); @override void setTag(String? key, String? value) => super.noSuchMethod( - Invocation.method(#setTag, [key, value]), - returnValueForMissingStub: null, - ); + Invocation.method(#setTag, [key, value]), + returnValueForMissingStub: null, + ); @override _i2.ISentrySpan startChild( @@ -483,20 +500,21 @@ class MockSentryTracer extends _i1.Mock implements _i3.SentryTracer { DateTime? startTimestamp, }) => (super.noSuchMethod( - Invocation.method( - #startChild, - [operation], - {#description: description, #startTimestamp: startTimestamp}, - ), - returnValue: _FakeISentrySpan_2( - this, - Invocation.method( - #startChild, - [operation], - {#description: description, #startTimestamp: startTimestamp}, - ), - ), - ) as _i2.ISentrySpan); + Invocation.method( + #startChild, + [operation], + {#description: description, #startTimestamp: startTimestamp}, + ), + returnValue: _FakeISentrySpan_2( + this, + Invocation.method( + #startChild, + [operation], + {#description: description, #startTimestamp: startTimestamp}, + ), + ), + ) + as _i2.ISentrySpan); @override _i2.ISentrySpan startChildWithParentSpanId( @@ -506,58 +524,58 @@ class MockSentryTracer extends _i1.Mock implements _i3.SentryTracer { DateTime? startTimestamp, }) => (super.noSuchMethod( - Invocation.method( - #startChildWithParentSpanId, - [parentSpanId, operation], - {#description: description, #startTimestamp: startTimestamp}, - ), - returnValue: _FakeISentrySpan_2( - this, - Invocation.method( - #startChildWithParentSpanId, - [parentSpanId, operation], - {#description: description, #startTimestamp: startTimestamp}, - ), - ), - ) as _i2.ISentrySpan); + Invocation.method( + #startChildWithParentSpanId, + [parentSpanId, operation], + {#description: description, #startTimestamp: startTimestamp}, + ), + returnValue: _FakeISentrySpan_2( + this, + Invocation.method( + #startChildWithParentSpanId, + [parentSpanId, operation], + {#description: description, #startTimestamp: startTimestamp}, + ), + ), + ) + as _i2.ISentrySpan); @override - _i2.SentryTraceHeader toSentryTrace() => (super.noSuchMethod( - Invocation.method(#toSentryTrace, []), - returnValue: _FakeSentryTraceHeader_3( - this, - Invocation.method(#toSentryTrace, []), - ), - ) as _i2.SentryTraceHeader); + _i2.SentryTraceHeader toSentryTrace() => + (super.noSuchMethod( + Invocation.method(#toSentryTrace, []), + returnValue: _FakeSentryTraceHeader_3( + this, + Invocation.method(#toSentryTrace, []), + ), + ) + as _i2.SentryTraceHeader); @override void setMeasurement( String? name, num? value, { _i2.SentryMeasurementUnit? unit, - }) => - super.noSuchMethod( - Invocation.method(#setMeasurement, [name, value], {#unit: unit}), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#setMeasurement, [name, value], {#unit: unit}), + returnValueForMissingStub: null, + ); @override void setMeasurementFromChild( String? name, num? value, { _i2.SentryMeasurementUnit? unit, - }) => - super.noSuchMethod( - Invocation.method( - #setMeasurementFromChild, [name, value], {#unit: unit}), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#setMeasurementFromChild, [name, value], {#unit: unit}), + returnValueForMissingStub: null, + ); @override void scheduleFinish() => super.noSuchMethod( - Invocation.method(#scheduleFinish, []), - returnValueForMissingStub: null, - ); + Invocation.method(#scheduleFinish, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [SentryTransaction]. @@ -569,43 +587,51 @@ class MockSentryTransaction extends _i1.Mock implements _i2.SentryTransaction { } @override - DateTime get startTimestamp => (super.noSuchMethod( - Invocation.getter(#startTimestamp), - returnValue: _FakeDateTime_1( - this, - Invocation.getter(#startTimestamp), - ), - ) as DateTime); + DateTime get startTimestamp => + (super.noSuchMethod( + Invocation.getter(#startTimestamp), + returnValue: _FakeDateTime_1( + this, + Invocation.getter(#startTimestamp), + ), + ) + as DateTime); @override set startTimestamp(DateTime? _startTimestamp) => super.noSuchMethod( - Invocation.setter(#startTimestamp, _startTimestamp), - returnValueForMissingStub: null, - ); + Invocation.setter(#startTimestamp, _startTimestamp), + returnValueForMissingStub: null, + ); @override - List<_i2.SentrySpan> get spans => (super.noSuchMethod( - Invocation.getter(#spans), - returnValue: <_i2.SentrySpan>[], - ) as List<_i2.SentrySpan>); + List<_i2.SentrySpan> get spans => + (super.noSuchMethod( + Invocation.getter(#spans), + returnValue: <_i2.SentrySpan>[], + ) + as List<_i2.SentrySpan>); @override set spans(List<_i2.SentrySpan>? _spans) => super.noSuchMethod( - Invocation.setter(#spans, _spans), - returnValueForMissingStub: null, - ); + Invocation.setter(#spans, _spans), + returnValueForMissingStub: null, + ); @override - _i3.SentryTracer get tracer => (super.noSuchMethod( - Invocation.getter(#tracer), - returnValue: _FakeSentryTracer_4(this, Invocation.getter(#tracer)), - ) as _i3.SentryTracer); + _i3.SentryTracer get tracer => + (super.noSuchMethod( + Invocation.getter(#tracer), + returnValue: _FakeSentryTracer_4(this, Invocation.getter(#tracer)), + ) + as _i3.SentryTracer); @override - Map get measurements => (super.noSuchMethod( - Invocation.getter(#measurements), - returnValue: {}, - ) as Map); + Map get measurements => + (super.noSuchMethod( + Invocation.getter(#measurements), + returnValue: {}, + ) + as Map); @override set measurements(Map? _measurements) => @@ -632,172 +658,178 @@ class MockSentryTransaction extends _i1.Mock implements _i2.SentryTransaction { as bool); @override - _i2.SentryId get eventId => (super.noSuchMethod( - Invocation.getter(#eventId), - returnValue: _FakeSentryId_5(this, Invocation.getter(#eventId)), - ) as _i2.SentryId); + _i2.SentryId get eventId => + (super.noSuchMethod( + Invocation.getter(#eventId), + returnValue: _FakeSentryId_5(this, Invocation.getter(#eventId)), + ) + as _i2.SentryId); @override set eventId(_i2.SentryId? _eventId) => super.noSuchMethod( - Invocation.setter(#eventId, _eventId), - returnValueForMissingStub: null, - ); + Invocation.setter(#eventId, _eventId), + returnValueForMissingStub: null, + ); @override set timestamp(DateTime? _timestamp) => super.noSuchMethod( - Invocation.setter(#timestamp, _timestamp), - returnValueForMissingStub: null, - ); + Invocation.setter(#timestamp, _timestamp), + returnValueForMissingStub: null, + ); @override set platform(String? _platform) => super.noSuchMethod( - Invocation.setter(#platform, _platform), - returnValueForMissingStub: null, - ); + Invocation.setter(#platform, _platform), + returnValueForMissingStub: null, + ); @override set logger(String? _logger) => super.noSuchMethod( - Invocation.setter(#logger, _logger), - returnValueForMissingStub: null, - ); + Invocation.setter(#logger, _logger), + returnValueForMissingStub: null, + ); @override set serverName(String? _serverName) => super.noSuchMethod( - Invocation.setter(#serverName, _serverName), - returnValueForMissingStub: null, - ); + Invocation.setter(#serverName, _serverName), + returnValueForMissingStub: null, + ); @override set release(String? _release) => super.noSuchMethod( - Invocation.setter(#release, _release), - returnValueForMissingStub: null, - ); + Invocation.setter(#release, _release), + returnValueForMissingStub: null, + ); @override set dist(String? _dist) => super.noSuchMethod( - Invocation.setter(#dist, _dist), - returnValueForMissingStub: null, - ); + Invocation.setter(#dist, _dist), + returnValueForMissingStub: null, + ); @override set environment(String? _environment) => super.noSuchMethod( - Invocation.setter(#environment, _environment), - returnValueForMissingStub: null, - ); + Invocation.setter(#environment, _environment), + returnValueForMissingStub: null, + ); @override set modules(Map? _modules) => super.noSuchMethod( - Invocation.setter(#modules, _modules), - returnValueForMissingStub: null, - ); + Invocation.setter(#modules, _modules), + returnValueForMissingStub: null, + ); @override set message(_i2.SentryMessage? _message) => super.noSuchMethod( - Invocation.setter(#message, _message), - returnValueForMissingStub: null, - ); + Invocation.setter(#message, _message), + returnValueForMissingStub: null, + ); @override set exceptions(List<_i2.SentryException>? _exceptions) => super.noSuchMethod( - Invocation.setter(#exceptions, _exceptions), - returnValueForMissingStub: null, - ); + Invocation.setter(#exceptions, _exceptions), + returnValueForMissingStub: null, + ); @override set threads(List<_i2.SentryThread>? _threads) => super.noSuchMethod( - Invocation.setter(#threads, _threads), - returnValueForMissingStub: null, - ); + Invocation.setter(#threads, _threads), + returnValueForMissingStub: null, + ); @override set transaction(String? _transaction) => super.noSuchMethod( - Invocation.setter(#transaction, _transaction), - returnValueForMissingStub: null, - ); + Invocation.setter(#transaction, _transaction), + returnValueForMissingStub: null, + ); @override set level(_i2.SentryLevel? _level) => super.noSuchMethod( - Invocation.setter(#level, _level), - returnValueForMissingStub: null, - ); + Invocation.setter(#level, _level), + returnValueForMissingStub: null, + ); @override set culprit(String? _culprit) => super.noSuchMethod( - Invocation.setter(#culprit, _culprit), - returnValueForMissingStub: null, - ); + Invocation.setter(#culprit, _culprit), + returnValueForMissingStub: null, + ); @override set tags(Map? _tags) => super.noSuchMethod( - Invocation.setter(#tags, _tags), - returnValueForMissingStub: null, - ); + Invocation.setter(#tags, _tags), + returnValueForMissingStub: null, + ); @override set extra(Map? _extra) => super.noSuchMethod( - Invocation.setter(#extra, _extra), - returnValueForMissingStub: null, - ); + Invocation.setter(#extra, _extra), + returnValueForMissingStub: null, + ); @override set breadcrumbs(List<_i2.Breadcrumb>? _breadcrumbs) => super.noSuchMethod( - Invocation.setter(#breadcrumbs, _breadcrumbs), - returnValueForMissingStub: null, - ); + Invocation.setter(#breadcrumbs, _breadcrumbs), + returnValueForMissingStub: null, + ); @override set user(_i2.SentryUser? _user) => super.noSuchMethod( - Invocation.setter(#user, _user), - returnValueForMissingStub: null, - ); + Invocation.setter(#user, _user), + returnValueForMissingStub: null, + ); @override - _i2.Contexts get contexts => (super.noSuchMethod( - Invocation.getter(#contexts), - returnValue: _FakeContexts_6(this, Invocation.getter(#contexts)), - ) as _i2.Contexts); + _i2.Contexts get contexts => + (super.noSuchMethod( + Invocation.getter(#contexts), + returnValue: _FakeContexts_6(this, Invocation.getter(#contexts)), + ) + as _i2.Contexts); @override set contexts(_i2.Contexts? _contexts) => super.noSuchMethod( - Invocation.setter(#contexts, _contexts), - returnValueForMissingStub: null, - ); + Invocation.setter(#contexts, _contexts), + returnValueForMissingStub: null, + ); @override set fingerprint(List? _fingerprint) => super.noSuchMethod( - Invocation.setter(#fingerprint, _fingerprint), - returnValueForMissingStub: null, - ); + Invocation.setter(#fingerprint, _fingerprint), + returnValueForMissingStub: null, + ); @override set sdk(_i2.SdkVersion? _sdk) => super.noSuchMethod( - Invocation.setter(#sdk, _sdk), - returnValueForMissingStub: null, - ); + Invocation.setter(#sdk, _sdk), + returnValueForMissingStub: null, + ); @override set request(_i2.SentryRequest? _request) => super.noSuchMethod( - Invocation.setter(#request, _request), - returnValueForMissingStub: null, - ); + Invocation.setter(#request, _request), + returnValueForMissingStub: null, + ); @override set debugMeta(_i2.DebugMeta? _debugMeta) => super.noSuchMethod( - Invocation.setter(#debugMeta, _debugMeta), - returnValueForMissingStub: null, - ); + Invocation.setter(#debugMeta, _debugMeta), + returnValueForMissingStub: null, + ); @override set type(String? _type) => super.noSuchMethod( - Invocation.setter(#type, _type), - returnValueForMissingStub: null, - ); + Invocation.setter(#type, _type), + returnValueForMissingStub: null, + ); @override - Map toJson() => (super.noSuchMethod( - Invocation.method(#toJson, []), - returnValue: {}, - ) as Map); + Map toJson() => + (super.noSuchMethod( + Invocation.method(#toJson, []), + returnValue: {}, + ) + as Map); @override _i2.SentryTransaction copyWith({ @@ -831,70 +863,71 @@ class MockSentryTransaction extends _i1.Mock implements _i2.SentryTransaction { _i2.SentryTransactionInfo? transactionInfo, }) => (super.noSuchMethod( - Invocation.method(#copyWith, [], { - #eventId: eventId, - #timestamp: timestamp, - #platform: platform, - #logger: logger, - #serverName: serverName, - #release: release, - #dist: dist, - #environment: environment, - #modules: modules, - #message: message, - #transaction: transaction, - #throwable: throwable, - #level: level, - #culprit: culprit, - #tags: tags, - #extra: extra, - #fingerprint: fingerprint, - #user: user, - #contexts: contexts, - #breadcrumbs: breadcrumbs, - #sdk: sdk, - #request: request, - #debugMeta: debugMeta, - #exceptions: exceptions, - #threads: threads, - #type: type, - #measurements: measurements, - #transactionInfo: transactionInfo, - }), - returnValue: _FakeSentryTransaction_7( - this, - Invocation.method(#copyWith, [], { - #eventId: eventId, - #timestamp: timestamp, - #platform: platform, - #logger: logger, - #serverName: serverName, - #release: release, - #dist: dist, - #environment: environment, - #modules: modules, - #message: message, - #transaction: transaction, - #throwable: throwable, - #level: level, - #culprit: culprit, - #tags: tags, - #extra: extra, - #fingerprint: fingerprint, - #user: user, - #contexts: contexts, - #breadcrumbs: breadcrumbs, - #sdk: sdk, - #request: request, - #debugMeta: debugMeta, - #exceptions: exceptions, - #threads: threads, - #type: type, - #measurements: measurements, - #transactionInfo: transactionInfo, - }), - ), - ) as _i2.SentryTransaction); + Invocation.method(#copyWith, [], { + #eventId: eventId, + #timestamp: timestamp, + #platform: platform, + #logger: logger, + #serverName: serverName, + #release: release, + #dist: dist, + #environment: environment, + #modules: modules, + #message: message, + #transaction: transaction, + #throwable: throwable, + #level: level, + #culprit: culprit, + #tags: tags, + #extra: extra, + #fingerprint: fingerprint, + #user: user, + #contexts: contexts, + #breadcrumbs: breadcrumbs, + #sdk: sdk, + #request: request, + #debugMeta: debugMeta, + #exceptions: exceptions, + #threads: threads, + #type: type, + #measurements: measurements, + #transactionInfo: transactionInfo, + }), + returnValue: _FakeSentryTransaction_7( + this, + Invocation.method(#copyWith, [], { + #eventId: eventId, + #timestamp: timestamp, + #platform: platform, + #logger: logger, + #serverName: serverName, + #release: release, + #dist: dist, + #environment: environment, + #modules: modules, + #message: message, + #transaction: transaction, + #throwable: throwable, + #level: level, + #culprit: culprit, + #tags: tags, + #extra: extra, + #fingerprint: fingerprint, + #user: user, + #contexts: contexts, + #breadcrumbs: breadcrumbs, + #sdk: sdk, + #request: request, + #debugMeta: debugMeta, + #exceptions: exceptions, + #threads: threads, + #type: type, + #measurements: measurements, + #transactionInfo: transactionInfo, + }), + ), + ) + as _i2.SentryTransaction); } /// A class which mocks [SentrySpan]. @@ -911,40 +944,46 @@ class MockSentrySpan extends _i1.Mock implements _i2.SentrySpan { as bool); @override - _i3.SentryTracer get tracer => (super.noSuchMethod( - Invocation.getter(#tracer), - returnValue: _FakeSentryTracer_4(this, Invocation.getter(#tracer)), - ) as _i3.SentryTracer); + _i3.SentryTracer get tracer => + (super.noSuchMethod( + Invocation.getter(#tracer), + returnValue: _FakeSentryTracer_4(this, Invocation.getter(#tracer)), + ) + as _i3.SentryTracer); @override set status(_i2.SpanStatus? status) => super.noSuchMethod( - Invocation.setter(#status, status), - returnValueForMissingStub: null, - ); + Invocation.setter(#status, status), + returnValueForMissingStub: null, + ); @override - DateTime get startTimestamp => (super.noSuchMethod( - Invocation.getter(#startTimestamp), - returnValue: _FakeDateTime_1( - this, - Invocation.getter(#startTimestamp), - ), - ) as DateTime); + DateTime get startTimestamp => + (super.noSuchMethod( + Invocation.getter(#startTimestamp), + returnValue: _FakeDateTime_1( + this, + Invocation.getter(#startTimestamp), + ), + ) + as DateTime); @override - _i2.SentrySpanContext get context => (super.noSuchMethod( - Invocation.getter(#context), - returnValue: _FakeSentrySpanContext_0( - this, - Invocation.getter(#context), - ), - ) as _i2.SentrySpanContext); + _i2.SentrySpanContext get context => + (super.noSuchMethod( + Invocation.getter(#context), + returnValue: _FakeSentrySpanContext_0( + this, + Invocation.getter(#context), + ), + ) + as _i2.SentrySpanContext); @override set origin(String? origin) => super.noSuchMethod( - Invocation.setter(#origin, origin), - returnValueForMissingStub: null, - ); + Invocation.setter(#origin, origin), + returnValueForMissingStub: null, + ); @override bool get finished => @@ -953,21 +992,25 @@ class MockSentrySpan extends _i1.Mock implements _i2.SentrySpan { @override set throwable(dynamic throwable) => super.noSuchMethod( - Invocation.setter(#throwable, throwable), - returnValueForMissingStub: null, - ); + Invocation.setter(#throwable, throwable), + returnValueForMissingStub: null, + ); @override - Map get tags => (super.noSuchMethod( - Invocation.getter(#tags), - returnValue: {}, - ) as Map); + Map get tags => + (super.noSuchMethod( + Invocation.getter(#tags), + returnValue: {}, + ) + as Map); @override - Map get data => (super.noSuchMethod( - Invocation.getter(#data), - returnValue: {}, - ) as Map); + Map get data => + (super.noSuchMethod( + Invocation.getter(#data), + returnValue: {}, + ) + as Map); @override _i11.Future finish({ @@ -976,38 +1019,39 @@ class MockSentrySpan extends _i1.Mock implements _i2.SentrySpan { _i2.Hint? hint, }) => (super.noSuchMethod( - Invocation.method(#finish, [], { - #status: status, - #endTimestamp: endTimestamp, - #hint: hint, - }), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) as _i11.Future); + Invocation.method(#finish, [], { + #status: status, + #endTimestamp: endTimestamp, + #hint: hint, + }), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) + as _i11.Future); @override void removeData(String? key) => super.noSuchMethod( - Invocation.method(#removeData, [key]), - returnValueForMissingStub: null, - ); + Invocation.method(#removeData, [key]), + returnValueForMissingStub: null, + ); @override void removeTag(String? key) => super.noSuchMethod( - Invocation.method(#removeTag, [key]), - returnValueForMissingStub: null, - ); + Invocation.method(#removeTag, [key]), + returnValueForMissingStub: null, + ); @override void setData(String? key, dynamic value) => super.noSuchMethod( - Invocation.method(#setData, [key, value]), - returnValueForMissingStub: null, - ); + Invocation.method(#setData, [key, value]), + returnValueForMissingStub: null, + ); @override void setTag(String? key, String? value) => super.noSuchMethod( - Invocation.method(#setTag, [key, value]), - returnValueForMissingStub: null, - ); + Invocation.method(#setTag, [key, value]), + returnValueForMissingStub: null, + ); @override _i2.ISentrySpan startChild( @@ -1016,52 +1060,56 @@ class MockSentrySpan extends _i1.Mock implements _i2.SentrySpan { DateTime? startTimestamp, }) => (super.noSuchMethod( - Invocation.method( - #startChild, - [operation], - {#description: description, #startTimestamp: startTimestamp}, - ), - returnValue: _FakeISentrySpan_2( - this, - Invocation.method( - #startChild, - [operation], - {#description: description, #startTimestamp: startTimestamp}, - ), - ), - ) as _i2.ISentrySpan); + Invocation.method( + #startChild, + [operation], + {#description: description, #startTimestamp: startTimestamp}, + ), + returnValue: _FakeISentrySpan_2( + this, + Invocation.method( + #startChild, + [operation], + {#description: description, #startTimestamp: startTimestamp}, + ), + ), + ) + as _i2.ISentrySpan); @override - Map toJson() => (super.noSuchMethod( - Invocation.method(#toJson, []), - returnValue: {}, - ) as Map); + Map toJson() => + (super.noSuchMethod( + Invocation.method(#toJson, []), + returnValue: {}, + ) + as Map); @override - _i2.SentryTraceHeader toSentryTrace() => (super.noSuchMethod( - Invocation.method(#toSentryTrace, []), - returnValue: _FakeSentryTraceHeader_3( - this, - Invocation.method(#toSentryTrace, []), - ), - ) as _i2.SentryTraceHeader); + _i2.SentryTraceHeader toSentryTrace() => + (super.noSuchMethod( + Invocation.method(#toSentryTrace, []), + returnValue: _FakeSentryTraceHeader_3( + this, + Invocation.method(#toSentryTrace, []), + ), + ) + as _i2.SentryTraceHeader); @override void setMeasurement( String? name, num? value, { _i2.SentryMeasurementUnit? unit, - }) => - super.noSuchMethod( - Invocation.method(#setMeasurement, [name, value], {#unit: unit}), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#setMeasurement, [name, value], {#unit: unit}), + returnValueForMissingStub: null, + ); @override void scheduleFinish() => super.noSuchMethod( - Invocation.method(#scheduleFinish, []), - returnValueForMissingStub: null, - ); + Invocation.method(#scheduleFinish, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [SentryClient]. @@ -1080,22 +1128,23 @@ class MockSentryClient extends _i1.Mock implements _i2.SentryClient { _i2.Hint? hint, }) => (super.noSuchMethod( - Invocation.method( - #captureEvent, - [event], - {#scope: scope, #stackTrace: stackTrace, #hint: hint}, - ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, Invocation.method( #captureEvent, [event], {#scope: scope, #stackTrace: stackTrace, #hint: hint}, ), - ), - ), - ) as _i11.Future<_i2.SentryId>); + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, + Invocation.method( + #captureEvent, + [event], + {#scope: scope, #stackTrace: stackTrace, #hint: hint}, + ), + ), + ), + ) + as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId> captureException( @@ -1105,22 +1154,23 @@ class MockSentryClient extends _i1.Mock implements _i2.SentryClient { _i2.Hint? hint, }) => (super.noSuchMethod( - Invocation.method( - #captureException, - [throwable], - {#stackTrace: stackTrace, #scope: scope, #hint: hint}, - ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, Invocation.method( #captureException, [throwable], {#stackTrace: stackTrace, #scope: scope, #hint: hint}, ), - ), - ), - ) as _i11.Future<_i2.SentryId>); + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, + Invocation.method( + #captureException, + [throwable], + {#stackTrace: stackTrace, #scope: scope, #hint: hint}, + ), + ), + ), + ) + as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId> captureMessage( @@ -1132,20 +1182,6 @@ class MockSentryClient extends _i1.Mock implements _i2.SentryClient { _i2.Hint? hint, }) => (super.noSuchMethod( - Invocation.method( - #captureMessage, - [formatted], - { - #level: level, - #template: template, - #params: params, - #scope: scope, - #hint: hint, - }, - ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, Invocation.method( #captureMessage, [formatted], @@ -1157,9 +1193,24 @@ class MockSentryClient extends _i1.Mock implements _i2.SentryClient { #hint: hint, }, ), - ), - ), - ) as _i11.Future<_i2.SentryId>); + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, + Invocation.method( + #captureMessage, + [formatted], + { + #level: level, + #template: template, + #params: params, + #scope: scope, + #hint: hint, + }, + ), + ), + ), + ) + as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId> captureTransaction( @@ -1169,29 +1220,31 @@ class MockSentryClient extends _i1.Mock implements _i2.SentryClient { _i2.Hint? hint, }) => (super.noSuchMethod( - Invocation.method( - #captureTransaction, - [transaction], - {#scope: scope, #traceContext: traceContext, #hint: hint}, - ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, Invocation.method( #captureTransaction, [transaction], {#scope: scope, #traceContext: traceContext, #hint: hint}, ), - ), - ), - ) as _i11.Future<_i2.SentryId>); + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, + Invocation.method( + #captureTransaction, + [transaction], + {#scope: scope, #traceContext: traceContext, #hint: hint}, + ), + ), + ), + ) + as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId?> captureEnvelope(_i2.SentryEnvelope? envelope) => (super.noSuchMethod( - Invocation.method(#captureEnvelope, [envelope]), - returnValue: _i11.Future<_i2.SentryId?>.value(), - ) as _i11.Future<_i2.SentryId?>); + Invocation.method(#captureEnvelope, [envelope]), + returnValue: _i11.Future<_i2.SentryId?>.value(), + ) + as _i11.Future<_i2.SentryId?>); @override _i11.Future<_i2.SentryId> captureFeedback( @@ -1200,28 +1253,29 @@ class MockSentryClient extends _i1.Mock implements _i2.SentryClient { _i2.Hint? hint, }) => (super.noSuchMethod( - Invocation.method( - #captureFeedback, - [feedback], - {#scope: scope, #hint: hint}, - ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, Invocation.method( #captureFeedback, [feedback], {#scope: scope, #hint: hint}, ), - ), - ), - ) as _i11.Future<_i2.SentryId>); + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, + Invocation.method( + #captureFeedback, + [feedback], + {#scope: scope, #hint: hint}, + ), + ), + ), + ) + as _i11.Future<_i2.SentryId>); @override void close() => super.noSuchMethod( - Invocation.method(#close, []), - returnValueForMissingStub: null, - ); + Invocation.method(#close, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [MethodChannel]. @@ -1233,35 +1287,42 @@ class MockMethodChannel extends _i1.Mock implements _i4.MethodChannel { } @override - String get name => (super.noSuchMethod( - Invocation.getter(#name), - returnValue: _i14.dummyValue( - this, - Invocation.getter(#name), - ), - ) as String); + String get name => + (super.noSuchMethod( + Invocation.getter(#name), + returnValue: _i14.dummyValue( + this, + Invocation.getter(#name), + ), + ) + as String); @override - _i4.MethodCodec get codec => (super.noSuchMethod( - Invocation.getter(#codec), - returnValue: _FakeMethodCodec_8(this, Invocation.getter(#codec)), - ) as _i4.MethodCodec); + _i4.MethodCodec get codec => + (super.noSuchMethod( + Invocation.getter(#codec), + returnValue: _FakeMethodCodec_8(this, Invocation.getter(#codec)), + ) + as _i4.MethodCodec); @override - _i4.BinaryMessenger get binaryMessenger => (super.noSuchMethod( - Invocation.getter(#binaryMessenger), - returnValue: _FakeBinaryMessenger_9( - this, - Invocation.getter(#binaryMessenger), - ), - ) as _i4.BinaryMessenger); + _i4.BinaryMessenger get binaryMessenger => + (super.noSuchMethod( + Invocation.getter(#binaryMessenger), + returnValue: _FakeBinaryMessenger_9( + this, + Invocation.getter(#binaryMessenger), + ), + ) + as _i4.BinaryMessenger); @override _i11.Future invokeMethod(String? method, [dynamic arguments]) => (super.noSuchMethod( - Invocation.method(#invokeMethod, [method, arguments]), - returnValue: _i11.Future.value(), - ) as _i11.Future); + Invocation.method(#invokeMethod, [method, arguments]), + returnValue: _i11.Future.value(), + ) + as _i11.Future); @override _i11.Future?> invokeListMethod( @@ -1269,9 +1330,10 @@ class MockMethodChannel extends _i1.Mock implements _i4.MethodChannel { dynamic arguments, ]) => (super.noSuchMethod( - Invocation.method(#invokeListMethod, [method, arguments]), - returnValue: _i11.Future?>.value(), - ) as _i11.Future?>); + Invocation.method(#invokeListMethod, [method, arguments]), + returnValue: _i11.Future?>.value(), + ) + as _i11.Future?>); @override _i11.Future?> invokeMapMethod( @@ -1279,18 +1341,18 @@ class MockMethodChannel extends _i1.Mock implements _i4.MethodChannel { dynamic arguments, ]) => (super.noSuchMethod( - Invocation.method(#invokeMapMethod, [method, arguments]), - returnValue: _i11.Future?>.value(), - ) as _i11.Future?>); + Invocation.method(#invokeMapMethod, [method, arguments]), + returnValue: _i11.Future?>.value(), + ) + as _i11.Future?>); @override void setMethodCallHandler( _i11.Future Function(_i4.MethodCall)? handler, - ) => - super.noSuchMethod( - Invocation.method(#setMethodCallHandler, [handler]), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#setMethodCallHandler, [handler]), + returnValueForMissingStub: null, + ); } /// A class which mocks [SentryNativeBinding]. @@ -1303,22 +1365,28 @@ class MockSentryNativeBinding extends _i1.Mock } @override - bool get supportsCaptureEnvelope => (super.noSuchMethod( - Invocation.getter(#supportsCaptureEnvelope), - returnValue: false, - ) as bool); + bool get supportsCaptureEnvelope => + (super.noSuchMethod( + Invocation.getter(#supportsCaptureEnvelope), + returnValue: false, + ) + as bool); @override - bool get supportsLoadContexts => (super.noSuchMethod( - Invocation.getter(#supportsLoadContexts), - returnValue: false, - ) as bool); + bool get supportsLoadContexts => + (super.noSuchMethod( + Invocation.getter(#supportsLoadContexts), + returnValue: false, + ) + as bool); @override - bool get supportsReplay => (super.noSuchMethod( - Invocation.getter(#supportsReplay), - returnValue: false, - ) as bool); + bool get supportsReplay => + (super.noSuchMethod( + Invocation.getter(#supportsReplay), + returnValue: false, + ) + as bool); @override _i11.FutureOr init(_i2.Hub? hub) => @@ -1331,17 +1399,19 @@ class MockSentryNativeBinding extends _i1.Mock bool? containsUnhandledException, ) => (super.noSuchMethod( - Invocation.method(#captureEnvelope, [ - envelopeData, - containsUnhandledException, - ]), - ) as _i11.FutureOr); + Invocation.method(#captureEnvelope, [ + envelopeData, + containsUnhandledException, + ]), + ) + as _i11.FutureOr); @override _i11.FutureOr captureStructuredEnvelope(_i2.SentryEnvelope? envelope) => (super.noSuchMethod( - Invocation.method(#captureStructuredEnvelope, [envelope]), - ) as _i11.FutureOr); + Invocation.method(#captureStructuredEnvelope, [envelope]), + ) + as _i11.FutureOr); @override _i11.FutureOr<_i18.NativeFrames?> endNativeFrames(_i2.SentryId? id) => @@ -1400,12 +1470,13 @@ class MockSentryNativeBinding extends _i1.Mock int? endTimeNs, ) => (super.noSuchMethod( - Invocation.method(#collectProfile, [ - traceId, - startTimeNs, - endTimeNs, - ]), - ) as _i11.FutureOr?>); + Invocation.method(#collectProfile, [ + traceId, + startTimeNs, + endTimeNs, + ]), + ) + as _i11.FutureOr?>); @override _i11.FutureOr?> loadDebugImages( @@ -1422,22 +1493,24 @@ class MockSentryNativeBinding extends _i1.Mock @override _i11.FutureOr<_i2.SentryId> captureReplay(bool? isCrash) => (super.noSuchMethod( - Invocation.method(#captureReplay, [isCrash]), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, Invocation.method(#captureReplay, [isCrash]), - ), - ), - ) as _i11.FutureOr<_i2.SentryId>); + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, + Invocation.method(#captureReplay, [isCrash]), + ), + ), + ) + as _i11.FutureOr<_i2.SentryId>); @override _i11.FutureOr startSession({bool? ignoreDuration = false}) => (super.noSuchMethod( - Invocation.method(#startSession, [], { - #ignoreDuration: ignoreDuration, - }), - ) as _i11.FutureOr); + Invocation.method(#startSession, [], { + #ignoreDuration: ignoreDuration, + }), + ) + as _i11.FutureOr); } /// A class which mocks [SentryDelayedFramesTracker]. @@ -1450,10 +1523,12 @@ class MockSentryDelayedFramesTracker extends _i1.Mock } @override - List<_i20.SentryFrameTiming> get delayedFrames => (super.noSuchMethod( - Invocation.getter(#delayedFrames), - returnValue: <_i20.SentryFrameTiming>[], - ) as List<_i20.SentryFrameTiming>); + List<_i20.SentryFrameTiming> get delayedFrames => + (super.noSuchMethod( + Invocation.getter(#delayedFrames), + returnValue: <_i20.SentryFrameTiming>[], + ) + as List<_i20.SentryFrameTiming>); @override List<_i20.SentryFrameTiming> getFramesIntersecting({ @@ -1461,12 +1536,13 @@ class MockSentryDelayedFramesTracker extends _i1.Mock required DateTime? endTimestamp, }) => (super.noSuchMethod( - Invocation.method(#getFramesIntersecting, [], { - #startTimestamp: startTimestamp, - #endTimestamp: endTimestamp, - }), - returnValue: <_i20.SentryFrameTiming>[], - ) as List<_i20.SentryFrameTiming>); + Invocation.method(#getFramesIntersecting, [], { + #startTimestamp: startTimestamp, + #endTimestamp: endTimestamp, + }), + returnValue: <_i20.SentryFrameTiming>[], + ) + as List<_i20.SentryFrameTiming>); @override void addDelayedFrame(DateTime? startTimestamp, DateTime? endTimestamp) => @@ -1488,17 +1564,18 @@ class MockSentryDelayedFramesTracker extends _i1.Mock required DateTime? spanEndTimestamp, }) => (super.noSuchMethod( - Invocation.method(#getFrameMetrics, [], { - #spanStartTimestamp: spanStartTimestamp, - #spanEndTimestamp: spanEndTimestamp, - }), - ) as _i20.SpanFrameMetrics?); + Invocation.method(#getFrameMetrics, [], { + #spanStartTimestamp: spanStartTimestamp, + #spanEndTimestamp: spanEndTimestamp, + }), + ) + as _i20.SpanFrameMetrics?); @override void clear() => super.noSuchMethod( - Invocation.method(#clear, []), - returnValueForMissingStub: null, - ); + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [BindingWrapper]. @@ -1510,13 +1587,15 @@ class MockBindingWrapper extends _i1.Mock implements _i2.BindingWrapper { } @override - _i5.WidgetsBinding ensureInitialized() => (super.noSuchMethod( - Invocation.method(#ensureInitialized, []), - returnValue: _FakeWidgetsBinding_10( - this, - Invocation.method(#ensureInitialized, []), - ), - ) as _i5.WidgetsBinding); + _i5.WidgetsBinding ensureInitialized() => + (super.noSuchMethod( + Invocation.method(#ensureInitialized, []), + returnValue: _FakeWidgetsBinding_10( + this, + Invocation.method(#ensureInitialized, []), + ), + ) + as _i5.WidgetsBinding); } /// A class which mocks [WidgetsFlutterBinding]. @@ -1529,22 +1608,26 @@ class MockWidgetsFlutterBinding extends _i1.Mock } @override - _i6.SingletonFlutterWindow get window => (super.noSuchMethod( - Invocation.getter(#window), - returnValue: _FakeSingletonFlutterWindow_11( - this, - Invocation.getter(#window), - ), - ) as _i6.SingletonFlutterWindow); - - @override - _i6.PlatformDispatcher get platformDispatcher => (super.noSuchMethod( - Invocation.getter(#platformDispatcher), - returnValue: _FakePlatformDispatcher_12( - this, - Invocation.getter(#platformDispatcher), - ), - ) as _i6.PlatformDispatcher); + _i6.SingletonFlutterWindow get window => + (super.noSuchMethod( + Invocation.getter(#window), + returnValue: _FakeSingletonFlutterWindow_11( + this, + Invocation.getter(#window), + ), + ) + as _i6.SingletonFlutterWindow); + + @override + _i6.PlatformDispatcher get platformDispatcher => + (super.noSuchMethod( + Invocation.getter(#platformDispatcher), + returnValue: _FakePlatformDispatcher_12( + this, + Invocation.getter(#platformDispatcher), + ), + ) + as _i6.PlatformDispatcher); @override bool get locked => @@ -1552,77 +1635,91 @@ class MockWidgetsFlutterBinding extends _i1.Mock as bool); @override - _i7.PointerRouter get pointerRouter => (super.noSuchMethod( - Invocation.getter(#pointerRouter), - returnValue: _FakePointerRouter_13( - this, - Invocation.getter(#pointerRouter), - ), - ) as _i7.PointerRouter); + _i7.PointerRouter get pointerRouter => + (super.noSuchMethod( + Invocation.getter(#pointerRouter), + returnValue: _FakePointerRouter_13( + this, + Invocation.getter(#pointerRouter), + ), + ) + as _i7.PointerRouter); @override - _i7.GestureArenaManager get gestureArena => (super.noSuchMethod( - Invocation.getter(#gestureArena), - returnValue: _FakeGestureArenaManager_14( - this, - Invocation.getter(#gestureArena), - ), - ) as _i7.GestureArenaManager); + _i7.GestureArenaManager get gestureArena => + (super.noSuchMethod( + Invocation.getter(#gestureArena), + returnValue: _FakeGestureArenaManager_14( + this, + Invocation.getter(#gestureArena), + ), + ) + as _i7.GestureArenaManager); @override - _i7.PointerSignalResolver get pointerSignalResolver => (super.noSuchMethod( - Invocation.getter(#pointerSignalResolver), - returnValue: _FakePointerSignalResolver_15( - this, - Invocation.getter(#pointerSignalResolver), - ), - ) as _i7.PointerSignalResolver); + _i7.PointerSignalResolver get pointerSignalResolver => + (super.noSuchMethod( + Invocation.getter(#pointerSignalResolver), + returnValue: _FakePointerSignalResolver_15( + this, + Invocation.getter(#pointerSignalResolver), + ), + ) + as _i7.PointerSignalResolver); @override - bool get resamplingEnabled => (super.noSuchMethod( - Invocation.getter(#resamplingEnabled), - returnValue: false, - ) as bool); + bool get resamplingEnabled => + (super.noSuchMethod( + Invocation.getter(#resamplingEnabled), + returnValue: false, + ) + as bool); @override set resamplingEnabled(bool? _resamplingEnabled) => super.noSuchMethod( - Invocation.setter(#resamplingEnabled, _resamplingEnabled), - returnValueForMissingStub: null, - ); + Invocation.setter(#resamplingEnabled, _resamplingEnabled), + returnValueForMissingStub: null, + ); @override - Duration get samplingOffset => (super.noSuchMethod( - Invocation.getter(#samplingOffset), - returnValue: _FakeDuration_16( - this, - Invocation.getter(#samplingOffset), - ), - ) as Duration); + Duration get samplingOffset => + (super.noSuchMethod( + Invocation.getter(#samplingOffset), + returnValue: _FakeDuration_16( + this, + Invocation.getter(#samplingOffset), + ), + ) + as Duration); @override set samplingOffset(Duration? _samplingOffset) => super.noSuchMethod( - Invocation.setter(#samplingOffset, _samplingOffset), - returnValueForMissingStub: null, - ); + Invocation.setter(#samplingOffset, _samplingOffset), + returnValueForMissingStub: null, + ); @override - _i7.SamplingClock get samplingClock => (super.noSuchMethod( - Invocation.getter(#samplingClock), - returnValue: _FakeSamplingClock_17( - this, - Invocation.getter(#samplingClock), - ), - ) as _i7.SamplingClock); + _i7.SamplingClock get samplingClock => + (super.noSuchMethod( + Invocation.getter(#samplingClock), + returnValue: _FakeSamplingClock_17( + this, + Invocation.getter(#samplingClock), + ), + ) + as _i7.SamplingClock); @override - _i21.SchedulingStrategy get schedulingStrategy => (super.noSuchMethod( - Invocation.getter(#schedulingStrategy), - returnValue: ({ - required int priority, - required _i21.SchedulerBinding scheduler, - }) => - false, - ) as _i21.SchedulingStrategy); + _i21.SchedulingStrategy get schedulingStrategy => + (super.noSuchMethod( + Invocation.getter(#schedulingStrategy), + returnValue: + ({ + required int priority, + required _i21.SchedulerBinding scheduler, + }) => false, + ) + as _i21.SchedulingStrategy); @override set schedulingStrategy(_i21.SchedulingStrategy? _schedulingStrategy) => @@ -1632,28 +1729,36 @@ class MockWidgetsFlutterBinding extends _i1.Mock ); @override - int get transientCallbackCount => (super.noSuchMethod( - Invocation.getter(#transientCallbackCount), - returnValue: 0, - ) as int); + int get transientCallbackCount => + (super.noSuchMethod( + Invocation.getter(#transientCallbackCount), + returnValue: 0, + ) + as int); @override - _i11.Future get endOfFrame => (super.noSuchMethod( - Invocation.getter(#endOfFrame), - returnValue: _i11.Future.value(), - ) as _i11.Future); + _i11.Future get endOfFrame => + (super.noSuchMethod( + Invocation.getter(#endOfFrame), + returnValue: _i11.Future.value(), + ) + as _i11.Future); @override - bool get hasScheduledFrame => (super.noSuchMethod( - Invocation.getter(#hasScheduledFrame), - returnValue: false, - ) as bool); + bool get hasScheduledFrame => + (super.noSuchMethod( + Invocation.getter(#hasScheduledFrame), + returnValue: false, + ) + as bool); @override - _i21.SchedulerPhase get schedulerPhase => (super.noSuchMethod( - Invocation.getter(#schedulerPhase), - returnValue: _i21.SchedulerPhase.idle, - ) as _i21.SchedulerPhase); + _i21.SchedulerPhase get schedulerPhase => + (super.noSuchMethod( + Invocation.getter(#schedulerPhase), + returnValue: _i21.SchedulerPhase.idle, + ) + as _i21.SchedulerPhase); @override bool get framesEnabled => @@ -1661,178 +1766,220 @@ class MockWidgetsFlutterBinding extends _i1.Mock as bool); @override - Duration get currentFrameTimeStamp => (super.noSuchMethod( - Invocation.getter(#currentFrameTimeStamp), - returnValue: _FakeDuration_16( - this, - Invocation.getter(#currentFrameTimeStamp), - ), - ) as Duration); + Duration get currentFrameTimeStamp => + (super.noSuchMethod( + Invocation.getter(#currentFrameTimeStamp), + returnValue: _FakeDuration_16( + this, + Invocation.getter(#currentFrameTimeStamp), + ), + ) + as Duration); @override - Duration get currentSystemFrameTimeStamp => (super.noSuchMethod( - Invocation.getter(#currentSystemFrameTimeStamp), - returnValue: _FakeDuration_16( - this, - Invocation.getter(#currentSystemFrameTimeStamp), - ), - ) as Duration); + Duration get currentSystemFrameTimeStamp => + (super.noSuchMethod( + Invocation.getter(#currentSystemFrameTimeStamp), + returnValue: _FakeDuration_16( + this, + Invocation.getter(#currentSystemFrameTimeStamp), + ), + ) + as Duration); @override - _i8.ValueNotifier get accessibilityFocus => (super.noSuchMethod( - Invocation.getter(#accessibilityFocus), - returnValue: _FakeValueNotifier_18( - this, - Invocation.getter(#accessibilityFocus), - ), - ) as _i8.ValueNotifier); + _i8.ValueNotifier get accessibilityFocus => + (super.noSuchMethod( + Invocation.getter(#accessibilityFocus), + returnValue: _FakeValueNotifier_18( + this, + Invocation.getter(#accessibilityFocus), + ), + ) + as _i8.ValueNotifier); @override - _i4.HardwareKeyboard get keyboard => (super.noSuchMethod( - Invocation.getter(#keyboard), - returnValue: _FakeHardwareKeyboard_19( - this, - Invocation.getter(#keyboard), - ), - ) as _i4.HardwareKeyboard); + _i4.HardwareKeyboard get keyboard => + (super.noSuchMethod( + Invocation.getter(#keyboard), + returnValue: _FakeHardwareKeyboard_19( + this, + Invocation.getter(#keyboard), + ), + ) + as _i4.HardwareKeyboard); @override - _i4.KeyEventManager get keyEventManager => (super.noSuchMethod( - Invocation.getter(#keyEventManager), - returnValue: _FakeKeyEventManager_20( - this, - Invocation.getter(#keyEventManager), - ), - ) as _i4.KeyEventManager); + _i4.KeyEventManager get keyEventManager => + (super.noSuchMethod( + Invocation.getter(#keyEventManager), + returnValue: _FakeKeyEventManager_20( + this, + Invocation.getter(#keyEventManager), + ), + ) + as _i4.KeyEventManager); @override - _i4.BinaryMessenger get defaultBinaryMessenger => (super.noSuchMethod( - Invocation.getter(#defaultBinaryMessenger), - returnValue: _FakeBinaryMessenger_9( - this, - Invocation.getter(#defaultBinaryMessenger), - ), - ) as _i4.BinaryMessenger); + _i4.BinaryMessenger get defaultBinaryMessenger => + (super.noSuchMethod( + Invocation.getter(#defaultBinaryMessenger), + returnValue: _FakeBinaryMessenger_9( + this, + Invocation.getter(#defaultBinaryMessenger), + ), + ) + as _i4.BinaryMessenger); @override - _i6.ChannelBuffers get channelBuffers => (super.noSuchMethod( - Invocation.getter(#channelBuffers), - returnValue: _FakeChannelBuffers_21( - this, - Invocation.getter(#channelBuffers), - ), - ) as _i6.ChannelBuffers); + _i6.ChannelBuffers get channelBuffers => + (super.noSuchMethod( + Invocation.getter(#channelBuffers), + returnValue: _FakeChannelBuffers_21( + this, + Invocation.getter(#channelBuffers), + ), + ) + as _i6.ChannelBuffers); @override - _i4.RestorationManager get restorationManager => (super.noSuchMethod( - Invocation.getter(#restorationManager), - returnValue: _FakeRestorationManager_22( - this, - Invocation.getter(#restorationManager), - ), - ) as _i4.RestorationManager); + _i4.RestorationManager get restorationManager => + (super.noSuchMethod( + Invocation.getter(#restorationManager), + returnValue: _FakeRestorationManager_22( + this, + Invocation.getter(#restorationManager), + ), + ) + as _i4.RestorationManager); @override - _i9.ImageCache get imageCache => (super.noSuchMethod( - Invocation.getter(#imageCache), - returnValue: _FakeImageCache_23( - this, - Invocation.getter(#imageCache), - ), - ) as _i9.ImageCache); + _i9.ImageCache get imageCache => + (super.noSuchMethod( + Invocation.getter(#imageCache), + returnValue: _FakeImageCache_23( + this, + Invocation.getter(#imageCache), + ), + ) + as _i9.ImageCache); @override - _i8.Listenable get systemFonts => (super.noSuchMethod( - Invocation.getter(#systemFonts), - returnValue: _FakeListenable_24( - this, - Invocation.getter(#systemFonts), - ), - ) as _i8.Listenable); + _i8.Listenable get systemFonts => + (super.noSuchMethod( + Invocation.getter(#systemFonts), + returnValue: _FakeListenable_24( + this, + Invocation.getter(#systemFonts), + ), + ) + as _i8.Listenable); @override - bool get semanticsEnabled => (super.noSuchMethod( - Invocation.getter(#semanticsEnabled), - returnValue: false, - ) as bool); + bool get semanticsEnabled => + (super.noSuchMethod( + Invocation.getter(#semanticsEnabled), + returnValue: false, + ) + as bool); @override - int get debugOutstandingSemanticsHandles => (super.noSuchMethod( - Invocation.getter(#debugOutstandingSemanticsHandles), - returnValue: 0, - ) as int); + int get debugOutstandingSemanticsHandles => + (super.noSuchMethod( + Invocation.getter(#debugOutstandingSemanticsHandles), + returnValue: 0, + ) + as int); @override - _i6.AccessibilityFeatures get accessibilityFeatures => (super.noSuchMethod( - Invocation.getter(#accessibilityFeatures), - returnValue: _FakeAccessibilityFeatures_25( - this, - Invocation.getter(#accessibilityFeatures), - ), - ) as _i6.AccessibilityFeatures); + _i6.AccessibilityFeatures get accessibilityFeatures => + (super.noSuchMethod( + Invocation.getter(#accessibilityFeatures), + returnValue: _FakeAccessibilityFeatures_25( + this, + Invocation.getter(#accessibilityFeatures), + ), + ) + as _i6.AccessibilityFeatures); @override - bool get disableAnimations => (super.noSuchMethod( - Invocation.getter(#disableAnimations), - returnValue: false, - ) as bool); + bool get disableAnimations => + (super.noSuchMethod( + Invocation.getter(#disableAnimations), + returnValue: false, + ) + as bool); @override - _i10.PipelineOwner get pipelineOwner => (super.noSuchMethod( - Invocation.getter(#pipelineOwner), - returnValue: _i14.dummyValue<_i10.PipelineOwner>( - this, - Invocation.getter(#pipelineOwner), - ), - ) as _i10.PipelineOwner); + _i10.PipelineOwner get pipelineOwner => + (super.noSuchMethod( + Invocation.getter(#pipelineOwner), + returnValue: _i14.dummyValue<_i10.PipelineOwner>( + this, + Invocation.getter(#pipelineOwner), + ), + ) + as _i10.PipelineOwner); @override - _i10.RenderView get renderView => (super.noSuchMethod( - Invocation.getter(#renderView), - returnValue: _FakeRenderView_26( - this, - Invocation.getter(#renderView), - ), - ) as _i10.RenderView); + _i10.RenderView get renderView => + (super.noSuchMethod( + Invocation.getter(#renderView), + returnValue: _FakeRenderView_26( + this, + Invocation.getter(#renderView), + ), + ) + as _i10.RenderView); @override - _i10.MouseTracker get mouseTracker => (super.noSuchMethod( - Invocation.getter(#mouseTracker), - returnValue: _FakeMouseTracker_27( - this, - Invocation.getter(#mouseTracker), - ), - ) as _i10.MouseTracker); + _i10.MouseTracker get mouseTracker => + (super.noSuchMethod( + Invocation.getter(#mouseTracker), + returnValue: _FakeMouseTracker_27( + this, + Invocation.getter(#mouseTracker), + ), + ) + as _i10.MouseTracker); @override - _i10.PipelineOwner get rootPipelineOwner => (super.noSuchMethod( - Invocation.getter(#rootPipelineOwner), - returnValue: _i14.dummyValue<_i10.PipelineOwner>( - this, - Invocation.getter(#rootPipelineOwner), - ), - ) as _i10.PipelineOwner); + _i10.PipelineOwner get rootPipelineOwner => + (super.noSuchMethod( + Invocation.getter(#rootPipelineOwner), + returnValue: _i14.dummyValue<_i10.PipelineOwner>( + this, + Invocation.getter(#rootPipelineOwner), + ), + ) + as _i10.PipelineOwner); @override - Iterable<_i10.RenderView> get renderViews => (super.noSuchMethod( - Invocation.getter(#renderViews), - returnValue: <_i10.RenderView>[], - ) as Iterable<_i10.RenderView>); + Iterable<_i10.RenderView> get renderViews => + (super.noSuchMethod( + Invocation.getter(#renderViews), + returnValue: <_i10.RenderView>[], + ) + as Iterable<_i10.RenderView>); @override - bool get sendFramesToEngine => (super.noSuchMethod( - Invocation.getter(#sendFramesToEngine), - returnValue: false, - ) as bool); + bool get sendFramesToEngine => + (super.noSuchMethod( + Invocation.getter(#sendFramesToEngine), + returnValue: false, + ) + as bool); @override - _i9.PlatformMenuDelegate get platformMenuDelegate => (super.noSuchMethod( - Invocation.getter(#platformMenuDelegate), - returnValue: _FakePlatformMenuDelegate_28( - this, - Invocation.getter(#platformMenuDelegate), - ), - ) as _i9.PlatformMenuDelegate); + _i9.PlatformMenuDelegate get platformMenuDelegate => + (super.noSuchMethod( + Invocation.getter(#platformMenuDelegate), + returnValue: _FakePlatformMenuDelegate_28( + this, + Invocation.getter(#platformMenuDelegate), + ), + ) + as _i9.PlatformMenuDelegate); @override set platformMenuDelegate(_i9.PlatformMenuDelegate? _platformMenuDelegate) => @@ -1842,10 +1989,12 @@ class MockWidgetsFlutterBinding extends _i1.Mock ); @override - bool get debugBuildingDirtyElements => (super.noSuchMethod( - Invocation.getter(#debugBuildingDirtyElements), - returnValue: false, - ) as bool); + bool get debugBuildingDirtyElements => + (super.noSuchMethod( + Invocation.getter(#debugBuildingDirtyElements), + returnValue: false, + ) + as bool); @override set debugBuildingDirtyElements(bool? _debugBuildingDirtyElements) => @@ -1858,148 +2007,165 @@ class MockWidgetsFlutterBinding extends _i1.Mock ); @override - bool get debugShowWidgetInspectorOverride => (super.noSuchMethod( - Invocation.getter(#debugShowWidgetInspectorOverride), - returnValue: false, - ) as bool); + bool get debugShowWidgetInspectorOverride => + (super.noSuchMethod( + Invocation.getter(#debugShowWidgetInspectorOverride), + returnValue: false, + ) + as bool); @override set debugShowWidgetInspectorOverride(bool? value) => super.noSuchMethod( - Invocation.setter(#debugShowWidgetInspectorOverride, value), - returnValueForMissingStub: null, - ); + Invocation.setter(#debugShowWidgetInspectorOverride, value), + returnValueForMissingStub: null, + ); @override _i8.ValueNotifier get debugShowWidgetInspectorOverrideNotifier => (super.noSuchMethod( - Invocation.getter(#debugShowWidgetInspectorOverrideNotifier), - returnValue: _FakeValueNotifier_18( - this, - Invocation.getter(#debugShowWidgetInspectorOverrideNotifier), - ), - ) as _i8.ValueNotifier); + Invocation.getter(#debugShowWidgetInspectorOverrideNotifier), + returnValue: _FakeValueNotifier_18( + this, + Invocation.getter(#debugShowWidgetInspectorOverrideNotifier), + ), + ) + as _i8.ValueNotifier); @override - _i9.FocusManager get focusManager => (super.noSuchMethod( - Invocation.getter(#focusManager), - returnValue: _FakeFocusManager_29( - this, - Invocation.getter(#focusManager), - ), - ) as _i9.FocusManager); + _i9.FocusManager get focusManager => + (super.noSuchMethod( + Invocation.getter(#focusManager), + returnValue: _FakeFocusManager_29( + this, + Invocation.getter(#focusManager), + ), + ) + as _i9.FocusManager); @override - bool get firstFrameRasterized => (super.noSuchMethod( - Invocation.getter(#firstFrameRasterized), - returnValue: false, - ) as bool); + bool get firstFrameRasterized => + (super.noSuchMethod( + Invocation.getter(#firstFrameRasterized), + returnValue: false, + ) + as bool); @override - _i11.Future get waitUntilFirstFrameRasterized => (super.noSuchMethod( - Invocation.getter(#waitUntilFirstFrameRasterized), - returnValue: _i11.Future.value(), - ) as _i11.Future); + _i11.Future get waitUntilFirstFrameRasterized => + (super.noSuchMethod( + Invocation.getter(#waitUntilFirstFrameRasterized), + returnValue: _i11.Future.value(), + ) + as _i11.Future); @override - bool get debugDidSendFirstFrameEvent => (super.noSuchMethod( - Invocation.getter(#debugDidSendFirstFrameEvent), - returnValue: false, - ) as bool); + bool get debugDidSendFirstFrameEvent => + (super.noSuchMethod( + Invocation.getter(#debugDidSendFirstFrameEvent), + returnValue: false, + ) + as bool); @override - bool get isRootWidgetAttached => (super.noSuchMethod( - Invocation.getter(#isRootWidgetAttached), - returnValue: false, - ) as bool); + bool get isRootWidgetAttached => + (super.noSuchMethod( + Invocation.getter(#isRootWidgetAttached), + returnValue: false, + ) + as bool); @override void initInstances() => super.noSuchMethod( - Invocation.method(#initInstances, []), - returnValueForMissingStub: null, - ); + Invocation.method(#initInstances, []), + returnValueForMissingStub: null, + ); @override - bool debugCheckZone(String? entryPoint) => (super.noSuchMethod( - Invocation.method(#debugCheckZone, [entryPoint]), - returnValue: false, - ) as bool); + bool debugCheckZone(String? entryPoint) => + (super.noSuchMethod( + Invocation.method(#debugCheckZone, [entryPoint]), + returnValue: false, + ) + as bool); @override void initServiceExtensions() => super.noSuchMethod( - Invocation.method(#initServiceExtensions, []), - returnValueForMissingStub: null, - ); + Invocation.method(#initServiceExtensions, []), + returnValueForMissingStub: null, + ); @override _i11.Future lockEvents(_i11.Future Function()? callback) => (super.noSuchMethod( - Invocation.method(#lockEvents, [callback]), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) as _i11.Future); + Invocation.method(#lockEvents, [callback]), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) + as _i11.Future); @override void unlocked() => super.noSuchMethod( - Invocation.method(#unlocked, []), - returnValueForMissingStub: null, - ); + Invocation.method(#unlocked, []), + returnValueForMissingStub: null, + ); @override - _i11.Future reassembleApplication() => (super.noSuchMethod( - Invocation.method(#reassembleApplication, []), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) as _i11.Future); + _i11.Future reassembleApplication() => + (super.noSuchMethod( + Invocation.method(#reassembleApplication, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) + as _i11.Future); @override - _i11.Future performReassemble() => (super.noSuchMethod( - Invocation.method(#performReassemble, []), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) as _i11.Future); + _i11.Future performReassemble() => + (super.noSuchMethod( + Invocation.method(#performReassemble, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) + as _i11.Future); @override void registerSignalServiceExtension({ required String? name, required _i8.AsyncCallback? callback, - }) => - super.noSuchMethod( - Invocation.method(#registerSignalServiceExtension, [], { - #name: name, - #callback: callback, - }), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#registerSignalServiceExtension, [], { + #name: name, + #callback: callback, + }), + returnValueForMissingStub: null, + ); @override void registerBoolServiceExtension({ required String? name, required _i8.AsyncValueGetter? getter, required _i8.AsyncValueSetter? setter, - }) => - super.noSuchMethod( - Invocation.method(#registerBoolServiceExtension, [], { - #name: name, - #getter: getter, - #setter: setter, - }), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#registerBoolServiceExtension, [], { + #name: name, + #getter: getter, + #setter: setter, + }), + returnValueForMissingStub: null, + ); @override void registerNumericServiceExtension({ required String? name, required _i8.AsyncValueGetter? getter, required _i8.AsyncValueSetter? setter, - }) => - super.noSuchMethod( - Invocation.method(#registerNumericServiceExtension, [], { - #name: name, - #getter: getter, - #setter: setter, - }), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#registerNumericServiceExtension, [], { + #name: name, + #getter: getter, + #setter: setter, + }), + returnValueForMissingStub: null, + ); @override void postEvent(String? eventKind, Map? eventData) => @@ -2013,51 +2179,48 @@ class MockWidgetsFlutterBinding extends _i1.Mock required String? name, required _i8.AsyncValueGetter? getter, required _i8.AsyncValueSetter? setter, - }) => - super.noSuchMethod( - Invocation.method(#registerStringServiceExtension, [], { - #name: name, - #getter: getter, - #setter: setter, - }), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#registerStringServiceExtension, [], { + #name: name, + #getter: getter, + #setter: setter, + }), + returnValueForMissingStub: null, + ); @override void registerServiceExtension({ required String? name, required _i8.ServiceExtensionCallback? callback, - }) => - super.noSuchMethod( - Invocation.method(#registerServiceExtension, [], { - #name: name, - #callback: callback, - }), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#registerServiceExtension, [], { + #name: name, + #callback: callback, + }), + returnValueForMissingStub: null, + ); @override void cancelPointer(int? pointer) => super.noSuchMethod( - Invocation.method(#cancelPointer, [pointer]), - returnValueForMissingStub: null, - ); + Invocation.method(#cancelPointer, [pointer]), + returnValueForMissingStub: null, + ); @override void handlePointerEvent(_i4.PointerEvent? event) => super.noSuchMethod( - Invocation.method(#handlePointerEvent, [event]), - returnValueForMissingStub: null, - ); + Invocation.method(#handlePointerEvent, [event]), + returnValueForMissingStub: null, + ); @override void hitTestInView( _i7.HitTestResult? result, _i6.Offset? position, int? viewId, - ) => - super.noSuchMethod( - Invocation.method(#hitTestInView, [result, position, viewId]), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#hitTestInView, [result, position, viewId]), + returnValueForMissingStub: null, + ); @override void hitTest(_i7.HitTestResult? result, _i6.Offset? position) => @@ -2070,33 +2233,31 @@ class MockWidgetsFlutterBinding extends _i1.Mock void dispatchEvent( _i4.PointerEvent? event, _i7.HitTestResult? hitTestResult, - ) => - super.noSuchMethod( - Invocation.method(#dispatchEvent, [event, hitTestResult]), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#dispatchEvent, [event, hitTestResult]), + returnValueForMissingStub: null, + ); @override void handleEvent( _i4.PointerEvent? event, _i7.HitTestEntry<_i7.HitTestTarget>? entry, - ) => - super.noSuchMethod( - Invocation.method(#handleEvent, [event, entry]), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#handleEvent, [event, entry]), + returnValueForMissingStub: null, + ); @override void resetGestureBinding() => super.noSuchMethod( - Invocation.method(#resetGestureBinding, []), - returnValueForMissingStub: null, - ); + Invocation.method(#resetGestureBinding, []), + returnValueForMissingStub: null, + ); @override void addTimingsCallback(_i6.TimingsCallback? callback) => super.noSuchMethod( - Invocation.method(#addTimingsCallback, [callback]), - returnValueForMissingStub: null, - ); + Invocation.method(#addTimingsCallback, [callback]), + returnValueForMissingStub: null, + ); @override void removeTimingsCallback(_i6.TimingsCallback? callback) => @@ -2107,9 +2268,9 @@ class MockWidgetsFlutterBinding extends _i1.Mock @override void resetInternalState() => super.noSuchMethod( - Invocation.method(#resetInternalState, []), - returnValueForMissingStub: null, - ); + Invocation.method(#resetInternalState, []), + returnValueForMissingStub: null, + ); @override void handleAppLifecycleStateChanged(_i6.AppLifecycleState? state) => @@ -2126,37 +2287,41 @@ class MockWidgetsFlutterBinding extends _i1.Mock _i22.Flow? flow, }) => (super.noSuchMethod( - Invocation.method( - #scheduleTask, - [task, priority], - {#debugLabel: debugLabel, #flow: flow}, - ), - returnValue: _i14.ifNotNull( - _i14.dummyValueOrNull( - this, - Invocation.method( - #scheduleTask, - [task, priority], - {#debugLabel: debugLabel, #flow: flow}, - ), - ), - (T v) => _i11.Future.value(v), - ) ?? - _FakeFuture_30( - this, - Invocation.method( - #scheduleTask, - [task, priority], - {#debugLabel: debugLabel, #flow: flow}, - ), + Invocation.method( + #scheduleTask, + [task, priority], + {#debugLabel: debugLabel, #flow: flow}, ), - ) as _i11.Future); + returnValue: + _i14.ifNotNull( + _i14.dummyValueOrNull( + this, + Invocation.method( + #scheduleTask, + [task, priority], + {#debugLabel: debugLabel, #flow: flow}, + ), + ), + (T v) => _i11.Future.value(v), + ) ?? + _FakeFuture_30( + this, + Invocation.method( + #scheduleTask, + [task, priority], + {#debugLabel: debugLabel, #flow: flow}, + ), + ), + ) + as _i11.Future); @override - bool handleEventLoopCallback() => (super.noSuchMethod( - Invocation.method(#handleEventLoopCallback, []), - returnValue: false, - ) as bool); + bool handleEventLoopCallback() => + (super.noSuchMethod( + Invocation.method(#handleEventLoopCallback, []), + returnValue: false, + ) + as bool); @override int scheduleFrameCallback( @@ -2165,43 +2330,49 @@ class MockWidgetsFlutterBinding extends _i1.Mock bool? scheduleNewFrame = true, }) => (super.noSuchMethod( - Invocation.method( - #scheduleFrameCallback, - [callback], - { - #rescheduling: rescheduling, - #scheduleNewFrame: scheduleNewFrame, - }, - ), - returnValue: 0, - ) as int); + Invocation.method( + #scheduleFrameCallback, + [callback], + { + #rescheduling: rescheduling, + #scheduleNewFrame: scheduleNewFrame, + }, + ), + returnValue: 0, + ) + as int); @override void cancelFrameCallbackWithId(int? id) => super.noSuchMethod( - Invocation.method(#cancelFrameCallbackWithId, [id]), - returnValueForMissingStub: null, - ); + Invocation.method(#cancelFrameCallbackWithId, [id]), + returnValueForMissingStub: null, + ); @override - bool debugAssertNoTransientCallbacks(String? reason) => (super.noSuchMethod( - Invocation.method(#debugAssertNoTransientCallbacks, [reason]), - returnValue: false, - ) as bool); + bool debugAssertNoTransientCallbacks(String? reason) => + (super.noSuchMethod( + Invocation.method(#debugAssertNoTransientCallbacks, [reason]), + returnValue: false, + ) + as bool); @override bool debugAssertNoPendingPerformanceModeRequests(String? reason) => (super.noSuchMethod( - Invocation.method(#debugAssertNoPendingPerformanceModeRequests, [ - reason, - ]), - returnValue: false, - ) as bool); + Invocation.method(#debugAssertNoPendingPerformanceModeRequests, [ + reason, + ]), + returnValue: false, + ) + as bool); @override - bool debugAssertNoTimeDilation(String? reason) => (super.noSuchMethod( - Invocation.method(#debugAssertNoTimeDilation, [reason]), - returnValue: false, - ) as bool); + bool debugAssertNoTimeDilation(String? reason) => + (super.noSuchMethod( + Invocation.method(#debugAssertNoTimeDilation, [reason]), + returnValue: false, + ) + as bool); @override void addPersistentFrameCallback(_i21.FrameCallback? callback) => @@ -2214,57 +2385,56 @@ class MockWidgetsFlutterBinding extends _i1.Mock void addPostFrameCallback( _i21.FrameCallback? callback, { String? debugLabel = 'callback', - }) => - super.noSuchMethod( - Invocation.method( - #addPostFrameCallback, - [callback], - {#debugLabel: debugLabel}, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method( + #addPostFrameCallback, + [callback], + {#debugLabel: debugLabel}, + ), + returnValueForMissingStub: null, + ); @override void ensureFrameCallbacksRegistered() => super.noSuchMethod( - Invocation.method(#ensureFrameCallbacksRegistered, []), - returnValueForMissingStub: null, - ); + Invocation.method(#ensureFrameCallbacksRegistered, []), + returnValueForMissingStub: null, + ); @override void ensureVisualUpdate() => super.noSuchMethod( - Invocation.method(#ensureVisualUpdate, []), - returnValueForMissingStub: null, - ); + Invocation.method(#ensureVisualUpdate, []), + returnValueForMissingStub: null, + ); @override void scheduleFrame() => super.noSuchMethod( - Invocation.method(#scheduleFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#scheduleFrame, []), + returnValueForMissingStub: null, + ); @override void scheduleForcedFrame() => super.noSuchMethod( - Invocation.method(#scheduleForcedFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#scheduleForcedFrame, []), + returnValueForMissingStub: null, + ); @override void scheduleWarmUpFrame() => super.noSuchMethod( - Invocation.method(#scheduleWarmUpFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#scheduleWarmUpFrame, []), + returnValueForMissingStub: null, + ); @override void resetEpoch() => super.noSuchMethod( - Invocation.method(#resetEpoch, []), - returnValueForMissingStub: null, - ); + Invocation.method(#resetEpoch, []), + returnValueForMissingStub: null, + ); @override void handleBeginFrame(Duration? rawTimeStamp) => super.noSuchMethod( - Invocation.method(#handleBeginFrame, [rawTimeStamp]), - returnValueForMissingStub: null, - ); + Invocation.method(#handleBeginFrame, [rawTimeStamp]), + returnValueForMissingStub: null, + ); @override _i21.PerformanceModeRequestHandle? requestPerformanceMode( @@ -2275,65 +2445,69 @@ class MockWidgetsFlutterBinding extends _i1.Mock @override void handleDrawFrame() => super.noSuchMethod( - Invocation.method(#handleDrawFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handleDrawFrame, []), + returnValueForMissingStub: null, + ); @override - _i4.BinaryMessenger createBinaryMessenger() => (super.noSuchMethod( - Invocation.method(#createBinaryMessenger, []), - returnValue: _FakeBinaryMessenger_9( - this, - Invocation.method(#createBinaryMessenger, []), - ), - ) as _i4.BinaryMessenger); + _i4.BinaryMessenger createBinaryMessenger() => + (super.noSuchMethod( + Invocation.method(#createBinaryMessenger, []), + returnValue: _FakeBinaryMessenger_9( + this, + Invocation.method(#createBinaryMessenger, []), + ), + ) + as _i4.BinaryMessenger); @override void handleMemoryPressure() => super.noSuchMethod( - Invocation.method(#handleMemoryPressure, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handleMemoryPressure, []), + returnValueForMissingStub: null, + ); @override _i11.Future handleSystemMessage(Object? systemMessage) => (super.noSuchMethod( - Invocation.method(#handleSystemMessage, [systemMessage]), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) as _i11.Future); + Invocation.method(#handleSystemMessage, [systemMessage]), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) + as _i11.Future); @override void initLicenses() => super.noSuchMethod( - Invocation.method(#initLicenses, []), - returnValueForMissingStub: null, - ); + Invocation.method(#initLicenses, []), + returnValueForMissingStub: null, + ); @override void evict(String? asset) => super.noSuchMethod( - Invocation.method(#evict, [asset]), - returnValueForMissingStub: null, - ); + Invocation.method(#evict, [asset]), + returnValueForMissingStub: null, + ); @override void readInitialLifecycleStateFromNativeWindow() => super.noSuchMethod( - Invocation.method(#readInitialLifecycleStateFromNativeWindow, []), - returnValueForMissingStub: null, - ); + Invocation.method(#readInitialLifecycleStateFromNativeWindow, []), + returnValueForMissingStub: null, + ); @override void handleViewFocusChanged(_i6.ViewFocusEvent? event) => super.noSuchMethod( - Invocation.method(#handleViewFocusChanged, [event]), - returnValueForMissingStub: null, - ); + Invocation.method(#handleViewFocusChanged, [event]), + returnValueForMissingStub: null, + ); @override _i11.Future<_i6.AppExitResponse> handleRequestAppExit() => (super.noSuchMethod( - Invocation.method(#handleRequestAppExit, []), - returnValue: _i11.Future<_i6.AppExitResponse>.value( - _i6.AppExitResponse.exit, - ), - ) as _i11.Future<_i6.AppExitResponse>); + Invocation.method(#handleRequestAppExit, []), + returnValue: _i11.Future<_i6.AppExitResponse>.value( + _i6.AppExitResponse.exit, + ), + ) + as _i11.Future<_i6.AppExitResponse>); @override _i11.Future<_i6.AppExitResponse> exitApplication( @@ -2341,20 +2515,23 @@ class MockWidgetsFlutterBinding extends _i1.Mock int? exitCode = 0, ]) => (super.noSuchMethod( - Invocation.method(#exitApplication, [exitType, exitCode]), - returnValue: _i11.Future<_i6.AppExitResponse>.value( - _i6.AppExitResponse.exit, - ), - ) as _i11.Future<_i6.AppExitResponse>); + Invocation.method(#exitApplication, [exitType, exitCode]), + returnValue: _i11.Future<_i6.AppExitResponse>.value( + _i6.AppExitResponse.exit, + ), + ) + as _i11.Future<_i6.AppExitResponse>); @override - _i4.RestorationManager createRestorationManager() => (super.noSuchMethod( - Invocation.method(#createRestorationManager, []), - returnValue: _FakeRestorationManager_22( - this, - Invocation.method(#createRestorationManager, []), - ), - ) as _i4.RestorationManager); + _i4.RestorationManager createRestorationManager() => + (super.noSuchMethod( + Invocation.method(#createRestorationManager, []), + returnValue: _FakeRestorationManager_22( + this, + Invocation.method(#createRestorationManager, []), + ), + ) + as _i4.RestorationManager); @override void setSystemUiChangeCallback(_i4.SystemUiChangeCallback? callback) => @@ -2364,20 +2541,24 @@ class MockWidgetsFlutterBinding extends _i1.Mock ); @override - _i11.Future initializationComplete() => (super.noSuchMethod( - Invocation.method(#initializationComplete, []), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) as _i11.Future); + _i11.Future initializationComplete() => + (super.noSuchMethod( + Invocation.method(#initializationComplete, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) + as _i11.Future); @override - _i9.ImageCache createImageCache() => (super.noSuchMethod( - Invocation.method(#createImageCache, []), - returnValue: _FakeImageCache_23( - this, - Invocation.method(#createImageCache, []), - ), - ) as _i9.ImageCache); + _i9.ImageCache createImageCache() => + (super.noSuchMethod( + Invocation.method(#createImageCache, []), + returnValue: _FakeImageCache_23( + this, + Invocation.method(#createImageCache, []), + ), + ) + as _i9.ImageCache); @override _i11.Future<_i6.Codec> instantiateImageCodecFromBuffer( @@ -2387,18 +2568,6 @@ class MockWidgetsFlutterBinding extends _i1.Mock bool? allowUpscaling = false, }) => (super.noSuchMethod( - Invocation.method( - #instantiateImageCodecFromBuffer, - [buffer], - { - #cacheWidth: cacheWidth, - #cacheHeight: cacheHeight, - #allowUpscaling: allowUpscaling, - }, - ), - returnValue: _i11.Future<_i6.Codec>.value( - _FakeCodec_31( - this, Invocation.method( #instantiateImageCodecFromBuffer, [buffer], @@ -2408,9 +2577,22 @@ class MockWidgetsFlutterBinding extends _i1.Mock #allowUpscaling: allowUpscaling, }, ), - ), - ), - ) as _i11.Future<_i6.Codec>); + returnValue: _i11.Future<_i6.Codec>.value( + _FakeCodec_31( + this, + Invocation.method( + #instantiateImageCodecFromBuffer, + [buffer], + { + #cacheWidth: cacheWidth, + #cacheHeight: cacheHeight, + #allowUpscaling: allowUpscaling, + }, + ), + ), + ), + ) + as _i11.Future<_i6.Codec>); @override _i11.Future<_i6.Codec> instantiateImageCodecWithSize( @@ -2418,22 +2600,23 @@ class MockWidgetsFlutterBinding extends _i1.Mock _i6.TargetImageSizeCallback? getTargetSize, }) => (super.noSuchMethod( - Invocation.method( - #instantiateImageCodecWithSize, - [buffer], - {#getTargetSize: getTargetSize}, - ), - returnValue: _i11.Future<_i6.Codec>.value( - _FakeCodec_31( - this, Invocation.method( #instantiateImageCodecWithSize, [buffer], {#getTargetSize: getTargetSize}, ), - ), - ), - ) as _i11.Future<_i6.Codec>); + returnValue: _i11.Future<_i6.Codec>.value( + _FakeCodec_31( + this, + Invocation.method( + #instantiateImageCodecWithSize, + [buffer], + {#getTargetSize: getTargetSize}, + ), + ), + ), + ) + as _i11.Future<_i6.Codec>); @override void addSemanticsEnabledListener(_i6.VoidCallback? listener) => @@ -2452,29 +2635,29 @@ class MockWidgetsFlutterBinding extends _i1.Mock @override void addSemanticsActionListener( _i8.ValueSetter<_i6.SemanticsActionEvent>? listener, - ) => - super.noSuchMethod( - Invocation.method(#addSemanticsActionListener, [listener]), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#addSemanticsActionListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeSemanticsActionListener( _i8.ValueSetter<_i6.SemanticsActionEvent>? listener, - ) => - super.noSuchMethod( - Invocation.method(#removeSemanticsActionListener, [listener]), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#removeSemanticsActionListener, [listener]), + returnValueForMissingStub: null, + ); @override - _i12.SemanticsHandle ensureSemantics() => (super.noSuchMethod( - Invocation.method(#ensureSemantics, []), - returnValue: _FakeSemanticsHandle_32( - this, - Invocation.method(#ensureSemantics, []), - ), - ) as _i12.SemanticsHandle); + _i12.SemanticsHandle ensureSemantics() => + (super.noSuchMethod( + Invocation.method(#ensureSemantics, []), + returnValue: _FakeSemanticsHandle_32( + this, + Invocation.method(#ensureSemantics, []), + ), + ) + as _i12.SemanticsHandle); @override void performSemanticsAction(_i6.SemanticsActionEvent? action) => @@ -2485,207 +2668,225 @@ class MockWidgetsFlutterBinding extends _i1.Mock @override void handleAccessibilityFeaturesChanged() => super.noSuchMethod( - Invocation.method(#handleAccessibilityFeaturesChanged, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handleAccessibilityFeaturesChanged, []), + returnValueForMissingStub: null, + ); @override _i6.SemanticsUpdateBuilder createSemanticsUpdateBuilder() => (super.noSuchMethod( - Invocation.method(#createSemanticsUpdateBuilder, []), - returnValue: _FakeSemanticsUpdateBuilder_33( - this, - Invocation.method(#createSemanticsUpdateBuilder, []), - ), - ) as _i6.SemanticsUpdateBuilder); + Invocation.method(#createSemanticsUpdateBuilder, []), + returnValue: _FakeSemanticsUpdateBuilder_33( + this, + Invocation.method(#createSemanticsUpdateBuilder, []), + ), + ) + as _i6.SemanticsUpdateBuilder); @override - _i10.PipelineOwner createRootPipelineOwner() => (super.noSuchMethod( - Invocation.method(#createRootPipelineOwner, []), - returnValue: _i14.dummyValue<_i10.PipelineOwner>( - this, - Invocation.method(#createRootPipelineOwner, []), - ), - ) as _i10.PipelineOwner); + _i10.PipelineOwner createRootPipelineOwner() => + (super.noSuchMethod( + Invocation.method(#createRootPipelineOwner, []), + returnValue: _i14.dummyValue<_i10.PipelineOwner>( + this, + Invocation.method(#createRootPipelineOwner, []), + ), + ) + as _i10.PipelineOwner); @override void addRenderView(_i10.RenderView? view) => super.noSuchMethod( - Invocation.method(#addRenderView, [view]), - returnValueForMissingStub: null, - ); + Invocation.method(#addRenderView, [view]), + returnValueForMissingStub: null, + ); @override void removeRenderView(_i10.RenderView? view) => super.noSuchMethod( - Invocation.method(#removeRenderView, [view]), - returnValueForMissingStub: null, - ); + Invocation.method(#removeRenderView, [view]), + returnValueForMissingStub: null, + ); @override _i10.ViewConfiguration createViewConfigurationFor( _i10.RenderView? renderView, ) => (super.noSuchMethod( - Invocation.method(#createViewConfigurationFor, [renderView]), - returnValue: _FakeViewConfiguration_34( - this, - Invocation.method(#createViewConfigurationFor, [renderView]), - ), - ) as _i10.ViewConfiguration); + Invocation.method(#createViewConfigurationFor, [renderView]), + returnValue: _FakeViewConfiguration_34( + this, + Invocation.method(#createViewConfigurationFor, [renderView]), + ), + ) + as _i10.ViewConfiguration); @override - _i6.SceneBuilder createSceneBuilder() => (super.noSuchMethod( - Invocation.method(#createSceneBuilder, []), - returnValue: _FakeSceneBuilder_35( - this, - Invocation.method(#createSceneBuilder, []), - ), - ) as _i6.SceneBuilder); + _i6.SceneBuilder createSceneBuilder() => + (super.noSuchMethod( + Invocation.method(#createSceneBuilder, []), + returnValue: _FakeSceneBuilder_35( + this, + Invocation.method(#createSceneBuilder, []), + ), + ) + as _i6.SceneBuilder); @override - _i6.PictureRecorder createPictureRecorder() => (super.noSuchMethod( - Invocation.method(#createPictureRecorder, []), - returnValue: _FakePictureRecorder_36( - this, - Invocation.method(#createPictureRecorder, []), - ), - ) as _i6.PictureRecorder); + _i6.PictureRecorder createPictureRecorder() => + (super.noSuchMethod( + Invocation.method(#createPictureRecorder, []), + returnValue: _FakePictureRecorder_36( + this, + Invocation.method(#createPictureRecorder, []), + ), + ) + as _i6.PictureRecorder); @override - _i6.Canvas createCanvas(_i6.PictureRecorder? recorder) => (super.noSuchMethod( - Invocation.method(#createCanvas, [recorder]), - returnValue: _FakeCanvas_37( - this, - Invocation.method(#createCanvas, [recorder]), - ), - ) as _i6.Canvas); + _i6.Canvas createCanvas(_i6.PictureRecorder? recorder) => + (super.noSuchMethod( + Invocation.method(#createCanvas, [recorder]), + returnValue: _FakeCanvas_37( + this, + Invocation.method(#createCanvas, [recorder]), + ), + ) + as _i6.Canvas); @override void handleMetricsChanged() => super.noSuchMethod( - Invocation.method(#handleMetricsChanged, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handleMetricsChanged, []), + returnValueForMissingStub: null, + ); @override void handleTextScaleFactorChanged() => super.noSuchMethod( - Invocation.method(#handleTextScaleFactorChanged, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handleTextScaleFactorChanged, []), + returnValueForMissingStub: null, + ); @override void handlePlatformBrightnessChanged() => super.noSuchMethod( - Invocation.method(#handlePlatformBrightnessChanged, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handlePlatformBrightnessChanged, []), + returnValueForMissingStub: null, + ); @override void initMouseTracker([_i10.MouseTracker? tracker]) => super.noSuchMethod( - Invocation.method(#initMouseTracker, [tracker]), - returnValueForMissingStub: null, - ); + Invocation.method(#initMouseTracker, [tracker]), + returnValueForMissingStub: null, + ); @override void deferFirstFrame() => super.noSuchMethod( - Invocation.method(#deferFirstFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#deferFirstFrame, []), + returnValueForMissingStub: null, + ); @override void allowFirstFrame() => super.noSuchMethod( - Invocation.method(#allowFirstFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#allowFirstFrame, []), + returnValueForMissingStub: null, + ); @override void resetFirstFrameSent() => super.noSuchMethod( - Invocation.method(#resetFirstFrameSent, []), - returnValueForMissingStub: null, - ); + Invocation.method(#resetFirstFrameSent, []), + returnValueForMissingStub: null, + ); @override void drawFrame() => super.noSuchMethod( - Invocation.method(#drawFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#drawFrame, []), + returnValueForMissingStub: null, + ); @override void addObserver(_i5.WidgetsBindingObserver? observer) => super.noSuchMethod( - Invocation.method(#addObserver, [observer]), - returnValueForMissingStub: null, - ); + Invocation.method(#addObserver, [observer]), + returnValueForMissingStub: null, + ); @override bool removeObserver(_i5.WidgetsBindingObserver? observer) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer]), - returnValue: false, - ) as bool); + Invocation.method(#removeObserver, [observer]), + returnValue: false, + ) + as bool); @override void handleLocaleChanged() => super.noSuchMethod( - Invocation.method(#handleLocaleChanged, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handleLocaleChanged, []), + returnValueForMissingStub: null, + ); @override void dispatchLocalesChanged(List<_i6.Locale>? locales) => super.noSuchMethod( - Invocation.method(#dispatchLocalesChanged, [locales]), - returnValueForMissingStub: null, - ); + Invocation.method(#dispatchLocalesChanged, [locales]), + returnValueForMissingStub: null, + ); @override void dispatchAccessibilityFeaturesChanged() => super.noSuchMethod( - Invocation.method(#dispatchAccessibilityFeaturesChanged, []), - returnValueForMissingStub: null, - ); + Invocation.method(#dispatchAccessibilityFeaturesChanged, []), + returnValueForMissingStub: null, + ); @override - _i11.Future handlePopRoute() => (super.noSuchMethod( - Invocation.method(#handlePopRoute, []), - returnValue: _i11.Future.value(false), - ) as _i11.Future); + _i11.Future handlePopRoute() => + (super.noSuchMethod( + Invocation.method(#handlePopRoute, []), + returnValue: _i11.Future.value(false), + ) + as _i11.Future); @override - _i11.Future handlePushRoute(String? route) => (super.noSuchMethod( - Invocation.method(#handlePushRoute, [route]), - returnValue: _i11.Future.value(false), - ) as _i11.Future); + _i11.Future handlePushRoute(String? route) => + (super.noSuchMethod( + Invocation.method(#handlePushRoute, [route]), + returnValue: _i11.Future.value(false), + ) + as _i11.Future); @override - _i9.Widget wrapWithDefaultView(_i9.Widget? rootWidget) => (super.noSuchMethod( - Invocation.method(#wrapWithDefaultView, [rootWidget]), - returnValue: _FakeWidget_38( - this, - Invocation.method(#wrapWithDefaultView, [rootWidget]), - ), - ) as _i9.Widget); + _i9.Widget wrapWithDefaultView(_i9.Widget? rootWidget) => + (super.noSuchMethod( + Invocation.method(#wrapWithDefaultView, [rootWidget]), + returnValue: _FakeWidget_38( + this, + Invocation.method(#wrapWithDefaultView, [rootWidget]), + ), + ) + as _i9.Widget); @override void scheduleAttachRootWidget(_i9.Widget? rootWidget) => super.noSuchMethod( - Invocation.method(#scheduleAttachRootWidget, [rootWidget]), - returnValueForMissingStub: null, - ); + Invocation.method(#scheduleAttachRootWidget, [rootWidget]), + returnValueForMissingStub: null, + ); @override void attachRootWidget(_i9.Widget? rootWidget) => super.noSuchMethod( - Invocation.method(#attachRootWidget, [rootWidget]), - returnValueForMissingStub: null, - ); + Invocation.method(#attachRootWidget, [rootWidget]), + returnValueForMissingStub: null, + ); @override void attachToBuildOwner(_i5.RootWidget? widget) => super.noSuchMethod( - Invocation.method(#attachToBuildOwner, [widget]), - returnValueForMissingStub: null, - ); + Invocation.method(#attachToBuildOwner, [widget]), + returnValueForMissingStub: null, + ); @override _i6.Locale? computePlatformResolvedLocale( List<_i6.Locale>? supportedLocales, ) => (super.noSuchMethod( - Invocation.method(#computePlatformResolvedLocale, [ - supportedLocales, - ]), - ) as _i6.Locale?); + Invocation.method(#computePlatformResolvedLocale, [ + supportedLocales, + ]), + ) + as _i6.Locale?); } /// A class which mocks [SentryJsBinding]. @@ -2698,40 +2899,47 @@ class MockSentryJsBinding extends _i1.Mock implements _i23.SentryJsBinding { @override void init(Map? options) => super.noSuchMethod( - Invocation.method(#init, [options]), - returnValueForMissingStub: null, - ); + Invocation.method(#init, [options]), + returnValueForMissingStub: null, + ); @override void close() => super.noSuchMethod( - Invocation.method(#close, []), - returnValueForMissingStub: null, - ); + Invocation.method(#close, []), + returnValueForMissingStub: null, + ); @override void captureEnvelope(List? envelope) => super.noSuchMethod( - Invocation.method(#captureEnvelope, [envelope]), - returnValueForMissingStub: null, - ); + Invocation.method(#captureEnvelope, [envelope]), + returnValueForMissingStub: null, + ); @override void startSession() => super.noSuchMethod( - Invocation.method(#startSession, []), - returnValueForMissingStub: null, - ); + Invocation.method(#startSession, []), + returnValueForMissingStub: null, + ); @override void updateSession({int? errors, String? status}) => super.noSuchMethod( - Invocation.method( - #updateSession, [], {#errors: errors, #status: status}), - returnValueForMissingStub: null, - ); + Invocation.method(#updateSession, [], {#errors: errors, #status: status}), + returnValueForMissingStub: null, + ); @override void captureSession() => super.noSuchMethod( - Invocation.method(#captureSession, []), - returnValueForMissingStub: null, - ); + Invocation.method(#captureSession, []), + returnValueForMissingStub: null, + ); + + @override + Map getFilenameToDebugIdMap() => + (super.noSuchMethod( + Invocation.method(#getFilenameToDebugIdMap, []), + returnValue: {}, + ) + as Map); } /// A class which mocks [Hub]. @@ -2743,13 +2951,15 @@ class MockHub extends _i1.Mock implements _i2.Hub { } @override - _i2.SentryOptions get options => (super.noSuchMethod( - Invocation.getter(#options), - returnValue: _FakeSentryOptions_39( - this, - Invocation.getter(#options), - ), - ) as _i2.SentryOptions); + _i2.SentryOptions get options => + (super.noSuchMethod( + Invocation.getter(#options), + returnValue: _FakeSentryOptions_39( + this, + Invocation.getter(#options), + ), + ) + as _i2.SentryOptions); @override bool get isEnabled => @@ -2757,22 +2967,26 @@ class MockHub extends _i1.Mock implements _i2.Hub { as bool); @override - _i2.SentryId get lastEventId => (super.noSuchMethod( - Invocation.getter(#lastEventId), - returnValue: _FakeSentryId_5(this, Invocation.getter(#lastEventId)), - ) as _i2.SentryId); + _i2.SentryId get lastEventId => + (super.noSuchMethod( + Invocation.getter(#lastEventId), + returnValue: _FakeSentryId_5(this, Invocation.getter(#lastEventId)), + ) + as _i2.SentryId); @override - _i2.Scope get scope => (super.noSuchMethod( - Invocation.getter(#scope), - returnValue: _FakeScope_40(this, Invocation.getter(#scope)), - ) as _i2.Scope); + _i2.Scope get scope => + (super.noSuchMethod( + Invocation.getter(#scope), + returnValue: _FakeScope_40(this, Invocation.getter(#scope)), + ) + as _i2.Scope); @override set profilerFactory(_i15.SentryProfilerFactory? value) => super.noSuchMethod( - Invocation.setter(#profilerFactory, value), - returnValueForMissingStub: null, - ); + Invocation.setter(#profilerFactory, value), + returnValueForMissingStub: null, + ); @override _i11.Future<_i2.SentryId> captureEvent( @@ -2782,22 +2996,23 @@ class MockHub extends _i1.Mock implements _i2.Hub { _i2.ScopeCallback? withScope, }) => (super.noSuchMethod( - Invocation.method( - #captureEvent, - [event], - {#stackTrace: stackTrace, #hint: hint, #withScope: withScope}, - ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, Invocation.method( #captureEvent, [event], {#stackTrace: stackTrace, #hint: hint, #withScope: withScope}, ), - ), - ), - ) as _i11.Future<_i2.SentryId>); + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, + Invocation.method( + #captureEvent, + [event], + {#stackTrace: stackTrace, #hint: hint, #withScope: withScope}, + ), + ), + ), + ) + as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId> captureException( @@ -2807,22 +3022,23 @@ class MockHub extends _i1.Mock implements _i2.Hub { _i2.ScopeCallback? withScope, }) => (super.noSuchMethod( - Invocation.method( - #captureException, - [throwable], - {#stackTrace: stackTrace, #hint: hint, #withScope: withScope}, - ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, Invocation.method( #captureException, [throwable], {#stackTrace: stackTrace, #hint: hint, #withScope: withScope}, ), - ), - ), - ) as _i11.Future<_i2.SentryId>); + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, + Invocation.method( + #captureException, + [throwable], + {#stackTrace: stackTrace, #hint: hint, #withScope: withScope}, + ), + ), + ), + ) + as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId> captureMessage( @@ -2834,20 +3050,6 @@ class MockHub extends _i1.Mock implements _i2.Hub { _i2.ScopeCallback? withScope, }) => (super.noSuchMethod( - Invocation.method( - #captureMessage, - [message], - { - #level: level, - #template: template, - #params: params, - #hint: hint, - #withScope: withScope, - }, - ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, Invocation.method( #captureMessage, [message], @@ -2859,9 +3061,24 @@ class MockHub extends _i1.Mock implements _i2.Hub { #withScope: withScope, }, ), - ), - ), - ) as _i11.Future<_i2.SentryId>); + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, + Invocation.method( + #captureMessage, + [message], + { + #level: level, + #template: template, + #params: params, + #hint: hint, + #withScope: withScope, + }, + ), + ), + ), + ) + as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId> captureFeedback( @@ -2870,49 +3087,55 @@ class MockHub extends _i1.Mock implements _i2.Hub { _i2.ScopeCallback? withScope, }) => (super.noSuchMethod( - Invocation.method( - #captureFeedback, - [feedback], - {#hint: hint, #withScope: withScope}, - ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, Invocation.method( #captureFeedback, [feedback], {#hint: hint, #withScope: withScope}, ), - ), - ), - ) as _i11.Future<_i2.SentryId>); + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, + Invocation.method( + #captureFeedback, + [feedback], + {#hint: hint, #withScope: withScope}, + ), + ), + ), + ) + as _i11.Future<_i2.SentryId>); @override _i11.Future addBreadcrumb(_i2.Breadcrumb? crumb, {_i2.Hint? hint}) => (super.noSuchMethod( - Invocation.method(#addBreadcrumb, [crumb], {#hint: hint}), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) as _i11.Future); + Invocation.method(#addBreadcrumb, [crumb], {#hint: hint}), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) + as _i11.Future); @override void bindClient(_i2.SentryClient? client) => super.noSuchMethod( - Invocation.method(#bindClient, [client]), - returnValueForMissingStub: null, - ); + Invocation.method(#bindClient, [client]), + returnValueForMissingStub: null, + ); @override - _i2.Hub clone() => (super.noSuchMethod( - Invocation.method(#clone, []), - returnValue: _FakeHub_41(this, Invocation.method(#clone, [])), - ) as _i2.Hub); + _i2.Hub clone() => + (super.noSuchMethod( + Invocation.method(#clone, []), + returnValue: _FakeHub_41(this, Invocation.method(#clone, [])), + ) + as _i2.Hub); @override - _i11.Future close() => (super.noSuchMethod( - Invocation.method(#close, []), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) as _i11.Future); + _i11.Future close() => + (super.noSuchMethod( + Invocation.method(#close, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) + as _i11.Future); @override _i11.FutureOr configureScope(_i2.ScopeCallback? callback) => @@ -2933,33 +3156,34 @@ class MockHub extends _i1.Mock implements _i2.Hub { Map? customSamplingContext, }) => (super.noSuchMethod( - Invocation.method( - #startTransaction, - [name, operation], - { - #description: description, - #startTimestamp: startTimestamp, - #bindToScope: bindToScope, - #waitForChildren: waitForChildren, - #autoFinishAfter: autoFinishAfter, - #trimEnd: trimEnd, - #onFinish: onFinish, - #customSamplingContext: customSamplingContext, - }, - ), - returnValue: _i13.startTransactionShim( - name, - operation, - description: description, - startTimestamp: startTimestamp, - bindToScope: bindToScope, - waitForChildren: waitForChildren, - autoFinishAfter: autoFinishAfter, - trimEnd: trimEnd, - onFinish: onFinish, - customSamplingContext: customSamplingContext, - ), - ) as _i2.ISentrySpan); + Invocation.method( + #startTransaction, + [name, operation], + { + #description: description, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + #customSamplingContext: customSamplingContext, + }, + ), + returnValue: _i13.startTransactionShim( + name, + operation, + description: description, + startTimestamp: startTimestamp, + bindToScope: bindToScope, + waitForChildren: waitForChildren, + autoFinishAfter: autoFinishAfter, + trimEnd: trimEnd, + onFinish: onFinish, + customSamplingContext: customSamplingContext, + ), + ) + as _i2.ISentrySpan); @override _i2.ISentrySpan startTransactionWithContext( @@ -2973,36 +3197,43 @@ class MockHub extends _i1.Mock implements _i2.Hub { _i2.OnTransactionFinish? onFinish, }) => (super.noSuchMethod( - Invocation.method( - #startTransactionWithContext, - [transactionContext], - { - #customSamplingContext: customSamplingContext, - #startTimestamp: startTimestamp, - #bindToScope: bindToScope, - #waitForChildren: waitForChildren, - #autoFinishAfter: autoFinishAfter, - #trimEnd: trimEnd, - #onFinish: onFinish, - }, - ), - returnValue: _FakeISentrySpan_2( - this, - Invocation.method( - #startTransactionWithContext, - [transactionContext], - { - #customSamplingContext: customSamplingContext, - #startTimestamp: startTimestamp, - #bindToScope: bindToScope, - #waitForChildren: waitForChildren, - #autoFinishAfter: autoFinishAfter, - #trimEnd: trimEnd, - #onFinish: onFinish, - }, - ), - ), - ) as _i2.ISentrySpan); + Invocation.method( + #startTransactionWithContext, + [transactionContext], + { + #customSamplingContext: customSamplingContext, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + }, + ), + returnValue: _FakeISentrySpan_2( + this, + Invocation.method( + #startTransactionWithContext, + [transactionContext], + { + #customSamplingContext: customSamplingContext, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + }, + ), + ), + ) + as _i2.ISentrySpan); + + @override + void generateNewTraceId() => super.noSuchMethod( + Invocation.method(#generateNewTraceId, []), + returnValueForMissingStub: null, + ); @override _i11.Future<_i2.SentryId> captureTransaction( @@ -3011,31 +3242,31 @@ class MockHub extends _i1.Mock implements _i2.Hub { _i2.Hint? hint, }) => (super.noSuchMethod( - Invocation.method( - #captureTransaction, - [transaction], - {#traceContext: traceContext, #hint: hint}, - ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, Invocation.method( #captureTransaction, [transaction], {#traceContext: traceContext, #hint: hint}, ), - ), - ), - ) as _i11.Future<_i2.SentryId>); + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, + Invocation.method( + #captureTransaction, + [transaction], + {#traceContext: traceContext, #hint: hint}, + ), + ), + ), + ) + as _i11.Future<_i2.SentryId>); @override void setSpanContext( dynamic throwable, _i2.ISentrySpan? span, String? transaction, - ) => - super.noSuchMethod( - Invocation.method(#setSpanContext, [throwable, span, transaction]), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#setSpanContext, [throwable, span, transaction]), + returnValueForMissingStub: null, + ); } diff --git a/flutter/test/screenshot/sentry_screenshot_widget_test.mocks.dart b/flutter/test/screenshot/sentry_screenshot_widget_test.mocks.dart index 260d732543..beb822fd59 100644 --- a/flutter/test/screenshot/sentry_screenshot_widget_test.mocks.dart +++ b/flutter/test/screenshot/sentry_screenshot_widget_test.mocks.dart @@ -36,7 +36,8 @@ class MockCallbacks extends _i1.Mock implements _i2.Callbacks { _i3.SentryScreenshotWidgetStatus? b, ) => (super.noSuchMethod( - Invocation.method(#onBuild, [a, b]), - returnValue: false, - ) as bool); + Invocation.method(#onBuild, [a, b]), + returnValue: false, + ) + as bool); } From 210c4515075b7d71b59a36a4718cc013864885bd Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 8 May 2025 14:59:28 +0200 Subject: [PATCH 06/37] Formatting --- flutter/test/mocks.mocks.dart | 3103 ++++++++--------- .../sentry_screenshot_widget_test.mocks.dart | 7 +- 2 files changed, 1445 insertions(+), 1665 deletions(-) diff --git a/flutter/test/mocks.mocks.dart b/flutter/test/mocks.mocks.dart index 295e34ee00..d4a0df6d1b 100644 --- a/flutter/test/mocks.mocks.dart +++ b/flutter/test/mocks.mocks.dart @@ -47,151 +47,151 @@ import 'mocks.dart' as _i13; class _FakeSentrySpanContext_0 extends _i1.SmartFake implements _i2.SentrySpanContext { _FakeSentrySpanContext_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDateTime_1 extends _i1.SmartFake implements DateTime { _FakeDateTime_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeISentrySpan_2 extends _i1.SmartFake implements _i2.ISentrySpan { _FakeISentrySpan_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSentryTraceHeader_3 extends _i1.SmartFake implements _i2.SentryTraceHeader { _FakeSentryTraceHeader_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSentryTracer_4 extends _i1.SmartFake implements _i3.SentryTracer { _FakeSentryTracer_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSentryId_5 extends _i1.SmartFake implements _i2.SentryId { _FakeSentryId_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeContexts_6 extends _i1.SmartFake implements _i2.Contexts { _FakeContexts_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSentryTransaction_7 extends _i1.SmartFake implements _i2.SentryTransaction { _FakeSentryTransaction_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeMethodCodec_8 extends _i1.SmartFake implements _i4.MethodCodec { _FakeMethodCodec_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeBinaryMessenger_9 extends _i1.SmartFake implements _i4.BinaryMessenger { _FakeBinaryMessenger_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWidgetsBinding_10 extends _i1.SmartFake implements _i5.WidgetsBinding { _FakeWidgetsBinding_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSingletonFlutterWindow_11 extends _i1.SmartFake implements _i6.SingletonFlutterWindow { _FakeSingletonFlutterWindow_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformDispatcher_12 extends _i1.SmartFake implements _i6.PlatformDispatcher { _FakePlatformDispatcher_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePointerRouter_13 extends _i1.SmartFake implements _i7.PointerRouter { _FakePointerRouter_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeGestureArenaManager_14 extends _i1.SmartFake implements _i7.GestureArenaManager { _FakeGestureArenaManager_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePointerSignalResolver_15 extends _i1.SmartFake implements _i7.PointerSignalResolver { _FakePointerSignalResolver_15(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDuration_16 extends _i1.SmartFake implements Duration { _FakeDuration_16(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSamplingClock_17 extends _i1.SmartFake implements _i7.SamplingClock { _FakeSamplingClock_17(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeValueNotifier_18 extends _i1.SmartFake implements _i8.ValueNotifier { _FakeValueNotifier_18(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeHardwareKeyboard_19 extends _i1.SmartFake implements _i4.HardwareKeyboard { _FakeHardwareKeyboard_19(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeKeyEventManager_20 extends _i1.SmartFake implements _i4.KeyEventManager { _FakeKeyEventManager_20(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeChannelBuffers_21 extends _i1.SmartFake implements _i6.ChannelBuffers { _FakeChannelBuffers_21(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeRestorationManager_22 extends _i1.SmartFake implements _i4.RestorationManager { _FakeRestorationManager_22(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeImageCache_23 extends _i1.SmartFake implements _i9.ImageCache { _FakeImageCache_23(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeListenable_24 extends _i1.SmartFake implements _i8.Listenable { _FakeListenable_24(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeAccessibilityFeatures_25 extends _i1.SmartFake implements _i6.AccessibilityFeatures { _FakeAccessibilityFeatures_25(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeRenderView_26 extends _i1.SmartFake implements _i10.RenderView { _FakeRenderView_26(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); @override String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => @@ -200,18 +200,18 @@ class _FakeRenderView_26 extends _i1.SmartFake implements _i10.RenderView { class _FakeMouseTracker_27 extends _i1.SmartFake implements _i10.MouseTracker { _FakeMouseTracker_27(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformMenuDelegate_28 extends _i1.SmartFake implements _i9.PlatformMenuDelegate { _FakePlatformMenuDelegate_28(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeFocusManager_29 extends _i1.SmartFake implements _i9.FocusManager { _FakeFocusManager_29(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); @override String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => @@ -220,51 +220,51 @@ class _FakeFocusManager_29 extends _i1.SmartFake implements _i9.FocusManager { class _FakeFuture_30 extends _i1.SmartFake implements _i11.Future { _FakeFuture_30(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeCodec_31 extends _i1.SmartFake implements _i6.Codec { _FakeCodec_31(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSemanticsHandle_32 extends _i1.SmartFake implements _i12.SemanticsHandle { _FakeSemanticsHandle_32(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSemanticsUpdateBuilder_33 extends _i1.SmartFake implements _i6.SemanticsUpdateBuilder { _FakeSemanticsUpdateBuilder_33(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeViewConfiguration_34 extends _i1.SmartFake implements _i10.ViewConfiguration { _FakeViewConfiguration_34(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSceneBuilder_35 extends _i1.SmartFake implements _i6.SceneBuilder { _FakeSceneBuilder_35(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePictureRecorder_36 extends _i1.SmartFake implements _i6.PictureRecorder { _FakePictureRecorder_36(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeCanvas_37 extends _i1.SmartFake implements _i6.Canvas { _FakeCanvas_37(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWidget_38 extends _i1.SmartFake implements _i9.Widget { _FakeWidget_38(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); @override String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => @@ -273,17 +273,17 @@ class _FakeWidget_38 extends _i1.SmartFake implements _i9.Widget { class _FakeSentryOptions_39 extends _i1.SmartFake implements _i2.SentryOptions { _FakeSentryOptions_39(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeScope_40 extends _i1.SmartFake implements _i2.Scope { _FakeScope_40(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeHub_41 extends _i1.SmartFake implements _i2.Hub { _FakeHub_41(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [Callbacks]. @@ -300,9 +300,8 @@ class MockCallbacks extends _i1.Mock implements _i13.Callbacks { dynamic arguments, ]) => (super.noSuchMethod( - Invocation.method(#methodCallHandler, [method, arguments]), - ) - as _i11.Future?); + Invocation.method(#methodCallHandler, [method, arguments]), + ) as _i11.Future?); } /// A class which mocks [Transport]. @@ -316,10 +315,9 @@ class MockTransport extends _i1.Mock implements _i2.Transport { @override _i11.Future<_i2.SentryId?> send(_i2.SentryEnvelope? envelope) => (super.noSuchMethod( - Invocation.method(#send, [envelope]), - returnValue: _i11.Future<_i2.SentryId?>.value(), - ) - as _i11.Future<_i2.SentryId?>); + Invocation.method(#send, [envelope]), + returnValue: _i11.Future<_i2.SentryId?>.value(), + ) as _i11.Future<_i2.SentryId?>); } /// A class which mocks [SentryTracer]. @@ -331,93 +329,83 @@ class MockSentryTracer extends _i1.Mock implements _i3.SentryTracer { } @override - String get name => - (super.noSuchMethod( - Invocation.getter(#name), - returnValue: _i14.dummyValue( - this, - Invocation.getter(#name), - ), - ) - as String); + String get name => (super.noSuchMethod( + Invocation.getter(#name), + returnValue: _i14.dummyValue( + this, + Invocation.getter(#name), + ), + ) as String); @override set name(String? _name) => super.noSuchMethod( - Invocation.setter(#name, _name), - returnValueForMissingStub: null, - ); + Invocation.setter(#name, _name), + returnValueForMissingStub: null, + ); @override _i2.SentryTransactionNameSource get transactionNameSource => (super.noSuchMethod( - Invocation.getter(#transactionNameSource), - returnValue: _i2.SentryTransactionNameSource.custom, - ) - as _i2.SentryTransactionNameSource); + Invocation.getter(#transactionNameSource), + returnValue: _i2.SentryTransactionNameSource.custom, + ) as _i2.SentryTransactionNameSource); @override set transactionNameSource( _i2.SentryTransactionNameSource? _transactionNameSource, - ) => super.noSuchMethod( - Invocation.setter(#transactionNameSource, _transactionNameSource), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.setter(#transactionNameSource, _transactionNameSource), + returnValueForMissingStub: null, + ); @override set profiler(_i15.SentryProfiler? _profiler) => super.noSuchMethod( - Invocation.setter(#profiler, _profiler), - returnValueForMissingStub: null, - ); + Invocation.setter(#profiler, _profiler), + returnValueForMissingStub: null, + ); @override set profileInfo(_i15.SentryProfileInfo? _profileInfo) => super.noSuchMethod( - Invocation.setter(#profileInfo, _profileInfo), - returnValueForMissingStub: null, - ); + Invocation.setter(#profileInfo, _profileInfo), + returnValueForMissingStub: null, + ); @override - Map get measurements => - (super.noSuchMethod( - Invocation.getter(#measurements), - returnValue: {}, - ) - as Map); + Map get measurements => (super.noSuchMethod( + Invocation.getter(#measurements), + returnValue: {}, + ) as Map); @override - _i2.SentrySpanContext get context => - (super.noSuchMethod( - Invocation.getter(#context), - returnValue: _FakeSentrySpanContext_0( - this, - Invocation.getter(#context), - ), - ) - as _i2.SentrySpanContext); + _i2.SentrySpanContext get context => (super.noSuchMethod( + Invocation.getter(#context), + returnValue: _FakeSentrySpanContext_0( + this, + Invocation.getter(#context), + ), + ) as _i2.SentrySpanContext); @override set origin(String? origin) => super.noSuchMethod( - Invocation.setter(#origin, origin), - returnValueForMissingStub: null, - ); + Invocation.setter(#origin, origin), + returnValueForMissingStub: null, + ); @override - DateTime get startTimestamp => - (super.noSuchMethod( - Invocation.getter(#startTimestamp), - returnValue: _FakeDateTime_1( - this, - Invocation.getter(#startTimestamp), - ), - ) - as DateTime); + DateTime get startTimestamp => (super.noSuchMethod( + Invocation.getter(#startTimestamp), + returnValue: _FakeDateTime_1( + this, + Invocation.getter(#startTimestamp), + ), + ) as DateTime); @override - Map get data => - (super.noSuchMethod( - Invocation.getter(#data), - returnValue: {}, - ) - as Map); + Map get data => (super.noSuchMethod( + Invocation.getter(#data), + returnValue: {}, + ) as Map); @override bool get finished => @@ -425,32 +413,28 @@ class MockSentryTracer extends _i1.Mock implements _i3.SentryTracer { as bool); @override - List<_i2.SentrySpan> get children => - (super.noSuchMethod( - Invocation.getter(#children), - returnValue: <_i2.SentrySpan>[], - ) - as List<_i2.SentrySpan>); + List<_i2.SentrySpan> get children => (super.noSuchMethod( + Invocation.getter(#children), + returnValue: <_i2.SentrySpan>[], + ) as List<_i2.SentrySpan>); @override set throwable(dynamic throwable) => super.noSuchMethod( - Invocation.setter(#throwable, throwable), - returnValueForMissingStub: null, - ); + Invocation.setter(#throwable, throwable), + returnValueForMissingStub: null, + ); @override set status(_i2.SpanStatus? status) => super.noSuchMethod( - Invocation.setter(#status, status), - returnValueForMissingStub: null, - ); + Invocation.setter(#status, status), + returnValueForMissingStub: null, + ); @override - Map get tags => - (super.noSuchMethod( - Invocation.getter(#tags), - returnValue: {}, - ) - as Map); + Map get tags => (super.noSuchMethod( + Invocation.getter(#tags), + returnValue: {}, + ) as Map); @override _i11.Future finish({ @@ -459,39 +443,38 @@ class MockSentryTracer extends _i1.Mock implements _i3.SentryTracer { _i2.Hint? hint, }) => (super.noSuchMethod( - Invocation.method(#finish, [], { - #status: status, - #endTimestamp: endTimestamp, - #hint: hint, - }), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) - as _i11.Future); + Invocation.method(#finish, [], { + #status: status, + #endTimestamp: endTimestamp, + #hint: hint, + }), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override void removeData(String? key) => super.noSuchMethod( - Invocation.method(#removeData, [key]), - returnValueForMissingStub: null, - ); + Invocation.method(#removeData, [key]), + returnValueForMissingStub: null, + ); @override void removeTag(String? key) => super.noSuchMethod( - Invocation.method(#removeTag, [key]), - returnValueForMissingStub: null, - ); + Invocation.method(#removeTag, [key]), + returnValueForMissingStub: null, + ); @override void setData(String? key, dynamic value) => super.noSuchMethod( - Invocation.method(#setData, [key, value]), - returnValueForMissingStub: null, - ); + Invocation.method(#setData, [key, value]), + returnValueForMissingStub: null, + ); @override void setTag(String? key, String? value) => super.noSuchMethod( - Invocation.method(#setTag, [key, value]), - returnValueForMissingStub: null, - ); + Invocation.method(#setTag, [key, value]), + returnValueForMissingStub: null, + ); @override _i2.ISentrySpan startChild( @@ -500,21 +483,20 @@ class MockSentryTracer extends _i1.Mock implements _i3.SentryTracer { DateTime? startTimestamp, }) => (super.noSuchMethod( - Invocation.method( - #startChild, - [operation], - {#description: description, #startTimestamp: startTimestamp}, - ), - returnValue: _FakeISentrySpan_2( - this, - Invocation.method( - #startChild, - [operation], - {#description: description, #startTimestamp: startTimestamp}, - ), - ), - ) - as _i2.ISentrySpan); + Invocation.method( + #startChild, + [operation], + {#description: description, #startTimestamp: startTimestamp}, + ), + returnValue: _FakeISentrySpan_2( + this, + Invocation.method( + #startChild, + [operation], + {#description: description, #startTimestamp: startTimestamp}, + ), + ), + ) as _i2.ISentrySpan); @override _i2.ISentrySpan startChildWithParentSpanId( @@ -524,58 +506,58 @@ class MockSentryTracer extends _i1.Mock implements _i3.SentryTracer { DateTime? startTimestamp, }) => (super.noSuchMethod( - Invocation.method( - #startChildWithParentSpanId, - [parentSpanId, operation], - {#description: description, #startTimestamp: startTimestamp}, - ), - returnValue: _FakeISentrySpan_2( - this, - Invocation.method( - #startChildWithParentSpanId, - [parentSpanId, operation], - {#description: description, #startTimestamp: startTimestamp}, - ), - ), - ) - as _i2.ISentrySpan); + Invocation.method( + #startChildWithParentSpanId, + [parentSpanId, operation], + {#description: description, #startTimestamp: startTimestamp}, + ), + returnValue: _FakeISentrySpan_2( + this, + Invocation.method( + #startChildWithParentSpanId, + [parentSpanId, operation], + {#description: description, #startTimestamp: startTimestamp}, + ), + ), + ) as _i2.ISentrySpan); @override - _i2.SentryTraceHeader toSentryTrace() => - (super.noSuchMethod( - Invocation.method(#toSentryTrace, []), - returnValue: _FakeSentryTraceHeader_3( - this, - Invocation.method(#toSentryTrace, []), - ), - ) - as _i2.SentryTraceHeader); + _i2.SentryTraceHeader toSentryTrace() => (super.noSuchMethod( + Invocation.method(#toSentryTrace, []), + returnValue: _FakeSentryTraceHeader_3( + this, + Invocation.method(#toSentryTrace, []), + ), + ) as _i2.SentryTraceHeader); @override void setMeasurement( String? name, num? value, { _i2.SentryMeasurementUnit? unit, - }) => super.noSuchMethod( - Invocation.method(#setMeasurement, [name, value], {#unit: unit}), - returnValueForMissingStub: null, - ); + }) => + super.noSuchMethod( + Invocation.method(#setMeasurement, [name, value], {#unit: unit}), + returnValueForMissingStub: null, + ); @override void setMeasurementFromChild( String? name, num? value, { _i2.SentryMeasurementUnit? unit, - }) => super.noSuchMethod( - Invocation.method(#setMeasurementFromChild, [name, value], {#unit: unit}), - returnValueForMissingStub: null, - ); + }) => + super.noSuchMethod( + Invocation.method( + #setMeasurementFromChild, [name, value], {#unit: unit}), + returnValueForMissingStub: null, + ); @override void scheduleFinish() => super.noSuchMethod( - Invocation.method(#scheduleFinish, []), - returnValueForMissingStub: null, - ); + Invocation.method(#scheduleFinish, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [SentryTransaction]. @@ -587,51 +569,43 @@ class MockSentryTransaction extends _i1.Mock implements _i2.SentryTransaction { } @override - DateTime get startTimestamp => - (super.noSuchMethod( - Invocation.getter(#startTimestamp), - returnValue: _FakeDateTime_1( - this, - Invocation.getter(#startTimestamp), - ), - ) - as DateTime); + DateTime get startTimestamp => (super.noSuchMethod( + Invocation.getter(#startTimestamp), + returnValue: _FakeDateTime_1( + this, + Invocation.getter(#startTimestamp), + ), + ) as DateTime); @override set startTimestamp(DateTime? _startTimestamp) => super.noSuchMethod( - Invocation.setter(#startTimestamp, _startTimestamp), - returnValueForMissingStub: null, - ); + Invocation.setter(#startTimestamp, _startTimestamp), + returnValueForMissingStub: null, + ); @override - List<_i2.SentrySpan> get spans => - (super.noSuchMethod( - Invocation.getter(#spans), - returnValue: <_i2.SentrySpan>[], - ) - as List<_i2.SentrySpan>); + List<_i2.SentrySpan> get spans => (super.noSuchMethod( + Invocation.getter(#spans), + returnValue: <_i2.SentrySpan>[], + ) as List<_i2.SentrySpan>); @override set spans(List<_i2.SentrySpan>? _spans) => super.noSuchMethod( - Invocation.setter(#spans, _spans), - returnValueForMissingStub: null, - ); + Invocation.setter(#spans, _spans), + returnValueForMissingStub: null, + ); @override - _i3.SentryTracer get tracer => - (super.noSuchMethod( - Invocation.getter(#tracer), - returnValue: _FakeSentryTracer_4(this, Invocation.getter(#tracer)), - ) - as _i3.SentryTracer); + _i3.SentryTracer get tracer => (super.noSuchMethod( + Invocation.getter(#tracer), + returnValue: _FakeSentryTracer_4(this, Invocation.getter(#tracer)), + ) as _i3.SentryTracer); @override - Map get measurements => - (super.noSuchMethod( - Invocation.getter(#measurements), - returnValue: {}, - ) - as Map); + Map get measurements => (super.noSuchMethod( + Invocation.getter(#measurements), + returnValue: {}, + ) as Map); @override set measurements(Map? _measurements) => @@ -658,178 +632,172 @@ class MockSentryTransaction extends _i1.Mock implements _i2.SentryTransaction { as bool); @override - _i2.SentryId get eventId => - (super.noSuchMethod( - Invocation.getter(#eventId), - returnValue: _FakeSentryId_5(this, Invocation.getter(#eventId)), - ) - as _i2.SentryId); + _i2.SentryId get eventId => (super.noSuchMethod( + Invocation.getter(#eventId), + returnValue: _FakeSentryId_5(this, Invocation.getter(#eventId)), + ) as _i2.SentryId); @override set eventId(_i2.SentryId? _eventId) => super.noSuchMethod( - Invocation.setter(#eventId, _eventId), - returnValueForMissingStub: null, - ); + Invocation.setter(#eventId, _eventId), + returnValueForMissingStub: null, + ); @override set timestamp(DateTime? _timestamp) => super.noSuchMethod( - Invocation.setter(#timestamp, _timestamp), - returnValueForMissingStub: null, - ); + Invocation.setter(#timestamp, _timestamp), + returnValueForMissingStub: null, + ); @override set platform(String? _platform) => super.noSuchMethod( - Invocation.setter(#platform, _platform), - returnValueForMissingStub: null, - ); + Invocation.setter(#platform, _platform), + returnValueForMissingStub: null, + ); @override set logger(String? _logger) => super.noSuchMethod( - Invocation.setter(#logger, _logger), - returnValueForMissingStub: null, - ); + Invocation.setter(#logger, _logger), + returnValueForMissingStub: null, + ); @override set serverName(String? _serverName) => super.noSuchMethod( - Invocation.setter(#serverName, _serverName), - returnValueForMissingStub: null, - ); + Invocation.setter(#serverName, _serverName), + returnValueForMissingStub: null, + ); @override set release(String? _release) => super.noSuchMethod( - Invocation.setter(#release, _release), - returnValueForMissingStub: null, - ); + Invocation.setter(#release, _release), + returnValueForMissingStub: null, + ); @override set dist(String? _dist) => super.noSuchMethod( - Invocation.setter(#dist, _dist), - returnValueForMissingStub: null, - ); + Invocation.setter(#dist, _dist), + returnValueForMissingStub: null, + ); @override set environment(String? _environment) => super.noSuchMethod( - Invocation.setter(#environment, _environment), - returnValueForMissingStub: null, - ); + Invocation.setter(#environment, _environment), + returnValueForMissingStub: null, + ); @override set modules(Map? _modules) => super.noSuchMethod( - Invocation.setter(#modules, _modules), - returnValueForMissingStub: null, - ); + Invocation.setter(#modules, _modules), + returnValueForMissingStub: null, + ); @override set message(_i2.SentryMessage? _message) => super.noSuchMethod( - Invocation.setter(#message, _message), - returnValueForMissingStub: null, - ); + Invocation.setter(#message, _message), + returnValueForMissingStub: null, + ); @override set exceptions(List<_i2.SentryException>? _exceptions) => super.noSuchMethod( - Invocation.setter(#exceptions, _exceptions), - returnValueForMissingStub: null, - ); + Invocation.setter(#exceptions, _exceptions), + returnValueForMissingStub: null, + ); @override set threads(List<_i2.SentryThread>? _threads) => super.noSuchMethod( - Invocation.setter(#threads, _threads), - returnValueForMissingStub: null, - ); + Invocation.setter(#threads, _threads), + returnValueForMissingStub: null, + ); @override set transaction(String? _transaction) => super.noSuchMethod( - Invocation.setter(#transaction, _transaction), - returnValueForMissingStub: null, - ); + Invocation.setter(#transaction, _transaction), + returnValueForMissingStub: null, + ); @override set level(_i2.SentryLevel? _level) => super.noSuchMethod( - Invocation.setter(#level, _level), - returnValueForMissingStub: null, - ); + Invocation.setter(#level, _level), + returnValueForMissingStub: null, + ); @override set culprit(String? _culprit) => super.noSuchMethod( - Invocation.setter(#culprit, _culprit), - returnValueForMissingStub: null, - ); + Invocation.setter(#culprit, _culprit), + returnValueForMissingStub: null, + ); @override set tags(Map? _tags) => super.noSuchMethod( - Invocation.setter(#tags, _tags), - returnValueForMissingStub: null, - ); + Invocation.setter(#tags, _tags), + returnValueForMissingStub: null, + ); @override set extra(Map? _extra) => super.noSuchMethod( - Invocation.setter(#extra, _extra), - returnValueForMissingStub: null, - ); + Invocation.setter(#extra, _extra), + returnValueForMissingStub: null, + ); @override set breadcrumbs(List<_i2.Breadcrumb>? _breadcrumbs) => super.noSuchMethod( - Invocation.setter(#breadcrumbs, _breadcrumbs), - returnValueForMissingStub: null, - ); + Invocation.setter(#breadcrumbs, _breadcrumbs), + returnValueForMissingStub: null, + ); @override set user(_i2.SentryUser? _user) => super.noSuchMethod( - Invocation.setter(#user, _user), - returnValueForMissingStub: null, - ); + Invocation.setter(#user, _user), + returnValueForMissingStub: null, + ); @override - _i2.Contexts get contexts => - (super.noSuchMethod( - Invocation.getter(#contexts), - returnValue: _FakeContexts_6(this, Invocation.getter(#contexts)), - ) - as _i2.Contexts); + _i2.Contexts get contexts => (super.noSuchMethod( + Invocation.getter(#contexts), + returnValue: _FakeContexts_6(this, Invocation.getter(#contexts)), + ) as _i2.Contexts); @override set contexts(_i2.Contexts? _contexts) => super.noSuchMethod( - Invocation.setter(#contexts, _contexts), - returnValueForMissingStub: null, - ); + Invocation.setter(#contexts, _contexts), + returnValueForMissingStub: null, + ); @override set fingerprint(List? _fingerprint) => super.noSuchMethod( - Invocation.setter(#fingerprint, _fingerprint), - returnValueForMissingStub: null, - ); + Invocation.setter(#fingerprint, _fingerprint), + returnValueForMissingStub: null, + ); @override set sdk(_i2.SdkVersion? _sdk) => super.noSuchMethod( - Invocation.setter(#sdk, _sdk), - returnValueForMissingStub: null, - ); + Invocation.setter(#sdk, _sdk), + returnValueForMissingStub: null, + ); @override set request(_i2.SentryRequest? _request) => super.noSuchMethod( - Invocation.setter(#request, _request), - returnValueForMissingStub: null, - ); + Invocation.setter(#request, _request), + returnValueForMissingStub: null, + ); @override set debugMeta(_i2.DebugMeta? _debugMeta) => super.noSuchMethod( - Invocation.setter(#debugMeta, _debugMeta), - returnValueForMissingStub: null, - ); + Invocation.setter(#debugMeta, _debugMeta), + returnValueForMissingStub: null, + ); @override set type(String? _type) => super.noSuchMethod( - Invocation.setter(#type, _type), - returnValueForMissingStub: null, - ); + Invocation.setter(#type, _type), + returnValueForMissingStub: null, + ); @override - Map toJson() => - (super.noSuchMethod( - Invocation.method(#toJson, []), - returnValue: {}, - ) - as Map); + Map toJson() => (super.noSuchMethod( + Invocation.method(#toJson, []), + returnValue: {}, + ) as Map); @override _i2.SentryTransaction copyWith({ @@ -863,71 +831,70 @@ class MockSentryTransaction extends _i1.Mock implements _i2.SentryTransaction { _i2.SentryTransactionInfo? transactionInfo, }) => (super.noSuchMethod( - Invocation.method(#copyWith, [], { - #eventId: eventId, - #timestamp: timestamp, - #platform: platform, - #logger: logger, - #serverName: serverName, - #release: release, - #dist: dist, - #environment: environment, - #modules: modules, - #message: message, - #transaction: transaction, - #throwable: throwable, - #level: level, - #culprit: culprit, - #tags: tags, - #extra: extra, - #fingerprint: fingerprint, - #user: user, - #contexts: contexts, - #breadcrumbs: breadcrumbs, - #sdk: sdk, - #request: request, - #debugMeta: debugMeta, - #exceptions: exceptions, - #threads: threads, - #type: type, - #measurements: measurements, - #transactionInfo: transactionInfo, - }), - returnValue: _FakeSentryTransaction_7( - this, - Invocation.method(#copyWith, [], { - #eventId: eventId, - #timestamp: timestamp, - #platform: platform, - #logger: logger, - #serverName: serverName, - #release: release, - #dist: dist, - #environment: environment, - #modules: modules, - #message: message, - #transaction: transaction, - #throwable: throwable, - #level: level, - #culprit: culprit, - #tags: tags, - #extra: extra, - #fingerprint: fingerprint, - #user: user, - #contexts: contexts, - #breadcrumbs: breadcrumbs, - #sdk: sdk, - #request: request, - #debugMeta: debugMeta, - #exceptions: exceptions, - #threads: threads, - #type: type, - #measurements: measurements, - #transactionInfo: transactionInfo, - }), - ), - ) - as _i2.SentryTransaction); + Invocation.method(#copyWith, [], { + #eventId: eventId, + #timestamp: timestamp, + #platform: platform, + #logger: logger, + #serverName: serverName, + #release: release, + #dist: dist, + #environment: environment, + #modules: modules, + #message: message, + #transaction: transaction, + #throwable: throwable, + #level: level, + #culprit: culprit, + #tags: tags, + #extra: extra, + #fingerprint: fingerprint, + #user: user, + #contexts: contexts, + #breadcrumbs: breadcrumbs, + #sdk: sdk, + #request: request, + #debugMeta: debugMeta, + #exceptions: exceptions, + #threads: threads, + #type: type, + #measurements: measurements, + #transactionInfo: transactionInfo, + }), + returnValue: _FakeSentryTransaction_7( + this, + Invocation.method(#copyWith, [], { + #eventId: eventId, + #timestamp: timestamp, + #platform: platform, + #logger: logger, + #serverName: serverName, + #release: release, + #dist: dist, + #environment: environment, + #modules: modules, + #message: message, + #transaction: transaction, + #throwable: throwable, + #level: level, + #culprit: culprit, + #tags: tags, + #extra: extra, + #fingerprint: fingerprint, + #user: user, + #contexts: contexts, + #breadcrumbs: breadcrumbs, + #sdk: sdk, + #request: request, + #debugMeta: debugMeta, + #exceptions: exceptions, + #threads: threads, + #type: type, + #measurements: measurements, + #transactionInfo: transactionInfo, + }), + ), + ) as _i2.SentryTransaction); } /// A class which mocks [SentrySpan]. @@ -944,46 +911,40 @@ class MockSentrySpan extends _i1.Mock implements _i2.SentrySpan { as bool); @override - _i3.SentryTracer get tracer => - (super.noSuchMethod( - Invocation.getter(#tracer), - returnValue: _FakeSentryTracer_4(this, Invocation.getter(#tracer)), - ) - as _i3.SentryTracer); + _i3.SentryTracer get tracer => (super.noSuchMethod( + Invocation.getter(#tracer), + returnValue: _FakeSentryTracer_4(this, Invocation.getter(#tracer)), + ) as _i3.SentryTracer); @override set status(_i2.SpanStatus? status) => super.noSuchMethod( - Invocation.setter(#status, status), - returnValueForMissingStub: null, - ); + Invocation.setter(#status, status), + returnValueForMissingStub: null, + ); @override - DateTime get startTimestamp => - (super.noSuchMethod( - Invocation.getter(#startTimestamp), - returnValue: _FakeDateTime_1( - this, - Invocation.getter(#startTimestamp), - ), - ) - as DateTime); + DateTime get startTimestamp => (super.noSuchMethod( + Invocation.getter(#startTimestamp), + returnValue: _FakeDateTime_1( + this, + Invocation.getter(#startTimestamp), + ), + ) as DateTime); @override - _i2.SentrySpanContext get context => - (super.noSuchMethod( - Invocation.getter(#context), - returnValue: _FakeSentrySpanContext_0( - this, - Invocation.getter(#context), - ), - ) - as _i2.SentrySpanContext); + _i2.SentrySpanContext get context => (super.noSuchMethod( + Invocation.getter(#context), + returnValue: _FakeSentrySpanContext_0( + this, + Invocation.getter(#context), + ), + ) as _i2.SentrySpanContext); @override set origin(String? origin) => super.noSuchMethod( - Invocation.setter(#origin, origin), - returnValueForMissingStub: null, - ); + Invocation.setter(#origin, origin), + returnValueForMissingStub: null, + ); @override bool get finished => @@ -992,25 +953,21 @@ class MockSentrySpan extends _i1.Mock implements _i2.SentrySpan { @override set throwable(dynamic throwable) => super.noSuchMethod( - Invocation.setter(#throwable, throwable), - returnValueForMissingStub: null, - ); + Invocation.setter(#throwable, throwable), + returnValueForMissingStub: null, + ); @override - Map get tags => - (super.noSuchMethod( - Invocation.getter(#tags), - returnValue: {}, - ) - as Map); + Map get tags => (super.noSuchMethod( + Invocation.getter(#tags), + returnValue: {}, + ) as Map); @override - Map get data => - (super.noSuchMethod( - Invocation.getter(#data), - returnValue: {}, - ) - as Map); + Map get data => (super.noSuchMethod( + Invocation.getter(#data), + returnValue: {}, + ) as Map); @override _i11.Future finish({ @@ -1019,39 +976,38 @@ class MockSentrySpan extends _i1.Mock implements _i2.SentrySpan { _i2.Hint? hint, }) => (super.noSuchMethod( - Invocation.method(#finish, [], { - #status: status, - #endTimestamp: endTimestamp, - #hint: hint, - }), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) - as _i11.Future); + Invocation.method(#finish, [], { + #status: status, + #endTimestamp: endTimestamp, + #hint: hint, + }), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override void removeData(String? key) => super.noSuchMethod( - Invocation.method(#removeData, [key]), - returnValueForMissingStub: null, - ); + Invocation.method(#removeData, [key]), + returnValueForMissingStub: null, + ); @override void removeTag(String? key) => super.noSuchMethod( - Invocation.method(#removeTag, [key]), - returnValueForMissingStub: null, - ); + Invocation.method(#removeTag, [key]), + returnValueForMissingStub: null, + ); @override void setData(String? key, dynamic value) => super.noSuchMethod( - Invocation.method(#setData, [key, value]), - returnValueForMissingStub: null, - ); + Invocation.method(#setData, [key, value]), + returnValueForMissingStub: null, + ); @override void setTag(String? key, String? value) => super.noSuchMethod( - Invocation.method(#setTag, [key, value]), - returnValueForMissingStub: null, - ); + Invocation.method(#setTag, [key, value]), + returnValueForMissingStub: null, + ); @override _i2.ISentrySpan startChild( @@ -1060,56 +1016,52 @@ class MockSentrySpan extends _i1.Mock implements _i2.SentrySpan { DateTime? startTimestamp, }) => (super.noSuchMethod( - Invocation.method( - #startChild, - [operation], - {#description: description, #startTimestamp: startTimestamp}, - ), - returnValue: _FakeISentrySpan_2( - this, - Invocation.method( - #startChild, - [operation], - {#description: description, #startTimestamp: startTimestamp}, - ), - ), - ) - as _i2.ISentrySpan); + Invocation.method( + #startChild, + [operation], + {#description: description, #startTimestamp: startTimestamp}, + ), + returnValue: _FakeISentrySpan_2( + this, + Invocation.method( + #startChild, + [operation], + {#description: description, #startTimestamp: startTimestamp}, + ), + ), + ) as _i2.ISentrySpan); @override - Map toJson() => - (super.noSuchMethod( - Invocation.method(#toJson, []), - returnValue: {}, - ) - as Map); + Map toJson() => (super.noSuchMethod( + Invocation.method(#toJson, []), + returnValue: {}, + ) as Map); @override - _i2.SentryTraceHeader toSentryTrace() => - (super.noSuchMethod( - Invocation.method(#toSentryTrace, []), - returnValue: _FakeSentryTraceHeader_3( - this, - Invocation.method(#toSentryTrace, []), - ), - ) - as _i2.SentryTraceHeader); + _i2.SentryTraceHeader toSentryTrace() => (super.noSuchMethod( + Invocation.method(#toSentryTrace, []), + returnValue: _FakeSentryTraceHeader_3( + this, + Invocation.method(#toSentryTrace, []), + ), + ) as _i2.SentryTraceHeader); @override void setMeasurement( String? name, num? value, { _i2.SentryMeasurementUnit? unit, - }) => super.noSuchMethod( - Invocation.method(#setMeasurement, [name, value], {#unit: unit}), - returnValueForMissingStub: null, - ); + }) => + super.noSuchMethod( + Invocation.method(#setMeasurement, [name, value], {#unit: unit}), + returnValueForMissingStub: null, + ); @override void scheduleFinish() => super.noSuchMethod( - Invocation.method(#scheduleFinish, []), - returnValueForMissingStub: null, - ); + Invocation.method(#scheduleFinish, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [SentryClient]. @@ -1128,23 +1080,22 @@ class MockSentryClient extends _i1.Mock implements _i2.SentryClient { _i2.Hint? hint, }) => (super.noSuchMethod( + Invocation.method( + #captureEvent, + [event], + {#scope: scope, #stackTrace: stackTrace, #hint: hint}, + ), + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, Invocation.method( #captureEvent, [event], {#scope: scope, #stackTrace: stackTrace, #hint: hint}, ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, - Invocation.method( - #captureEvent, - [event], - {#scope: scope, #stackTrace: stackTrace, #hint: hint}, - ), - ), - ), - ) - as _i11.Future<_i2.SentryId>); + ), + ), + ) as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId> captureException( @@ -1154,23 +1105,22 @@ class MockSentryClient extends _i1.Mock implements _i2.SentryClient { _i2.Hint? hint, }) => (super.noSuchMethod( + Invocation.method( + #captureException, + [throwable], + {#stackTrace: stackTrace, #scope: scope, #hint: hint}, + ), + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, Invocation.method( #captureException, [throwable], {#stackTrace: stackTrace, #scope: scope, #hint: hint}, ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, - Invocation.method( - #captureException, - [throwable], - {#stackTrace: stackTrace, #scope: scope, #hint: hint}, - ), - ), - ), - ) - as _i11.Future<_i2.SentryId>); + ), + ), + ) as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId> captureMessage( @@ -1182,6 +1132,20 @@ class MockSentryClient extends _i1.Mock implements _i2.SentryClient { _i2.Hint? hint, }) => (super.noSuchMethod( + Invocation.method( + #captureMessage, + [formatted], + { + #level: level, + #template: template, + #params: params, + #scope: scope, + #hint: hint, + }, + ), + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, Invocation.method( #captureMessage, [formatted], @@ -1193,24 +1157,9 @@ class MockSentryClient extends _i1.Mock implements _i2.SentryClient { #hint: hint, }, ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, - Invocation.method( - #captureMessage, - [formatted], - { - #level: level, - #template: template, - #params: params, - #scope: scope, - #hint: hint, - }, - ), - ), - ), - ) - as _i11.Future<_i2.SentryId>); + ), + ), + ) as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId> captureTransaction( @@ -1220,31 +1169,29 @@ class MockSentryClient extends _i1.Mock implements _i2.SentryClient { _i2.Hint? hint, }) => (super.noSuchMethod( + Invocation.method( + #captureTransaction, + [transaction], + {#scope: scope, #traceContext: traceContext, #hint: hint}, + ), + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, Invocation.method( #captureTransaction, [transaction], {#scope: scope, #traceContext: traceContext, #hint: hint}, ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, - Invocation.method( - #captureTransaction, - [transaction], - {#scope: scope, #traceContext: traceContext, #hint: hint}, - ), - ), - ), - ) - as _i11.Future<_i2.SentryId>); + ), + ), + ) as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId?> captureEnvelope(_i2.SentryEnvelope? envelope) => (super.noSuchMethod( - Invocation.method(#captureEnvelope, [envelope]), - returnValue: _i11.Future<_i2.SentryId?>.value(), - ) - as _i11.Future<_i2.SentryId?>); + Invocation.method(#captureEnvelope, [envelope]), + returnValue: _i11.Future<_i2.SentryId?>.value(), + ) as _i11.Future<_i2.SentryId?>); @override _i11.Future<_i2.SentryId> captureFeedback( @@ -1253,29 +1200,28 @@ class MockSentryClient extends _i1.Mock implements _i2.SentryClient { _i2.Hint? hint, }) => (super.noSuchMethod( + Invocation.method( + #captureFeedback, + [feedback], + {#scope: scope, #hint: hint}, + ), + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, Invocation.method( #captureFeedback, [feedback], {#scope: scope, #hint: hint}, ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, - Invocation.method( - #captureFeedback, - [feedback], - {#scope: scope, #hint: hint}, - ), - ), - ), - ) - as _i11.Future<_i2.SentryId>); + ), + ), + ) as _i11.Future<_i2.SentryId>); @override void close() => super.noSuchMethod( - Invocation.method(#close, []), - returnValueForMissingStub: null, - ); + Invocation.method(#close, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [MethodChannel]. @@ -1287,42 +1233,35 @@ class MockMethodChannel extends _i1.Mock implements _i4.MethodChannel { } @override - String get name => - (super.noSuchMethod( - Invocation.getter(#name), - returnValue: _i14.dummyValue( - this, - Invocation.getter(#name), - ), - ) - as String); + String get name => (super.noSuchMethod( + Invocation.getter(#name), + returnValue: _i14.dummyValue( + this, + Invocation.getter(#name), + ), + ) as String); @override - _i4.MethodCodec get codec => - (super.noSuchMethod( - Invocation.getter(#codec), - returnValue: _FakeMethodCodec_8(this, Invocation.getter(#codec)), - ) - as _i4.MethodCodec); + _i4.MethodCodec get codec => (super.noSuchMethod( + Invocation.getter(#codec), + returnValue: _FakeMethodCodec_8(this, Invocation.getter(#codec)), + ) as _i4.MethodCodec); @override - _i4.BinaryMessenger get binaryMessenger => - (super.noSuchMethod( - Invocation.getter(#binaryMessenger), - returnValue: _FakeBinaryMessenger_9( - this, - Invocation.getter(#binaryMessenger), - ), - ) - as _i4.BinaryMessenger); + _i4.BinaryMessenger get binaryMessenger => (super.noSuchMethod( + Invocation.getter(#binaryMessenger), + returnValue: _FakeBinaryMessenger_9( + this, + Invocation.getter(#binaryMessenger), + ), + ) as _i4.BinaryMessenger); @override _i11.Future invokeMethod(String? method, [dynamic arguments]) => (super.noSuchMethod( - Invocation.method(#invokeMethod, [method, arguments]), - returnValue: _i11.Future.value(), - ) - as _i11.Future); + Invocation.method(#invokeMethod, [method, arguments]), + returnValue: _i11.Future.value(), + ) as _i11.Future); @override _i11.Future?> invokeListMethod( @@ -1330,10 +1269,9 @@ class MockMethodChannel extends _i1.Mock implements _i4.MethodChannel { dynamic arguments, ]) => (super.noSuchMethod( - Invocation.method(#invokeListMethod, [method, arguments]), - returnValue: _i11.Future?>.value(), - ) - as _i11.Future?>); + Invocation.method(#invokeListMethod, [method, arguments]), + returnValue: _i11.Future?>.value(), + ) as _i11.Future?>); @override _i11.Future?> invokeMapMethod( @@ -1341,18 +1279,18 @@ class MockMethodChannel extends _i1.Mock implements _i4.MethodChannel { dynamic arguments, ]) => (super.noSuchMethod( - Invocation.method(#invokeMapMethod, [method, arguments]), - returnValue: _i11.Future?>.value(), - ) - as _i11.Future?>); + Invocation.method(#invokeMapMethod, [method, arguments]), + returnValue: _i11.Future?>.value(), + ) as _i11.Future?>); @override void setMethodCallHandler( _i11.Future Function(_i4.MethodCall)? handler, - ) => super.noSuchMethod( - Invocation.method(#setMethodCallHandler, [handler]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#setMethodCallHandler, [handler]), + returnValueForMissingStub: null, + ); } /// A class which mocks [SentryNativeBinding]. @@ -1365,28 +1303,22 @@ class MockSentryNativeBinding extends _i1.Mock } @override - bool get supportsCaptureEnvelope => - (super.noSuchMethod( - Invocation.getter(#supportsCaptureEnvelope), - returnValue: false, - ) - as bool); + bool get supportsCaptureEnvelope => (super.noSuchMethod( + Invocation.getter(#supportsCaptureEnvelope), + returnValue: false, + ) as bool); @override - bool get supportsLoadContexts => - (super.noSuchMethod( - Invocation.getter(#supportsLoadContexts), - returnValue: false, - ) - as bool); + bool get supportsLoadContexts => (super.noSuchMethod( + Invocation.getter(#supportsLoadContexts), + returnValue: false, + ) as bool); @override - bool get supportsReplay => - (super.noSuchMethod( - Invocation.getter(#supportsReplay), - returnValue: false, - ) - as bool); + bool get supportsReplay => (super.noSuchMethod( + Invocation.getter(#supportsReplay), + returnValue: false, + ) as bool); @override _i11.FutureOr init(_i2.Hub? hub) => @@ -1399,19 +1331,17 @@ class MockSentryNativeBinding extends _i1.Mock bool? containsUnhandledException, ) => (super.noSuchMethod( - Invocation.method(#captureEnvelope, [ - envelopeData, - containsUnhandledException, - ]), - ) - as _i11.FutureOr); + Invocation.method(#captureEnvelope, [ + envelopeData, + containsUnhandledException, + ]), + ) as _i11.FutureOr); @override _i11.FutureOr captureStructuredEnvelope(_i2.SentryEnvelope? envelope) => (super.noSuchMethod( - Invocation.method(#captureStructuredEnvelope, [envelope]), - ) - as _i11.FutureOr); + Invocation.method(#captureStructuredEnvelope, [envelope]), + ) as _i11.FutureOr); @override _i11.FutureOr<_i18.NativeFrames?> endNativeFrames(_i2.SentryId? id) => @@ -1470,13 +1400,12 @@ class MockSentryNativeBinding extends _i1.Mock int? endTimeNs, ) => (super.noSuchMethod( - Invocation.method(#collectProfile, [ - traceId, - startTimeNs, - endTimeNs, - ]), - ) - as _i11.FutureOr?>); + Invocation.method(#collectProfile, [ + traceId, + startTimeNs, + endTimeNs, + ]), + ) as _i11.FutureOr?>); @override _i11.FutureOr?> loadDebugImages( @@ -1493,24 +1422,22 @@ class MockSentryNativeBinding extends _i1.Mock @override _i11.FutureOr<_i2.SentryId> captureReplay(bool? isCrash) => (super.noSuchMethod( + Invocation.method(#captureReplay, [isCrash]), + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, Invocation.method(#captureReplay, [isCrash]), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, - Invocation.method(#captureReplay, [isCrash]), - ), - ), - ) - as _i11.FutureOr<_i2.SentryId>); + ), + ), + ) as _i11.FutureOr<_i2.SentryId>); @override _i11.FutureOr startSession({bool? ignoreDuration = false}) => (super.noSuchMethod( - Invocation.method(#startSession, [], { - #ignoreDuration: ignoreDuration, - }), - ) - as _i11.FutureOr); + Invocation.method(#startSession, [], { + #ignoreDuration: ignoreDuration, + }), + ) as _i11.FutureOr); } /// A class which mocks [SentryDelayedFramesTracker]. @@ -1523,12 +1450,10 @@ class MockSentryDelayedFramesTracker extends _i1.Mock } @override - List<_i20.SentryFrameTiming> get delayedFrames => - (super.noSuchMethod( - Invocation.getter(#delayedFrames), - returnValue: <_i20.SentryFrameTiming>[], - ) - as List<_i20.SentryFrameTiming>); + List<_i20.SentryFrameTiming> get delayedFrames => (super.noSuchMethod( + Invocation.getter(#delayedFrames), + returnValue: <_i20.SentryFrameTiming>[], + ) as List<_i20.SentryFrameTiming>); @override List<_i20.SentryFrameTiming> getFramesIntersecting({ @@ -1536,13 +1461,12 @@ class MockSentryDelayedFramesTracker extends _i1.Mock required DateTime? endTimestamp, }) => (super.noSuchMethod( - Invocation.method(#getFramesIntersecting, [], { - #startTimestamp: startTimestamp, - #endTimestamp: endTimestamp, - }), - returnValue: <_i20.SentryFrameTiming>[], - ) - as List<_i20.SentryFrameTiming>); + Invocation.method(#getFramesIntersecting, [], { + #startTimestamp: startTimestamp, + #endTimestamp: endTimestamp, + }), + returnValue: <_i20.SentryFrameTiming>[], + ) as List<_i20.SentryFrameTiming>); @override void addDelayedFrame(DateTime? startTimestamp, DateTime? endTimestamp) => @@ -1564,18 +1488,17 @@ class MockSentryDelayedFramesTracker extends _i1.Mock required DateTime? spanEndTimestamp, }) => (super.noSuchMethod( - Invocation.method(#getFrameMetrics, [], { - #spanStartTimestamp: spanStartTimestamp, - #spanEndTimestamp: spanEndTimestamp, - }), - ) - as _i20.SpanFrameMetrics?); + Invocation.method(#getFrameMetrics, [], { + #spanStartTimestamp: spanStartTimestamp, + #spanEndTimestamp: spanEndTimestamp, + }), + ) as _i20.SpanFrameMetrics?); @override void clear() => super.noSuchMethod( - Invocation.method(#clear, []), - returnValueForMissingStub: null, - ); + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [BindingWrapper]. @@ -1587,15 +1510,13 @@ class MockBindingWrapper extends _i1.Mock implements _i2.BindingWrapper { } @override - _i5.WidgetsBinding ensureInitialized() => - (super.noSuchMethod( - Invocation.method(#ensureInitialized, []), - returnValue: _FakeWidgetsBinding_10( - this, - Invocation.method(#ensureInitialized, []), - ), - ) - as _i5.WidgetsBinding); + _i5.WidgetsBinding ensureInitialized() => (super.noSuchMethod( + Invocation.method(#ensureInitialized, []), + returnValue: _FakeWidgetsBinding_10( + this, + Invocation.method(#ensureInitialized, []), + ), + ) as _i5.WidgetsBinding); } /// A class which mocks [WidgetsFlutterBinding]. @@ -1608,26 +1529,22 @@ class MockWidgetsFlutterBinding extends _i1.Mock } @override - _i6.SingletonFlutterWindow get window => - (super.noSuchMethod( - Invocation.getter(#window), - returnValue: _FakeSingletonFlutterWindow_11( - this, - Invocation.getter(#window), - ), - ) - as _i6.SingletonFlutterWindow); + _i6.SingletonFlutterWindow get window => (super.noSuchMethod( + Invocation.getter(#window), + returnValue: _FakeSingletonFlutterWindow_11( + this, + Invocation.getter(#window), + ), + ) as _i6.SingletonFlutterWindow); @override - _i6.PlatformDispatcher get platformDispatcher => - (super.noSuchMethod( - Invocation.getter(#platformDispatcher), - returnValue: _FakePlatformDispatcher_12( - this, - Invocation.getter(#platformDispatcher), - ), - ) - as _i6.PlatformDispatcher); + _i6.PlatformDispatcher get platformDispatcher => (super.noSuchMethod( + Invocation.getter(#platformDispatcher), + returnValue: _FakePlatformDispatcher_12( + this, + Invocation.getter(#platformDispatcher), + ), + ) as _i6.PlatformDispatcher); @override bool get locked => @@ -1635,91 +1552,77 @@ class MockWidgetsFlutterBinding extends _i1.Mock as bool); @override - _i7.PointerRouter get pointerRouter => - (super.noSuchMethod( - Invocation.getter(#pointerRouter), - returnValue: _FakePointerRouter_13( - this, - Invocation.getter(#pointerRouter), - ), - ) - as _i7.PointerRouter); + _i7.PointerRouter get pointerRouter => (super.noSuchMethod( + Invocation.getter(#pointerRouter), + returnValue: _FakePointerRouter_13( + this, + Invocation.getter(#pointerRouter), + ), + ) as _i7.PointerRouter); @override - _i7.GestureArenaManager get gestureArena => - (super.noSuchMethod( - Invocation.getter(#gestureArena), - returnValue: _FakeGestureArenaManager_14( - this, - Invocation.getter(#gestureArena), - ), - ) - as _i7.GestureArenaManager); + _i7.GestureArenaManager get gestureArena => (super.noSuchMethod( + Invocation.getter(#gestureArena), + returnValue: _FakeGestureArenaManager_14( + this, + Invocation.getter(#gestureArena), + ), + ) as _i7.GestureArenaManager); @override - _i7.PointerSignalResolver get pointerSignalResolver => - (super.noSuchMethod( - Invocation.getter(#pointerSignalResolver), - returnValue: _FakePointerSignalResolver_15( - this, - Invocation.getter(#pointerSignalResolver), - ), - ) - as _i7.PointerSignalResolver); + _i7.PointerSignalResolver get pointerSignalResolver => (super.noSuchMethod( + Invocation.getter(#pointerSignalResolver), + returnValue: _FakePointerSignalResolver_15( + this, + Invocation.getter(#pointerSignalResolver), + ), + ) as _i7.PointerSignalResolver); @override - bool get resamplingEnabled => - (super.noSuchMethod( - Invocation.getter(#resamplingEnabled), - returnValue: false, - ) - as bool); + bool get resamplingEnabled => (super.noSuchMethod( + Invocation.getter(#resamplingEnabled), + returnValue: false, + ) as bool); @override set resamplingEnabled(bool? _resamplingEnabled) => super.noSuchMethod( - Invocation.setter(#resamplingEnabled, _resamplingEnabled), - returnValueForMissingStub: null, - ); + Invocation.setter(#resamplingEnabled, _resamplingEnabled), + returnValueForMissingStub: null, + ); @override - Duration get samplingOffset => - (super.noSuchMethod( - Invocation.getter(#samplingOffset), - returnValue: _FakeDuration_16( - this, - Invocation.getter(#samplingOffset), - ), - ) - as Duration); + Duration get samplingOffset => (super.noSuchMethod( + Invocation.getter(#samplingOffset), + returnValue: _FakeDuration_16( + this, + Invocation.getter(#samplingOffset), + ), + ) as Duration); @override set samplingOffset(Duration? _samplingOffset) => super.noSuchMethod( - Invocation.setter(#samplingOffset, _samplingOffset), - returnValueForMissingStub: null, - ); + Invocation.setter(#samplingOffset, _samplingOffset), + returnValueForMissingStub: null, + ); @override - _i7.SamplingClock get samplingClock => - (super.noSuchMethod( - Invocation.getter(#samplingClock), - returnValue: _FakeSamplingClock_17( - this, - Invocation.getter(#samplingClock), - ), - ) - as _i7.SamplingClock); + _i7.SamplingClock get samplingClock => (super.noSuchMethod( + Invocation.getter(#samplingClock), + returnValue: _FakeSamplingClock_17( + this, + Invocation.getter(#samplingClock), + ), + ) as _i7.SamplingClock); @override - _i21.SchedulingStrategy get schedulingStrategy => - (super.noSuchMethod( - Invocation.getter(#schedulingStrategy), - returnValue: - ({ - required int priority, - required _i21.SchedulerBinding scheduler, - }) => false, - ) - as _i21.SchedulingStrategy); + _i21.SchedulingStrategy get schedulingStrategy => (super.noSuchMethod( + Invocation.getter(#schedulingStrategy), + returnValue: ({ + required int priority, + required _i21.SchedulerBinding scheduler, + }) => + false, + ) as _i21.SchedulingStrategy); @override set schedulingStrategy(_i21.SchedulingStrategy? _schedulingStrategy) => @@ -1729,36 +1632,28 @@ class MockWidgetsFlutterBinding extends _i1.Mock ); @override - int get transientCallbackCount => - (super.noSuchMethod( - Invocation.getter(#transientCallbackCount), - returnValue: 0, - ) - as int); + int get transientCallbackCount => (super.noSuchMethod( + Invocation.getter(#transientCallbackCount), + returnValue: 0, + ) as int); @override - _i11.Future get endOfFrame => - (super.noSuchMethod( - Invocation.getter(#endOfFrame), - returnValue: _i11.Future.value(), - ) - as _i11.Future); + _i11.Future get endOfFrame => (super.noSuchMethod( + Invocation.getter(#endOfFrame), + returnValue: _i11.Future.value(), + ) as _i11.Future); @override - bool get hasScheduledFrame => - (super.noSuchMethod( - Invocation.getter(#hasScheduledFrame), - returnValue: false, - ) - as bool); + bool get hasScheduledFrame => (super.noSuchMethod( + Invocation.getter(#hasScheduledFrame), + returnValue: false, + ) as bool); @override - _i21.SchedulerPhase get schedulerPhase => - (super.noSuchMethod( - Invocation.getter(#schedulerPhase), - returnValue: _i21.SchedulerPhase.idle, - ) - as _i21.SchedulerPhase); + _i21.SchedulerPhase get schedulerPhase => (super.noSuchMethod( + Invocation.getter(#schedulerPhase), + returnValue: _i21.SchedulerPhase.idle, + ) as _i21.SchedulerPhase); @override bool get framesEnabled => @@ -1766,220 +1661,178 @@ class MockWidgetsFlutterBinding extends _i1.Mock as bool); @override - Duration get currentFrameTimeStamp => - (super.noSuchMethod( - Invocation.getter(#currentFrameTimeStamp), - returnValue: _FakeDuration_16( - this, - Invocation.getter(#currentFrameTimeStamp), - ), - ) - as Duration); + Duration get currentFrameTimeStamp => (super.noSuchMethod( + Invocation.getter(#currentFrameTimeStamp), + returnValue: _FakeDuration_16( + this, + Invocation.getter(#currentFrameTimeStamp), + ), + ) as Duration); @override - Duration get currentSystemFrameTimeStamp => - (super.noSuchMethod( - Invocation.getter(#currentSystemFrameTimeStamp), - returnValue: _FakeDuration_16( - this, - Invocation.getter(#currentSystemFrameTimeStamp), - ), - ) - as Duration); + Duration get currentSystemFrameTimeStamp => (super.noSuchMethod( + Invocation.getter(#currentSystemFrameTimeStamp), + returnValue: _FakeDuration_16( + this, + Invocation.getter(#currentSystemFrameTimeStamp), + ), + ) as Duration); @override - _i8.ValueNotifier get accessibilityFocus => - (super.noSuchMethod( - Invocation.getter(#accessibilityFocus), - returnValue: _FakeValueNotifier_18( - this, - Invocation.getter(#accessibilityFocus), - ), - ) - as _i8.ValueNotifier); + _i8.ValueNotifier get accessibilityFocus => (super.noSuchMethod( + Invocation.getter(#accessibilityFocus), + returnValue: _FakeValueNotifier_18( + this, + Invocation.getter(#accessibilityFocus), + ), + ) as _i8.ValueNotifier); @override - _i4.HardwareKeyboard get keyboard => - (super.noSuchMethod( - Invocation.getter(#keyboard), - returnValue: _FakeHardwareKeyboard_19( - this, - Invocation.getter(#keyboard), - ), - ) - as _i4.HardwareKeyboard); + _i4.HardwareKeyboard get keyboard => (super.noSuchMethod( + Invocation.getter(#keyboard), + returnValue: _FakeHardwareKeyboard_19( + this, + Invocation.getter(#keyboard), + ), + ) as _i4.HardwareKeyboard); @override - _i4.KeyEventManager get keyEventManager => - (super.noSuchMethod( - Invocation.getter(#keyEventManager), - returnValue: _FakeKeyEventManager_20( - this, - Invocation.getter(#keyEventManager), - ), - ) - as _i4.KeyEventManager); + _i4.KeyEventManager get keyEventManager => (super.noSuchMethod( + Invocation.getter(#keyEventManager), + returnValue: _FakeKeyEventManager_20( + this, + Invocation.getter(#keyEventManager), + ), + ) as _i4.KeyEventManager); @override - _i4.BinaryMessenger get defaultBinaryMessenger => - (super.noSuchMethod( - Invocation.getter(#defaultBinaryMessenger), - returnValue: _FakeBinaryMessenger_9( - this, - Invocation.getter(#defaultBinaryMessenger), - ), - ) - as _i4.BinaryMessenger); + _i4.BinaryMessenger get defaultBinaryMessenger => (super.noSuchMethod( + Invocation.getter(#defaultBinaryMessenger), + returnValue: _FakeBinaryMessenger_9( + this, + Invocation.getter(#defaultBinaryMessenger), + ), + ) as _i4.BinaryMessenger); @override - _i6.ChannelBuffers get channelBuffers => - (super.noSuchMethod( - Invocation.getter(#channelBuffers), - returnValue: _FakeChannelBuffers_21( - this, - Invocation.getter(#channelBuffers), - ), - ) - as _i6.ChannelBuffers); + _i6.ChannelBuffers get channelBuffers => (super.noSuchMethod( + Invocation.getter(#channelBuffers), + returnValue: _FakeChannelBuffers_21( + this, + Invocation.getter(#channelBuffers), + ), + ) as _i6.ChannelBuffers); @override - _i4.RestorationManager get restorationManager => - (super.noSuchMethod( - Invocation.getter(#restorationManager), - returnValue: _FakeRestorationManager_22( - this, - Invocation.getter(#restorationManager), - ), - ) - as _i4.RestorationManager); + _i4.RestorationManager get restorationManager => (super.noSuchMethod( + Invocation.getter(#restorationManager), + returnValue: _FakeRestorationManager_22( + this, + Invocation.getter(#restorationManager), + ), + ) as _i4.RestorationManager); @override - _i9.ImageCache get imageCache => - (super.noSuchMethod( - Invocation.getter(#imageCache), - returnValue: _FakeImageCache_23( - this, - Invocation.getter(#imageCache), - ), - ) - as _i9.ImageCache); + _i9.ImageCache get imageCache => (super.noSuchMethod( + Invocation.getter(#imageCache), + returnValue: _FakeImageCache_23( + this, + Invocation.getter(#imageCache), + ), + ) as _i9.ImageCache); @override - _i8.Listenable get systemFonts => - (super.noSuchMethod( - Invocation.getter(#systemFonts), - returnValue: _FakeListenable_24( - this, - Invocation.getter(#systemFonts), - ), - ) - as _i8.Listenable); + _i8.Listenable get systemFonts => (super.noSuchMethod( + Invocation.getter(#systemFonts), + returnValue: _FakeListenable_24( + this, + Invocation.getter(#systemFonts), + ), + ) as _i8.Listenable); @override - bool get semanticsEnabled => - (super.noSuchMethod( - Invocation.getter(#semanticsEnabled), - returnValue: false, - ) - as bool); + bool get semanticsEnabled => (super.noSuchMethod( + Invocation.getter(#semanticsEnabled), + returnValue: false, + ) as bool); @override - int get debugOutstandingSemanticsHandles => - (super.noSuchMethod( - Invocation.getter(#debugOutstandingSemanticsHandles), - returnValue: 0, - ) - as int); + int get debugOutstandingSemanticsHandles => (super.noSuchMethod( + Invocation.getter(#debugOutstandingSemanticsHandles), + returnValue: 0, + ) as int); @override - _i6.AccessibilityFeatures get accessibilityFeatures => - (super.noSuchMethod( - Invocation.getter(#accessibilityFeatures), - returnValue: _FakeAccessibilityFeatures_25( - this, - Invocation.getter(#accessibilityFeatures), - ), - ) - as _i6.AccessibilityFeatures); + _i6.AccessibilityFeatures get accessibilityFeatures => (super.noSuchMethod( + Invocation.getter(#accessibilityFeatures), + returnValue: _FakeAccessibilityFeatures_25( + this, + Invocation.getter(#accessibilityFeatures), + ), + ) as _i6.AccessibilityFeatures); @override - bool get disableAnimations => - (super.noSuchMethod( - Invocation.getter(#disableAnimations), - returnValue: false, - ) - as bool); + bool get disableAnimations => (super.noSuchMethod( + Invocation.getter(#disableAnimations), + returnValue: false, + ) as bool); @override - _i10.PipelineOwner get pipelineOwner => - (super.noSuchMethod( - Invocation.getter(#pipelineOwner), - returnValue: _i14.dummyValue<_i10.PipelineOwner>( - this, - Invocation.getter(#pipelineOwner), - ), - ) - as _i10.PipelineOwner); + _i10.PipelineOwner get pipelineOwner => (super.noSuchMethod( + Invocation.getter(#pipelineOwner), + returnValue: _i14.dummyValue<_i10.PipelineOwner>( + this, + Invocation.getter(#pipelineOwner), + ), + ) as _i10.PipelineOwner); @override - _i10.RenderView get renderView => - (super.noSuchMethod( - Invocation.getter(#renderView), - returnValue: _FakeRenderView_26( - this, - Invocation.getter(#renderView), - ), - ) - as _i10.RenderView); + _i10.RenderView get renderView => (super.noSuchMethod( + Invocation.getter(#renderView), + returnValue: _FakeRenderView_26( + this, + Invocation.getter(#renderView), + ), + ) as _i10.RenderView); @override - _i10.MouseTracker get mouseTracker => - (super.noSuchMethod( - Invocation.getter(#mouseTracker), - returnValue: _FakeMouseTracker_27( - this, - Invocation.getter(#mouseTracker), - ), - ) - as _i10.MouseTracker); + _i10.MouseTracker get mouseTracker => (super.noSuchMethod( + Invocation.getter(#mouseTracker), + returnValue: _FakeMouseTracker_27( + this, + Invocation.getter(#mouseTracker), + ), + ) as _i10.MouseTracker); @override - _i10.PipelineOwner get rootPipelineOwner => - (super.noSuchMethod( - Invocation.getter(#rootPipelineOwner), - returnValue: _i14.dummyValue<_i10.PipelineOwner>( - this, - Invocation.getter(#rootPipelineOwner), - ), - ) - as _i10.PipelineOwner); + _i10.PipelineOwner get rootPipelineOwner => (super.noSuchMethod( + Invocation.getter(#rootPipelineOwner), + returnValue: _i14.dummyValue<_i10.PipelineOwner>( + this, + Invocation.getter(#rootPipelineOwner), + ), + ) as _i10.PipelineOwner); @override - Iterable<_i10.RenderView> get renderViews => - (super.noSuchMethod( - Invocation.getter(#renderViews), - returnValue: <_i10.RenderView>[], - ) - as Iterable<_i10.RenderView>); + Iterable<_i10.RenderView> get renderViews => (super.noSuchMethod( + Invocation.getter(#renderViews), + returnValue: <_i10.RenderView>[], + ) as Iterable<_i10.RenderView>); @override - bool get sendFramesToEngine => - (super.noSuchMethod( - Invocation.getter(#sendFramesToEngine), - returnValue: false, - ) - as bool); + bool get sendFramesToEngine => (super.noSuchMethod( + Invocation.getter(#sendFramesToEngine), + returnValue: false, + ) as bool); @override - _i9.PlatformMenuDelegate get platformMenuDelegate => - (super.noSuchMethod( - Invocation.getter(#platformMenuDelegate), - returnValue: _FakePlatformMenuDelegate_28( - this, - Invocation.getter(#platformMenuDelegate), - ), - ) - as _i9.PlatformMenuDelegate); + _i9.PlatformMenuDelegate get platformMenuDelegate => (super.noSuchMethod( + Invocation.getter(#platformMenuDelegate), + returnValue: _FakePlatformMenuDelegate_28( + this, + Invocation.getter(#platformMenuDelegate), + ), + ) as _i9.PlatformMenuDelegate); @override set platformMenuDelegate(_i9.PlatformMenuDelegate? _platformMenuDelegate) => @@ -1989,12 +1842,10 @@ class MockWidgetsFlutterBinding extends _i1.Mock ); @override - bool get debugBuildingDirtyElements => - (super.noSuchMethod( - Invocation.getter(#debugBuildingDirtyElements), - returnValue: false, - ) - as bool); + bool get debugBuildingDirtyElements => (super.noSuchMethod( + Invocation.getter(#debugBuildingDirtyElements), + returnValue: false, + ) as bool); @override set debugBuildingDirtyElements(bool? _debugBuildingDirtyElements) => @@ -2007,165 +1858,148 @@ class MockWidgetsFlutterBinding extends _i1.Mock ); @override - bool get debugShowWidgetInspectorOverride => - (super.noSuchMethod( - Invocation.getter(#debugShowWidgetInspectorOverride), - returnValue: false, - ) - as bool); + bool get debugShowWidgetInspectorOverride => (super.noSuchMethod( + Invocation.getter(#debugShowWidgetInspectorOverride), + returnValue: false, + ) as bool); @override set debugShowWidgetInspectorOverride(bool? value) => super.noSuchMethod( - Invocation.setter(#debugShowWidgetInspectorOverride, value), - returnValueForMissingStub: null, - ); + Invocation.setter(#debugShowWidgetInspectorOverride, value), + returnValueForMissingStub: null, + ); @override _i8.ValueNotifier get debugShowWidgetInspectorOverrideNotifier => (super.noSuchMethod( - Invocation.getter(#debugShowWidgetInspectorOverrideNotifier), - returnValue: _FakeValueNotifier_18( - this, - Invocation.getter(#debugShowWidgetInspectorOverrideNotifier), - ), - ) - as _i8.ValueNotifier); + Invocation.getter(#debugShowWidgetInspectorOverrideNotifier), + returnValue: _FakeValueNotifier_18( + this, + Invocation.getter(#debugShowWidgetInspectorOverrideNotifier), + ), + ) as _i8.ValueNotifier); @override - _i9.FocusManager get focusManager => - (super.noSuchMethod( - Invocation.getter(#focusManager), - returnValue: _FakeFocusManager_29( - this, - Invocation.getter(#focusManager), - ), - ) - as _i9.FocusManager); + _i9.FocusManager get focusManager => (super.noSuchMethod( + Invocation.getter(#focusManager), + returnValue: _FakeFocusManager_29( + this, + Invocation.getter(#focusManager), + ), + ) as _i9.FocusManager); @override - bool get firstFrameRasterized => - (super.noSuchMethod( - Invocation.getter(#firstFrameRasterized), - returnValue: false, - ) - as bool); + bool get firstFrameRasterized => (super.noSuchMethod( + Invocation.getter(#firstFrameRasterized), + returnValue: false, + ) as bool); @override - _i11.Future get waitUntilFirstFrameRasterized => - (super.noSuchMethod( - Invocation.getter(#waitUntilFirstFrameRasterized), - returnValue: _i11.Future.value(), - ) - as _i11.Future); + _i11.Future get waitUntilFirstFrameRasterized => (super.noSuchMethod( + Invocation.getter(#waitUntilFirstFrameRasterized), + returnValue: _i11.Future.value(), + ) as _i11.Future); @override - bool get debugDidSendFirstFrameEvent => - (super.noSuchMethod( - Invocation.getter(#debugDidSendFirstFrameEvent), - returnValue: false, - ) - as bool); + bool get debugDidSendFirstFrameEvent => (super.noSuchMethod( + Invocation.getter(#debugDidSendFirstFrameEvent), + returnValue: false, + ) as bool); @override - bool get isRootWidgetAttached => - (super.noSuchMethod( - Invocation.getter(#isRootWidgetAttached), - returnValue: false, - ) - as bool); + bool get isRootWidgetAttached => (super.noSuchMethod( + Invocation.getter(#isRootWidgetAttached), + returnValue: false, + ) as bool); @override void initInstances() => super.noSuchMethod( - Invocation.method(#initInstances, []), - returnValueForMissingStub: null, - ); + Invocation.method(#initInstances, []), + returnValueForMissingStub: null, + ); @override - bool debugCheckZone(String? entryPoint) => - (super.noSuchMethod( - Invocation.method(#debugCheckZone, [entryPoint]), - returnValue: false, - ) - as bool); + bool debugCheckZone(String? entryPoint) => (super.noSuchMethod( + Invocation.method(#debugCheckZone, [entryPoint]), + returnValue: false, + ) as bool); @override void initServiceExtensions() => super.noSuchMethod( - Invocation.method(#initServiceExtensions, []), - returnValueForMissingStub: null, - ); + Invocation.method(#initServiceExtensions, []), + returnValueForMissingStub: null, + ); @override _i11.Future lockEvents(_i11.Future Function()? callback) => (super.noSuchMethod( - Invocation.method(#lockEvents, [callback]), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) - as _i11.Future); + Invocation.method(#lockEvents, [callback]), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override void unlocked() => super.noSuchMethod( - Invocation.method(#unlocked, []), - returnValueForMissingStub: null, - ); + Invocation.method(#unlocked, []), + returnValueForMissingStub: null, + ); @override - _i11.Future reassembleApplication() => - (super.noSuchMethod( - Invocation.method(#reassembleApplication, []), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) - as _i11.Future); + _i11.Future reassembleApplication() => (super.noSuchMethod( + Invocation.method(#reassembleApplication, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - _i11.Future performReassemble() => - (super.noSuchMethod( - Invocation.method(#performReassemble, []), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) - as _i11.Future); + _i11.Future performReassemble() => (super.noSuchMethod( + Invocation.method(#performReassemble, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override void registerSignalServiceExtension({ required String? name, required _i8.AsyncCallback? callback, - }) => super.noSuchMethod( - Invocation.method(#registerSignalServiceExtension, [], { - #name: name, - #callback: callback, - }), - returnValueForMissingStub: null, - ); + }) => + super.noSuchMethod( + Invocation.method(#registerSignalServiceExtension, [], { + #name: name, + #callback: callback, + }), + returnValueForMissingStub: null, + ); @override void registerBoolServiceExtension({ required String? name, required _i8.AsyncValueGetter? getter, required _i8.AsyncValueSetter? setter, - }) => super.noSuchMethod( - Invocation.method(#registerBoolServiceExtension, [], { - #name: name, - #getter: getter, - #setter: setter, - }), - returnValueForMissingStub: null, - ); + }) => + super.noSuchMethod( + Invocation.method(#registerBoolServiceExtension, [], { + #name: name, + #getter: getter, + #setter: setter, + }), + returnValueForMissingStub: null, + ); @override void registerNumericServiceExtension({ required String? name, required _i8.AsyncValueGetter? getter, required _i8.AsyncValueSetter? setter, - }) => super.noSuchMethod( - Invocation.method(#registerNumericServiceExtension, [], { - #name: name, - #getter: getter, - #setter: setter, - }), - returnValueForMissingStub: null, - ); + }) => + super.noSuchMethod( + Invocation.method(#registerNumericServiceExtension, [], { + #name: name, + #getter: getter, + #setter: setter, + }), + returnValueForMissingStub: null, + ); @override void postEvent(String? eventKind, Map? eventData) => @@ -2179,48 +2013,51 @@ class MockWidgetsFlutterBinding extends _i1.Mock required String? name, required _i8.AsyncValueGetter? getter, required _i8.AsyncValueSetter? setter, - }) => super.noSuchMethod( - Invocation.method(#registerStringServiceExtension, [], { - #name: name, - #getter: getter, - #setter: setter, - }), - returnValueForMissingStub: null, - ); + }) => + super.noSuchMethod( + Invocation.method(#registerStringServiceExtension, [], { + #name: name, + #getter: getter, + #setter: setter, + }), + returnValueForMissingStub: null, + ); @override void registerServiceExtension({ required String? name, required _i8.ServiceExtensionCallback? callback, - }) => super.noSuchMethod( - Invocation.method(#registerServiceExtension, [], { - #name: name, - #callback: callback, - }), - returnValueForMissingStub: null, - ); + }) => + super.noSuchMethod( + Invocation.method(#registerServiceExtension, [], { + #name: name, + #callback: callback, + }), + returnValueForMissingStub: null, + ); @override void cancelPointer(int? pointer) => super.noSuchMethod( - Invocation.method(#cancelPointer, [pointer]), - returnValueForMissingStub: null, - ); + Invocation.method(#cancelPointer, [pointer]), + returnValueForMissingStub: null, + ); @override void handlePointerEvent(_i4.PointerEvent? event) => super.noSuchMethod( - Invocation.method(#handlePointerEvent, [event]), - returnValueForMissingStub: null, - ); + Invocation.method(#handlePointerEvent, [event]), + returnValueForMissingStub: null, + ); @override void hitTestInView( _i7.HitTestResult? result, _i6.Offset? position, int? viewId, - ) => super.noSuchMethod( - Invocation.method(#hitTestInView, [result, position, viewId]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#hitTestInView, [result, position, viewId]), + returnValueForMissingStub: null, + ); @override void hitTest(_i7.HitTestResult? result, _i6.Offset? position) => @@ -2233,31 +2070,33 @@ class MockWidgetsFlutterBinding extends _i1.Mock void dispatchEvent( _i4.PointerEvent? event, _i7.HitTestResult? hitTestResult, - ) => super.noSuchMethod( - Invocation.method(#dispatchEvent, [event, hitTestResult]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#dispatchEvent, [event, hitTestResult]), + returnValueForMissingStub: null, + ); @override void handleEvent( _i4.PointerEvent? event, _i7.HitTestEntry<_i7.HitTestTarget>? entry, - ) => super.noSuchMethod( - Invocation.method(#handleEvent, [event, entry]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#handleEvent, [event, entry]), + returnValueForMissingStub: null, + ); @override void resetGestureBinding() => super.noSuchMethod( - Invocation.method(#resetGestureBinding, []), - returnValueForMissingStub: null, - ); + Invocation.method(#resetGestureBinding, []), + returnValueForMissingStub: null, + ); @override void addTimingsCallback(_i6.TimingsCallback? callback) => super.noSuchMethod( - Invocation.method(#addTimingsCallback, [callback]), - returnValueForMissingStub: null, - ); + Invocation.method(#addTimingsCallback, [callback]), + returnValueForMissingStub: null, + ); @override void removeTimingsCallback(_i6.TimingsCallback? callback) => @@ -2268,9 +2107,9 @@ class MockWidgetsFlutterBinding extends _i1.Mock @override void resetInternalState() => super.noSuchMethod( - Invocation.method(#resetInternalState, []), - returnValueForMissingStub: null, - ); + Invocation.method(#resetInternalState, []), + returnValueForMissingStub: null, + ); @override void handleAppLifecycleStateChanged(_i6.AppLifecycleState? state) => @@ -2287,41 +2126,37 @@ class MockWidgetsFlutterBinding extends _i1.Mock _i22.Flow? flow, }) => (super.noSuchMethod( - Invocation.method( - #scheduleTask, - [task, priority], - {#debugLabel: debugLabel, #flow: flow}, - ), - returnValue: - _i14.ifNotNull( - _i14.dummyValueOrNull( - this, - Invocation.method( - #scheduleTask, - [task, priority], - {#debugLabel: debugLabel, #flow: flow}, - ), - ), - (T v) => _i11.Future.value(v), - ) ?? - _FakeFuture_30( - this, - Invocation.method( - #scheduleTask, - [task, priority], - {#debugLabel: debugLabel, #flow: flow}, - ), + Invocation.method( + #scheduleTask, + [task, priority], + {#debugLabel: debugLabel, #flow: flow}, + ), + returnValue: _i14.ifNotNull( + _i14.dummyValueOrNull( + this, + Invocation.method( + #scheduleTask, + [task, priority], + {#debugLabel: debugLabel, #flow: flow}, ), - ) - as _i11.Future); + ), + (T v) => _i11.Future.value(v), + ) ?? + _FakeFuture_30( + this, + Invocation.method( + #scheduleTask, + [task, priority], + {#debugLabel: debugLabel, #flow: flow}, + ), + ), + ) as _i11.Future); @override - bool handleEventLoopCallback() => - (super.noSuchMethod( - Invocation.method(#handleEventLoopCallback, []), - returnValue: false, - ) - as bool); + bool handleEventLoopCallback() => (super.noSuchMethod( + Invocation.method(#handleEventLoopCallback, []), + returnValue: false, + ) as bool); @override int scheduleFrameCallback( @@ -2330,49 +2165,43 @@ class MockWidgetsFlutterBinding extends _i1.Mock bool? scheduleNewFrame = true, }) => (super.noSuchMethod( - Invocation.method( - #scheduleFrameCallback, - [callback], - { - #rescheduling: rescheduling, - #scheduleNewFrame: scheduleNewFrame, - }, - ), - returnValue: 0, - ) - as int); + Invocation.method( + #scheduleFrameCallback, + [callback], + { + #rescheduling: rescheduling, + #scheduleNewFrame: scheduleNewFrame, + }, + ), + returnValue: 0, + ) as int); @override void cancelFrameCallbackWithId(int? id) => super.noSuchMethod( - Invocation.method(#cancelFrameCallbackWithId, [id]), - returnValueForMissingStub: null, - ); + Invocation.method(#cancelFrameCallbackWithId, [id]), + returnValueForMissingStub: null, + ); @override - bool debugAssertNoTransientCallbacks(String? reason) => - (super.noSuchMethod( - Invocation.method(#debugAssertNoTransientCallbacks, [reason]), - returnValue: false, - ) - as bool); + bool debugAssertNoTransientCallbacks(String? reason) => (super.noSuchMethod( + Invocation.method(#debugAssertNoTransientCallbacks, [reason]), + returnValue: false, + ) as bool); @override bool debugAssertNoPendingPerformanceModeRequests(String? reason) => (super.noSuchMethod( - Invocation.method(#debugAssertNoPendingPerformanceModeRequests, [ - reason, - ]), - returnValue: false, - ) - as bool); + Invocation.method(#debugAssertNoPendingPerformanceModeRequests, [ + reason, + ]), + returnValue: false, + ) as bool); @override - bool debugAssertNoTimeDilation(String? reason) => - (super.noSuchMethod( - Invocation.method(#debugAssertNoTimeDilation, [reason]), - returnValue: false, - ) - as bool); + bool debugAssertNoTimeDilation(String? reason) => (super.noSuchMethod( + Invocation.method(#debugAssertNoTimeDilation, [reason]), + returnValue: false, + ) as bool); @override void addPersistentFrameCallback(_i21.FrameCallback? callback) => @@ -2385,56 +2214,57 @@ class MockWidgetsFlutterBinding extends _i1.Mock void addPostFrameCallback( _i21.FrameCallback? callback, { String? debugLabel = 'callback', - }) => super.noSuchMethod( - Invocation.method( - #addPostFrameCallback, - [callback], - {#debugLabel: debugLabel}, - ), - returnValueForMissingStub: null, - ); + }) => + super.noSuchMethod( + Invocation.method( + #addPostFrameCallback, + [callback], + {#debugLabel: debugLabel}, + ), + returnValueForMissingStub: null, + ); @override void ensureFrameCallbacksRegistered() => super.noSuchMethod( - Invocation.method(#ensureFrameCallbacksRegistered, []), - returnValueForMissingStub: null, - ); + Invocation.method(#ensureFrameCallbacksRegistered, []), + returnValueForMissingStub: null, + ); @override void ensureVisualUpdate() => super.noSuchMethod( - Invocation.method(#ensureVisualUpdate, []), - returnValueForMissingStub: null, - ); + Invocation.method(#ensureVisualUpdate, []), + returnValueForMissingStub: null, + ); @override void scheduleFrame() => super.noSuchMethod( - Invocation.method(#scheduleFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#scheduleFrame, []), + returnValueForMissingStub: null, + ); @override void scheduleForcedFrame() => super.noSuchMethod( - Invocation.method(#scheduleForcedFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#scheduleForcedFrame, []), + returnValueForMissingStub: null, + ); @override void scheduleWarmUpFrame() => super.noSuchMethod( - Invocation.method(#scheduleWarmUpFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#scheduleWarmUpFrame, []), + returnValueForMissingStub: null, + ); @override void resetEpoch() => super.noSuchMethod( - Invocation.method(#resetEpoch, []), - returnValueForMissingStub: null, - ); + Invocation.method(#resetEpoch, []), + returnValueForMissingStub: null, + ); @override void handleBeginFrame(Duration? rawTimeStamp) => super.noSuchMethod( - Invocation.method(#handleBeginFrame, [rawTimeStamp]), - returnValueForMissingStub: null, - ); + Invocation.method(#handleBeginFrame, [rawTimeStamp]), + returnValueForMissingStub: null, + ); @override _i21.PerformanceModeRequestHandle? requestPerformanceMode( @@ -2445,69 +2275,65 @@ class MockWidgetsFlutterBinding extends _i1.Mock @override void handleDrawFrame() => super.noSuchMethod( - Invocation.method(#handleDrawFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handleDrawFrame, []), + returnValueForMissingStub: null, + ); @override - _i4.BinaryMessenger createBinaryMessenger() => - (super.noSuchMethod( - Invocation.method(#createBinaryMessenger, []), - returnValue: _FakeBinaryMessenger_9( - this, - Invocation.method(#createBinaryMessenger, []), - ), - ) - as _i4.BinaryMessenger); + _i4.BinaryMessenger createBinaryMessenger() => (super.noSuchMethod( + Invocation.method(#createBinaryMessenger, []), + returnValue: _FakeBinaryMessenger_9( + this, + Invocation.method(#createBinaryMessenger, []), + ), + ) as _i4.BinaryMessenger); @override void handleMemoryPressure() => super.noSuchMethod( - Invocation.method(#handleMemoryPressure, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handleMemoryPressure, []), + returnValueForMissingStub: null, + ); @override _i11.Future handleSystemMessage(Object? systemMessage) => (super.noSuchMethod( - Invocation.method(#handleSystemMessage, [systemMessage]), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) - as _i11.Future); + Invocation.method(#handleSystemMessage, [systemMessage]), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override void initLicenses() => super.noSuchMethod( - Invocation.method(#initLicenses, []), - returnValueForMissingStub: null, - ); + Invocation.method(#initLicenses, []), + returnValueForMissingStub: null, + ); @override void evict(String? asset) => super.noSuchMethod( - Invocation.method(#evict, [asset]), - returnValueForMissingStub: null, - ); + Invocation.method(#evict, [asset]), + returnValueForMissingStub: null, + ); @override void readInitialLifecycleStateFromNativeWindow() => super.noSuchMethod( - Invocation.method(#readInitialLifecycleStateFromNativeWindow, []), - returnValueForMissingStub: null, - ); + Invocation.method(#readInitialLifecycleStateFromNativeWindow, []), + returnValueForMissingStub: null, + ); @override void handleViewFocusChanged(_i6.ViewFocusEvent? event) => super.noSuchMethod( - Invocation.method(#handleViewFocusChanged, [event]), - returnValueForMissingStub: null, - ); + Invocation.method(#handleViewFocusChanged, [event]), + returnValueForMissingStub: null, + ); @override _i11.Future<_i6.AppExitResponse> handleRequestAppExit() => (super.noSuchMethod( - Invocation.method(#handleRequestAppExit, []), - returnValue: _i11.Future<_i6.AppExitResponse>.value( - _i6.AppExitResponse.exit, - ), - ) - as _i11.Future<_i6.AppExitResponse>); + Invocation.method(#handleRequestAppExit, []), + returnValue: _i11.Future<_i6.AppExitResponse>.value( + _i6.AppExitResponse.exit, + ), + ) as _i11.Future<_i6.AppExitResponse>); @override _i11.Future<_i6.AppExitResponse> exitApplication( @@ -2515,23 +2341,20 @@ class MockWidgetsFlutterBinding extends _i1.Mock int? exitCode = 0, ]) => (super.noSuchMethod( - Invocation.method(#exitApplication, [exitType, exitCode]), - returnValue: _i11.Future<_i6.AppExitResponse>.value( - _i6.AppExitResponse.exit, - ), - ) - as _i11.Future<_i6.AppExitResponse>); + Invocation.method(#exitApplication, [exitType, exitCode]), + returnValue: _i11.Future<_i6.AppExitResponse>.value( + _i6.AppExitResponse.exit, + ), + ) as _i11.Future<_i6.AppExitResponse>); @override - _i4.RestorationManager createRestorationManager() => - (super.noSuchMethod( - Invocation.method(#createRestorationManager, []), - returnValue: _FakeRestorationManager_22( - this, - Invocation.method(#createRestorationManager, []), - ), - ) - as _i4.RestorationManager); + _i4.RestorationManager createRestorationManager() => (super.noSuchMethod( + Invocation.method(#createRestorationManager, []), + returnValue: _FakeRestorationManager_22( + this, + Invocation.method(#createRestorationManager, []), + ), + ) as _i4.RestorationManager); @override void setSystemUiChangeCallback(_i4.SystemUiChangeCallback? callback) => @@ -2541,24 +2364,20 @@ class MockWidgetsFlutterBinding extends _i1.Mock ); @override - _i11.Future initializationComplete() => - (super.noSuchMethod( - Invocation.method(#initializationComplete, []), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) - as _i11.Future); + _i11.Future initializationComplete() => (super.noSuchMethod( + Invocation.method(#initializationComplete, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - _i9.ImageCache createImageCache() => - (super.noSuchMethod( - Invocation.method(#createImageCache, []), - returnValue: _FakeImageCache_23( - this, - Invocation.method(#createImageCache, []), - ), - ) - as _i9.ImageCache); + _i9.ImageCache createImageCache() => (super.noSuchMethod( + Invocation.method(#createImageCache, []), + returnValue: _FakeImageCache_23( + this, + Invocation.method(#createImageCache, []), + ), + ) as _i9.ImageCache); @override _i11.Future<_i6.Codec> instantiateImageCodecFromBuffer( @@ -2568,6 +2387,18 @@ class MockWidgetsFlutterBinding extends _i1.Mock bool? allowUpscaling = false, }) => (super.noSuchMethod( + Invocation.method( + #instantiateImageCodecFromBuffer, + [buffer], + { + #cacheWidth: cacheWidth, + #cacheHeight: cacheHeight, + #allowUpscaling: allowUpscaling, + }, + ), + returnValue: _i11.Future<_i6.Codec>.value( + _FakeCodec_31( + this, Invocation.method( #instantiateImageCodecFromBuffer, [buffer], @@ -2577,22 +2408,9 @@ class MockWidgetsFlutterBinding extends _i1.Mock #allowUpscaling: allowUpscaling, }, ), - returnValue: _i11.Future<_i6.Codec>.value( - _FakeCodec_31( - this, - Invocation.method( - #instantiateImageCodecFromBuffer, - [buffer], - { - #cacheWidth: cacheWidth, - #cacheHeight: cacheHeight, - #allowUpscaling: allowUpscaling, - }, - ), - ), - ), - ) - as _i11.Future<_i6.Codec>); + ), + ), + ) as _i11.Future<_i6.Codec>); @override _i11.Future<_i6.Codec> instantiateImageCodecWithSize( @@ -2600,23 +2418,22 @@ class MockWidgetsFlutterBinding extends _i1.Mock _i6.TargetImageSizeCallback? getTargetSize, }) => (super.noSuchMethod( + Invocation.method( + #instantiateImageCodecWithSize, + [buffer], + {#getTargetSize: getTargetSize}, + ), + returnValue: _i11.Future<_i6.Codec>.value( + _FakeCodec_31( + this, Invocation.method( #instantiateImageCodecWithSize, [buffer], {#getTargetSize: getTargetSize}, ), - returnValue: _i11.Future<_i6.Codec>.value( - _FakeCodec_31( - this, - Invocation.method( - #instantiateImageCodecWithSize, - [buffer], - {#getTargetSize: getTargetSize}, - ), - ), - ), - ) - as _i11.Future<_i6.Codec>); + ), + ), + ) as _i11.Future<_i6.Codec>); @override void addSemanticsEnabledListener(_i6.VoidCallback? listener) => @@ -2635,29 +2452,29 @@ class MockWidgetsFlutterBinding extends _i1.Mock @override void addSemanticsActionListener( _i8.ValueSetter<_i6.SemanticsActionEvent>? listener, - ) => super.noSuchMethod( - Invocation.method(#addSemanticsActionListener, [listener]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#addSemanticsActionListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeSemanticsActionListener( _i8.ValueSetter<_i6.SemanticsActionEvent>? listener, - ) => super.noSuchMethod( - Invocation.method(#removeSemanticsActionListener, [listener]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#removeSemanticsActionListener, [listener]), + returnValueForMissingStub: null, + ); @override - _i12.SemanticsHandle ensureSemantics() => - (super.noSuchMethod( - Invocation.method(#ensureSemantics, []), - returnValue: _FakeSemanticsHandle_32( - this, - Invocation.method(#ensureSemantics, []), - ), - ) - as _i12.SemanticsHandle); + _i12.SemanticsHandle ensureSemantics() => (super.noSuchMethod( + Invocation.method(#ensureSemantics, []), + returnValue: _FakeSemanticsHandle_32( + this, + Invocation.method(#ensureSemantics, []), + ), + ) as _i12.SemanticsHandle); @override void performSemanticsAction(_i6.SemanticsActionEvent? action) => @@ -2668,225 +2485,207 @@ class MockWidgetsFlutterBinding extends _i1.Mock @override void handleAccessibilityFeaturesChanged() => super.noSuchMethod( - Invocation.method(#handleAccessibilityFeaturesChanged, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handleAccessibilityFeaturesChanged, []), + returnValueForMissingStub: null, + ); @override _i6.SemanticsUpdateBuilder createSemanticsUpdateBuilder() => (super.noSuchMethod( - Invocation.method(#createSemanticsUpdateBuilder, []), - returnValue: _FakeSemanticsUpdateBuilder_33( - this, - Invocation.method(#createSemanticsUpdateBuilder, []), - ), - ) - as _i6.SemanticsUpdateBuilder); + Invocation.method(#createSemanticsUpdateBuilder, []), + returnValue: _FakeSemanticsUpdateBuilder_33( + this, + Invocation.method(#createSemanticsUpdateBuilder, []), + ), + ) as _i6.SemanticsUpdateBuilder); @override - _i10.PipelineOwner createRootPipelineOwner() => - (super.noSuchMethod( - Invocation.method(#createRootPipelineOwner, []), - returnValue: _i14.dummyValue<_i10.PipelineOwner>( - this, - Invocation.method(#createRootPipelineOwner, []), - ), - ) - as _i10.PipelineOwner); + _i10.PipelineOwner createRootPipelineOwner() => (super.noSuchMethod( + Invocation.method(#createRootPipelineOwner, []), + returnValue: _i14.dummyValue<_i10.PipelineOwner>( + this, + Invocation.method(#createRootPipelineOwner, []), + ), + ) as _i10.PipelineOwner); @override void addRenderView(_i10.RenderView? view) => super.noSuchMethod( - Invocation.method(#addRenderView, [view]), - returnValueForMissingStub: null, - ); + Invocation.method(#addRenderView, [view]), + returnValueForMissingStub: null, + ); @override void removeRenderView(_i10.RenderView? view) => super.noSuchMethod( - Invocation.method(#removeRenderView, [view]), - returnValueForMissingStub: null, - ); + Invocation.method(#removeRenderView, [view]), + returnValueForMissingStub: null, + ); @override _i10.ViewConfiguration createViewConfigurationFor( _i10.RenderView? renderView, ) => (super.noSuchMethod( - Invocation.method(#createViewConfigurationFor, [renderView]), - returnValue: _FakeViewConfiguration_34( - this, - Invocation.method(#createViewConfigurationFor, [renderView]), - ), - ) - as _i10.ViewConfiguration); + Invocation.method(#createViewConfigurationFor, [renderView]), + returnValue: _FakeViewConfiguration_34( + this, + Invocation.method(#createViewConfigurationFor, [renderView]), + ), + ) as _i10.ViewConfiguration); @override - _i6.SceneBuilder createSceneBuilder() => - (super.noSuchMethod( - Invocation.method(#createSceneBuilder, []), - returnValue: _FakeSceneBuilder_35( - this, - Invocation.method(#createSceneBuilder, []), - ), - ) - as _i6.SceneBuilder); + _i6.SceneBuilder createSceneBuilder() => (super.noSuchMethod( + Invocation.method(#createSceneBuilder, []), + returnValue: _FakeSceneBuilder_35( + this, + Invocation.method(#createSceneBuilder, []), + ), + ) as _i6.SceneBuilder); @override - _i6.PictureRecorder createPictureRecorder() => - (super.noSuchMethod( - Invocation.method(#createPictureRecorder, []), - returnValue: _FakePictureRecorder_36( - this, - Invocation.method(#createPictureRecorder, []), - ), - ) - as _i6.PictureRecorder); + _i6.PictureRecorder createPictureRecorder() => (super.noSuchMethod( + Invocation.method(#createPictureRecorder, []), + returnValue: _FakePictureRecorder_36( + this, + Invocation.method(#createPictureRecorder, []), + ), + ) as _i6.PictureRecorder); @override - _i6.Canvas createCanvas(_i6.PictureRecorder? recorder) => - (super.noSuchMethod( - Invocation.method(#createCanvas, [recorder]), - returnValue: _FakeCanvas_37( - this, - Invocation.method(#createCanvas, [recorder]), - ), - ) - as _i6.Canvas); + _i6.Canvas createCanvas(_i6.PictureRecorder? recorder) => (super.noSuchMethod( + Invocation.method(#createCanvas, [recorder]), + returnValue: _FakeCanvas_37( + this, + Invocation.method(#createCanvas, [recorder]), + ), + ) as _i6.Canvas); @override void handleMetricsChanged() => super.noSuchMethod( - Invocation.method(#handleMetricsChanged, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handleMetricsChanged, []), + returnValueForMissingStub: null, + ); @override void handleTextScaleFactorChanged() => super.noSuchMethod( - Invocation.method(#handleTextScaleFactorChanged, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handleTextScaleFactorChanged, []), + returnValueForMissingStub: null, + ); @override void handlePlatformBrightnessChanged() => super.noSuchMethod( - Invocation.method(#handlePlatformBrightnessChanged, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handlePlatformBrightnessChanged, []), + returnValueForMissingStub: null, + ); @override void initMouseTracker([_i10.MouseTracker? tracker]) => super.noSuchMethod( - Invocation.method(#initMouseTracker, [tracker]), - returnValueForMissingStub: null, - ); + Invocation.method(#initMouseTracker, [tracker]), + returnValueForMissingStub: null, + ); @override void deferFirstFrame() => super.noSuchMethod( - Invocation.method(#deferFirstFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#deferFirstFrame, []), + returnValueForMissingStub: null, + ); @override void allowFirstFrame() => super.noSuchMethod( - Invocation.method(#allowFirstFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#allowFirstFrame, []), + returnValueForMissingStub: null, + ); @override void resetFirstFrameSent() => super.noSuchMethod( - Invocation.method(#resetFirstFrameSent, []), - returnValueForMissingStub: null, - ); + Invocation.method(#resetFirstFrameSent, []), + returnValueForMissingStub: null, + ); @override void drawFrame() => super.noSuchMethod( - Invocation.method(#drawFrame, []), - returnValueForMissingStub: null, - ); + Invocation.method(#drawFrame, []), + returnValueForMissingStub: null, + ); @override void addObserver(_i5.WidgetsBindingObserver? observer) => super.noSuchMethod( - Invocation.method(#addObserver, [observer]), - returnValueForMissingStub: null, - ); + Invocation.method(#addObserver, [observer]), + returnValueForMissingStub: null, + ); @override bool removeObserver(_i5.WidgetsBindingObserver? observer) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer]), - returnValue: false, - ) - as bool); + Invocation.method(#removeObserver, [observer]), + returnValue: false, + ) as bool); @override void handleLocaleChanged() => super.noSuchMethod( - Invocation.method(#handleLocaleChanged, []), - returnValueForMissingStub: null, - ); + Invocation.method(#handleLocaleChanged, []), + returnValueForMissingStub: null, + ); @override void dispatchLocalesChanged(List<_i6.Locale>? locales) => super.noSuchMethod( - Invocation.method(#dispatchLocalesChanged, [locales]), - returnValueForMissingStub: null, - ); + Invocation.method(#dispatchLocalesChanged, [locales]), + returnValueForMissingStub: null, + ); @override void dispatchAccessibilityFeaturesChanged() => super.noSuchMethod( - Invocation.method(#dispatchAccessibilityFeaturesChanged, []), - returnValueForMissingStub: null, - ); + Invocation.method(#dispatchAccessibilityFeaturesChanged, []), + returnValueForMissingStub: null, + ); @override - _i11.Future handlePopRoute() => - (super.noSuchMethod( - Invocation.method(#handlePopRoute, []), - returnValue: _i11.Future.value(false), - ) - as _i11.Future); + _i11.Future handlePopRoute() => (super.noSuchMethod( + Invocation.method(#handlePopRoute, []), + returnValue: _i11.Future.value(false), + ) as _i11.Future); @override - _i11.Future handlePushRoute(String? route) => - (super.noSuchMethod( - Invocation.method(#handlePushRoute, [route]), - returnValue: _i11.Future.value(false), - ) - as _i11.Future); + _i11.Future handlePushRoute(String? route) => (super.noSuchMethod( + Invocation.method(#handlePushRoute, [route]), + returnValue: _i11.Future.value(false), + ) as _i11.Future); @override - _i9.Widget wrapWithDefaultView(_i9.Widget? rootWidget) => - (super.noSuchMethod( - Invocation.method(#wrapWithDefaultView, [rootWidget]), - returnValue: _FakeWidget_38( - this, - Invocation.method(#wrapWithDefaultView, [rootWidget]), - ), - ) - as _i9.Widget); + _i9.Widget wrapWithDefaultView(_i9.Widget? rootWidget) => (super.noSuchMethod( + Invocation.method(#wrapWithDefaultView, [rootWidget]), + returnValue: _FakeWidget_38( + this, + Invocation.method(#wrapWithDefaultView, [rootWidget]), + ), + ) as _i9.Widget); @override void scheduleAttachRootWidget(_i9.Widget? rootWidget) => super.noSuchMethod( - Invocation.method(#scheduleAttachRootWidget, [rootWidget]), - returnValueForMissingStub: null, - ); + Invocation.method(#scheduleAttachRootWidget, [rootWidget]), + returnValueForMissingStub: null, + ); @override void attachRootWidget(_i9.Widget? rootWidget) => super.noSuchMethod( - Invocation.method(#attachRootWidget, [rootWidget]), - returnValueForMissingStub: null, - ); + Invocation.method(#attachRootWidget, [rootWidget]), + returnValueForMissingStub: null, + ); @override void attachToBuildOwner(_i5.RootWidget? widget) => super.noSuchMethod( - Invocation.method(#attachToBuildOwner, [widget]), - returnValueForMissingStub: null, - ); + Invocation.method(#attachToBuildOwner, [widget]), + returnValueForMissingStub: null, + ); @override _i6.Locale? computePlatformResolvedLocale( List<_i6.Locale>? supportedLocales, ) => (super.noSuchMethod( - Invocation.method(#computePlatformResolvedLocale, [ - supportedLocales, - ]), - ) - as _i6.Locale?); + Invocation.method(#computePlatformResolvedLocale, [ + supportedLocales, + ]), + ) as _i6.Locale?); } /// A class which mocks [SentryJsBinding]. @@ -2899,47 +2698,46 @@ class MockSentryJsBinding extends _i1.Mock implements _i23.SentryJsBinding { @override void init(Map? options) => super.noSuchMethod( - Invocation.method(#init, [options]), - returnValueForMissingStub: null, - ); + Invocation.method(#init, [options]), + returnValueForMissingStub: null, + ); @override void close() => super.noSuchMethod( - Invocation.method(#close, []), - returnValueForMissingStub: null, - ); + Invocation.method(#close, []), + returnValueForMissingStub: null, + ); @override void captureEnvelope(List? envelope) => super.noSuchMethod( - Invocation.method(#captureEnvelope, [envelope]), - returnValueForMissingStub: null, - ); + Invocation.method(#captureEnvelope, [envelope]), + returnValueForMissingStub: null, + ); @override void startSession() => super.noSuchMethod( - Invocation.method(#startSession, []), - returnValueForMissingStub: null, - ); + Invocation.method(#startSession, []), + returnValueForMissingStub: null, + ); @override void updateSession({int? errors, String? status}) => super.noSuchMethod( - Invocation.method(#updateSession, [], {#errors: errors, #status: status}), - returnValueForMissingStub: null, - ); + Invocation.method( + #updateSession, [], {#errors: errors, #status: status}), + returnValueForMissingStub: null, + ); @override void captureSession() => super.noSuchMethod( - Invocation.method(#captureSession, []), - returnValueForMissingStub: null, - ); + Invocation.method(#captureSession, []), + returnValueForMissingStub: null, + ); @override - Map getFilenameToDebugIdMap() => - (super.noSuchMethod( - Invocation.method(#getFilenameToDebugIdMap, []), - returnValue: {}, - ) - as Map); + Map getFilenameToDebugIdMap() => (super.noSuchMethod( + Invocation.method(#getFilenameToDebugIdMap, []), + returnValue: {}, + ) as Map); } /// A class which mocks [Hub]. @@ -2951,15 +2749,13 @@ class MockHub extends _i1.Mock implements _i2.Hub { } @override - _i2.SentryOptions get options => - (super.noSuchMethod( - Invocation.getter(#options), - returnValue: _FakeSentryOptions_39( - this, - Invocation.getter(#options), - ), - ) - as _i2.SentryOptions); + _i2.SentryOptions get options => (super.noSuchMethod( + Invocation.getter(#options), + returnValue: _FakeSentryOptions_39( + this, + Invocation.getter(#options), + ), + ) as _i2.SentryOptions); @override bool get isEnabled => @@ -2967,26 +2763,22 @@ class MockHub extends _i1.Mock implements _i2.Hub { as bool); @override - _i2.SentryId get lastEventId => - (super.noSuchMethod( - Invocation.getter(#lastEventId), - returnValue: _FakeSentryId_5(this, Invocation.getter(#lastEventId)), - ) - as _i2.SentryId); + _i2.SentryId get lastEventId => (super.noSuchMethod( + Invocation.getter(#lastEventId), + returnValue: _FakeSentryId_5(this, Invocation.getter(#lastEventId)), + ) as _i2.SentryId); @override - _i2.Scope get scope => - (super.noSuchMethod( - Invocation.getter(#scope), - returnValue: _FakeScope_40(this, Invocation.getter(#scope)), - ) - as _i2.Scope); + _i2.Scope get scope => (super.noSuchMethod( + Invocation.getter(#scope), + returnValue: _FakeScope_40(this, Invocation.getter(#scope)), + ) as _i2.Scope); @override set profilerFactory(_i15.SentryProfilerFactory? value) => super.noSuchMethod( - Invocation.setter(#profilerFactory, value), - returnValueForMissingStub: null, - ); + Invocation.setter(#profilerFactory, value), + returnValueForMissingStub: null, + ); @override _i11.Future<_i2.SentryId> captureEvent( @@ -2996,23 +2788,22 @@ class MockHub extends _i1.Mock implements _i2.Hub { _i2.ScopeCallback? withScope, }) => (super.noSuchMethod( + Invocation.method( + #captureEvent, + [event], + {#stackTrace: stackTrace, #hint: hint, #withScope: withScope}, + ), + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, Invocation.method( #captureEvent, [event], {#stackTrace: stackTrace, #hint: hint, #withScope: withScope}, ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, - Invocation.method( - #captureEvent, - [event], - {#stackTrace: stackTrace, #hint: hint, #withScope: withScope}, - ), - ), - ), - ) - as _i11.Future<_i2.SentryId>); + ), + ), + ) as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId> captureException( @@ -3022,23 +2813,22 @@ class MockHub extends _i1.Mock implements _i2.Hub { _i2.ScopeCallback? withScope, }) => (super.noSuchMethod( + Invocation.method( + #captureException, + [throwable], + {#stackTrace: stackTrace, #hint: hint, #withScope: withScope}, + ), + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, Invocation.method( #captureException, [throwable], {#stackTrace: stackTrace, #hint: hint, #withScope: withScope}, ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, - Invocation.method( - #captureException, - [throwable], - {#stackTrace: stackTrace, #hint: hint, #withScope: withScope}, - ), - ), - ), - ) - as _i11.Future<_i2.SentryId>); + ), + ), + ) as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId> captureMessage( @@ -3050,6 +2840,20 @@ class MockHub extends _i1.Mock implements _i2.Hub { _i2.ScopeCallback? withScope, }) => (super.noSuchMethod( + Invocation.method( + #captureMessage, + [message], + { + #level: level, + #template: template, + #params: params, + #hint: hint, + #withScope: withScope, + }, + ), + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, Invocation.method( #captureMessage, [message], @@ -3061,24 +2865,9 @@ class MockHub extends _i1.Mock implements _i2.Hub { #withScope: withScope, }, ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, - Invocation.method( - #captureMessage, - [message], - { - #level: level, - #template: template, - #params: params, - #hint: hint, - #withScope: withScope, - }, - ), - ), - ), - ) - as _i11.Future<_i2.SentryId>); + ), + ), + ) as _i11.Future<_i2.SentryId>); @override _i11.Future<_i2.SentryId> captureFeedback( @@ -3087,55 +2876,49 @@ class MockHub extends _i1.Mock implements _i2.Hub { _i2.ScopeCallback? withScope, }) => (super.noSuchMethod( + Invocation.method( + #captureFeedback, + [feedback], + {#hint: hint, #withScope: withScope}, + ), + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, Invocation.method( #captureFeedback, [feedback], {#hint: hint, #withScope: withScope}, ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, - Invocation.method( - #captureFeedback, - [feedback], - {#hint: hint, #withScope: withScope}, - ), - ), - ), - ) - as _i11.Future<_i2.SentryId>); + ), + ), + ) as _i11.Future<_i2.SentryId>); @override _i11.Future addBreadcrumb(_i2.Breadcrumb? crumb, {_i2.Hint? hint}) => (super.noSuchMethod( - Invocation.method(#addBreadcrumb, [crumb], {#hint: hint}), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) - as _i11.Future); + Invocation.method(#addBreadcrumb, [crumb], {#hint: hint}), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override void bindClient(_i2.SentryClient? client) => super.noSuchMethod( - Invocation.method(#bindClient, [client]), - returnValueForMissingStub: null, - ); + Invocation.method(#bindClient, [client]), + returnValueForMissingStub: null, + ); @override - _i2.Hub clone() => - (super.noSuchMethod( - Invocation.method(#clone, []), - returnValue: _FakeHub_41(this, Invocation.method(#clone, [])), - ) - as _i2.Hub); + _i2.Hub clone() => (super.noSuchMethod( + Invocation.method(#clone, []), + returnValue: _FakeHub_41(this, Invocation.method(#clone, [])), + ) as _i2.Hub); @override - _i11.Future close() => - (super.noSuchMethod( - Invocation.method(#close, []), - returnValue: _i11.Future.value(), - returnValueForMissingStub: _i11.Future.value(), - ) - as _i11.Future); + _i11.Future close() => (super.noSuchMethod( + Invocation.method(#close, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override _i11.FutureOr configureScope(_i2.ScopeCallback? callback) => @@ -3156,34 +2939,33 @@ class MockHub extends _i1.Mock implements _i2.Hub { Map? customSamplingContext, }) => (super.noSuchMethod( - Invocation.method( - #startTransaction, - [name, operation], - { - #description: description, - #startTimestamp: startTimestamp, - #bindToScope: bindToScope, - #waitForChildren: waitForChildren, - #autoFinishAfter: autoFinishAfter, - #trimEnd: trimEnd, - #onFinish: onFinish, - #customSamplingContext: customSamplingContext, - }, - ), - returnValue: _i13.startTransactionShim( - name, - operation, - description: description, - startTimestamp: startTimestamp, - bindToScope: bindToScope, - waitForChildren: waitForChildren, - autoFinishAfter: autoFinishAfter, - trimEnd: trimEnd, - onFinish: onFinish, - customSamplingContext: customSamplingContext, - ), - ) - as _i2.ISentrySpan); + Invocation.method( + #startTransaction, + [name, operation], + { + #description: description, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + #customSamplingContext: customSamplingContext, + }, + ), + returnValue: _i13.startTransactionShim( + name, + operation, + description: description, + startTimestamp: startTimestamp, + bindToScope: bindToScope, + waitForChildren: waitForChildren, + autoFinishAfter: autoFinishAfter, + trimEnd: trimEnd, + onFinish: onFinish, + customSamplingContext: customSamplingContext, + ), + ) as _i2.ISentrySpan); @override _i2.ISentrySpan startTransactionWithContext( @@ -3197,43 +2979,42 @@ class MockHub extends _i1.Mock implements _i2.Hub { _i2.OnTransactionFinish? onFinish, }) => (super.noSuchMethod( - Invocation.method( - #startTransactionWithContext, - [transactionContext], - { - #customSamplingContext: customSamplingContext, - #startTimestamp: startTimestamp, - #bindToScope: bindToScope, - #waitForChildren: waitForChildren, - #autoFinishAfter: autoFinishAfter, - #trimEnd: trimEnd, - #onFinish: onFinish, - }, - ), - returnValue: _FakeISentrySpan_2( - this, - Invocation.method( - #startTransactionWithContext, - [transactionContext], - { - #customSamplingContext: customSamplingContext, - #startTimestamp: startTimestamp, - #bindToScope: bindToScope, - #waitForChildren: waitForChildren, - #autoFinishAfter: autoFinishAfter, - #trimEnd: trimEnd, - #onFinish: onFinish, - }, - ), - ), - ) - as _i2.ISentrySpan); + Invocation.method( + #startTransactionWithContext, + [transactionContext], + { + #customSamplingContext: customSamplingContext, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + }, + ), + returnValue: _FakeISentrySpan_2( + this, + Invocation.method( + #startTransactionWithContext, + [transactionContext], + { + #customSamplingContext: customSamplingContext, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + }, + ), + ), + ) as _i2.ISentrySpan); @override void generateNewTraceId() => super.noSuchMethod( - Invocation.method(#generateNewTraceId, []), - returnValueForMissingStub: null, - ); + Invocation.method(#generateNewTraceId, []), + returnValueForMissingStub: null, + ); @override _i11.Future<_i2.SentryId> captureTransaction( @@ -3242,31 +3023,31 @@ class MockHub extends _i1.Mock implements _i2.Hub { _i2.Hint? hint, }) => (super.noSuchMethod( + Invocation.method( + #captureTransaction, + [transaction], + {#traceContext: traceContext, #hint: hint}, + ), + returnValue: _i11.Future<_i2.SentryId>.value( + _FakeSentryId_5( + this, Invocation.method( #captureTransaction, [transaction], {#traceContext: traceContext, #hint: hint}, ), - returnValue: _i11.Future<_i2.SentryId>.value( - _FakeSentryId_5( - this, - Invocation.method( - #captureTransaction, - [transaction], - {#traceContext: traceContext, #hint: hint}, - ), - ), - ), - ) - as _i11.Future<_i2.SentryId>); + ), + ), + ) as _i11.Future<_i2.SentryId>); @override void setSpanContext( dynamic throwable, _i2.ISentrySpan? span, String? transaction, - ) => super.noSuchMethod( - Invocation.method(#setSpanContext, [throwable, span, transaction]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#setSpanContext, [throwable, span, transaction]), + returnValueForMissingStub: null, + ); } diff --git a/flutter/test/screenshot/sentry_screenshot_widget_test.mocks.dart b/flutter/test/screenshot/sentry_screenshot_widget_test.mocks.dart index beb822fd59..260d732543 100644 --- a/flutter/test/screenshot/sentry_screenshot_widget_test.mocks.dart +++ b/flutter/test/screenshot/sentry_screenshot_widget_test.mocks.dart @@ -36,8 +36,7 @@ class MockCallbacks extends _i1.Mock implements _i2.Callbacks { _i3.SentryScreenshotWidgetStatus? b, ) => (super.noSuchMethod( - Invocation.method(#onBuild, [a, b]), - returnValue: false, - ) - as bool); + Invocation.method(#onBuild, [a, b]), + returnValue: false, + ) as bool); } From 7920bf6741a3cddc62fc86eeb59e75ddff0b105a Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 8 May 2025 15:19:57 +0200 Subject: [PATCH 07/37] Update searching for debug id --- flutter/lib/src/web/sentry_web.dart | 34 +++++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/flutter/lib/src/web/sentry_web.dart b/flutter/lib/src/web/sentry_web.dart index eb2c082865..83b9b1eec4 100644 --- a/flutter/lib/src/web/sentry_web.dart +++ b/flutter/lib/src/web/sentry_web.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:typed_data'; +import 'package:collection/collection.dart'; import 'package:sentry/src/sentry_item_type.dart'; import '../../sentry_flutter.dart'; @@ -181,22 +182,31 @@ class SentryWeb with SentryNativeSafeInvoker implements SentryNativeBinding { @override FutureOr?> loadDebugImages(SentryStackTrace stackTrace) { - final map = _binding.getFilenameToDebugIdMap(); - if (map.isEmpty) { + final debugIdMap = _binding.getFilenameToDebugIdMap(); + if (debugIdMap.isEmpty) { _log('Could not find debug id in js source file.'); return null; } - // Find the first frame that has an entry in the map. - for (final frame in stackTrace.frames) { - final debugId = map[frame.absPath] ?? map[frame.fileName]; - if (debugId != null) { - final codeFile = - map.containsKey(frame.absPath) ? frame.absPath : frame.fileName; - return [ - DebugImage(debugId: debugId, type: 'sourcemap', codeFile: codeFile) - ]; - } + final frame = stackTrace.frames.firstWhereOrNull((frame) { + return debugIdMap.containsKey(frame.absPath) || + debugIdMap.containsKey(frame.fileName); + }); + if (frame == null) { + _log('Could not find any frame with a matching debug id.'); + return null; + } + + final codeFile = frame.absPath ?? frame.fileName; + final debugId = debugIdMap[codeFile]; + if (debugId != null) { + return [ + DebugImage( + debugId: debugId, + type: 'sourcemap', + codeFile: codeFile, + ), + ]; } _log('Could not match any frame against the debug id map.'); From 68284ff6e9dd9aa65ebedb2156aa35c4faa3f9ed Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 8 May 2025 15:39:31 +0200 Subject: [PATCH 08/37] Update --- flutter/example/lib/main.dart | 7 +-- .../lib/src/web/noop_sentry_js_binding.dart | 2 +- flutter/lib/src/web/sentry_js_binding.dart | 2 +- flutter/lib/src/web/sentry_web.dart | 2 +- .../lib/src/web/web_sentry_js_binding.dart | 46 ++++++++++--------- flutter/test/mocks.mocks.dart | 6 --- 6 files changed, 32 insertions(+), 33 deletions(-) diff --git a/flutter/example/lib/main.dart b/flutter/example/lib/main.dart index bbd4239f84..b10bb6f585 100644 --- a/flutter/example/lib/main.dart +++ b/flutter/example/lib/main.dart @@ -79,16 +79,17 @@ Future setupSentry( // We can enable Sentry debug logging during development. This is likely // going to log too much for your app, but can be useful when figuring out // configuration issues, e.g. finding out why your events are not uploaded. - options.diagnosticLevel = SentryLevel.debug; + options.diagnosticLevel = SentryLevel.info; options.debug = kDebugMode; options.spotlight = Spotlight(enabled: true); options.enableTimeToFullDisplayTracing = true; options.maxRequestBodySize = MaxRequestBodySize.always; options.navigatorKey = navigatorKey; + options.addIntegration(LoggingIntegration()); - options.replay.sessionSampleRate = 1.0; - options.replay.onErrorSampleRate = 1.0; + // options.replay.sessionSampleRate = 1.0; + // options.replay.onErrorSampleRate = 1.0; _isIntegrationTest = isIntegrationTest; if (_isIntegrationTest) { diff --git a/flutter/lib/src/web/noop_sentry_js_binding.dart b/flutter/lib/src/web/noop_sentry_js_binding.dart index 5e05723dcc..a082dbf21f 100644 --- a/flutter/lib/src/web/noop_sentry_js_binding.dart +++ b/flutter/lib/src/web/noop_sentry_js_binding.dart @@ -34,7 +34,7 @@ class NoOpSentryJsBinding implements SentryJsBinding { void updateSession({int? errors, String? status}) {} @override - Map getFilenameToDebugIdMap() { + Map? getFilenameToDebugIdMap() { return {}; } } diff --git a/flutter/lib/src/web/sentry_js_binding.dart b/flutter/lib/src/web/sentry_js_binding.dart index b667d6dce5..e41cb73055 100644 --- a/flutter/lib/src/web/sentry_js_binding.dart +++ b/flutter/lib/src/web/sentry_js_binding.dart @@ -11,7 +11,7 @@ abstract class SentryJsBinding { Map? getSession(); void updateSession({int? errors, String? status}); void captureSession(); - Map getFilenameToDebugIdMap(); + Map? getFilenameToDebugIdMap(); @visibleForTesting dynamic getJsOptions(); } diff --git a/flutter/lib/src/web/sentry_web.dart b/flutter/lib/src/web/sentry_web.dart index 83b9b1eec4..c372e7e991 100644 --- a/flutter/lib/src/web/sentry_web.dart +++ b/flutter/lib/src/web/sentry_web.dart @@ -183,7 +183,7 @@ class SentryWeb with SentryNativeSafeInvoker implements SentryNativeBinding { @override FutureOr?> loadDebugImages(SentryStackTrace stackTrace) { final debugIdMap = _binding.getFilenameToDebugIdMap(); - if (debugIdMap.isEmpty) { + if (debugIdMap == null || debugIdMap.isEmpty) { _log('Could not find debug id in js source file.'); return null; } diff --git a/flutter/lib/src/web/web_sentry_js_binding.dart b/flutter/lib/src/web/web_sentry_js_binding.dart index b4eb9febae..a556239e1e 100644 --- a/flutter/lib/src/web/web_sentry_js_binding.dart +++ b/flutter/lib/src/web/web_sentry_js_binding.dart @@ -94,43 +94,47 @@ class WebSentryJsBinding implements SentryJsBinding { } } - Map? cachedFilenameDebugIds; - int? lastKeysCount; - Map>? parsedStackResults; + Map? _cachedFilenameDebugIds; + int? _lastKeysCount; + Map>? _parsedStackResults; @override - Map getFilenameToDebugIdMap() { + Map? getFilenameToDebugIdMap() { + // 1) Read the debug-ID table once final debugIdMap = _globalThis['_sentryDebugIds'].dartify() as Map?; + if (debugIdMap == null) { + return null; + } + final stackParser = _stackParser(); - // final debugIdMap = test - if (debugIdMap == null || stackParser == null) { - return {}; + if (stackParser == null) { + return null; } final debugIdKeys = debugIdMap.keys.toList(); - // Use cached results if available - if (cachedFilenameDebugIds != null && debugIdKeys.length == lastKeysCount) { - return Map.from(cachedFilenameDebugIds!); + // 2) Fast path: use cached results if available + if (_cachedFilenameDebugIds != null && + debugIdKeys.length == _lastKeysCount) { + return Map.from(_cachedFilenameDebugIds!); } + _lastKeysCount = debugIdKeys.length; - lastKeysCount = debugIdKeys.length; - - // Build a map of filename -> debug_id. - cachedFilenameDebugIds = + // 3) Build a map of filename -> debug_id and refresh cache + final options = _client?.getOptions(); + _cachedFilenameDebugIds = debugIdKeys.fold>({}, (acc, stackKey) { - parsedStackResults ??= {}; + _parsedStackResults ??= {}; final String stackKeyStr = stackKey.toString(); - print(stackKeyStr); - final List? result = parsedStackResults![stackKeyStr]; + final List? result = _parsedStackResults![stackKeyStr]; if (result != null) { acc[result[0]] = result[1]; } else { - final parsedStack = _stackParser() - ?.callAsFunction(SentryJsClient().getOptions(), stackKeyStr.toJS) + final parsedStack = stackParser + .callAsFunction(options, stackKeyStr.toJS) .dartify() as List?; if (parsedStack == null) { @@ -144,7 +148,7 @@ class WebSentryJsBinding implements SentryJsBinding { if (filename != null && debugId != null) { acc[filename] = debugId; - parsedStackResults![stackKeyStr] = [filename, debugId]; + _parsedStackResults![stackKeyStr] = [filename, debugId]; break; } } @@ -153,7 +157,7 @@ class WebSentryJsBinding implements SentryJsBinding { return acc; }); - return Map.from(cachedFilenameDebugIds!); + return Map.from(_cachedFilenameDebugIds!); } JSFunction? _stackParser() { diff --git a/flutter/test/mocks.mocks.dart b/flutter/test/mocks.mocks.dart index d4a0df6d1b..bbf00ba80a 100644 --- a/flutter/test/mocks.mocks.dart +++ b/flutter/test/mocks.mocks.dart @@ -2732,12 +2732,6 @@ class MockSentryJsBinding extends _i1.Mock implements _i23.SentryJsBinding { Invocation.method(#captureSession, []), returnValueForMissingStub: null, ); - - @override - Map getFilenameToDebugIdMap() => (super.noSuchMethod( - Invocation.method(#getFilenameToDebugIdMap, []), - returnValue: {}, - ) as Map); } /// A class which mocks [Hub]. From 138f6e209e2342d65608f9c0dfdb5b592a3f1c93 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 8 May 2025 16:40:43 +0200 Subject: [PATCH 09/37] Update --- .../lib/src/web/web_sentry_js_binding.dart | 1 + flutter/test/web/sentry_web_test.dart | 53 +++++++++++++++- .../test/web/web_sentry_js_binding_test.dart | 60 +++++++++++++++++++ 3 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 flutter/test/web/web_sentry_js_binding_test.dart diff --git a/flutter/lib/src/web/web_sentry_js_binding.dart b/flutter/lib/src/web/web_sentry_js_binding.dart index a556239e1e..c4d780a578 100644 --- a/flutter/lib/src/web/web_sentry_js_binding.dart +++ b/flutter/lib/src/web/web_sentry_js_binding.dart @@ -95,6 +95,7 @@ class WebSentryJsBinding implements SentryJsBinding { } Map? _cachedFilenameDebugIds; + Map? get cachedFilenameDebugIds => _cachedFilenameDebugIds; int? _lastKeysCount; Map>? _parsedStackResults; diff --git a/flutter/test/web/sentry_web_test.dart b/flutter/test/web/sentry_web_test.dart index 6a85dfe622..134c529cd2 100644 --- a/flutter/test/web/sentry_web_test.dart +++ b/flutter/test/web/sentry_web_test.dart @@ -1,6 +1,8 @@ @TestOn('browser') library; +import 'dart:js_interop'; +import 'dart:js_interop_unsafe'; import 'dart:typed_data'; import 'package:flutter_test/flutter_test.dart'; @@ -18,7 +20,7 @@ import '../mocks.dart'; import '../mocks.mocks.dart'; void main() { - group('$SentryWeb', () { + group(SentryWeb, () { late SentryFlutterOptions options; late Hub hub; @@ -102,6 +104,40 @@ void main() { await sut.captureStructuredEnvelope(SentryEnvelope.fromEvent( SentryEvent(), SdkVersion(name: 'test', version: '0'))); }); + + test( + 'loadDebugImages loads debug id to debug images with matching absPath', + () async { + _globalThis['_sentryDebugIds'] = _debugIdMap.jsify(); + + final frames = [ + SentryStackFrame(absPath: 'http://127.0.0.1:8080/main.dart.js') + ]; + final stackTrace = SentryStackTrace(frames: frames); + final images = await sut.loadDebugImages(stackTrace); + + expect(images, isNotNull); + expect(images!.length, 1); + expect(images.first.codeFile, frames.first.absPath); + expect(images.first.debugId, _debugId); + }); + + test( + 'loadDebugImages loads debug id to debug images with matching filename', + () async { + _globalThis['_sentryDebugIds'] = _debugIdMap.jsify(); + + final frames = [ + SentryStackFrame(fileName: 'http://127.0.0.1:8080/main.dart.js') + ]; + final stackTrace = SentryStackTrace(frames: frames); + final images = await sut.loadDebugImages(stackTrace); + + expect(images, isNotNull); + expect(images!.length, 1); + expect(images.first.codeFile, frames.first.fileName); + expect(images.first.debugId, _debugId); + }); }); group('with mock binding', () { @@ -155,7 +191,6 @@ void main() { sut.endNativeFrames(SentryId.empty()); sut.fetchNativeAppStart(); sut.loadContexts(); - sut.loadDebugImages(SentryStackTrace(frames: [])); sut.nativeCrash(); sut.removeContexts('key'); sut.removeExtra('key'); @@ -176,7 +211,6 @@ void main() { expect(sut.displayRefreshRate(), isNull); expect(sut.fetchNativeAppStart(), isNull); expect(sut.loadContexts(), isNull); - expect(sut.loadDebugImages(SentryStackTrace(frames: [])), isNull); expect(sut.collectProfile(SentryId.empty(), 0, 0), isNull); expect(sut.endNativeFrames(SentryId.empty()), isNull); expect(sut.startProfiler(SentryId.empty()), isNull); @@ -234,3 +268,16 @@ void main() { }); }); } + +@JS('globalThis') +external JSObject get _globalThis; + +final _debugId = '82cc8a97-04c5-5e1e-b98d-bb3e647208e6'; +final _firstFrame = + '''Error at chrome-extension://aeblfdkhhhdcdjpifhhbdiojplfjncoa/inline/injected/webauthn-listeners.js:2:127 + at chrome-extension://aeblfdkhhhdcdjpifhhbdiojplfjncoa/inline/injected/webauthn-listeners.js:2:260 +'''; +final _secondFrame = '''Error at http://127.0.0.1:8080/main.dart.js:2:169 + at http://127.0.0.1:8080/main.dart.js:2:304'''; +// We wanna assert that the second frame is the correct debug id match +final _debugIdMap = {_firstFrame: 'whatever debug id', _secondFrame: _debugId}; diff --git a/flutter/test/web/web_sentry_js_binding_test.dart b/flutter/test/web/web_sentry_js_binding_test.dart new file mode 100644 index 0000000000..f70dc8de41 --- /dev/null +++ b/flutter/test/web/web_sentry_js_binding_test.dart @@ -0,0 +1,60 @@ +import 'dart:js_interop'; +import 'dart:js_interop_unsafe'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:sentry_flutter/src/web/script_loader/sentry_script_loader.dart'; +import 'package:sentry_flutter/src/web/sentry_js_bundle.dart'; +import 'package:sentry_flutter/src/web/web_sentry_js_binding.dart'; + +import '../mocks.dart'; + +/// Test file for testing specific binding implementation such as caching. +/// Most of the other tests that involve the binding live in sentry_web_test.dart. +void main() { + group(WebSentryJsBinding, () { + late Fixture fixture; + + setUp(() { + fixture = Fixture(); + }); + + test( + 'getFilenameToDebugIdMap returns the cached result on subsequent calls', + () async { + final sut = await fixture.getSut(); + sut.init({}); + _globalThis['_sentryDebugIds'] = _debugIdMap.jsify(); + + final firstResult = sut.getFilenameToDebugIdMap(); + final cachedResult = sut.cachedFilenameDebugIds; + final secondResult = sut.getFilenameToDebugIdMap(); + + expect(firstResult, isNotNull); + expect(firstResult, cachedResult); + expect(secondResult, cachedResult); + }); + }); +} + +class Fixture { + final options = defaultTestOptions(); + + Future getSut() async { + final loader = SentryScriptLoader(options: options); + await loader.loadWebSdk(debugScripts); + return WebSentryJsBinding(); + } +} + +final _debugId = '82cc8a97-04c5-5e1e-b98d-bb3e647208e6'; +final _firstFrame = + '''Error at chrome-extension://aeblfdkhhhdcdjpifhhbdiojplfjncoa/inline/injected/webauthn-listeners.js:2:127 + at chrome-extension://aeblfdkhhhdcdjpifhhbdiojplfjncoa/inline/injected/webauthn-listeners.js:2:260 +'''; +final _secondFrame = '''Error at http://127.0.0.1:8080/main.dart.js:2:169 + at http://127.0.0.1:8080/main.dart.js:2:304'''; +// We wanna assert that the second frame is the correct debug id match +final _debugIdMap = {_firstFrame: 'whatever debug id', _secondFrame: _debugId}; + +@JS('globalThis') +external JSObject get _globalThis; From 966a5c74b6c7bf115b171ad44994f2d8e87652c4 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 8 May 2025 16:41:27 +0200 Subject: [PATCH 10/37] Revert main --- flutter/example/lib/main.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flutter/example/lib/main.dart b/flutter/example/lib/main.dart index b10bb6f585..bbd4239f84 100644 --- a/flutter/example/lib/main.dart +++ b/flutter/example/lib/main.dart @@ -79,17 +79,16 @@ Future setupSentry( // We can enable Sentry debug logging during development. This is likely // going to log too much for your app, but can be useful when figuring out // configuration issues, e.g. finding out why your events are not uploaded. - options.diagnosticLevel = SentryLevel.info; + options.diagnosticLevel = SentryLevel.debug; options.debug = kDebugMode; options.spotlight = Spotlight(enabled: true); options.enableTimeToFullDisplayTracing = true; options.maxRequestBodySize = MaxRequestBodySize.always; options.navigatorKey = navigatorKey; - options.addIntegration(LoggingIntegration()); - // options.replay.sessionSampleRate = 1.0; - // options.replay.onErrorSampleRate = 1.0; + options.replay.sessionSampleRate = 1.0; + options.replay.onErrorSampleRate = 1.0; _isIntegrationTest = isIntegrationTest; if (_isIntegrationTest) { From ed3c45a0aac1e69c3a012588b942e8fabc539bba Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 8 May 2025 16:51:37 +0200 Subject: [PATCH 11/37] Improve readability --- .../lib/src/web/web_sentry_js_binding.dart | 21 +++++++------------ flutter/test/web/sentry_web_test.dart | 2 ++ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/flutter/lib/src/web/web_sentry_js_binding.dart b/flutter/lib/src/web/web_sentry_js_binding.dart index c4d780a578..7ba0bacd22 100644 --- a/flutter/lib/src/web/web_sentry_js_binding.dart +++ b/flutter/lib/src/web/web_sentry_js_binding.dart @@ -124,41 +124,36 @@ class WebSentryJsBinding implements SentryJsBinding { // 3) Build a map of filename -> debug_id and refresh cache final options = _client?.getOptions(); - _cachedFilenameDebugIds = - debugIdKeys.fold>({}, (acc, stackKey) { + final Map filenameDebugIdMap = {}; + for (final stackKey in debugIdKeys) { _parsedStackResults ??= {}; final String stackKeyStr = stackKey.toString(); final List? result = _parsedStackResults![stackKeyStr]; if (result != null) { - acc[result[0]] = result[1]; + filenameDebugIdMap[result[0]] = result[1]; } else { final parsedStack = stackParser .callAsFunction(options, stackKeyStr.toJS) .dartify() as List?; - if (parsedStack == null) { - return acc; - } + if (parsedStack == null) continue; for (int i = parsedStack.length - 1; i >= 0; i--) { final stackFrame = parsedStack[i] as Map?; final filename = stackFrame?['filename']?.toString(); final debugId = debugIdMap[stackKeyStr]?.toString(); - if (filename != null && debugId != null) { - acc[filename] = debugId; + filenameDebugIdMap[filename] = debugId; _parsedStackResults![stackKeyStr] = [filename, debugId]; break; } } } - - return acc; - }); - - return Map.from(_cachedFilenameDebugIds!); + } + _cachedFilenameDebugIds = filenameDebugIdMap; + return filenameDebugIdMap; } JSFunction? _stackParser() { diff --git a/flutter/test/web/sentry_web_test.dart b/flutter/test/web/sentry_web_test.dart index 134c529cd2..f3ece0bba8 100644 --- a/flutter/test/web/sentry_web_test.dart +++ b/flutter/test/web/sentry_web_test.dart @@ -108,6 +108,7 @@ void main() { test( 'loadDebugImages loads debug id to debug images with matching absPath', () async { + await sut.init(hub); _globalThis['_sentryDebugIds'] = _debugIdMap.jsify(); final frames = [ @@ -125,6 +126,7 @@ void main() { test( 'loadDebugImages loads debug id to debug images with matching filename', () async { + await sut.init(hub); _globalThis['_sentryDebugIds'] = _debugIdMap.jsify(); final frames = [ From d7227229acc19fc3d0664a80cadca10d1c5a6204 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 8 May 2025 16:54:07 +0200 Subject: [PATCH 12/37] Return unmodifiable --- flutter/lib/src/web/web_sentry_js_binding.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flutter/lib/src/web/web_sentry_js_binding.dart b/flutter/lib/src/web/web_sentry_js_binding.dart index 7ba0bacd22..fbbb353bdf 100644 --- a/flutter/lib/src/web/web_sentry_js_binding.dart +++ b/flutter/lib/src/web/web_sentry_js_binding.dart @@ -118,7 +118,8 @@ class WebSentryJsBinding implements SentryJsBinding { // 2) Fast path: use cached results if available if (_cachedFilenameDebugIds != null && debugIdKeys.length == _lastKeysCount) { - return Map.from(_cachedFilenameDebugIds!); + // Return a copy + return Map.unmodifiable(_cachedFilenameDebugIds!); } _lastKeysCount = debugIdKeys.length; @@ -153,7 +154,7 @@ class WebSentryJsBinding implements SentryJsBinding { } } _cachedFilenameDebugIds = filenameDebugIdMap; - return filenameDebugIdMap; + return Map.unmodifiable(filenameDebugIdMap); } JSFunction? _stackParser() { From 190672da451d7e88a03dd468afe18b34e642a178 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 8 May 2025 16:58:52 +0200 Subject: [PATCH 13/37] Update CHANGELOG --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31ba550b13..f967a802f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Unreleased + +### Features + +- [Flutter Web]: add debug ids to events ([#2917](https://github.com/getsentry/sentry-dart/pull/2917)) + - This allows support for symbolication based on [debug ids](https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js/debug-ids/) + ## 9.0.0-RC ### Various fixes & improvements From f5e3a89f706003ff004085634a5a7cd44a45014f Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 8 May 2025 17:01:08 +0200 Subject: [PATCH 14/37] Update web_load_debug_images_integration.dart --- .../lib/src/integrations/web_load_debug_images_integration.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/lib/src/integrations/web_load_debug_images_integration.dart b/flutter/lib/src/integrations/web_load_debug_images_integration.dart index 7edbe5d7da..d6712606d7 100644 --- a/flutter/lib/src/integrations/web_load_debug_images_integration.dart +++ b/flutter/lib/src/integrations/web_load_debug_images_integration.dart @@ -11,7 +11,7 @@ Integration createLoadDebugImagesIntegration( } /// Loads the debug id injected by Sentry tooling e.g Sentry Dart Plugin -/// This is necessary for symbolication of minified js stacktraces. +/// This is necessary for symbolication of minified js stacktraces via debug ids. class LoadNativeDebugImagesIntegration extends Integration { final SentryNativeBinding _native; From 80198f487a61210546b8c5431f6d2fd57d1aa9f9 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 8 May 2025 17:14:11 +0200 Subject: [PATCH 15/37] Update --- flutter/lib/src/web/sentry_web.dart | 1 + flutter/test/mocks.dart | 11 ++++++++++- flutter/test/web/sentry_web_test.dart | 18 ++++-------------- .../test/web/web_sentry_js_binding_test.dart | 15 ++++----------- 4 files changed, 19 insertions(+), 26 deletions(-) diff --git a/flutter/lib/src/web/sentry_web.dart b/flutter/lib/src/web/sentry_web.dart index c372e7e991..a1f8dd0750 100644 --- a/flutter/lib/src/web/sentry_web.dart +++ b/flutter/lib/src/web/sentry_web.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:typed_data'; import 'package:collection/collection.dart'; +// ignore: implementation_imports import 'package:sentry/src/sentry_item_type.dart'; import '../../sentry_flutter.dart'; diff --git a/flutter/test/mocks.dart b/flutter/test/mocks.dart index 592b70d886..aaa9f3f369 100644 --- a/flutter/test/mocks.dart +++ b/flutter/test/mocks.dart @@ -6,19 +6,28 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:meta/meta.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; +import 'package:sentry/src/platform/platform.dart'; import 'package:sentry/src/sentry_tracer.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:sentry_flutter/src/frames_tracking/sentry_delayed_frames_tracker.dart'; import 'package:sentry_flutter/src/native/sentry_native_binding.dart'; import 'package:sentry_flutter/src/renderer/renderer.dart'; import 'package:sentry_flutter/src/web/sentry_js_binding.dart'; -import 'package:sentry/src/platform/platform.dart'; import 'mocks.mocks.dart'; import 'no_such_method_provider.dart'; const fakeDsn = 'https://abc@def.ingest.sentry.io/1234567'; const fakeProguardUuid = '3457d982-65ef-576d-a6ad-65b5f30f49a5'; +final _firstFrame = + '''Error at chrome-extension://aeblfdkhhhdcdjpifhhbdiojplfjncoa/inline/injected/webauthn-listeners.js:2:127 + at chrome-extension://aeblfdkhhhdcdjpifhhbdiojplfjncoa/inline/injected/webauthn-listeners.js:2:260 +'''; +final _secondFrame = '''Error at http://127.0.0.1:8080/main.dart.js:2:169 + at http://127.0.0.1:8080/main.dart.js:2:304'''; +// We wanna assert that the second frame is the correct debug id match +final debugIdMap = {_firstFrame: 'whatever debug id', _secondFrame: debugId}; +final debugId = '82cc8a97-04c5-5e1e-b98d-bb3e647208e6'; SentryFlutterOptions defaultTestOptions( {Platform? platform, RuntimeChecker? checker}) { diff --git a/flutter/test/web/sentry_web_test.dart b/flutter/test/web/sentry_web_test.dart index f3ece0bba8..0de55a0862 100644 --- a/flutter/test/web/sentry_web_test.dart +++ b/flutter/test/web/sentry_web_test.dart @@ -109,7 +109,7 @@ void main() { 'loadDebugImages loads debug id to debug images with matching absPath', () async { await sut.init(hub); - _globalThis['_sentryDebugIds'] = _debugIdMap.jsify(); + _globalThis['_sentryDebugIds'] = debugIdMap.jsify(); final frames = [ SentryStackFrame(absPath: 'http://127.0.0.1:8080/main.dart.js') @@ -120,14 +120,14 @@ void main() { expect(images, isNotNull); expect(images!.length, 1); expect(images.first.codeFile, frames.first.absPath); - expect(images.first.debugId, _debugId); + expect(images.first.debugId, debugId); }); test( 'loadDebugImages loads debug id to debug images with matching filename', () async { await sut.init(hub); - _globalThis['_sentryDebugIds'] = _debugIdMap.jsify(); + _globalThis['_sentryDebugIds'] = debugIdMap.jsify(); final frames = [ SentryStackFrame(fileName: 'http://127.0.0.1:8080/main.dart.js') @@ -138,7 +138,7 @@ void main() { expect(images, isNotNull); expect(images!.length, 1); expect(images.first.codeFile, frames.first.fileName); - expect(images.first.debugId, _debugId); + expect(images.first.debugId, debugId); }); }); @@ -273,13 +273,3 @@ void main() { @JS('globalThis') external JSObject get _globalThis; - -final _debugId = '82cc8a97-04c5-5e1e-b98d-bb3e647208e6'; -final _firstFrame = - '''Error at chrome-extension://aeblfdkhhhdcdjpifhhbdiojplfjncoa/inline/injected/webauthn-listeners.js:2:127 - at chrome-extension://aeblfdkhhhdcdjpifhhbdiojplfjncoa/inline/injected/webauthn-listeners.js:2:260 -'''; -final _secondFrame = '''Error at http://127.0.0.1:8080/main.dart.js:2:169 - at http://127.0.0.1:8080/main.dart.js:2:304'''; -// We wanna assert that the second frame is the correct debug id match -final _debugIdMap = {_firstFrame: 'whatever debug id', _secondFrame: _debugId}; diff --git a/flutter/test/web/web_sentry_js_binding_test.dart b/flutter/test/web/web_sentry_js_binding_test.dart index f70dc8de41..4f5e152ad7 100644 --- a/flutter/test/web/web_sentry_js_binding_test.dart +++ b/flutter/test/web/web_sentry_js_binding_test.dart @@ -1,3 +1,6 @@ +@TestOn('browser') +library; + import 'dart:js_interop'; import 'dart:js_interop_unsafe'; @@ -23,7 +26,7 @@ void main() { () async { final sut = await fixture.getSut(); sut.init({}); - _globalThis['_sentryDebugIds'] = _debugIdMap.jsify(); + _globalThis['_sentryDebugIds'] = debugIdMap.jsify(); final firstResult = sut.getFilenameToDebugIdMap(); final cachedResult = sut.cachedFilenameDebugIds; @@ -46,15 +49,5 @@ class Fixture { } } -final _debugId = '82cc8a97-04c5-5e1e-b98d-bb3e647208e6'; -final _firstFrame = - '''Error at chrome-extension://aeblfdkhhhdcdjpifhhbdiojplfjncoa/inline/injected/webauthn-listeners.js:2:127 - at chrome-extension://aeblfdkhhhdcdjpifhhbdiojplfjncoa/inline/injected/webauthn-listeners.js:2:260 -'''; -final _secondFrame = '''Error at http://127.0.0.1:8080/main.dart.js:2:169 - at http://127.0.0.1:8080/main.dart.js:2:304'''; -// We wanna assert that the second frame is the correct debug id match -final _debugIdMap = {_firstFrame: 'whatever debug id', _secondFrame: _debugId}; - @JS('globalThis') external JSObject get _globalThis; From ce76820784f9c7dc9b8a9d9c501a2ac3c2a97e75 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 12 May 2025 15:21:50 +0200 Subject: [PATCH 16/37] Improve --- .../lib/src/integrations/integrations.dart | 2 +- flutter/lib/src/web/debug_ids.dart | 50 ++++++++++++++++ .../lib/src/web/web_sentry_js_binding.dart | 58 ++++--------------- flutter/test/web/sentry_web_test.dart | 14 +++++ 4 files changed, 75 insertions(+), 49 deletions(-) create mode 100644 flutter/lib/src/web/debug_ids.dart diff --git a/flutter/lib/src/integrations/integrations.dart b/flutter/lib/src/integrations/integrations.dart index fbdb180f9c..25722e7d7f 100644 --- a/flutter/lib/src/integrations/integrations.dart +++ b/flutter/lib/src/integrations/integrations.dart @@ -1,9 +1,9 @@ export 'debug_print_integration.dart'; export 'flutter_error_integration.dart'; export 'load_contexts_integration.dart'; +export 'load_debug_images_integration.dart'; export 'load_release_integration.dart'; export 'native_app_start_integration.dart'; -export 'native_load_debug_images_integration.dart'; export 'on_error_integration.dart'; export 'sdk_integration.dart'; export 'widgets_binding_integration.dart'; diff --git a/flutter/lib/src/web/debug_ids.dart b/flutter/lib/src/web/debug_ids.dart new file mode 100644 index 0000000000..bca8ee5d49 --- /dev/null +++ b/flutter/lib/src/web/debug_ids.dart @@ -0,0 +1,50 @@ +import 'dart:js_interop'; + +import 'package:meta/meta.dart'; + +Map? _cachedFilenameDebugIds; +Map? get cachedFilenameDebugIds => _cachedFilenameDebugIds; +final Map> _parsedStackResults = {}; +int? _lastKeysCount; + +@internal +Map? parseFilenameToDebugIdMap(Map debugIdMap, + JSFunction stackParser, JSObject? options) { + final debugIdKeys = debugIdMap.keys.toList(); + + // Fast path: use cached results if available + if (_cachedFilenameDebugIds != null && debugIdKeys.length == _lastKeysCount) { + return Map.unmodifiable(_cachedFilenameDebugIds!); + } + _lastKeysCount = debugIdKeys.length; + + // Build a map of filename -> debug_id and refresh cache + final Map filenameDebugIdMap = {}; + for (final stackKey in debugIdKeys) { + final String stackKeyStr = stackKey.toString(); + final List? result = _parsedStackResults[stackKeyStr]; + + if (result != null) { + filenameDebugIdMap[result[0]] = result[1]; + } else { + final parsedStack = stackParser + .callAsFunction(options, stackKeyStr.toJS) + .dartify() as List?; + + if (parsedStack == null) continue; + + for (int i = parsedStack.length - 1; i >= 0; i--) { + final stackFrame = parsedStack[i] as Map?; + final filename = stackFrame?['filename']?.toString(); + final debugId = debugIdMap[stackKeyStr]?.toString(); + if (filename != null && debugId != null) { + filenameDebugIdMap[filename] = debugId; + _parsedStackResults[stackKeyStr] = [filename, debugId]; + break; + } + } + } + } + _cachedFilenameDebugIds = filenameDebugIdMap; + return Map.unmodifiable(filenameDebugIdMap); +} diff --git a/flutter/lib/src/web/web_sentry_js_binding.dart b/flutter/lib/src/web/web_sentry_js_binding.dart index fbbb353bdf..8c5e906385 100644 --- a/flutter/lib/src/web/web_sentry_js_binding.dart +++ b/flutter/lib/src/web/web_sentry_js_binding.dart @@ -3,6 +3,7 @@ import 'dart:js_interop_unsafe'; import 'package:flutter/cupertino.dart'; +import 'debug_ids.dart'; import 'sentry_js_binding.dart'; SentryJsBinding createJsBinding() { @@ -11,6 +12,7 @@ SentryJsBinding createJsBinding() { class WebSentryJsBinding implements SentryJsBinding { SentryJsClient? _client; + JSObject? _options; @override void init(Map options) { @@ -20,6 +22,7 @@ class WebSentryJsBinding implements SentryJsBinding { } _init(options.jsify()); _client = SentryJsClient(); + _options = _client?.getOptions(); } @override @@ -94,14 +97,8 @@ class WebSentryJsBinding implements SentryJsBinding { } } - Map? _cachedFilenameDebugIds; - Map? get cachedFilenameDebugIds => _cachedFilenameDebugIds; - int? _lastKeysCount; - Map>? _parsedStackResults; - @override Map? getFilenameToDebugIdMap() { - // 1) Read the debug-ID table once final debugIdMap = _globalThis['_sentryDebugIds'].dartify() as Map?; if (debugIdMap == null) { @@ -113,52 +110,17 @@ class WebSentryJsBinding implements SentryJsBinding { return null; } - final debugIdKeys = debugIdMap.keys.toList(); - - // 2) Fast path: use cached results if available - if (_cachedFilenameDebugIds != null && - debugIdKeys.length == _lastKeysCount) { - // Return a copy - return Map.unmodifiable(_cachedFilenameDebugIds!); - } - _lastKeysCount = debugIdKeys.length; - - // 3) Build a map of filename -> debug_id and refresh cache - final options = _client?.getOptions(); - final Map filenameDebugIdMap = {}; - for (final stackKey in debugIdKeys) { - _parsedStackResults ??= {}; - - final String stackKeyStr = stackKey.toString(); - final List? result = _parsedStackResults![stackKeyStr]; - - if (result != null) { - filenameDebugIdMap[result[0]] = result[1]; - } else { - final parsedStack = stackParser - .callAsFunction(options, stackKeyStr.toJS) - .dartify() as List?; - - if (parsedStack == null) continue; - - for (int i = parsedStack.length - 1; i >= 0; i--) { - final stackFrame = parsedStack[i] as Map?; - final filename = stackFrame?['filename']?.toString(); - final debugId = debugIdMap[stackKeyStr]?.toString(); - if (filename != null && debugId != null) { - filenameDebugIdMap[filename] = debugId; - _parsedStackResults![stackKeyStr] = [filename, debugId]; - break; - } - } - } + final filenameDebugIdMap = + parseFilenameToDebugIdMap(debugIdMap, stackParser, _options); + if (filenameDebugIdMap != null) { + return Map.unmodifiable(filenameDebugIdMap); } - _cachedFilenameDebugIds = filenameDebugIdMap; - return Map.unmodifiable(filenameDebugIdMap); + + return null; } JSFunction? _stackParser() { - final parser = SentryJsClient().getOptions()?['stackParser']; + final parser = _options?['stackParser']; if (parser != null && parser.isA()) { return parser as JSFunction; } diff --git a/flutter/test/web/sentry_web_test.dart b/flutter/test/web/sentry_web_test.dart index 0de55a0862..b5dc3cb34d 100644 --- a/flutter/test/web/sentry_web_test.dart +++ b/flutter/test/web/sentry_web_test.dart @@ -105,6 +105,20 @@ void main() { SentryEvent(), SdkVersion(name: 'test', version: '0'))); }); + test('loadDebugImages returns null if no debug ids are available', + () async { + await sut.init(hub); + _globalThis['_sentryDebugIds'] = null; + + final frames = [ + SentryStackFrame(absPath: 'http://127.0.0.1:8080/main.dart.js') + ]; + final stackTrace = SentryStackTrace(frames: frames); + final images = await sut.loadDebugImages(stackTrace); + + expect(images, isNull); + }); + test( 'loadDebugImages loads debug id to debug images with matching absPath', () async { From 14a1ce14848926767c5242d3b3572584bb482fae Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 12 May 2025 15:22:53 +0200 Subject: [PATCH 17/37] Update naming --- flutter/lib/src/web/debug_ids.dart | 2 +- flutter/lib/src/web/web_sentry_js_binding.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter/lib/src/web/debug_ids.dart b/flutter/lib/src/web/debug_ids.dart index bca8ee5d49..97eb7aa6fb 100644 --- a/flutter/lib/src/web/debug_ids.dart +++ b/flutter/lib/src/web/debug_ids.dart @@ -8,7 +8,7 @@ final Map> _parsedStackResults = {}; int? _lastKeysCount; @internal -Map? parseFilenameToDebugIdMap(Map debugIdMap, +Map? buildFilenameToDebugIdMap(Map debugIdMap, JSFunction stackParser, JSObject? options) { final debugIdKeys = debugIdMap.keys.toList(); diff --git a/flutter/lib/src/web/web_sentry_js_binding.dart b/flutter/lib/src/web/web_sentry_js_binding.dart index 8c5e906385..dcb99c73ef 100644 --- a/flutter/lib/src/web/web_sentry_js_binding.dart +++ b/flutter/lib/src/web/web_sentry_js_binding.dart @@ -111,7 +111,7 @@ class WebSentryJsBinding implements SentryJsBinding { } final filenameDebugIdMap = - parseFilenameToDebugIdMap(debugIdMap, stackParser, _options); + buildFilenameToDebugIdMap(debugIdMap, stackParser, _options); if (filenameDebugIdMap != null) { return Map.unmodifiable(filenameDebugIdMap); } From 3a7db1a0d4e42f09ace90b1acda673d28c9d2b02 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 12 May 2025 15:24:06 +0200 Subject: [PATCH 18/37] Add additional test --- flutter/test/web/sentry_web_test.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flutter/test/web/sentry_web_test.dart b/flutter/test/web/sentry_web_test.dart index b5dc3cb34d..0bb41af537 100644 --- a/flutter/test/web/sentry_web_test.dart +++ b/flutter/test/web/sentry_web_test.dart @@ -119,6 +119,18 @@ void main() { expect(images, isNull); }); + test('loadDebugImages returns null if no matching absPath or filename', + () async { + await sut.init(hub); + _globalThis['_sentryDebugIds'] = debugIdMap.jsify(); + + final frames = [SentryStackFrame(absPath: 'abc', fileName: 'def')]; + final stackTrace = SentryStackTrace(frames: frames); + final images = await sut.loadDebugImages(stackTrace); + + expect(images, isNull); + }); + test( 'loadDebugImages loads debug id to debug images with matching absPath', () async { From 6d0e7e17f109eee64c93c7cc09f24af0a0ef069e Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 12 May 2025 15:48:33 +0200 Subject: [PATCH 19/37] Update test --- flutter/lib/src/web/debug_ids.dart | 1 + flutter/test/web/web_sentry_js_binding_test.dart | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/flutter/lib/src/web/debug_ids.dart b/flutter/lib/src/web/debug_ids.dart index 97eb7aa6fb..1c8fe5449d 100644 --- a/flutter/lib/src/web/debug_ids.dart +++ b/flutter/lib/src/web/debug_ids.dart @@ -3,6 +3,7 @@ import 'dart:js_interop'; import 'package:meta/meta.dart'; Map? _cachedFilenameDebugIds; +@visibleForTesting Map? get cachedFilenameDebugIds => _cachedFilenameDebugIds; final Map> _parsedStackResults = {}; int? _lastKeysCount; diff --git a/flutter/test/web/web_sentry_js_binding_test.dart b/flutter/test/web/web_sentry_js_binding_test.dart index 4f5e152ad7..97144b3598 100644 --- a/flutter/test/web/web_sentry_js_binding_test.dart +++ b/flutter/test/web/web_sentry_js_binding_test.dart @@ -5,6 +5,7 @@ import 'dart:js_interop'; import 'dart:js_interop_unsafe'; import 'package:flutter_test/flutter_test.dart'; +import 'package:sentry_flutter/src/web/debug_ids.dart'; import 'package:sentry_flutter/src/web/script_loader/sentry_script_loader.dart'; import 'package:sentry_flutter/src/web/sentry_js_bundle.dart'; import 'package:sentry_flutter/src/web/web_sentry_js_binding.dart'; @@ -29,7 +30,7 @@ void main() { _globalThis['_sentryDebugIds'] = debugIdMap.jsify(); final firstResult = sut.getFilenameToDebugIdMap(); - final cachedResult = sut.cachedFilenameDebugIds; + final cachedResult = cachedFilenameDebugIds; final secondResult = sut.getFilenameToDebugIdMap(); expect(firstResult, isNotNull); From 457634059a8ad7a3fb17bdf1b776dea6dfb9776c Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 12 May 2025 17:14:16 +0200 Subject: [PATCH 20/37] Update debug id impl --- flutter/lib/src/web/debug_ids.dart | 91 ++++++++++++------- .../lib/src/web/web_sentry_js_binding.dart | 27 ++---- 2 files changed, 67 insertions(+), 51 deletions(-) diff --git a/flutter/lib/src/web/debug_ids.dart b/flutter/lib/src/web/debug_ids.dart index 1c8fe5449d..cdf73cc1b8 100644 --- a/flutter/lib/src/web/debug_ids.dart +++ b/flutter/lib/src/web/debug_ids.dart @@ -1,51 +1,78 @@ import 'dart:js_interop'; +import 'dart:js_interop_unsafe'; -import 'package:meta/meta.dart'; +import 'package:flutter/cupertino.dart'; + +import 'web_sentry_js_binding.dart'; + +final Map _filenameToDebugIds = {}; +final Set _debugIdsWithFilenames = {}; + +int _lastKeysCount = 0; -Map? _cachedFilenameDebugIds; @visibleForTesting -Map? get cachedFilenameDebugIds => _cachedFilenameDebugIds; -final Map> _parsedStackResults = {}; -int? _lastKeysCount; - -@internal -Map? buildFilenameToDebugIdMap(Map debugIdMap, - JSFunction stackParser, JSObject? options) { - final debugIdKeys = debugIdMap.keys.toList(); - - // Fast path: use cached results if available - if (_cachedFilenameDebugIds != null && debugIdKeys.length == _lastKeysCount) { - return Map.unmodifiable(_cachedFilenameDebugIds!); +Map? get filenameToDebugIds => _filenameToDebugIds; + +/// Returns the cached map if available, otherwise builds the map with the +/// injected debug ids. +Map? getOrCreateFilenameToDebugIdMap(JSObject options) { + final debugIdMap = + globalThis['_sentryDebugIds'].dartify() as Map?; + if (debugIdMap == null) { + return null; + } + + if (debugIdMap.keys.length != _lastKeysCount) { + _buildFilenameToDebugIdMap( + debugIdMap, + options, + ); + _lastKeysCount = debugIdMap.keys.length; + } + + return Map.unmodifiable(_filenameToDebugIds); +} + +void _buildFilenameToDebugIdMap( + Map debugIdMap, + JSObject options, +) { + final stackParser = _stackParser(options); + if (stackParser == null) { + return; } - _lastKeysCount = debugIdKeys.length; - // Build a map of filename -> debug_id and refresh cache - final Map filenameDebugIdMap = {}; - for (final stackKey in debugIdKeys) { - final String stackKeyStr = stackKey.toString(); - final List? result = _parsedStackResults[stackKeyStr]; + for (final debugIdMapEntry in debugIdMap.entries) { + final String stackKeyStr = debugIdMapEntry.key.toString(); + final String debugIdStr = debugIdMapEntry.value.toString(); + + final debugIdHasCachedFilename = + _debugIdsWithFilenames.contains(debugIdStr); - if (result != null) { - filenameDebugIdMap[result[0]] = result[1]; - } else { + if (!debugIdHasCachedFilename) { final parsedStack = stackParser .callAsFunction(options, stackKeyStr.toJS) .dartify() as List?; if (parsedStack == null) continue; - for (int i = parsedStack.length - 1; i >= 0; i--) { - final stackFrame = parsedStack[i] as Map?; - final filename = stackFrame?['filename']?.toString(); - final debugId = debugIdMap[stackKeyStr]?.toString(); - if (filename != null && debugId != null) { - filenameDebugIdMap[filename] = debugId; - _parsedStackResults[stackKeyStr] = [filename, debugId]; + for (final stackFrame in parsedStack) { + final stackFrameMap = stackFrame as Map; + final filename = stackFrameMap['filename']?.toString(); + if (filename != null) { + _filenameToDebugIds[filename] = debugIdStr; + _debugIdsWithFilenames.add(debugIdStr); break; } } } } - _cachedFilenameDebugIds = filenameDebugIdMap; - return Map.unmodifiable(filenameDebugIdMap); +} + +JSFunction? _stackParser(JSObject options) { + final parser = options['stackParser']; + if (parser != null && parser.isA()) { + return parser as JSFunction; + } + return null; } diff --git a/flutter/lib/src/web/web_sentry_js_binding.dart b/flutter/lib/src/web/web_sentry_js_binding.dart index dcb99c73ef..0e324920df 100644 --- a/flutter/lib/src/web/web_sentry_js_binding.dart +++ b/flutter/lib/src/web/web_sentry_js_binding.dart @@ -1,7 +1,7 @@ import 'dart:js_interop'; import 'dart:js_interop_unsafe'; -import 'package:flutter/cupertino.dart'; +import 'package:meta/meta.dart'; import 'debug_ids.dart'; import 'sentry_js_binding.dart'; @@ -57,10 +57,10 @@ class WebSentryJsBinding implements SentryJsBinding { @override void close() { - final sentryProp = _globalThis.getProperty('Sentry'.toJS); + final sentryProp = globalThis.getProperty('Sentry'.toJS); if (sentryProp != null) { _close(); - _globalThis['Sentry'] = null; + globalThis['Sentry'] = null; } } @@ -99,24 +99,12 @@ class WebSentryJsBinding implements SentryJsBinding { @override Map? getFilenameToDebugIdMap() { - final debugIdMap = - _globalThis['_sentryDebugIds'].dartify() as Map?; - if (debugIdMap == null) { + final options = _options; + if (options == null) { return null; } - final stackParser = _stackParser(); - if (stackParser == null) { - return null; - } - - final filenameDebugIdMap = - buildFilenameToDebugIdMap(debugIdMap, stackParser, _options); - if (filenameDebugIdMap != null) { - return Map.unmodifiable(filenameDebugIdMap); - } - - return null; + return getOrCreateFilenameToDebugIdMap(options); } JSFunction? _stackParser() { @@ -169,4 +157,5 @@ external JSObject _globalHandlersIntegration(); external JSObject _dedupeIntegration(); @JS('globalThis') -external JSObject get _globalThis; +@internal +external JSObject get globalThis; From f98a03e1fc42d93490a9079aba69a22a2e594dae Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 12 May 2025 17:18:43 +0200 Subject: [PATCH 21/37] Update --- flutter/lib/src/web/web_sentry_js_binding.dart | 8 -------- flutter/test/web/web_sentry_js_binding_test.dart | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/flutter/lib/src/web/web_sentry_js_binding.dart b/flutter/lib/src/web/web_sentry_js_binding.dart index 0e324920df..21f0def01f 100644 --- a/flutter/lib/src/web/web_sentry_js_binding.dart +++ b/flutter/lib/src/web/web_sentry_js_binding.dart @@ -106,14 +106,6 @@ class WebSentryJsBinding implements SentryJsBinding { return getOrCreateFilenameToDebugIdMap(options); } - - JSFunction? _stackParser() { - final parser = _options?['stackParser']; - if (parser != null && parser.isA()) { - return parser as JSFunction; - } - return null; - } } @JS('Sentry.init') diff --git a/flutter/test/web/web_sentry_js_binding_test.dart b/flutter/test/web/web_sentry_js_binding_test.dart index 97144b3598..77e41355d3 100644 --- a/flutter/test/web/web_sentry_js_binding_test.dart +++ b/flutter/test/web/web_sentry_js_binding_test.dart @@ -30,7 +30,7 @@ void main() { _globalThis['_sentryDebugIds'] = debugIdMap.jsify(); final firstResult = sut.getFilenameToDebugIdMap(); - final cachedResult = cachedFilenameDebugIds; + final cachedResult = filenameToDebugIds; final secondResult = sut.getFilenameToDebugIdMap(); expect(firstResult, isNotNull); From d143766b6046cbc6653e380384e6fa95a621f9a1 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 12 May 2025 18:00:55 +0200 Subject: [PATCH 22/37] Update --- flutter/lib/src/web/debug_ids.dart | 78 ------------------- .../lib/src/web/web_sentry_js_binding.dart | 68 +++++++++++++++- .../test/web/web_sentry_js_binding_test.dart | 2 +- 3 files changed, 67 insertions(+), 81 deletions(-) delete mode 100644 flutter/lib/src/web/debug_ids.dart diff --git a/flutter/lib/src/web/debug_ids.dart b/flutter/lib/src/web/debug_ids.dart deleted file mode 100644 index cdf73cc1b8..0000000000 --- a/flutter/lib/src/web/debug_ids.dart +++ /dev/null @@ -1,78 +0,0 @@ -import 'dart:js_interop'; -import 'dart:js_interop_unsafe'; - -import 'package:flutter/cupertino.dart'; - -import 'web_sentry_js_binding.dart'; - -final Map _filenameToDebugIds = {}; -final Set _debugIdsWithFilenames = {}; - -int _lastKeysCount = 0; - -@visibleForTesting -Map? get filenameToDebugIds => _filenameToDebugIds; - -/// Returns the cached map if available, otherwise builds the map with the -/// injected debug ids. -Map? getOrCreateFilenameToDebugIdMap(JSObject options) { - final debugIdMap = - globalThis['_sentryDebugIds'].dartify() as Map?; - if (debugIdMap == null) { - return null; - } - - if (debugIdMap.keys.length != _lastKeysCount) { - _buildFilenameToDebugIdMap( - debugIdMap, - options, - ); - _lastKeysCount = debugIdMap.keys.length; - } - - return Map.unmodifiable(_filenameToDebugIds); -} - -void _buildFilenameToDebugIdMap( - Map debugIdMap, - JSObject options, -) { - final stackParser = _stackParser(options); - if (stackParser == null) { - return; - } - - for (final debugIdMapEntry in debugIdMap.entries) { - final String stackKeyStr = debugIdMapEntry.key.toString(); - final String debugIdStr = debugIdMapEntry.value.toString(); - - final debugIdHasCachedFilename = - _debugIdsWithFilenames.contains(debugIdStr); - - if (!debugIdHasCachedFilename) { - final parsedStack = stackParser - .callAsFunction(options, stackKeyStr.toJS) - .dartify() as List?; - - if (parsedStack == null) continue; - - for (final stackFrame in parsedStack) { - final stackFrameMap = stackFrame as Map; - final filename = stackFrameMap['filename']?.toString(); - if (filename != null) { - _filenameToDebugIds[filename] = debugIdStr; - _debugIdsWithFilenames.add(debugIdStr); - break; - } - } - } - } -} - -JSFunction? _stackParser(JSObject options) { - final parser = options['stackParser']; - if (parser != null && parser.isA()) { - return parser as JSFunction; - } - return null; -} diff --git a/flutter/lib/src/web/web_sentry_js_binding.dart b/flutter/lib/src/web/web_sentry_js_binding.dart index 21f0def01f..0bef204fad 100644 --- a/flutter/lib/src/web/web_sentry_js_binding.dart +++ b/flutter/lib/src/web/web_sentry_js_binding.dart @@ -3,7 +3,6 @@ import 'dart:js_interop_unsafe'; import 'package:meta/meta.dart'; -import 'debug_ids.dart'; import 'sentry_js_binding.dart'; SentryJsBinding createJsBinding() { @@ -13,6 +12,13 @@ SentryJsBinding createJsBinding() { class WebSentryJsBinding implements SentryJsBinding { SentryJsClient? _client; JSObject? _options; + final Map _filenameToDebugIds = {}; + final Set _debugIdsWithFilenames = {}; + + int _lastKeysCount = 0; + + @visibleForTesting + Map? get filenameToDebugIds => _filenameToDebugIds; @override void init(Map options) { @@ -104,7 +110,65 @@ class WebSentryJsBinding implements SentryJsBinding { return null; } - return getOrCreateFilenameToDebugIdMap(options); + final debugIdMap = + globalThis['_sentryDebugIds'].dartify() as Map?; + if (debugIdMap == null) { + return null; + } + + if (debugIdMap.keys.length != _lastKeysCount) { + _buildFilenameToDebugIdMap( + debugIdMap, + options, + ); + _lastKeysCount = debugIdMap.keys.length; + } + + return Map.unmodifiable(_filenameToDebugIds); + } + + void _buildFilenameToDebugIdMap( + Map debugIdMap, + JSObject options, + ) { + final stackParser = _stackParser(options); + if (stackParser == null) { + return; + } + + for (final debugIdMapEntry in debugIdMap.entries) { + final String stackKeyStr = debugIdMapEntry.key.toString(); + final String debugIdStr = debugIdMapEntry.value.toString(); + + final debugIdHasCachedFilename = + _debugIdsWithFilenames.contains(debugIdStr); + + if (!debugIdHasCachedFilename) { + final parsedStack = stackParser + .callAsFunction(options, stackKeyStr.toJS) + .dartify() as List?; + + if (parsedStack == null) continue; + + for (final stackFrame in parsedStack) { + final stackFrameMap = stackFrame as Map; + final filename = stackFrameMap['filename']?.toString(); + if (filename != null) { + _filenameToDebugIds[filename] = debugIdStr; + _debugIdsWithFilenames.add(debugIdStr); + break; + } + } + } + } + } + + JSFunction? _stackParser(JSObject options) { + final parser = options['stackParser']; + if (parser != null && parser.isA()) { + return parser as JSFunction; + } + return null; } } diff --git a/flutter/test/web/web_sentry_js_binding_test.dart b/flutter/test/web/web_sentry_js_binding_test.dart index 77e41355d3..1247ae6dc4 100644 --- a/flutter/test/web/web_sentry_js_binding_test.dart +++ b/flutter/test/web/web_sentry_js_binding_test.dart @@ -30,7 +30,7 @@ void main() { _globalThis['_sentryDebugIds'] = debugIdMap.jsify(); final firstResult = sut.getFilenameToDebugIdMap(); - final cachedResult = filenameToDebugIds; + final cachedResult = sut.filenameToDebugIds; final secondResult = sut.getFilenameToDebugIdMap(); expect(firstResult, isNotNull); From 7f65ab7fa6f1f181530644070eb84cbb4fa095a3 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Mon, 26 May 2025 11:41:00 +0200 Subject: [PATCH 23/37] rename processors to match integration names --- dart/lib/src/load_dart_debug_images_integration.dart | 7 ++++--- .../integrations/native_load_debug_images_integration.dart | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dart/lib/src/load_dart_debug_images_integration.dart b/dart/lib/src/load_dart_debug_images_integration.dart index b283535ea0..ac51fd2c66 100644 --- a/dart/lib/src/load_dart_debug_images_integration.dart +++ b/dart/lib/src/load_dart_debug_images_integration.dart @@ -20,15 +20,16 @@ class LoadDartDebugImagesIntegration extends Integration { void call(Hub hub, SentryOptions options) { if (options.enableDartSymbolication && options.runtimeChecker.isAppObfuscated()) { - options.addEventProcessor(LoadImageIntegrationEventProcessor(options)); + options.addEventProcessor( + LoadDartDebugImagesIntegrationEventProcessor(options)); options.sdk.addIntegration(integrationName); } } } @internal -class LoadImageIntegrationEventProcessor implements EventProcessor { - LoadImageIntegrationEventProcessor(this._options); +class LoadDartDebugImagesIntegrationEventProcessor implements EventProcessor { + LoadDartDebugImagesIntegrationEventProcessor(this._options); final SentryOptions _options; diff --git a/flutter/lib/src/integrations/native_load_debug_images_integration.dart b/flutter/lib/src/integrations/native_load_debug_images_integration.dart index 5eedd4115f..aa03360b54 100644 --- a/flutter/lib/src/integrations/native_load_debug_images_integration.dart +++ b/flutter/lib/src/integrations/native_load_debug_images_integration.dart @@ -38,7 +38,8 @@ class _LoadImageListIntegrationEventProcessor implements EventProcessor { final SentryFlutterOptions _options; final SentryNativeBinding _native; - late final _dartProcessor = LoadImageIntegrationEventProcessor(_options); + late final _dartProcessor = + LoadDartDebugImagesIntegrationEventProcessor(_options); @override Future apply(SentryEvent event, Hint hint) async { From 1d7d42ce8127c6d8138c6406bbca5aa495fb3b3f Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Mon, 26 May 2025 11:50:39 +0200 Subject: [PATCH 24/37] update condition, update naming of processors --- .../load_dart_debug_images_integration.dart | 2 +- ...ad_dart_debug_images_integration_test.dart | 26 ++++++++++++++++++- .../native_load_debug_images_integration.dart | 7 ++--- ..._native_debug_images_integration_test.dart | 4 +-- 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/dart/lib/src/load_dart_debug_images_integration.dart b/dart/lib/src/load_dart_debug_images_integration.dart index ac51fd2c66..0193b53372 100644 --- a/dart/lib/src/load_dart_debug_images_integration.dart +++ b/dart/lib/src/load_dart_debug_images_integration.dart @@ -19,7 +19,7 @@ class LoadDartDebugImagesIntegration extends Integration { @override void call(Hub hub, SentryOptions options) { if (options.enableDartSymbolication && - options.runtimeChecker.isAppObfuscated()) { + (options.runtimeChecker.isAppObfuscated() || options.platform.isWeb)) { options.addEventProcessor( LoadDartDebugImagesIntegrationEventProcessor(options)); options.sdk.addIntegration(integrationName); diff --git a/dart/test/load_dart_debug_images_integration_test.dart b/dart/test/load_dart_debug_images_integration_test.dart index 2971f149e2..a07bc15ba1 100644 --- a/dart/test/load_dart_debug_images_integration_test.dart +++ b/dart/test/load_dart_debug_images_integration_test.dart @@ -42,7 +42,7 @@ void main() { expect(fixture.options.eventProcessors.length, 1); expect( fixture.options.eventProcessors.first.runtimeType.toString(), - 'LoadImageIntegrationEventProcessor', + 'LoadDartDebugImagesIntegrationEventProcessor', ); }); @@ -211,6 +211,30 @@ isolate_dso_base: 10000000 expect(fixture.options.eventProcessors.length, 0); }); + test( + 'does add itself to sdk.integrations if app is not obfuscated but platform is web', + () { + final fixture = Fixture() + ..options.runtimeChecker = MockRuntimeChecker(isObfuscated: false) + ..options.platform = MockPlatform(isWeb: true); + fixture.callIntegration(); + expect( + fixture.options.sdk.integrations + .contains(LoadDartDebugImagesIntegration.integrationName), + true, + ); + }); + + test( + 'does add event processor to options if app is not obfuscated but platform is web', + () { + final fixture = Fixture() + ..options.runtimeChecker = MockRuntimeChecker(isObfuscated: false) + ..options.platform = MockPlatform(isWeb: true); + fixture.callIntegration(); + expect(fixture.options.eventProcessors.length, 1); + }); + test('debug image is null on unsupported platforms', () async { final fixture = Fixture()..options.platform = MockPlatform.linux(); fixture.callIntegration(); diff --git a/flutter/lib/src/integrations/native_load_debug_images_integration.dart b/flutter/lib/src/integrations/native_load_debug_images_integration.dart index aa03360b54..e5115ab825 100644 --- a/flutter/lib/src/integrations/native_load_debug_images_integration.dart +++ b/flutter/lib/src/integrations/native_load_debug_images_integration.dart @@ -25,15 +25,16 @@ class LoadNativeDebugImagesIntegration // ignore: invalid_use_of_internal_member if (options.runtimeChecker.isAppObfuscated()) { options.addEventProcessor( - _LoadImageListIntegrationEventProcessor(options, _native), + _LoadNativeDebugImagesIntegrationEventProcessor(options, _native), ); options.sdk.addIntegration(integrationName); } } } -class _LoadImageListIntegrationEventProcessor implements EventProcessor { - _LoadImageListIntegrationEventProcessor(this._options, this._native); +class _LoadNativeDebugImagesIntegrationEventProcessor + implements EventProcessor { + _LoadNativeDebugImagesIntegrationEventProcessor(this._options, this._native); final SentryFlutterOptions _options; final SentryNativeBinding _native; diff --git a/flutter/test/integrations/load_native_debug_images_integration_test.dart b/flutter/test/integrations/load_native_debug_images_integration_test.dart index dbc9051474..3b5861ad17 100644 --- a/flutter/test/integrations/load_native_debug_images_integration_test.dart +++ b/flutter/test/integrations/load_native_debug_images_integration_test.dart @@ -75,8 +75,8 @@ void main() { test('Event processor adds image list to the event', () async { final ep = fixture.options.eventProcessors.first; - expect( - ep.runtimeType.toString(), "_LoadImageListIntegrationEventProcessor"); + expect(ep.runtimeType.toString(), + "_LoadNativeDebugImagesIntegrationEventProcessor"); SentryEvent? event = _getEvent(); event = await ep.apply(event, Hint()); From 44ddbad75e97a104ec988f4e34396ff0ae5658c4 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Mon, 26 May 2025 12:00:52 +0200 Subject: [PATCH 25/37] add cl entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 733977a0dc..383fca0175 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ - [Flutter Web]: add debug ids to events ([#2917](https://github.com/getsentry/sentry-dart/pull/2917)) - This allows support for symbolication based on [debug ids](https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js/debug-ids/) +### Enhancements + +- Only enable load debug image integration for obfuscated apps ([#2907](https://github.com/getsentry/sentry-dart/pull/2907)) + ## 9.0.0-RC ### Various fixes & improvements From b0cee7d6d0dd48eaaf1105847876d58ce47c8e46 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 12 Jun 2025 03:35:17 -0700 Subject: [PATCH 26/37] Update runtime_checker.dart --- dart/lib/src/runtime_checker.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/dart/lib/src/runtime_checker.dart b/dart/lib/src/runtime_checker.dart index 95d6165d39..458b247c49 100644 --- a/dart/lib/src/runtime_checker.dart +++ b/dart/lib/src/runtime_checker.dart @@ -26,6 +26,7 @@ class RuntimeChecker { bool isAppObfuscated() { // In non-obfuscated builds, this will return "RuntimeChecker" // In obfuscated builds, this will return something like "a" or other short identifier + // Note: Flutter Web production builds will always be minified / "obfuscated". final typeName = runtimeType.toString(); return !typeName.contains('RuntimeChecker'); } From ee6d44934548b449259d35bb6d9ddb5645b821ba Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 12 Jun 2025 11:40:05 +0100 Subject: [PATCH 27/37] Rename --- .../src/integrations/web_load_debug_images_integration.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flutter/lib/src/integrations/web_load_debug_images_integration.dart b/flutter/lib/src/integrations/web_load_debug_images_integration.dart index d6712606d7..412dc3e905 100644 --- a/flutter/lib/src/integrations/web_load_debug_images_integration.dart +++ b/flutter/lib/src/integrations/web_load_debug_images_integration.dart @@ -7,17 +7,17 @@ import '../sentry_flutter_options.dart'; Integration createLoadDebugImagesIntegration( SentryNativeBinding native) { - return LoadNativeDebugImagesIntegration(native); + return LoadWebDebugImagesIntegration(native); } /// Loads the debug id injected by Sentry tooling e.g Sentry Dart Plugin /// This is necessary for symbolication of minified js stacktraces via debug ids. -class LoadNativeDebugImagesIntegration +class LoadWebDebugImagesIntegration extends Integration { final SentryNativeBinding _native; static const integrationName = 'LoadWebDebugImages'; - LoadNativeDebugImagesIntegration(this._native); + LoadWebDebugImagesIntegration(this._native); @override void call(Hub hub, SentryFlutterOptions options) { From ea357f96c118c20c266bc1bf1e64a4a691ee523f Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 12 Jun 2025 11:50:46 +0100 Subject: [PATCH 28/37] Fix analyze --- flutter/test/web/web_sentry_js_binding_test.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/flutter/test/web/web_sentry_js_binding_test.dart b/flutter/test/web/web_sentry_js_binding_test.dart index 1247ae6dc4..9da41db0e9 100644 --- a/flutter/test/web/web_sentry_js_binding_test.dart +++ b/flutter/test/web/web_sentry_js_binding_test.dart @@ -5,7 +5,6 @@ import 'dart:js_interop'; import 'dart:js_interop_unsafe'; import 'package:flutter_test/flutter_test.dart'; -import 'package:sentry_flutter/src/web/debug_ids.dart'; import 'package:sentry_flutter/src/web/script_loader/sentry_script_loader.dart'; import 'package:sentry_flutter/src/web/sentry_js_bundle.dart'; import 'package:sentry_flutter/src/web/web_sentry_js_binding.dart'; From a47d8867e39e39218813226625eab486c28aaf3c Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Tue, 17 Jun 2025 16:54:36 +0200 Subject: [PATCH 29/37] Fix log --- flutter/lib/src/web/sentry_web.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/lib/src/web/sentry_web.dart b/flutter/lib/src/web/sentry_web.dart index a1f8dd0750..e7b05a5535 100644 --- a/flutter/lib/src/web/sentry_web.dart +++ b/flutter/lib/src/web/sentry_web.dart @@ -20,7 +20,7 @@ class SentryWeb with SentryNativeSafeInvoker implements SentryNativeBinding { final SentryFlutterOptions _options; void _log(String message) { - _options.logger(SentryLevel.info, logger: '$SentryWeb', message); + _options.log(SentryLevel.info, logger: '$SentryWeb', message); } void _logNotSupported(String operation) => From f1215c68e5da18fcf224b066c5223baf8a87c169 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Wed, 18 Jun 2025 15:46:19 +0200 Subject: [PATCH 30/37] dont add on web --- .../load_dart_debug_images_integration.dart | 3 ++- ...oad_dart_debug_images_integration_test.dart | 18 +++--------------- .../web_load_debug_images_integration.dart | 3 +-- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/dart/lib/src/load_dart_debug_images_integration.dart b/dart/lib/src/load_dart_debug_images_integration.dart index f7c28932f6..b26aa05a83 100644 --- a/dart/lib/src/load_dart_debug_images_integration.dart +++ b/dart/lib/src/load_dart_debug_images_integration.dart @@ -19,7 +19,8 @@ class LoadDartDebugImagesIntegration extends Integration { @override void call(Hub hub, SentryOptions options) { if (options.enableDartSymbolication && - (options.runtimeChecker.isAppObfuscated() || options.platform.isWeb)) { + options.runtimeChecker.isAppObfuscated() && + !options.platform.isWeb) { options.addEventProcessor( LoadDartDebugImagesIntegrationEventProcessor(options)); options.sdk.addIntegration(integrationName); diff --git a/dart/test/load_dart_debug_images_integration_test.dart b/dart/test/load_dart_debug_images_integration_test.dart index a07bc15ba1..c81da91086 100644 --- a/dart/test/load_dart_debug_images_integration_test.dart +++ b/dart/test/load_dart_debug_images_integration_test.dart @@ -211,30 +211,18 @@ isolate_dso_base: 10000000 expect(fixture.options.eventProcessors.length, 0); }); - test( - 'does add itself to sdk.integrations if app is not obfuscated but platform is web', - () { + test('does not add itself to sdk.integrations if platform is web', () { final fixture = Fixture() - ..options.runtimeChecker = MockRuntimeChecker(isObfuscated: false) + ..options.runtimeChecker = MockRuntimeChecker(isObfuscated: true) ..options.platform = MockPlatform(isWeb: true); fixture.callIntegration(); expect( fixture.options.sdk.integrations .contains(LoadDartDebugImagesIntegration.integrationName), - true, + false, ); }); - test( - 'does add event processor to options if app is not obfuscated but platform is web', - () { - final fixture = Fixture() - ..options.runtimeChecker = MockRuntimeChecker(isObfuscated: false) - ..options.platform = MockPlatform(isWeb: true); - fixture.callIntegration(); - expect(fixture.options.eventProcessors.length, 1); - }); - test('debug image is null on unsupported platforms', () async { final fixture = Fixture()..options.platform = MockPlatform.linux(); fixture.callIntegration(); diff --git a/flutter/lib/src/integrations/web_load_debug_images_integration.dart b/flutter/lib/src/integrations/web_load_debug_images_integration.dart index 412dc3e905..893b536f83 100644 --- a/flutter/lib/src/integrations/web_load_debug_images_integration.dart +++ b/flutter/lib/src/integrations/web_load_debug_images_integration.dart @@ -12,8 +12,7 @@ Integration createLoadDebugImagesIntegration( /// Loads the debug id injected by Sentry tooling e.g Sentry Dart Plugin /// This is necessary for symbolication of minified js stacktraces via debug ids. -class LoadWebDebugImagesIntegration - extends Integration { +class LoadWebDebugImagesIntegration extends Integration { final SentryNativeBinding _native; static const integrationName = 'LoadWebDebugImages'; From c7357b14cb83d2f628010d285cc29dfbdee91838 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Wed, 18 Jun 2025 15:47:34 +0200 Subject: [PATCH 31/37] fix cl --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2857156092..4435203821 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ - [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#090) - [diff](https://github.com/getsentry/sentry-native/compare/0.8.4...0.9.0) +### Enhancements + +- Only enable load debug image integration for obfuscated apps ([#2907](https://github.com/getsentry/sentry-dart/pull/2907)) + ## 9.0.0 Version 9.0.0 marks a major release of the Sentry Dart/Flutter SDKs containing breaking changes. @@ -201,10 +205,6 @@ Sentry.logger.warn("This is a warning log with attributes.", attributes: { - Fix feature flag model keys ([#2943](https://github.com/getsentry/sentry-dart/pull/2943)) -### Enhancements - -- Only enable load debug image integration for obfuscated apps ([#2907](https://github.com/getsentry/sentry-dart/pull/2907)) - ## 9.0.0-RC ### Various fixes & improvements From 7317f533195507e87d9d6050b70d883904fc0448 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 18 Jun 2025 18:46:52 +0200 Subject: [PATCH 32/37] Fix test --- flutter/test/sentry_flutter_util.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flutter/test/sentry_flutter_util.dart b/flutter/test/sentry_flutter_util.dart index 76c0a8a2a0..415cf80039 100644 --- a/flutter/test/sentry_flutter_util.dart +++ b/flutter/test/sentry_flutter_util.dart @@ -40,13 +40,19 @@ void testConfiguration({ } Integration? nativeIntegration; + Integration? loadDebugImagesIntegration; if (kIsWeb) { nativeIntegration = integrations.firstWhereOrNull( (x) => x.runtimeType.toString() == 'WebSdkIntegration'); + loadDebugImagesIntegration = integrations.firstWhereOrNull( + (x) => x.runtimeType.toString() == 'LoadWebDebugImages'); } else { nativeIntegration = integrations.firstWhereOrNull( (x) => x.runtimeType.toString() == 'NativeSdkIntegration'); + loadDebugImagesIntegration = integrations.firstWhereOrNull( + (x) => x.runtimeType.toString() == 'LoadNativeDebugImages'); } + expect(loadDebugImagesIntegration, isNotNull); expect(nativeIntegration, isNotNull); } From 8a6c412584a1a3dffa680013de6d057180ecfdff Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 18 Jun 2025 19:18:58 +0200 Subject: [PATCH 33/37] update --- flutter/test/sentry_flutter_test.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/flutter/test/sentry_flutter_test.dart b/flutter/test/sentry_flutter_test.dart index 90706f54e4..8d6af41285 100644 --- a/flutter/test/sentry_flutter_test.dart +++ b/flutter/test/sentry_flutter_test.dart @@ -44,13 +44,11 @@ final nonWebIntegrations = [ // These should be added to Android final androidIntegrations = [ - LoadNativeDebugImagesIntegration, LoadContextsIntegration, ]; // These should be added to iOS and macOS final iOsAndMacOsIntegrations = [ - LoadNativeDebugImagesIntegration, LoadContextsIntegration, ]; From d494b81e79c19c1ed3d6e504a7ba38c008487680 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 18 Jun 2025 19:25:56 +0200 Subject: [PATCH 34/37] Fix test --- flutter/test/sentry_flutter_util.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter/test/sentry_flutter_util.dart b/flutter/test/sentry_flutter_util.dart index 415cf80039..f951c95c5e 100644 --- a/flutter/test/sentry_flutter_util.dart +++ b/flutter/test/sentry_flutter_util.dart @@ -45,12 +45,12 @@ void testConfiguration({ nativeIntegration = integrations.firstWhereOrNull( (x) => x.runtimeType.toString() == 'WebSdkIntegration'); loadDebugImagesIntegration = integrations.firstWhereOrNull( - (x) => x.runtimeType.toString() == 'LoadWebDebugImages'); + (x) => x.runtimeType.toString() == 'LoadWebDebugImagesIntegration'); } else { nativeIntegration = integrations.firstWhereOrNull( (x) => x.runtimeType.toString() == 'NativeSdkIntegration'); loadDebugImagesIntegration = integrations.firstWhereOrNull( - (x) => x.runtimeType.toString() == 'LoadNativeDebugImages'); + (x) => x.runtimeType.toString() == 'LoadNativeDebugImagesIntegration'); } expect(loadDebugImagesIntegration, isNotNull); expect(nativeIntegration, isNotNull); From 36dea6f619ab33a161501972e4a645fbfcf2b764 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 18 Jun 2025 19:43:02 +0200 Subject: [PATCH 35/37] Formatting --- .../src/integrations/web_load_debug_images_integration.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flutter/lib/src/integrations/web_load_debug_images_integration.dart b/flutter/lib/src/integrations/web_load_debug_images_integration.dart index 412dc3e905..893b536f83 100644 --- a/flutter/lib/src/integrations/web_load_debug_images_integration.dart +++ b/flutter/lib/src/integrations/web_load_debug_images_integration.dart @@ -12,8 +12,7 @@ Integration createLoadDebugImagesIntegration( /// Loads the debug id injected by Sentry tooling e.g Sentry Dart Plugin /// This is necessary for symbolication of minified js stacktraces via debug ids. -class LoadWebDebugImagesIntegration - extends Integration { +class LoadWebDebugImagesIntegration extends Integration { final SentryNativeBinding _native; static const integrationName = 'LoadWebDebugImages'; From e3613b102488534a048c2a0051f8656e87b2a80d Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Fri, 20 Jun 2025 13:31:44 +0200 Subject: [PATCH 36/37] Update --- .../Flutter/ephemeral/flutter_lldb_helper.py | 32 +++++++++++++++++++ .../ios/Flutter/ephemeral/flutter_lldbinit | 5 +++ .../native_load_debug_images_integration.dart | 8 +++-- 3 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 flutter/example/ios/Flutter/ephemeral/flutter_lldb_helper.py create mode 100644 flutter/example/ios/Flutter/ephemeral/flutter_lldbinit diff --git a/flutter/example/ios/Flutter/ephemeral/flutter_lldb_helper.py b/flutter/example/ios/Flutter/ephemeral/flutter_lldb_helper.py new file mode 100644 index 0000000000..a88caf99df --- /dev/null +++ b/flutter/example/ios/Flutter/ephemeral/flutter_lldb_helper.py @@ -0,0 +1,32 @@ +# +# Generated file, do not edit. +# + +import lldb + +def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): + """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" + base = frame.register["x0"].GetValueAsAddress() + page_len = frame.register["x1"].GetValueAsUnsigned() + + # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the + # first page to see if handled it correctly. This makes diagnosing + # misconfiguration (e.g. missing breakpoint) easier. + data = bytearray(page_len) + data[0:8] = b'IHELPED!' + + error = lldb.SBError() + frame.GetThread().GetProcess().WriteMemory(base, data, error) + if not error.Success(): + print(f'Failed to write into {base}[+{page_len}]', error) + return + +def __lldb_init_module(debugger: lldb.SBDebugger, _): + target = debugger.GetDummyTarget() + # Caveat: must use BreakpointCreateByRegEx here and not + # BreakpointCreateByName. For some reasons callback function does not + # get carried over from dummy target for the later. + bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") + bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) + bp.SetAutoContinue(True) + print("-- LLDB integration loaded --") diff --git a/flutter/example/ios/Flutter/ephemeral/flutter_lldbinit b/flutter/example/ios/Flutter/ephemeral/flutter_lldbinit new file mode 100644 index 0000000000..e3ba6fbedc --- /dev/null +++ b/flutter/example/ios/Flutter/ephemeral/flutter_lldbinit @@ -0,0 +1,5 @@ +# +# Generated file, do not edit. +# + +command script import --relative-to-command-file flutter_lldb_helper.py diff --git a/flutter/lib/src/integrations/native_load_debug_images_integration.dart b/flutter/lib/src/integrations/native_load_debug_images_integration.dart index cd90de0e3b..e5115ab825 100644 --- a/flutter/lib/src/integrations/native_load_debug_images_integration.dart +++ b/flutter/lib/src/integrations/native_load_debug_images_integration.dart @@ -32,13 +32,15 @@ class LoadNativeDebugImagesIntegration } } -class _LoadImageListIntegrationEventProcessor implements EventProcessor { - _LoadImageListIntegrationEventProcessor(this._options, this._native); +class _LoadNativeDebugImagesIntegrationEventProcessor + implements EventProcessor { + _LoadNativeDebugImagesIntegrationEventProcessor(this._options, this._native); final SentryFlutterOptions _options; final SentryNativeBinding _native; - late final _dartProcessor = LoadImageIntegrationEventProcessor(_options); + late final _dartProcessor = + LoadDartDebugImagesIntegrationEventProcessor(_options); @override Future apply(SentryEvent event, Hint hint) async { From 1ade42f33c242acce1a5109010525bdaf48ab28f Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Fri, 20 Jun 2025 13:32:27 +0200 Subject: [PATCH 37/37] Update --- .../Flutter/ephemeral/flutter_lldb_helper.py | 32 ------------------- .../ios/Flutter/ephemeral/flutter_lldbinit | 5 --- 2 files changed, 37 deletions(-) delete mode 100644 flutter/example/ios/Flutter/ephemeral/flutter_lldb_helper.py delete mode 100644 flutter/example/ios/Flutter/ephemeral/flutter_lldbinit diff --git a/flutter/example/ios/Flutter/ephemeral/flutter_lldb_helper.py b/flutter/example/ios/Flutter/ephemeral/flutter_lldb_helper.py deleted file mode 100644 index a88caf99df..0000000000 --- a/flutter/example/ios/Flutter/ephemeral/flutter_lldb_helper.py +++ /dev/null @@ -1,32 +0,0 @@ -# -# Generated file, do not edit. -# - -import lldb - -def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): - """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" - base = frame.register["x0"].GetValueAsAddress() - page_len = frame.register["x1"].GetValueAsUnsigned() - - # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the - # first page to see if handled it correctly. This makes diagnosing - # misconfiguration (e.g. missing breakpoint) easier. - data = bytearray(page_len) - data[0:8] = b'IHELPED!' - - error = lldb.SBError() - frame.GetThread().GetProcess().WriteMemory(base, data, error) - if not error.Success(): - print(f'Failed to write into {base}[+{page_len}]', error) - return - -def __lldb_init_module(debugger: lldb.SBDebugger, _): - target = debugger.GetDummyTarget() - # Caveat: must use BreakpointCreateByRegEx here and not - # BreakpointCreateByName. For some reasons callback function does not - # get carried over from dummy target for the later. - bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") - bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) - bp.SetAutoContinue(True) - print("-- LLDB integration loaded --") diff --git a/flutter/example/ios/Flutter/ephemeral/flutter_lldbinit b/flutter/example/ios/Flutter/ephemeral/flutter_lldbinit deleted file mode 100644 index e3ba6fbedc..0000000000 --- a/flutter/example/ios/Flutter/ephemeral/flutter_lldbinit +++ /dev/null @@ -1,5 +0,0 @@ -# -# Generated file, do not edit. -# - -command script import --relative-to-command-file flutter_lldb_helper.py