getImageUrl static method

Future<String?> getImageUrl(
  1. String filePath
)

Retrieves the download URL for a file stored in Firebase Storage.

  • filePath: The storage path of the file.

Returns the download URL on success, or null on failure.

Implementation

static Future<String?> getImageUrl(String filePath) async {
  try {
    return await _storage.ref(filePath).getDownloadURL();
  } catch (e) {
    debugPrint("Error fetching image URL: $e");
    return null;
  }
}