title: Flutter - Transform scale in center of Container
body: <p>I'm trying to create a flip effect, but before starting with the animation I'm trying to make the transformation stay in the center of the container.</p>
  
  <p>But even using <code>FractionalOffset(0.5, 0.5)</code> or <code>Center()</code> wrapping the <code>Transform()</code> result remains on the top of the <code>Container</code>, as in the image below.</p>
  
  <p>Could you help me leave it in the center of the container?</p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  void main() {
    runApp(new MyApp());
  }
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return new MaterialApp(
        home: new MyHomePage(),
      );
    }
  }
  
  class MyHomePage extends StatelessWidget{
    @override
    Widget build(BuildContext context) {
      return new Scaffold(
        appBar: new AppBar(),
        body: new Center(
          child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: &lt;Widget&gt;[
              new Container(
                alignment: new FractionalOffset(0.5, 0.5),
                height: 144.0,
                width: 360.0,
                decoration: new BoxDecoration(
                  border: new Border.all(color: new Color(0xFF9E9E9E))
                ),
                child: new Transform(
                  transform: new Matrix4.identity()..scale(1.0, 0.05),   
                    child: new Container(
                    decoration: new BoxDecoration(
                      color: new Color(0xFF005CA9),        
                    ),        
                  ), 
                )         
              )         
            ],
          ),
        ),
      );
    }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/g2lON.png" rel="noreferrer"><img src="https://i.stack.imgur.com/g2lON.png" alt="enter image description here"></a></p>