From 4e8ca72327599fc3285204bfea559b314ed5eb3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E7=8F=82?= Date: Mon, 14 Feb 2022 21:42:58 +0800 Subject: [PATCH] feat: add fit --- image_sequence_animator/lib/image_sequence_animator.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/image_sequence_animator/lib/image_sequence_animator.dart b/image_sequence_animator/lib/image_sequence_animator.dart index 8f441f3..92f0551 100644 --- a/image_sequence_animator/lib/image_sequence_animator.dart +++ b/image_sequence_animator/lib/image_sequence_animator.dart @@ -94,6 +94,9 @@ class ImageSequenceAnimator extends StatefulWidget { ///The callback for when the [ImageSequenceAnimator] finishes playing. final ImageSequenceProcessCallback? onFinishPlaying; + ///The image fit + final BoxFit? fit; + const ImageSequenceAnimator( this.folderName, this.fileName, @@ -115,6 +118,7 @@ class ImageSequenceAnimator extends StatefulWidget { this.onStartPlaying, this.onPlaying, this.onFinishPlaying, + this.fit, }) : super(key: key); @override @@ -399,6 +403,7 @@ class ImageSequenceAnimatorState extends State with Singl _getDirectory(), color: color, gaplessPlayback: true, + fit: widget.fit, ); } @@ -429,6 +434,7 @@ class ImageSequenceAnimatorState extends State with Singl return Container(); }, color: Colors.transparent, + fit: widget.fit, ); } } else @@ -444,6 +450,7 @@ class ImageSequenceAnimatorState extends State with Singl useOldImageOnUrlChange: _isCacheComplete, fadeOutDuration: const Duration(milliseconds: 0), fadeInDuration: const Duration(milliseconds: 0), + fit: widget.fit, ); } } else