AnimateZ: Flutter Package for Animating Widgets
Example Preview
Features
- Customizable animations: Define your own animation using
AnimationSpec
with properties likecurve
,duration
, andtween
. - Pre-defined animation types: Choose from predefined animation types like
rotate
,flip
, andscale
. - Easy to use: Wrap your child widget with
AnimateZWidget
and specify the desired animation parameters.
Usage
- Import the package:
import 'package:animate_z/animate_z.dart';
- Use the
AnimateZWidget
:
AnimateZWidget(
child: Icon(Icons.star),
animate: true,
animationType: AnimationType.rotate, // Or AnimationType.flip, AnimationType.scale
customAnimation: AnimationSpec(
curve: Curves.easeIn,
duration: Duration(milliseconds: 500),
tween: Tween<double>(begin: 0.0, end: 1.0), // Rotate 1 full turn
),
),
--OR--
AnimateZWidget(
child: Icon(Icons.star),
animate: true,
animationType: AnimationType.rotate, // Or AnimationType.flip, AnimationType.scale
),
Explanation:
- This example creates a rotating star icon.
animate
is set totrue
to enable animation.animationType
is set toAnimationType.rotate
.customAnimation
is used to define a custom animation with aneaseIn
curve, a duration of 500 milliseconds, and a rotation animation.
License
See the LICENSE file for details.