isOnStackTop method

bool isOnStackTop(
  1. String routeName,
  2. RouteLifecycleStateChanged routeLifecycleStateChanged
)

Implementation

bool isOnStackTop(
    String routeName, RouteLifecycleStateChanged routeLifecycleStateChanged) {
  if (_historyRoutes.isEmpty) return false;
  if (routeLifecycleDidChanges.isEmpty) return false;
  if (routeLifecycleDidChanges.entries.last.key ==
      getKey(routeName, routeLifecycleStateChanged)) {
    return routeName == _historyRoutes.last.settings.name;
  }
  return false;
}