Navigator pushReplacement initState

PHOTO EMBED

Sun Nov 06 2022 16:07:53 GMT+0000 (Coordinated Universal Time)

Saved by @macdac #dart

class _SplashScreenState extends State<SplashScreen> {
  
  @override
  initState() {
    super.initState();

    Future.delayed(const Duration(seconds: 3), () {
      Navigator.of(context).pushReplacement(
        MaterialPageRoute(
          builder: (context) => Wrapper(),
        ),
      );
    });
  }

// other methods 

}
content_copyCOPY

https://stackoverflow.com/questions/69779734/navigator-pushreplacement-error-in-flutter