I have one StatefulWidget in Flutter with button, which navigates me to another StatefulWidget using Navigator.push(). On second widge
StatefulWidget
Navigator.push()
The Easy Trick is to use the Navigator.pushReplacement method
Page 1
Navigator.pushReplacement( context, MaterialPageRoute( builder: (context) => Page2(), ), );
Page 2
Navigator.pushReplacement( context, MaterialPageRoute( builder: (context) => Page1(), ), );