extractAllFiles method

Future<void> extractAllFiles({
  1. required Directory outDir,
  2. bool isCancelled()?,
  3. void onProgress(
    1. double progress
    )?,
})

Extract All File

Implementation

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

  for (var file in await readAllFiles()) {
    final savePath = '${outDir.path}${Platform.pathSeparator}${file.name}';
    await file.extract(
      raf,
      savePath: savePath,
      isCancelled: isCancelled,
      onProgress: onProgress,
    );
  }
  await raf.close();
}