flutter_spritesheet_animation 1.1.0
flutter_spritesheet_animation: ^1.1.0 copied to clipboard
Lightweight spritesheet animation widget for Flutter. Grid-based and JSON atlas (TexturePacker, Aseprite) support with named animations, playback modes, and external controller.
1.1.0 #
- Added
SpriteAnimationController.speed, a playback multiplier that scales the whole animation clock. Unlikefps, it also applies to atlas animations whose frames carry their own durations, where the frame rate is fixed by the data andfpsis ignored. - Added
SpriteAnimationController.repeatCount: play a looping animation a fixed number of times, then fireonComplete. Null keeps the previous unlimited behaviour. Changing it resetscompletedCycles, so a new limit applies from now rather than counting cycles that already ran. - Added
completedCyclesand theonCyclecallback, which fires on every wrap of a looping animation with the number completed so far. - Added CI:
ci.yml(format, analyze, test),release.yml(tag on version change) andpublish.yml(pub.flutter-io.cn via OIDC). This was the only package in the workspace without them. - Added
example/assets/sprite_demo.png, a generated 8x8 / 64-frame spritesheet, and pointed the example at it. The example previously referencedassets/backpack.png, which is gitignored and was never committed, so the demo could not run from a clone andflutter analyzewarned about the missing asset directory. The gitignore entry is left alone.
1.0.3 #
- Added
PlayModeXextension withisForward,isReverseandisPingPongconvenience getters onPlayMode.
1.0.2 #
SpriteAnimationControllerconstructor now validatesfpsimmediately (throwsArgumentErrorwhenfps <= 0). Previously the assertion only ran when callers later mutatedfpsthrough the setter.- Extracted hot-loop magic numbers into named constants
(
_kMicrosecondsPerSecond,_kMicrosecondsPerMillisecond) inside the tick accumulator — no behavioural change, just readability.
1.0.1 #
- Fix: active ticker assertion on dispose with external controller.
1.0.0 #
- Initial release.
- Grid-based spritesheet animation (
SpriteAnimation.grid). - JSON atlas animation (
SpriteAnimation.atlas) with TexturePacker and Aseprite support. - Named animations via
frameTags. SpriteAnimationControllerwith play/pause/stop/goToFrame.- Playback modes: forward, reverse, pingPong.
- Per-frame duration from atlas data.
- Image precaching (
SpriteAnimation.precache/precacheAll). - Zero widget rebuilds via
CustomPainter(repaint:)— paint-layer-only updates. - Zero-allocation tick loop with raw microsecond arithmetic.
- Pre-computed grid rects for optimal rendering performance.
- Reusable Paint object to avoid per-frame allocations.
- Zero external dependencies (Flutter SDK only).