animated 2.0.0 copy "animated: ^2.0.0" to clipboard
animated: ^2.0.0 copied to clipboard

A very simple (yet powerful) implicit animation library for Flutter.

example/main.dart

import 'package:animated/animated.dart';
import 'package:flutter/material.dart';

class Example extends StatefulWidget {
  @override
  _ExampleState createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  bool scaled = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: GestureDetector(
        onTap: () {
          setState(() {
            scaled = !scaled;
          });
        },
        child: Animated(
          value: scaled ? 1 : 0.5,
          curve: Curves.easeInOut,
          duration: Duration(milliseconds: 300),
          builder: (context, child, animation) => Transform.scale(
            scale: animation.value,
            child: child,
          ),
          child: Container(
            width: 40,
            height: 40,
            color: Colors.red,
          ),
        ),
      ),
    );
  }
}
31
likes
130
pub points
88%
popularity

Publisher

unverified uploader

A very simple (yet powerful) implicit animation library for Flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on animated