open method

  1. @override
Future<Archive?> open(
  1. FileSystemEntity file,
  2. String? password
)
override

Opens a ZIP or exploded archive.

Implementation

@override
Future<Archive?> open(FileSystemEntity file, String? password) async =>
    waitTryOrNull(() async {
      if (await FileSystemEntity.isDirectory(file.path)) {
        return explodedArchiveFactory.open(file, password);
      } else {
        try {
          return await zipFactory.open(file, password);
        } on Exception catch (e, st) {
          Fimber.d("ERROR open archive", ex: e, stacktrace: st);
          return null;
        }
      }
    });