ImageStorageClient class
Image and files have separate clients (e.g. images can be resized, whereas files cannot).
Once the upload is completed the URL of the file/image is returned and is ready for use.
The returned URL is served via CDN and can be requested by anyone.
In order to avoid resource enumeration attacks, a unique signature is added. Manipulating the returned URL will likely result in HTTP errors.
Constructors
- ImageStorageClient(ImagesAPI _images, {Token? userToken, String? secret})
-
Initializes a ImageStorageClient object
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secret → String?
-
Your API secret
final
- userToken → Token?
-
Your user token obtain via the dashboard.
Required if you are using the sdk client side
final
Methods
-
delete(
String url) → Future< void> - Images can be deleted using their URL.
-
get(
String url) → Future< String?> - Images can be obtained using their URL.
-
getCropped(
String url, Crop crop) → Future< String?> - Crop an image using its URL. A new URL is then returned by the API.
-
getResized(
String url, Resize resize) → Future< String?> - Resize an image using its URL. A new URL is then returned by the API.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refreshUrl(
String targetUrl) → Future< String?> - Explicitly refresh CDN urls for uploaded images on the Stream CDN (only needed for files on the Stream CDN).
-
thumbnail(
String url, Thumbnail thumbnail) → Future< String?> - Generate a thumbnail for a given image url
-
toString(
) → String -
A string representation of this object.
inherited
-
upload(
AttachmentFile image, {OnSendProgress? onSendProgress, CancelToken? cancelToken}) → Future< String?> -
Uploading an image
input is a
MultipartFile
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited