how to avoid bottom overflowed while animation – Flutter

Issue

i have an AnimatedContainer and that container has an open/close animation when i tap on the container but there is a bottom overflowed by 38 pixels error.

shown in this video:

https://photos.google.com/share/AF1QipPsio8RS5BD0D1OzMbMA6sNCBamLF8nYEyml_-pPqKVe-tzza-PyvB3MQehdHKeNQ/photo/AF1QipPYOoZ6pOXARbd3SdpxY8OWegQxvFHtv2QNh7NQ?key=V0lhQnpPOWtCRm1RZ21yUnp6TkFZdmtKdWFuVk13

this is my code:

Column(
  children: <Widget> [
    GestureDetector(
      child: Container(
      duration: duration,
      child: all the content
    ),
    onTap: () {
      is_opened = !is_opened;  
    }
)
AniamtedOpacity(
  duration: duration,
  opacity: is_opened ? 1 : 0
      child: Container(
          child: Row(
            children: <Widget>[
              //Icons and texts
            ],
          ),
        ),
      ),
    ],
  )

thanks for the help

Solution

Wrap your AnimatedContainer widget with the expanded widget so that it can expand and take required space when tapped.

Answered By – OMi Shah

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *