// Just add mounted check in async func: // Add if (mounted) if (mounted) Navigator.pushReplacement(context, MaterialPageRoute(builder: (_) => const LoginScreen()));if (!mounted) return; Navigator.push(context, CupertinoPageRoute(builder: (context) => const SignUpScreen()));if (!mounted) return; Navigator.push( context, PageTransition( type: PageTransitionType.rightToLeft, child: const ResetEmailScreen()));