getPath method

String getPath()

Get current context path

Implementation

String getPath() {
  BuildContext? _parent = this;
  var segments = <PathSegment>[];
  while (_parent != null && _parent is! ServiceOwnerMixin) {
    if ((_parent as Binding?) is RouteBinding) {
      segments.add((_parent as RouteBinding).component.segment);
    }
    _parent = _parent._parent;
  }
  return "/${segments.map((e) => e.name).join("/")}";
}