buildPath static method

String buildPath(
  1. List<String> segments
)

buildPath('chats', '123') -> '/chats/123'; buildPath([]) -> '/'.

Implementation

static String buildPath(List<String> segments) {
  if (segments.isEmpty) return '/';
  return '/${segments.join('/')}';
}