App not exiting after clicking on back button android?

I don’t know if it was expected or i miss something in docs,android backbutton(the one in default navigation bar of android) is working file if i’m in routes. But if i’m at main page, it’s not exiting the app.How to achieve the same