From 98f3e2ebd0327a05e833bb2d095417292b24306b Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 20 Apr 2020 09:21:06 +0900 Subject: [PATCH] video: fixed background color --- lib/widgets/fullscreen/video_view.dart | 41 ++++++++------------------ 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/lib/widgets/fullscreen/video_view.dart b/lib/widgets/fullscreen/video_view.dart index 64d1c1c59..8673018ad 100644 --- a/lib/widgets/fullscreen/video_view.dart +++ b/lib/widgets/fullscreen/video_view.dart @@ -72,25 +72,13 @@ class AvesVideoState extends State { statusWidgetBuilder: (context, controller, status) => const SizedBox.shrink(), textureBuilder: (context, controller, info) { var id = controller.textureId; - if (id == null) { - return AspectRatio( - aspectRatio: entry.displayAspectRatio, - child: Container( - color: Colors.green, - ), - ); - } - - Widget child = Container( - color: Colors.blue, - child: Texture( - textureId: id, - ), - ); - - if (!controller.autoRotate) { - return child; - } + var child = id != null + ? Texture( + textureId: id, + ) + : Container( + color: Colors.black, + ); final degree = entry.catalogMetadata?.videoRotation ?? 0; if (degree != 0) { @@ -100,17 +88,14 @@ class AvesVideoState extends State { ); } - child = AspectRatio( - aspectRatio: entry.displayAspectRatio, - child: child, - ); - - return Container( - child: child, - alignment: Alignment.center, - color: Colors.transparent, + return Center( + child: AspectRatio( + aspectRatio: entry.displayAspectRatio, + child: child, + ), ); }, + backgroundColor: Colors.transparent, ) : Image( image: UriImage(uri: entry.uri, mimeType: entry.mimeType),