createPath static method
Creates a path by concatenating the provided path
and segments
.
If segments
is null
or empty, the original path
is returned.
Otherwise, the path
is concatenated with each segment from segments
separated by a forward slash ('/').
Implementation
static String createPath(String path, [Iterable? segments]) {
if (segments == null || segments.isEmpty) {
return path;
}
final list = segments.map((e) => '/$e');
return path + list.join();
}