7 lines
404 B
Dart
7 lines
404 B
Dart
// lib/remote/url_utils.dart
|
|
Uri buildAbsoluteUri(String baseUrl, String relativePath) {
|
|
final base = Uri.parse(baseUrl.endsWith('/') ? baseUrl : '$baseUrl/');
|
|
final cleaned = relativePath.startsWith('/') ? relativePath.substring(1) : relativePath;
|
|
final segments = cleaned.split('/').where((s) => s.isNotEmpty).toList();
|
|
return base.replace(pathSegments: [...base.pathSegments, ...segments]);
|
|
}
|