I am making a drawer in Flutter. And a refer and earn section in it. Now, whenever I click on that, I will be redirected to refer page. And when I will press back button on appbar, I come back to the drawer widget. This is working fine and accordingly. Now, I want that whenever I click on back button from refer page, my drawer should be closed and I reach to the main screen. How should i do it?