I just realized that flutter re-render all pages in histories stack when navigation changes. In my case I don't want to render page below of all my stack page histories. I just want to render my current page only.
First Page
Widget build(BuildContext context){
print("1st page");
return RaisedButton(onPressed: goToSecondPage())
}
Second Page
Widget build(BuildContext context){
print("2nd page");
return RaisedButton(onPressed: goToThirdPage())
}
Third Page
Widget build(BuildContext context){
print("3rd page");
return Text("I am Third Page, The Last");
}
In my implementation I use Navigator.push(context, MaterialPageRoute(builder: (_) => SecondPage())
to navigate.
Log scenario: startup
1st page
go to second page
2nd page
1st page
go to third page
3rd page
2nd page
1st page
back to second page
2nd page
1st page