StorageController<K extends UploadFileParams, L extends UploadFileResponse?, M extends UploadFileStatus> class
abstract
Class containing properties and methods dealing with Upload of files.
- Inheritance
-
- Object
- RenovationController
- StorageController
- Implementers
Constructors
- StorageController(RenovationConfig config)
Properties
- config → RenovationConfig
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
checkFolderExists(
String folderDir) → Future< RequestResponse< bool?> > - Returns bool within RequestResponse after querying the folder in the backend.
-
clearCache(
) → void -
Clears the cache. Currently empty method
override
-
createFolder(
{required String folderName, String? parentFolder}) → Future< RequestResponse< bool?> > - Returns bool within RequestResponse after creating folder.
-
getByteList(
dynamic file) → Uint8List - Returns the file as Uint8List of a file.
-
getCore(
) → Renovation -
Gets the reference to the Renovation instance
inherited
-
getFileSize(
dynamic file) → int - Returns the file size depending on whether it's Uint8List or File.
-
getHostUrl(
) → String -
Returns the configured host URL towards the backend
inherited
-
getUrl(
String ref) → String? - Returns the URL appended to the reference of the file.
-
handleError(
String errorId, ErrorDetail error) → ErrorDetail -
Returns the
ErrorDetail
after manipulating an existing one.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
uploadFile(
K uploadFileParams) → BehaviorSubject< M> -
Returns a
BehaviorSubject
that emit UploadFileStatus as the upload progresses using socket.io. -
uploadViaHTTP(
K uploadFileParams) → Future< RequestResponse< L> > - Returns UploadFileResponse on uploading of file. This method should be used if uploadFile fails.
-
validateUploadFileArgs(
K uploadFileParams) → void - Validate the arguments of the file to be uploaded.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited