Question: I'm looking to animate the scale of a container using the [transform](https://docs.flutter.io/flutter/widgets/AnimatedContainer/transform.html) property of an [AnimatedContainer](https://docs.flutter.io/flutter/widgets/AnimatedContainer-class.html); however, the scale is not being transitioned and jumps directly from start to end.

Code Snippet:

```
var container = new AnimatedContainer(
  duration: const Duration(milliseconds: 200),
  width: 50.0,
  height: 50.0,
  // selected is a bool that will be toggled
  transform: selected ? new Matrix4.identity() : new Matrix4.identity().scaled(0.2,0.2),
  decoration: new BoxDecoration(
    shape: BoxShape.circle,
    backgroundColor: Colors.blue[500],
  ),
  child: new Center(
    child: new Icon(
      Icons.check,
      color: Colors.white,
    ),
  )
);

```

Any insight on what's going on?

Answer: 
I'm afraid `transform` is one of the properties we don't animate (`child` is another). If you want to animate the scale, you can use ScaleTransition.

ScaleTransition: <https://docs.flutter.io/flutter/widgets/ScaleTransition-class.html>

Bug for Matrix lerp: <https://github.com/flutter/flutter/issues/443>
AnimatedContainer supports animting it's transform value, as follow:

```
/// scale to 95%, centerred
final width = 200.0;
final height = 300.0;
bool shouldScaleDown = true;// change value when needed
AnimatedContainer(
  color: Colors.blueAccent,
  width: width,
  height: height,
  duration: Duration(milliseconds: 100),
  transform: (shouldScaleDown
      ? (Matrix4.identity()
        ..translate(0.025 * width, 0.025 * height)// translate towards right and down
        ..scale(0.95, 0.95))// scale with to 95% anchorred at topleft of the AnimatedContainer
      : Matrix4.identity()),
  child: Container(),
);

```