TogeFileUploadWidget constructor
const
TogeFileUploadWidget({
- Key? key,
- required String uploadTitle,
- String? systemTrayTitle,
- List<
TogeFileUploadSource> ? sources, - String? title,
- Widget? uploadIconWidget,
- int maxFileSizeInMB = 5,
- String? errorMessageBuilder()?,
- int maxUpload = 1,
- bool isModalDismissible = true,
- String? subLabelOne,
- String? subLabelTwo,
- List<
TogeFileUploadFileType> ? allowedFileTypes, - bool allowDuplicateFiles = false,
- void onFilesChanged(
- List<
TogeFileUploadEntity> files
- List<
- void onFileAdded(
- TogeFileUploadEntity file
- void onFileRemoved(
- TogeFileUploadEntity file
- void onFileReplaced(
- TogeFileUploadEntity oldFile,
- TogeFileUploadEntity newFile
- void onReplaceTap(
- int index,
- TogeFileUploadSource source
- Future<
bool> onUploadTap()?, - List<
TogeFileUploadEntity> ? initialFiles, - String? takePhotoLabel,
- String? photoGalleryLabel,
- String? fileStorageLabel,
- String? replaceFileLabel,
- bool viewOnly = false,
Implementation
const TogeFileUploadWidget({
super.key,
required this.uploadTitle,
this.systemTrayTitle,
this.sources,
this.title,
this.uploadIconWidget,
this.maxFileSizeInMB = 5,
this.errorMessageBuilder,
this.maxUpload = 1,
this.isModalDismissible = true,
this.subLabelOne,
this.subLabelTwo,
this.allowedFileTypes,
this.allowDuplicateFiles = false,
this.onFilesChanged,
this.onFileAdded,
this.onFileRemoved,
this.onFileReplaced,
this.onReplaceTap,
this.onUploadTap,
this.initialFiles,
this.takePhotoLabel,
this.photoGalleryLabel,
this.fileStorageLabel,
this.replaceFileLabel,
this.viewOnly = false,
}) : assert(
maxFileSizeInMB > 0,
'Max file size must be greater than 0',
);