Skip to content

Commit 6214b14

Browse files
committed
set minimum frame duration (100ms)
1 parent e0ca258 commit 6214b14

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎cached_network_image/lib/src/image_provider/multi_image_stream_completer.dart‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ class MultiImageStreamCompleter extends ImageStreamCompleter {
117117
);
118118
_shownTimestamp = timestamp;
119119
_frameDuration = _nextFrame!.duration;
120+
121+
if (_frameDuration! <= const Duration(milliseconds: 10)) {
122+
_frameDuration = const Duration(milliseconds: 100);
123+
}
124+
120125
_nextFrame = null;
121126
if (_framesEmitted % _codec!.frameCount == 0 && _nextImageCodec != null) {
122127
_switchToNewCodec();

0 commit comments

Comments
 (0)