flutter_spritesheet_animation 1.2.0
flutter_spritesheet_animation: ^1.2.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.2.0 #
- Fixed
SpriteAnimation.gridgoing blank aftercolumns,rowsorframeCountchanged on rebuild. The frame rects were cleared but only rebuilt when a new image loaded, and the controller kept the old frame count. Both are now updated in place, without resuming a paused or finished animation. - Fixed callbacks set on an external
SpriteAnimationController(as in therepeatCountexample) being wiped when the controller was handed to the widget. The widget now only replaces them with callbacks of its own. - Fixed
onFrameandonCompletegoing stale: a rebuild with new callbacks now reaches the controller instead of it calling the ones from the first build. - Added
autoStarttoSpriteAnimationController.setupGrid(defaulttrue, unchanged behaviour) so the frame count can be updated without starting playback. - Fixed the release workflow, which could not push the version tag (403)
because the repository had no
RELEASE_DEPLOY_KEY. It now fails early with a clear message when the key is missing.
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.dev 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).