addFile method

Future<(FileRecord, bool)> addFile(
  1. String path, {
  2. Map<String, dynamic> extraInfo = const {},
  3. bool isCancelled()?,
  4. void onProgress(
    1. double progress
    )?,
})

Add Any File

Implementation

Future<(FileRecord, bool)> addFile(
  String path, {
  Map<String, dynamic> extraInfo = const {},
  bool Function()? isCancelled,
  void Function(double progress)? onProgress,
}) async {
  final fileRecord = FileRecord.fromPath(path, extraInfo: extraInfo);
  final (record, result) = await addRecord(
    fileRecord,
    isCancelledFile: isCancelled,
    onProgressFile: onProgress,
  );
  return (record as FileRecord, result);
}