AnimateCon is a lightweight and easy-to-use Flutter animation container that enables developers to effortlessly implement zooming, panning, and rotating animations. By utilizing AnimateCon, developers can seamlessly create complex and engaging animations within Flutter applications, thereby enhancing the overall user experience and making the interface more dynamic and interactive.
Install the AnimateCon
dependencies:
animatecon: latest
flutter packages get
import 'package:animatecon/animatecon.dart';
// add animate container
body: Center(
child: AnimateCon(
key: _key,
initProp: const {"alpha": 0},
child: Container(
width: 200,
height: 200,
color: Colors.blue,
)
),
),
/// control animate
final GlobalKey<AnimateConState> _key = GlobalKey<AnimateConState>();
bool _btnEnabled = true;
void _animate() {
if (!_btnEnabled) return;
_key.currentState!.animate({"y": 100, "alpha": 0.0}, {"y": 0.0, "alpha": 1.0},
time: 500, ease: animateEase.back.easeOut, onComplete: () {
_btnEnabled = true;
});
_btnEnabled = false;
}
/// animate scale position alpha props
_key.currentState!.animate({"y": 100, "scale": 0.0}, {"y": 0.0, "scale": 1.0},
time: 500, ease: animateEase.back.easeOut);
/// stop animate
_key.currentState!.stop();
AnimateCon is licensed under MIT license. View license.https://github.com/flutterkit/AnimateCon/blob/master/LICENSE