패키지, 저장소 및 앱 카테고리 검색

패키지 상세v2.0.0

image_sequence_animator

GIF 파일 사용의 대안으로 이미지 세트를 완전히 사용자 정의된 컨트롤로 애니메이션 처리할 수 있는 간단한 위젯입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
2천
좋아요
80
Pub 점수
120

패키지 설치

flutter pub add image_sequence_animator

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

이미지 시퀀스의 정밀한 애니메이션을 가능하게 하는 플러터 위젯으로 재생, 타이밍 및 반복에 대한 완전한 제어를 제공합니다. GIF의 가벼운 대안으로 개별 이미지 프레임을 사용하여 부드러운 애니메이션을 만들 수 있습니다. GIF가 너무 크거나 유연하지 않은 사용자 정의 애니메이션에 적합합니다. 이 패키지는 모든 주요 플랫폼을 지원하며 시작, 일시정지, 리셋 애니메이션을 위한 직관적인 API를 제공합니다.

사용 사례

  • 사용자 정의 애니메이션 UI 요소
  • 큰 GIF 파일 교체
  • 인터랙티브 앱 애니메이션
  • 게임 캐릭터 애니메이션
  • 프레임 단위 효과를 갖춘 로딩 인디케이터

주요 기능

  • 완전한 재생 제어
  • 모든 이미지 형식 지원
  • 크로스 플랫폼 호환성
  • 사용자 정의 프레임 레이트
  • 루프 옵션
  • 기존 위젯과의 간편한 통합

적합한 대상

  • GIF 대안을 찾는 개발자
  • 고성능 애니메이션을 필요로 하는 앱
  • 엄격한 파일 크기 제약이 있는 프로젝트
  • 인터랙티브 UI 컴포넌트
  • 정밀한 타이밍 제어가 필요한 애니메이션

고려 사항

  • 많은 프레임을 사용할 경우 메모리 사용량 증가
  • 사전 처리된 이미지 시퀀스가 필요합니다
  • 매우 긴 애니메이션에는 적합하지 않습니다
  • 프레임 로딩의 수동 관리
  • 비디오 형식에 비해 내장 효과가 제한적입니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

image_sequence_animator

Cosmos Software

Pub License

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 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.

Media | Description | How-to-Use

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.


Media

Watch on Youtube:

Image Sequence Animator

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.

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.

  • [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.

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.





카테고리

의존성

의존성 목록 1 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.