Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/src/thumbnail_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class ThumbnailViewer extends StatelessWidget {
double _eachPart = videoDuration / numberOfThumbnails;

List<Uint8List> _byteList = [];

// the cache of last thumbnail
Uint8List _lastBytes;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be Uint8List? _lastBytes;; note the ?. Generates an error in null safety otherwise since not declared.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its update in this pr #115

for (int i = 1; i <= numberOfThumbnails; i++) {
Uint8List _bytes;
_bytes = await VideoThumbnail.thumbnailData(
Expand All @@ -42,6 +43,13 @@ class ThumbnailViewer extends StatelessWidget {
quality: quality,
);

// if current thumbnail is null use the last thumbnail
if (_bytes != null) {
_lastBytes = _bytes;
} else {
_bytes = _lastBytes;
}

_byteList.add(_bytes);

yield _byteList;
Expand Down