Is there a way in Flutter to navigate to a page gradually by sliding

Viewed 126

Here is my problem. I would like that by dragging progressively (with my finger for example) up a container (Container) that this one moves following the movement but that a new page (NewPage) towards which I want to navigate is supperposed on the container while following the movement until a certain level when I release, that the page takes all the screen. (Let's say I want to do a Navigator.push but in this sense).

Something like this

Thank you.

class NewPage extends StatelessWidget {
   ...
   @override
   Widget build(BuildContext context) {
      return Scaffold(...);
   }
}

...

class _MainPageState extends State<MainPage> {
   ...
   @override
   Widget build(BuildContext context) {
      return Scaffold(
         body: Stack(
            children: [
               ...
               GestureDetector(
                  child: Positioned(
                     ...
                     child: Container()
                  )
               )
            ]
         )
      );
   }
}
1 Answers

Your question is a bit unclear. But try these different navigation techniques.

  1. Hero Animations
  2. PageView - Try this with scrollDirection: Axis.vertical
Related