title: How to Convert SizeTransition to FadeTransition for Flutter Codelab
body: <p>I'm new to Flutter and Dart. Hopes to get some guide on a tutorial exercise I'm stuck.</p>
  
  <p>I'm following Flutter Codelab <a href="https://codelabs.developers.google.com/codelabs/flutter/index.html?index=..%2F..index#6" rel="nofollow noreferrer">https://codelabs.developers.google.com/codelabs/flutter/index.html?index=..%2F..index#6</a> and able to do everything.</p>
  
  <p>There's an exercise it ask us to do that is</p>
  
  <p><em>Create a fade-in animation effect by wrapping the Container in a FadeTransition widget instead of a SizeTransition.</em></p>
  
  <p>The code as below</p>
  
  <pre><code>@override
  Widget build(BuildContext context) {
    return new SizeTransition(
      sizeFactor: new CurvedAnimation(
          parent: animationController, curve: Curves.easeOut),
      axisAlignment: 0.0,
      child: new Container(
        // ... other codes ...
      ),
    );
  }
  </code></pre>
  
  <p>So I change to FadeTransition, which requires <code>opacity</code> of type <code>Animation&lt;Double&gt;</code></p>
  
  <pre><code>@override
  Widget build(BuildContext context) {
    return new FadeTransition(
      opacity: animation
      child: new Container(
        // ... other codes ...
      ),
    );
  }
  </code></pre>
  
  <p>How could I create or send in the <code>animation</code>? (the above code will have <code>animation</code> unrecognizable).</p>