title: Obtaining parent size to use within child
body: <p>I am trying to put an AnimatedContainer inside my Expanded widget (since having the AnimatedContainer as the parent throws Flex errors), as I am using an event to resize two Expanded containers on three possible conditions. Both start off at 50/50 flex size, then on the second condition it changes to 25/75, the last condition it's 75/25. It worked well without the Animated container, but the size transition is instant and I would prefer to have it animate.</p>
  <p>This is essentially how things are setup at the moment:</p>
  <pre class="lang-dart prettyprint-override"><code>  Flex(
      direction: Axis.horizontal,
      crossAxisAlignment: CrossAxisAlignment.end,
      children: &lt;Widget&gt;[
        Expanded(  // &lt;---  I would like to get the current width of this
          flex: (target[expController.target][&quot;newsWidth&quot;]),
          child: AnimatedContainer(
            width: ?, // &lt;-- and use it here
            duration: Duration(milliseconds: 500),
            curve: Curves.fastOutSlowIn,
            child: NewsMainHome(),
          ),
        ),
        Spacer(flex: target[expController.target][&quot;spacer&quot;]),
        Expanded(
          flex: (target[expController.target][&quot;changeLogWidth&quot;]),
          child: AnimatedContainer(
            width: ?, // Set to parent size
            duration: Duration(milliseconds: 500),
            curve: Curves.fastOutSlowIn,
            child: ChangeLogList(),
          ),
        ),
      ],
    ),
  </code></pre>
  <p>It would be nice to be able to set the AnimatedContainer width to the size of the parent Expanded width so it will animate the size transition when the Expanded flex value changes from the event, but I have yet to find a decent way to go about it. Any ideas/suggestions?</p>
  <p>Thanks,<br />
  -MH</p>