swift_animations library
SwiftUI-like declarative animations for Flutter
Zero boilerplate - no controllers, no ticker providers required!
import 'package:swift_animations/swift_animations.dart';
Container(
width: 120,
height: 120,
decoration: BoxDecoration(
color: Colors.purple,
borderRadius: BorderRadius.circular(20),
),
)
.animate()
.scale(1.2)
.fadeIn()
.repeat(reverse: true)
Classes
- AnimatedWidgetBuilder
- Builder that accumulates animation configuration Can be used directly as a Widget in widget trees
- AnimationConfig
- Animation configuration that can be chained
- DurationShorthand
- Helper class for shorthand duration notation Supports formats like: .500ms, .5s, .5m, 500ms, 5s, 5m
- Navigation animation builder
- Navigation animation configuration
- Swift navigation singleton
Enums
- Navigation type enum
- SlideDirection
- Direction for slide-in animations
Extensions
- AnimateExtension on Widget
- Extension to add animate() method to any Widget
- DurationNumberExtension on num
- Extension methods on numbers for duration shorthand Example: 500.ms, 0.5.s, 5.m
- DurationStringExtension on String
- Extension to create DurationShorthand from strings
- WidgetGestureExtensions on Widget
- Extension to add liquid tap effects to any widget using swift_animations
Properties
- swift → SwiftNavigation
-
Global swift navigation instance
final