process method
- FilePickerConfig config,
- FileWrapper file
override
method that is to be implemented.
Implementation
@override
Future<FileWrapper> process(FilePickerConfig config, FileWrapper file) async {
if (kIsWeb || file.content is! XFile) return file;
final String photoDir = path.dirname(file.xFilePath);
final String epoch = DateFormat('yyyyMMdd_HHmmssSSS').format(DateTime.now());
final String fileName = '${file.type.toPrefix()}_$epoch${path.extension(file.xFilePath)}';
final String newPath = path.join(photoDir, fileName);
final File photoFile = File(file.xFilePath).renameSync(newPath);
return FileWrapper(file.type, ZdsXFile.fromFile(photoFile));
}