pathJoin method
Implementation
String pathJoin(List<String> parts) {
var separator = '/';
final replace = RegExp(r'$separator{1,}');
return parts
.join(separator)
.replaceAll(replace, separator)
.replaceAll('http:/', 'http://')
.replaceAll('https:/', 'https://');
}