FileUploadControllerModel constructor
FileUploadControllerModel({
- required FileUploaderRef ref,
- bool startOnInit = true,
- double progress = 0,
- FileUploadStatus status = FileUploadStatus.waiting,
The model that manages the upload state of a file. State is composed of:
FileUploadControllerModel.progress, track the file upload progress- FileUploadControllerModel.transformationProgress, track the file transformation progress
FileUploadControllerModel.status, file upload status
Expose uploadCallback and retryCallback to run the file upload. upload and retry run the same functions as uploadCallback and retryCallback
This model has everything needed to FileCard to show the file upload state.
Constructor
startOnInit to run the upload immediately
progress to set the initial progress
status to set the initial status
Implementation
FileUploadControllerModel({
required FileUploaderRef ref,
bool startOnInit = true,
double progress = 0,
FileUploadStatus status = FileUploadStatus.waiting,
}) : _ref = ref,
_startOnInit = startOnInit,
_progress = progress.clamp(0, 1),
_transformationProgress = 0,
_status = status {
_startup();
}