In flutter for uploading image according to doc is
final avatarFile = File('path/to/file');
final response = await supabase
.storage
.from('avatars')
.upload('public/avatar1.png', avatarFile, fileOptions: FileOptions(
cacheControl: '3600',
upsert: false
));
So, how we can get the downloadUrl of this uploaded media ?
You can use the getPublicUrl method:
final res = supabase
.storage
.from('avatars')
.getPublicUrl('public/avatar1.png');
final publicURL = res.data;
See https://supabase.com/docs/reference/dart/storage-from-getpublicurl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With