Dart Reference v2.0

Retrieve public URL

Retrieve URLs for assets in public buckets

  • The bucket needs to be set to public, either via updateBucket() or by going to Storage on supabase.com/dashboard, clicking the overflow menu on a bucket and choosing "Make public"
  • Policy permissions required:
    • buckets permissions: none
    • objects permissions: none
  • Refer to the Storage guide on how access control works
Parameters
    path
    REQUIRED
    String

    The path and name of the file to generate the public URL for. For example folder/image.png.

    transform
    Optional
    TransformOptions

    Transform the asset before serving it to the client.


final String publicUrl = supabase
  .storage
  .from('public-bucket')
  .getPublicUrl('avatar1.png');