simple animations
simple animations is a powerful package to create beautiful custom animations in no time.
- �� fully tested
- �� well documented
- �� enterprise-ready
�� highlights
- easily create custom animations in stateless widgets
- animate multiple properties at once
- create staggered animations within seconds
- simplified working with animationcontroller instances
- debug animations
⛏️ getting started
add simple animations to your project by following the instructions on the
install page.
it contains multiple features. each covers a different aspect of making animation very simple.
feature | description |
---|---|
�� stateless animation | widgets for super simple creation of custom animations. |
�� timeline tween | animate multiple properties at once or create staggered animations. |
�� anicoto | setup managed animationcontrollers instantly. |
⏯ animation developer tools | debug animations or create them step by step. |
�� liquid | beautiful visual animations that increases the visual quality of your app. |
�� stateless animation
stateless animation provides a powerful set of flutter widgets that hide the most complex part of creating animations.
example: square with an animated background color.
import 'package:flutter/material.dart';
import 'package:simple_animations/simple_animations.dart';
import 'package:supercharged/supercharged.dart';
class myapp extends statelesswidget {
@override
widget build(buildcontext context) {
// create animation widget with type of animated variable
return playanimation<color?>(
tween: colors.red.tweento(colors.blue), // define tween
duration: 2.seconds, // define duration
builder: (context, child, value) {
return container(
color: value, // use animated value
width: 100,
height: 100,
);
});
}
}
note: we use supercharged extensions here. if you don’t like it, refer to this dependency-less example.
�� timeline tween
timeline tween is a mighty tool that enables you to tween multiple
properties or designing staggered animations in a single animatable
.
example: custom tween with multiple properties.
import 'package:flutter/material.dart';
import 'package:simple_animations/simple_animations.dart';
import 'package:supercharged/supercharged.dart';
// define animated properties
enum aniprops { width, height, color }
// design tween by composing scenes
final tween = timelinetween<aniprops>()
..addscene(begin: 0.milliseconds, duration: 500.milliseconds)
.animate(aniprops.width, tween: 0.0.tweento(400.0))
.animate(aniprops.height, tween: 500.0.tweento(200.0))
.animate(aniprops.color, tween: colors.red.tweento(colors.yellow))
..addscene(begin: 700.milliseconds, end: 1200.milliseconds)
.animate(aniprops.width, tween: 400.0.tweento(500.0));
note: we use supercharged extensions here. if you don’t like it, refer to this dependency-less example.
�� anicoto
anicoto fully manages your animationcontroller instances and handles initialization, configuration and disposing. no
more boilerplate code.
example: animated stateful widget with full-fledged animationcontroller instance.
import 'package:flutter/material.dart';
import 'package:simple_animations/simple_animations.dart';
import 'package:supercharged/supercharged.dart';
class mywidget extends statefulwidget {
@override
_mywidgetstate createstate() => _mywidgetstate();
}
// add animationmixin to widget's state
class _mywidgetstate extends state<mywidget> with animationmixin {
// declare animation variable
late animation<double> size;
@override
void initstate() {
// connect tween and controller and apply to animation variable
size = 0.0.tweento(200.0).animatedby(controller);
controller.play(); // start the animation playback
super.initstate();
}
@override
widget build(buildcontext context) {
return container(
width: size.value, // use animation variable's value
height: size.value, // use animation variable's value
color: colors.red,
);
}
}
⏯ animation developer tools
tired of watching the same animation over and over again, in order to fine tune it?
the animation developer tools allows you pause anywhere, scroll around, speed up, slow down or focus on a certain
interval of the animation.
�� liquid
liquid provides ready-to-use, stunning visual animations that can be explored and configured
with liquid studio.
Comments are closed.