Skip to content

Commit b157a35

Browse files
committed
rename to beforeScreenshotCapture
1 parent 9fce5c0 commit b157a35

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

flutter/lib/src/event_processor/screenshot_event_processor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ScreenshotEventProcessor implements EventProcessor {
4646

4747
// ignore: deprecated_member_use_from_same_package
4848
final beforeScreenshot = _options.beforeScreenshot;
49-
final beforeCapture = _options.beforeScreenshotCapture;
49+
final beforeCapture = _options.beforeCaptureScreenshot;
5050

5151
try {
5252
FutureOr<bool>? result;

flutter/lib/src/sentry_flutter_options.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,13 @@ class SentryFlutterOptions extends SentryOptions {
196196
bool attachScreenshotOnlyWhenResumed = false;
197197

198198
@Deprecated(
199-
'Will be removed in a future version. Use [beforeScreenshotCapture] instead')
199+
'Will be removed in a future version. Use [beforeCaptureScreenshot] instead')
200200
BeforeScreenshotCallback? beforeScreenshot;
201201

202202
/// Sets a callback which is executed before capturing screenshots. Only
203203
/// relevant if `attachScreenshot` is set to true. When false is returned
204204
/// from the function, no screenshot will be attached.
205-
BeforeCaptureCallback? beforeScreenshotCapture;
205+
BeforeCaptureCallback? beforeCaptureScreenshot;
206206

207207
/// Enable or disable automatic breadcrumbs for User interactions Using [Listener]
208208
///

flutter/test/event_processor/screenshot_event_processor_test.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ void main() {
216216
});
217217
});
218218

219-
group('beforeScreenshotCapture', () {
219+
group('beforeCaptureScreenshot', () {
220220
testWidgets('does add screenshot if beforeCapture returns true',
221221
(tester) async {
222-
fixture.options.beforeScreenshotCapture =
222+
fixture.options.beforeCaptureScreenshot =
223223
(SentryEvent event, Hint hint, bool shouldDebounce) {
224224
return true;
225225
};
@@ -229,7 +229,7 @@ void main() {
229229

230230
testWidgets('does add screenshot if async beforeCapture returns true',
231231
(tester) async {
232-
fixture.options.beforeScreenshotCapture =
232+
fixture.options.beforeCaptureScreenshot =
233233
(SentryEvent event, Hint hint, bool shouldDebounce) async {
234234
await Future<void>.delayed(Duration(milliseconds: 1));
235235
return true;
@@ -240,7 +240,7 @@ void main() {
240240

241241
testWidgets('does not add screenshot if beforeCapture returns false',
242242
(tester) async {
243-
fixture.options.beforeScreenshotCapture =
243+
fixture.options.beforeCaptureScreenshot =
244244
(SentryEvent event, Hint hint, bool shouldDebounce) {
245245
return false;
246246
};
@@ -250,7 +250,7 @@ void main() {
250250

251251
testWidgets('does not add screenshot if async beforeCapture returns false',
252252
(tester) async {
253-
fixture.options.beforeScreenshotCapture =
253+
fixture.options.beforeCaptureScreenshot =
254254
(SentryEvent event, Hint hint, bool shouldDebounce) async {
255255
await Future<void>.delayed(Duration(milliseconds: 1));
256256
return false;
@@ -261,7 +261,7 @@ void main() {
261261

262262
testWidgets('does add screenshot if beforeCapture throws', (tester) async {
263263
fixture.options.automatedTestMode = false;
264-
fixture.options.beforeScreenshotCapture =
264+
fixture.options.beforeCaptureScreenshot =
265265
(SentryEvent event, Hint hint, bool shouldDebounce) {
266266
throw Error();
267267
};
@@ -272,7 +272,7 @@ void main() {
272272
testWidgets('does add screenshot if async beforeCapture throws',
273273
(tester) async {
274274
fixture.options.automatedTestMode = false;
275-
fixture.options.beforeScreenshotCapture =
275+
fixture.options.beforeCaptureScreenshot =
276276
(SentryEvent event, Hint hint, bool shouldDebounce) async {
277277
await Future<void>.delayed(Duration(milliseconds: 1));
278278
throw Error();
@@ -286,7 +286,7 @@ void main() {
286286
await tester.runAsync(() async {
287287
var shouldDebounceValues = <bool>[];
288288

289-
fixture.options.beforeScreenshotCapture =
289+
fixture.options.beforeCaptureScreenshot =
290290
(SentryEvent event, Hint hint, bool shouldDebounce) {
291291
shouldDebounceValues.add(shouldDebounce);
292292
return true;
@@ -323,7 +323,7 @@ void main() {
323323
SentryEvent? beforeScreenshotEvent;
324324
Hint? beforeScreenshotHint;
325325

326-
fixture.options.beforeScreenshotCapture =
326+
fixture.options.beforeCaptureScreenshot =
327327
(SentryEvent event, Hint hint, bool shouldDebounce) {
328328
beforeScreenshotEvent = event;
329329
beforeScreenshotHint = hint;

0 commit comments

Comments
 (0)