extractPath static method

String extractPath(
  1. String url
)

Extracts the path from a full TMDB image URL.

Implementation

static String extractPath(String url) {
  if (url.isEmpty) return '';
  final uri = Uri.parse(url);
  final pathSegments = uri.pathSegments;
  if (pathSegments.length < 2) return '';
  // Return only the last segment (the actual file path).

  return '/${pathSegments.last}';
}