Edin
Edin

Reputation: 898

how to avoid bottom overflowed while animation - Flutter

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

Upvotes: 3

Views: 5153

Answers (1)

OMi Shah
OMi Shah

Reputation: 6186

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

Upvotes: 10

Related Questions