swift_animations 3.0.0 copy "swift_animations: ^3.0.0" to clipboard
swift_animations: ^3.0.0 copied to clipboard

SwiftUI-like declarative animations for Flutter. Zero boilerplate - no controllers, no ticker providers required! Works on all platforms.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

3.0.0 - 2026-03-12 #

Added #

Align effect

  • .align({begin, end}) – Animate child between two Alignment values (e.g. topCenter → center)

Follow path

  • .followPath(path) – Move child along a Path; progress 0–1 maps to path position via PathMetric

Crossfade / Swap

  • .crossfade(builder) – Crossfade from child to widget built by builder() (opacity-based)
  • .swap(at, builder) – At progress at (0–1), replace child with builder(child)

CustomEffect / ToggleEffect

  • .custom(builder) – Custom widget builder (context, value, child) for arbitrary effects
  • .toggle(at, builder) – At progress at, builder receives (context, value >= at, child) for before/after states

ShaderEffect (GLSL)

  • .shader(fragmentShader, {uniformIndex}) – Apply a FragmentShader; uniform at given index is set to animation value 0–1

ThenEffect (sequencing)

  • .then({delay}) – Add extra delay so effective delay = delay + thenDelay for sequenced animations

Target (0–1 state animate)

  • .target(targetNotifier) – Animate to value 0–1 when a ValueListenable<double> changes (e.g. drive from slider or state)

Callbacks (onComplete, onPlay)

  • .onPlay(callback) – Called when animation actually starts (after delay)
  • .onComplete(callback) – Called when animation completes

CallbackEffect / ListenEffect

  • .callbackAt(at, callback) – Fire callback once when progress crosses at (0–1)
  • .listen(listener) – Listener called with current value (0–1) each frame; deferred to avoid setState during build

Fixed #

  • showSnackBar() and similar UI updates from animation callbacks (onPlay, onComplete, callbackAt) no longer run during build; example defers them via WidgetsBinding.instance.addPostFrameCallback.
  • Listen effect no longer triggers "setState during build"; listen callback is invoked in a post-frame callback so updating a ValueNotifier from it is safe.

2.0.0 - 2026-03-12 #

Added #

Extra effects (blur, shimmer, flip, shake, elevation, color)

  • .blur([sigma]) – Animate blur from 0 to sigma (default 4)
  • .shimmer() – Shimmer/sweep loading-style effect
  • .flipX() / .flipY() – 3D card flip on X or Y axis
  • .shake() – Shake effect
  • .elevation([value]) – Animate Material elevation shadow (default 8)
  • .saturate([end]) – Color saturation (0 = grayscale, 1 = normal)
  • .tint(color, [amount]) – Color tint overlay

List stagger

  • List<Widget>.animate({Duration interval}) – Staggered list animations; each child gets the same effects with delay = base delay + index × interval
  • AnimatedListBuilder – Same chain API as single-widget animation (scale, fadeIn, slideIn*, duration, spring*, etc.)

Adapters (drive animation from scroll or value)

  • .animate(drive: ValueListenable<double>) – Progress 0–1 driven by a ValueListenable<double> (e.g. scroll, slider) instead of the internal controller
  • Use with ValueNotifier<double> or any ValueListenable<double> for scroll-linked or custom-driven animations

Shared effect presets (design system)

  • SwiftEffects class with static presets:
    • SwiftEffects.entrance(child) – Fade in + slide from bottom, 300 ms
    • SwiftEffects.cardReveal(child) – Fade in + scale, 400 ms
    • SwiftEffects.slideFromRight(child) – Fade in + slide from right, 350 ms
    • SwiftEffects.springEntrance(child) – Spring-based entrance (iOS-style)
    • SwiftEffects.listEntrance(children, {interval}) – Staggered list with entrance (default interval 100 ms)

Example app

  • New "Extra Effects & Presets" screen (between Gesture Extension and Navigation Animations) demonstrating blur, shimmer, flip, shake, elevation, saturate, tint, list stagger, drive adapter, and SwiftEffects presets

Fixed #

  • (From 1.2.3) sGestureDetector widget invisible on app start (Android/iOS). Animation controllers now initialize with correct values (scale/stretch: 1.0, offset: 0.0) so the wrapped widget is visible from the first frame.

1.2.3 - 2026-03-12 #

Fixed #

  • Fixed sGestureDetector widget invisible on app start (Android/iOS). Animation controllers now initialize with correct values (scale/stretch: 1.0, offset: 0.0) so the wrapped widget is visible from the first frame.

1.2.2 2025-01-XX #

Added #

  • Beautiful Buy Me a Coffee support button in example app
  • Support section in README with encouraging messaging
  • Direct link to support page for project development

Changed #

  • Updated example app to include url_launcher for opening support links
  • Enhanced README with support section highlighting project benefits

1.2.1 2025-01-XX #

Fixed #

  • Fixed repeatCount() method causing infinite loops instead of respecting the specified count
  • Fixed repeat count logic for reverse animations to properly count complete cycles
  • Improved status listener cleanup to prevent memory leaks

Added #

  • Platform-specific navigation animations with fluent API
  • swift.push(), swift.pushReplacement(), swift.pushRoute() methods
  • swift.pushNamed(), swift.pushReplacementNamed() methods
  • swift.pushNamedAndRemoveUntil(), swift.pushAndRemoveUntil() methods
  • iOS-style slide transitions (from right)
  • Android-style fade + slide up transitions
  • Web-style fade transitions
  • Configurable duration and curve for navigation animations

1.2.0 2025-01-XX #

Added #

  • Gesture extensions with .sGestureDetector() method
  • Liquid tap effects with spring physics animations
  • Scale animation on tap with iOS-style spring physics
  • Stretch effects during drag gestures
  • Long press support with configurable duration
  • Auto-scaling based on widget size
  • Customizable stretch and translate sensitivity

1.1.0 2025-01-XX #

Added #

  • Spring physics animations support
  • spring() method for custom spring animations with configurable mass, stiffness, damping, and initial velocity
  • springIOS() method for iOS-style snappy spring animations
  • springGentle() method for gentle spring animations with smooth bounce
  • springBouncy() method for bouncy spring animations with high bounce
  • Support for unbounded animation controllers for spring physics

1.0.1 2025-01-XX #

Changed #

1.0.0 2025-01-XX #

Added #

  • Initial release of swift_animations package
  • SwiftUI-like declarative animation API
  • Zero boilerplate animations - no mixins required
  • Support for all Flutter platforms (iOS, Android, Web, macOS, Linux, Windows)
  • Transform animations: scale, scaleX, scaleY, rotate
  • Opacity animations: fadeIn, fadeOut, custom opacity
  • Slide animations: slideX, slideY, slideInTop, slideInBottom, slideInLeft, slideInRight
  • Special effects: bounce, pulse, fadeInScale
  • Animation configuration: duration, delay, curve, repeat, repeatCount, persist
  • Duration shorthand support: .500ms, 0.5.s, 5.m, etc.
  • Number extensions for duration: 500.ms, 1.5.s, 2.m

Features #

  • Clean chaining API similar to SwiftUI
  • Automatic ticker provider management (handled internally)
  • No need for SingleTickerProviderStateMixin or TickerProviderStateMixin in user code
  • Support for complex animation combinations
  • Animation state persistence option
39
likes
160
points
233
downloads

Documentation

API reference

Publisher

verified publisherswiftflutter.com

Weekly Downloads

SwiftUI-like declarative animations for Flutter. Zero boilerplate - no controllers, no ticker providers required! Works on all platforms.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on swift_animations