createArchive method
Create a zip archive from a directory
Implementation
Future<File> createArchive(Directory sourceDir, File outputFile) async {
if (!sourceDir.existsSync()) {
throw WalletException(
'Source directory does not exist: ${sourceDir.path}');
}
try {
final encoder = ZipFileEncoder();
encoder.zipDirectory(sourceDir, filename: outputFile.path);
return outputFile;
} catch (e) {
throw WalletException('Failed to create archive: $e');
}
}