Skip to content

Commit b1cd9a3

Browse files
committed
linter issues
1 parent 7f34265 commit b1cd9a3

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import java.lang.ref.WeakReference
3939
import kotlin.math.roundToInt
4040

4141
private const val APP_START_MAX_DURATION_MS = 60000
42+
private const val VIDEO_BLOCK_SIZE = 16
4243

4344
class SentryFlutterPlugin :
4445
FlutterPlugin,
@@ -576,11 +577,11 @@ class SentryFlutterPlugin :
576577
}
577578

578579
private fun Double.adjustReplaySizeToBlockSize(): Double {
579-
val remainder = this % 16
580-
return if (remainder <= 8) {
580+
val remainder = this % VIDEO_BLOCK_SIZE
581+
return if (remainder <= VIDEO_BLOCK_SIZE / 2) {
581582
this - remainder
582583
} else {
583-
this + (16 - remainder)
584+
this + (VIDEO_BLOCK_SIZE - remainder)
584585
}
585586
}
586587
}

flutter/lib/src/screenshot/sentry_screenshot_widget.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ typedef SentryScreenshotWidgetOnBuildCallback = bool Function(
6868
class _SentryScreenshotWidgetState extends State<SentryScreenshotWidget> {
6969
@override
7070
Widget build(BuildContext context) {
71+
final mq = MediaQuery.of(context);
7172
final status = SentryScreenshotWidgetStatus(
72-
size: MediaQuery.maybeSizeOf(context),
73-
pixelRatio: MediaQuery.maybeDevicePixelRatioOf(context),
74-
orientantion: MediaQuery.maybeOrientationOf(context),
73+
size: mq.size,
74+
pixelRatio: mq.devicePixelRatio,
75+
orientantion: mq.orientation,
7576
);
7677
final prevStatus = SentryScreenshotWidget._status;
7778
SentryScreenshotWidget._status = status;

flutter/test/replay/scheduler_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ class _Fixture {
6363
sut = Scheduler(
6464
const Duration(milliseconds: 1),
6565
(_) async => calls++,
66-
_AddPostFrameCallbackMock,
66+
_addPostFrameCallbackMock,
6767
);
6868
}
6969

70-
void _AddPostFrameCallbackMock(FrameCallback callback,
70+
void _addPostFrameCallbackMock(FrameCallback callback,
7171
{String debugLabel = 'callback'}) {
7272
registeredCallback = callback;
7373
}

0 commit comments

Comments
 (0)