Fix the aspect ratio of video thumbnails
This commit is contained in:
parent
22bb3138ef
commit
060cc2b41b
1 changed files with 13 additions and 4 deletions
|
@ -1,3 +1,4 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:chewie/chewie.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
@ -69,12 +70,20 @@ class _VideoWidgetState extends State<VideoWidget> {
|
|||
]);
|
||||
}
|
||||
|
||||
Center _getThumbnail() {
|
||||
Widget _getThumbnail() {
|
||||
final thumbnail = widget.file.localId == null
|
||||
? Image.network(widget.file.getThumbnailUrl())
|
||||
? CachedNetworkImage(
|
||||
imageUrl: widget.file.getThumbnailUrl(),
|
||||
fit: BoxFit.contain,
|
||||
)
|
||||
: Image.memory(
|
||||
ThumbnailLruCache.get(widget.file, THUMBNAIL_SMALL_SIZE));
|
||||
return Center(child: thumbnail);
|
||||
ThumbnailLruCache.get(widget.file, THUMBNAIL_SMALL_SIZE),
|
||||
fit: BoxFit.contain,
|
||||
);
|
||||
return Container(
|
||||
child: thumbnail,
|
||||
constraints: BoxConstraints.expand(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getVideoPlayer() {
|
||||
|
|
Loading…
Add table
Reference in a new issue