currentSegments property

List<RouteMatch> currentSegments

Collects the top-most visitable current-child of every top-most nested controller considering this controller as root

Implementation

List<RouteMatch> get currentSegments {
  var currentData = currentChild;
  final segments = <RouteMatch>[];
  if (currentData != null) {
    segments.add(currentData.route);
    final childCtrl = _innerControllerOf(currentData.key);
    if (childCtrl?.hasEntries == true) {
      segments.addAll(childCtrl!.currentSegments);
    } else if (currentData.hasPendingChildren) {
      segments.addAll(
        currentData.pendingChildren.last.flattened,
      );
    }
  }
  return segments;
}