I use the bottom navigation bar. Various pages remain stacks through push on A_Page, one of the bottom navigation items.
If you press the button on the top page, I want to clear all stacked pages, leaving only A_Page, the first page of the bottom navigation item. I think using Navigator.pop several times is a bad code.
How do I clear a pushed page except the first bottom navigation item page?
Navigator.popUntil(context, (route) => route.isFirst);