onFileReplaced property

void Function(TogeFileUploadEntity oldFile, TogeFileUploadEntity newFile)? onFileReplaced
final

Optional callback triggered when a file is replaced.

This is useful for tracking the replacement of files. This callback is executed when a file is replaced in the upload list.

  • The callback receives the old and new file as parameters.
  • This can be used to update the UI or perform additional actions when a file is replaced.
  • If the callback is not provided, no action will be taken when a file is replaced.
  • The old file is the file that was replaced.
  • The new file is the file that replaced the old one.

Implementation

final void Function(
  /// The old file that was replaced.
  TogeFileUploadEntity oldFile,

  /// The new file that replaced the old one.
  TogeFileUploadEntity newFile,
)? onFileReplaced;