aves_mio/lib/remote/url_utils.dart
Fabio Micheluz 452c378178
Some checks are pending
Quality check / Flutter analysis (push) Waiting to run
Quality check / CodeQL analysis (java-kotlin) (push) Waiting to run
f1
2026-02-28 13:42:46 +01:00

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]);
}