flutter start new flow and the get back to main code example
Example: im going from first screen to second and from there to third but dont want to go back in flutter
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => MainPage()),
(Route<dynamic> route) => false,
);