forked from eatvio/eatvio_app
12 lines
421 B
Dart
12 lines
421 B
Dart
/// Joins an API media path with [baseUrl].
|
|
///
|
|
/// Uploaded photos come back as relative paths (`/storage/...`).
|
|
/// Default avatars are already absolute (`https://ui-avatars...`) and must stay as-is.
|
|
String joinBaseUrl(String baseUrl, String path) {
|
|
final normalized = path.toLowerCase();
|
|
if (normalized.startsWith('https://') || normalized.startsWith('http://')) {
|
|
return path;
|
|
}
|
|
return '$baseUrl$path';
|
|
}
|