pushreplacementnamed for navigating in flutter code example
Example: flutter navigation pushreplacement
void _completeLogin() {
Navigator.pushReplacement(
context, MaterialPageRoute(builder: (BuildContext context) => MyHomePage()));
}
void _completeLogin() {
Navigator.pushReplacement(
context, MaterialPageRoute(builder: (BuildContext context) => MyHomePage()));
}