diff --git a/dart/lib/src/sentry.dart b/dart/lib/src/sentry.dart index b3faf735f0..fc3a62cf8d 100644 --- a/dart/lib/src/sentry.dart +++ b/dart/lib/src/sentry.dart @@ -226,7 +226,7 @@ class Sentry { /// Reports [SentryFeedback] to Sentry.io. /// /// Use [withScope] to add [SentryAttachment] to the feedback. - static Future captureFeedback( + static Future captureFeedback( SentryFeedback feedback, { Hint? hint, ScopeCallback? withScope, diff --git a/dio/test/mocks/mock_hub.dart b/dio/test/mocks/mock_hub.dart index 377e1efb79..910e6bb199 100644 --- a/dio/test/mocks/mock_hub.dart +++ b/dio/test/mocks/mock_hub.dart @@ -1,5 +1,4 @@ import 'package:meta/meta.dart'; - import 'package:sentry/sentry.dart'; import 'no_such_method_provider.dart'; @@ -10,6 +9,8 @@ class MockHub with NoSuchMethodProvider implements Hub { List captureMessageCalls = []; List addBreadcrumbCalls = []; List bindClientCalls = []; + + // ignore: deprecated_member_use List userFeedbackCalls = []; List captureTransactionCalls = []; int closeCalls = 0; @@ -121,6 +122,7 @@ class MockHub with NoSuchMethodProvider implements Hub { } @override + // ignore: deprecated_member_use Future captureUserFeedback(SentryUserFeedback userFeedback) async { userFeedbackCalls.add(userFeedback); } diff --git a/flutter/example/integration_test/integration_test.dart b/flutter/example/integration_test/integration_test.dart index d1ae5f876c..a14b8f4eda 100644 --- a/flutter/example/integration_test/integration_test.dart +++ b/flutter/example/integration_test/integration_test.dart @@ -86,14 +86,31 @@ void main() { await setupSentryAndApp(tester); // ignore: deprecated_member_use_from_same_package + // ignore: deprecated_member_use final feedback = SentryUserFeedback( eventId: SentryId.newId(), name: 'fixture-name', email: 'fixture@email.com', comments: 'fixture-comments'); + // ignore: deprecated_member_use await Sentry.captureUserFeedback(feedback); }); + testWidgets('setup sentry and capture feedback', (tester) async { + await setupSentryAndApp(tester); + + // ignore: deprecated_member_use_from_same_package + // ignore: deprecated_member_use + final associatedEventId = await Sentry.captureMessage("Associated"); + final feedback = SentryFeedback( + message: 'message', + contactEmail: 'john.appleseed@apple.com', + name: 'John Appleseed', + associatedEventId: associatedEventId, + ); + await Sentry.captureFeedback(feedback); + }); + testWidgets('setup sentry and close', (tester) async { await setupSentryAndApp(tester); diff --git a/isar/test/mocks/mocks.mocks.dart b/isar/test/mocks/mocks.mocks.dart index 4f7adfed86..dc4cbd87a4 100644 --- a/isar/test/mocks/mocks.mocks.dart +++ b/isar/test/mocks/mocks.mocks.dart @@ -286,6 +286,7 @@ class MockHub extends _i1.Mock implements _i2.Hub { ) as _i3.Future<_i2.SentryId>); @override + // ignore: deprecated_member_use _i3.Future captureUserFeedback(_i2.SentryUserFeedback? userFeedback) => (super.noSuchMethod( Invocation.method( diff --git a/sqflite/test/mocks/mocks.mocks.dart b/sqflite/test/mocks/mocks.mocks.dart index 6c4c5e362e..11300b2dff 100644 --- a/sqflite/test/mocks/mocks.mocks.dart +++ b/sqflite/test/mocks/mocks.mocks.dart @@ -1453,6 +1453,7 @@ class MockHub extends _i1.Mock implements _i2.Hub { )), ) as _i4.Future<_i2.SentryId>); @override + // ignore: deprecated_member_use _i4.Future captureUserFeedback(_i2.SentryUserFeedback? userFeedback) => (super.noSuchMethod( Invocation.method(