Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aliyigitbireroglu/flutter-image-sequence-animator
A simple widget for animating a set of images with full custom controls as an alternative to using a GIF file.
https://github.com/aliyigitbireroglu/flutter-image-sequence-animator
Last synced: 2 months ago
JSON representation
A simple widget for animating a set of images with full custom controls as an alternative to using a GIF file.
- Host: GitHub
- URL: https://github.com/aliyigitbireroglu/flutter-image-sequence-animator
- Owner: aliyigitbireroglu
- License: mit
- Created: 2019-08-17T11:39:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-11T00:16:32.000Z (almost 3 years ago)
- Last Synced: 2024-07-31T15:01:33.532Z (5 months ago)
- Language: Dart
- Size: 458 KB
- Stars: 151
- Watchers: 3
- Forks: 32
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-flutter-cn - Image Sequence Animator - 一款简单的小部件,用于动画化一组图片,提供完全自定义控制,作为使用GIF文件的替代方案,由[Ali Yigit Bireroglu](https://github.com/aliyigitbireroglu)创建。 (组件 / UI)
- awesome-flutter - Image Sequence Animator - A simple widget for animating a set of images with full custom controls as an alternative to using a GIF file. ` 📝 2 months ago ` (UI [🔝](#readme))
- awesome-flutter-cn - Image Sequence Animator - 一个用于对 gif 文件生成的图片序列进行完全控制实现不同动画效果的小工具,[Ali Yigit Bireroglu](https://github.com/aliyigitbireroglu). (组件 / UI)
README
# image_sequence_animator
[![Pub](https://img.shields.io/pub/v/image_sequence_animator?color=g)](https://pub.dev/packages/image_sequence_animator)
[![License](https://img.shields.io/github/license/aliyigitbireroglu/flutter-image-sequence-animator?color=blue)](https://github.com/aliyigitbireroglu/flutter-image-sequence-animator/blob/master/LICENSE)[comment]: <> (Introduction)
A simple widget for animating a set of images with full custom controls as an alternative to using a GIF file.**If you have a GIF file you would like to use with this package, I recommend [EZGIF](https://ezgif.com/split) to convert your GIF file to an image
sequence.****It is highly recommended to read the documentation and run the example project on a real device to fully understand and inspect the full range
of capabilities.**[comment]: <> (ToC)
[Media](#media) | [Description](#description) | [How-to-Use](#howtouse)[comment]: <> (Recent)
## Recent
* **[isOnline] is added. If your [folderName] is an online path, this value should be set to true.**
* **[waitUntilCacheIsComplete] is added. If you want the [ImageSequenceAnimator] to wait until the entire image sequence is cached, this value should be set
to true i. Otherwise, the [ImageSequenceAnimator] will invoke [onReadyToPlay] and start playing if [isAutoPlay] is set to true when it approximates that the
remaining caching can be completed without causing stutters. This value is only used if [isOnline] is set to true.**
* **[cacheProgressIndicatorBuilder] is added. If you want to display a widget until the [ImageSequenceAnimator] is ready to be played, use this function.**
* * *[comment]: <> (Media)
## MediaWatch on **Youtube**:
[comment]: <> (Description)
## Description
This simple widget for animating a set of images **(a.k.a an image sequence)** with full custom controls as an alternative to using a GIF file.GIF files are, as far as I know, not possible to control. With this package, you will have full control over your image sequence like controlling a
video. You can loop, boomerang, change the color, play, pause, stop, skip, rewind, restart and more.[comment]: <> (How-to-Use)
## How-to-Use
First, add your image sequence to your assets and update the "pubspec.yaml" accordingly.Then create an ImageSequenceAnimator widget as shown in the example:
```
ImageSequenceAnimator(
"assets/ImageSequences/MyImageSequence", //folderName
"Frame_", //fileName
0, //suffixStart
5, //suffixCount
"png", //fileFormat
60, //frameCount
{Key key,
fps : 60,
isLooping : false,
isBoomerang : false,
isAutoPlay : true,
color : Colors.white,
onReadyToPlay : _onReadyToPlay,
onStartPlaying : _onStartPlaying,
onPlaying : _onPlaying,
onFinishPlaying : _onFinishPlaying})ImageSequenceAnimator(
"https://www.domain.com/ImageSequences/MyImageSequence", //folderName
"Frame_", //fileName
0, //suffixStart
5, //suffixCount
"png", //fileFormat
60, //frameCount
{Key key,
fps : 60,
isLooping : false,
isBoomerang : false,
isAutoPlay: true,
isOnline: true,
waitUntilCacheIsComplete: true,
cacheProgressIndicatorBuilder: _cacheProgressIndicatorBuilder,
color : Colors.white,
onReadyToPlay : _onReadyToPlay,
onStartPlaying : _onStartPlaying,
onPlaying : _onPlaying,
onFinishPlaying : _onFinishPlaying})
Widget _cacheProgressIndicatorBuilder(BuildContext _context , double _progress);
void _onReadyToPlay(ImageSequenceAnimatorState _imageSequenceAnimator);
void _onStartPlaying(ImageSequenceAnimatorState _imageSequenceAnimator);
void _onPlaying(ImageSequenceAnimatorState _imageSequenceAnimator);
void _onFinishPlaying(ImageSequenceAnimatorState _imageSequenceAnimator);
```**Further Explanations:**
*For a complete set of descriptions for all parameters and methods, see the [documentation](https://pub.dev/documentation/image_sequence_animator/latest/).*
* [isLooping] will override [isBoomerang] if both are set to true.
* All [ImageSequenceProcessCallback] callbacks will return a reference to the created [ImageSequenceAnimator] state. You can save this instance for
further actions.
* Use [ImageSequenceAnimatorState]'s
[void setIsLooping(bool isLooping)], [void setIsBoomerang(bool isBoomerang)], [void setColor(Color color)], [void play({double from: -1.0})],
[void rewind({double from: -1.0})], [void pause()], [void skip(double value, {double percentage: -1.0})], [void restart()], [void stop()]
methods for the corresponding actions.
* Use [ImageSequenceAnimatorState]'s [bool get isLooping], [bool get isBoomerang], [double get currentProgress], [double get totalProgress],
[double get currentTime] and [double get totalTime] methods to get the respective values.[comment]: <> (Notes)
## Notes
I started using and learning Flutter only some weeks ago so this package might have some parts that don't make sense, that should be completely
different, that could be much better, etc. Please let me know! Nicely!Any help, suggestion or criticism is appreciated!
Cheers.
[comment]: <> (CosmosSoftware)