pushNamedAndRemove method
Implementation
void pushNamedAndRemove(
{required String name, Object? arguments, Widget? emptyPage}) {
if (_pages.isNotEmpty) {
_pages.clear();
}
pushNamed(name: name, arguments: arguments, emptyPage: emptyPage);
}