StaticApiImage class
A class to handle API interactions for static images.
Constructors
-
StaticApiImage.new(String imgName, {required String baseImgUrl, required Future<
String> genToken()}) - Constructor for StaticApiImage.
Properties
- baseImgUrl → String
-
The base URL for image-related API endpoints.
final
- deleteUrl → String
-
The URL for deleting the image.
no setter
- downloadUrl → String
-
The URL for downloading the image.
no setter
-
genToken
→ Future<
String> Function() -
A function to generate an authentication token.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imgName → String
-
The name of the image.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- uploadUrl → String
-
The URL for uploading the image.
no setter
Methods
-
deleteImage(
) → Future< void> - Deletes the image from the server. Throws an exception if the deletion fails.
-
getNetworkImage(
) → Future< Widget> - Fetches the image from the network and returns it as a Widget. If the request fails, returns a placeholder SizedBox.
-
getToken(
) → Future< String> - Generates a query parameter with the authentication token.
-
getToken2(
) → Future< String> - Generates an alternative query parameter with the authentication token.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
uploadImage(
Uint8List uploadedImage) → Future< void> - Uploads an image to the server. Throws an exception if the upload fails.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited