getBackdropUrl static method

String getBackdropUrl(
  1. String? path, {
  2. String size = 'w780',
})

Creates a backdrop URL with the specified size.

Implementation

static String getBackdropUrl(String? path, {String size = 'w780'}) {
  if (path == null || path.isEmpty) return '';
  // Remove any existing size prefixes.

  final cleanPath = path.replaceAll(RegExp(r'/[a-z0-9]+/'), '');
  return '$_baseUrl/${backdropSizes[size] ?? backdropSizes['w780']!}$cleanPath';
}