navigateToScreen method

void navigateToScreen(
  1. String route
)

Safely navigate to screen

Implementation

void navigateToScreen(String route) {
  if (navigatorKey.currentContext != null) {
    navigatorKey.currentContext!.goNamed(route);
  } else {
    dev.log('❌ Navigator not attached. Cannot navigate to: $route');
  }
}