allSegments method

List<String> allSegments({
  1. bool includeEmpty = false,
})

Collects top-most matched segments from all child-matches

if includeEmpty is true empty segments will be included in the list

Implementation

List<String> allSegments({bool includeEmpty = false}) => [
      if (segments.isEmpty && includeEmpty) '',
      ...segments,
      if (hasChildren) ...children!.last.allSegments(includeEmpty: includeEmpty)
    ];