Skip to content

Commit

Permalink
feat: add fit
Browse files Browse the repository at this point in the history
  • Loading branch information
akindone committed Feb 14, 2022
1 parent 41d5929 commit 4e8ca72
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions image_sequence_animator/lib/image_sequence_animator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -115,6 +118,7 @@ class ImageSequenceAnimator extends StatefulWidget {
this.onStartPlaying,
this.onPlaying,
this.onFinishPlaying,
this.fit,
}) : super(key: key);

@override
Expand Down Expand Up @@ -399,6 +403,7 @@ class ImageSequenceAnimatorState extends State<ImageSequenceAnimator> with Singl
_getDirectory(),
color: color,
gaplessPlayback: true,
fit: widget.fit,
);
}

Expand Down Expand Up @@ -429,6 +434,7 @@ class ImageSequenceAnimatorState extends State<ImageSequenceAnimator> with Singl
return Container();
},
color: Colors.transparent,
fit: widget.fit,
);
}
} else
Expand All @@ -444,6 +450,7 @@ class ImageSequenceAnimatorState extends State<ImageSequenceAnimator> with Singl
useOldImageOnUrlChange: _isCacheComplete,
fadeOutDuration: const Duration(milliseconds: 0),
fadeInDuration: const Duration(milliseconds: 0),
fit: widget.fit,
);
}
} else
Expand Down

0 comments on commit 4e8ca72

Please sign in to comment.