File tree Expand file tree Collapse file tree
android/src/main/kotlin/io/sentry/flutter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import java.lang.ref.WeakReference
3939import kotlin.math.roundToInt
4040
4141private const val APP_START_MAX_DURATION_MS = 60000
42+ private const val VIDEO_BLOCK_SIZE = 16
4243
4344class 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 }
Original file line number Diff line number Diff line change @@ -68,10 +68,11 @@ typedef SentryScreenshotWidgetOnBuildCallback = bool Function(
6868class _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;
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments