Browse Source

Add hero animation to videos

Vishnu Mohandas 5 years ago
parent
commit
d042d0dc2e
1 changed files with 5 additions and 1 deletions
  1. 5 1
      lib/ui/video_widget.dart

+ 5 - 1
lib/ui/video_widget.dart

@@ -52,10 +52,14 @@ class _VideoWidgetState extends State<VideoWidget> {
 
   @override
   Widget build(BuildContext context) {
-    return _videoPlayerController != null &&
+    final content = _videoPlayerController != null &&
             _videoPlayerController.value.initialized
         ? _getVideoPlayer()
         : _getLoadingWidget();
+    return Hero(
+      tag: widget.file.generatedId.toString(),
+      child: content,
+    );
   }
 
   Widget _getLoadingWidget() {