uploadToPublic method
Uploads the selected file directly to the storage's public/userId folder.
Pass [relativeDirPath] the relative path (within the public/userId folder) of the folder where you want to upload the file.
After uploading, the public URL is returned after the upload.
You can also specify the maximum vertical and horizontal size of the image by passing limitSize.
This value is applied if PickerMasamuneAdapter.forceImageResize is true.
ピックアップしたファイルを直接ストレージのpublic/userIdフォルダにアップロードします。
relativeDirPathにファイルをアップロードしたいフォルダの相対パス(public/userIdフォルダ内)を渡してください。
アップロードした後、アップロード後の公開URLが返されます。
またlimitSizeを渡すことで、画像の縦および横の最大サイズを指定することが可能です。
PickerMasamuneAdapter.forceImageResizeがtrueの場合、この値が適用されます。
Implementation
Future<Uri> uploadToPublic(String userId,
{String relativeDirPath = "", int? limitSize}) {
return upload(
relativeDirPath:
"public/${userId.trimQuery().trimString("/")}/${relativeDirPath.trimStringLeft("/")}",
limitSize: limitSize,
);
}