extractFile method

Future<void> extractFile(
  1. FileRecord fileRecord, {
  2. required String savePath,
  3. bool isCancelled()?,
  4. void onProgress(
    1. double progress
    )?,
})

Extract File

Implementation

Future<void> extractFile(
  FileRecord fileRecord, {
  required String savePath,
  bool Function()? isCancelled,
  void Function(double progress)? onProgress,
}) async {
  if (!isOpened) throw Exception('You Should Call -> SMDB.open()');
  final raf = await File(path).open();

  await fileRecord.extract(
    raf,
    savePath: savePath,
    isCancelled: isCancelled,
    onProgress: onProgress,
  );
  await raf.close();
}