FileUploadControllerModel constructor

FileUploadControllerModel({
  1. required FileUploaderRef ref,
  2. bool startOnInit = true,
  3. double progress = 0,
  4. FileUploadStatus status = FileUploadStatus.waiting,
})

The model that manages the upload state of a file. State is composed of:

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();
}