I'm using flutter for the web.
The page is transitioning with Navigator.of(context).pushNamed(Home.route);, but the animation is played at this time.
Is it possible to disable this animation?
I wrote the following code in the main() function of main.dart.
MaterialApp(
initialRoute: '/home',
routes: {
'/home': (context) => Home(),
'/profile': (context) => Profile(),
},
@immutable
class Home extends StatelessWidget {
static const String route = '/home';
....
}
@immutable
class Profile extends StatelessWidget {
static const String route = '/profile';
....
}
And as I mentioned earlier, the following code is used to transition the page.
Navigator.of(context).pushNamed(Home.route);
I was able to transition pages without animation by using Navigator.push, but I want to use Navigator.of(context).pushNamed() because the link does not change.
Does anyone know how to disable animation while still using Navigator.of(context).pushNamed()?
Thank you.