Is your feature request related to a problem? Please describe.
The storageFileApi class has a function to convert file paths to public url's. These urls are very simple and just concatenate the file path with some fixed strings. When deleting a file however, you need the path again.
Describe the solution you'd like
Instead of having to save the file path separately or converting the public url to a path manually before removing a file. I suggest implementing a function that converts the public url back to a file path.
Describe alternatives you've considered
Right now I manually convert the public url to the path again using
final filePath = publicUrl.replaceAll('${SupabaseClient.storageUrl}/object/public/avatars/', '');
Feature request
Is your feature request related to a problem? Please describe.
The
storageFileApi
class has a function to convert file paths to public url's. These urls are very simple and just concatenate the file path with some fixed strings. When deleting a file however, you need the path again.Describe the solution you'd like
Instead of having to save the file path separately or converting the public url to a path manually before removing a file. I suggest implementing a function that converts the public url back to a file path.
Describe alternatives you've considered
Right now I manually convert the public url to the path again using
so it can be used when deleting the file
but I feel this can be easily built in.
Solution
it can be as simple as adding this function which is just the
getPublicUrl()
function but in reverse.