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<String>? segments]) {
if (segments == null || segments.isEmpty) {
return path;
}
final Iterable<String> list = segments.map((String e) => "/$e");
return path + list.join();
}