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