FirebaseUrl constructor

FirebaseUrl(
  1. String url, {
  2. FirebaseApp? app,
})

The FirebaseUrl of the Cloud Storage image

FirebaseUrl("gs://bucket_f233/logo.jpg")
FirebaseUrl("https://firebasestorage.googleapis.com/b/bucket/o/logo.jpg")

The url can either be a HTTP or Google Storage URL pointing to an object. You can specify FirebaseApp if you are multiple firebase projects in app

Use FirebaseUrl.fromReference if you want to use reference directly.

Implementation

factory FirebaseUrl(String url, {FirebaseApp? app}) {
  final _url = Uri.parse(url);
  final ref = getRefFromUrl(url, app);
  final urlStr = _url.toString();
  final String uniqueId = getUniqueId(urlStr) + path.extension(urlStr);

  return FirebaseUrl._(_url, ref, uniqueId);
}