I have a segmented control and, in one of its pages, I have a webview. I want to close my web view automatically when I change page from the segmented control. Some suggestion?
Asked
Active
Viewed 2,601 times
2 Answers
1
you may work on the dispose event of your StateFullWidget
and close your webview when your component or page disposed :
@override
void dispose() {
// close the webview here
super.dispose();
}

khairy Mohamed
- 178
- 6
0
No need to do dispose, just use Navigator.pushReplacement will take care of all.

ViKi Vyas
- 691
- 5
- 16