didReplace method
function for checking and handling routes Replace route
behavior and stop playing audio.
Implementation
@override
void didReplace({Route<dynamic>? newRoute, Route<dynamic>? oldRoute}) {
if (newRoute is PageRoute<dynamic>) {
_handleRouteChanged(newRoute);
}
}