I am trying to do a Page transition using a circle in the center of the first view that expands revealing second view.
In alternative, it's the same if I use a widget with a transparent hole in the center (and we can see the bottom widget through the hole), and with an animation that expands the hole revealing the widget in the bottom.
The only answer I found similar to what I'm trying to do is this:
How to create widget with transparent hole in flutter
but I am not able to use a widget instead of the circle ping the center of the screen.
use
HoleMaterialPageRouteinstead ofMaterialPageRoute- note that you can completely removetransitionDurationif the default duration is ok with you, also you can removelate final curve = CurvedAnimation(and useanimation.valueinstead ofcurve.valuebut in my opinion non linear radius growth looks better :-)EDIT
in some cases a better solution is to use
ThemeData.pageTransitionsThemeso that you can useNavigator.pushNamedorNavigator.pushwith "normal"MaterialPageRoute(you dont have to change yourNavigatorrelated code)to do so you have to create a custom
PageTransitionsBuilder:and use it like that (this is a case for linux platform where i tested my code):