I am trying to push a MaterialPageRoute
using Navigator.of(context).push(...);
. The widget being pushed is just a Scaffold
with a transparent color as its backgroundColor
. However, when the screen is pushed, the transparent color is ignored and the previous screen remains invisible. How can this be fixed?
By the way, the only reason I am using Navigator.of(context).push(...);
instead of showDialog(...);
is because of bias towards the transition effect when pushing using Navigator.of(context).push(...);
2
Answers
You can try using
PageRouteBuilder
instead ofMaterialPageRoute
:It also supports transitions.
There are different ways to push a transparent route.
Option 1
Option 2