Wrap your screen widget with this to properly implement popping with system back button.
const RouterPage({ Key? key, required this.child, this.onWillPop, }) : super(key: key);