Slide widgets off screen in flutter


I ended up using an Animatable widget

And using a combination of a Stack() where I would animate offscreen elements to have negative offsets (via Positioned() children) based on the Animation and a TextField inside an Expanded()


I don't have access to the computer with the source code anymore, but you should be able to infer how to construct such a widget from the Flutter example gallery (this is how I was able to learn - specifically, look at the drawerdetails animation). I positioned the textfield and buttons in the same stack and animated the textfield size as well as the button position simultaneously

Author by


Updated on December 07, 2022


  • user3038457
    user3038457 20 days

    I currently have a Widget that has three elements -- two buttons and a text input. On text input focus I would like to slide the buttons off the screen and expand the text input to occupy the remaining width.

    Are there any flutter components (animation or otherwise) I can use to slide components off screen and animate the text field expansion?

  • Renan Coelho
    Renan Coelho about 3 years
    You just need to make use of SlideTransition widget