navigateBack method
void
navigateBack({
Implementation
void navigateBack({required BuildContext context}) {
if (routeHistory.isNotEmpty) {
currentRoute = routeHistory.removeLast();
debugPrint("Navigating back to $currentRoute");
Navigator.pop(context);
} else {
debugPrint("Cannot navigate back; history is empty.");
}
}