createPath static method

String createPath(
  1. String path, [
  2. Iterable? segments
])

Create a String path of the segments provided if any.

Implementation

static String createPath(String path, [Iterable<dynamic>? segments]) {
  if (segments == null || segments.isEmpty) {
    return path;
  }
  final list = segments.map((e) => '/$e');
  return path + list.join();
}