findPathTo method

List<AutoRoute> findPathTo(
  1. String routeName
)

Finds the track to a certain route in the routes-tree

This is mainly used to try adding parent routes to the navigation sequences when pushing child routes without adding their parents to stack first

returns and empty list if the track is not found

Implementation

List<AutoRoute> findPathTo(String routeName) {
  final track = <AutoRoute>[];
  for (final route in routes) {
    if (_findPath(route, routeName, track)) {
      break;
    }
  }
  return track;
}