zstandard
1.5.6, released 3 weeks ago by vyp.dev
Flutter plugin for fast Zstandard compression and decompression across native and WebAssembly.
What it does
Provides native and WebAssembly integration for the Zstandard (zstd) compression algorithm via FFI. It allows compressing and decompressing byte data synchronously or asynchronously using extension methods or the main Zstandard class.
AI-written summary of version 1.5.6, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need fast data compression or decompression for local storage, transmission, or backups.
- Your application targets multiple native platforms as well as the Web using WebAssembly.
Skip it when
- You only need simple string hashing or basic collections helpers without compression.
- You are targeting Fuchsia where native support is not available.
Strengths
- Cross-platform support including Android, iOS, Windows, macOS, Linux, and Web via WebAssembly.
- Offers both an object-oriented API and convenient extension functions on Uint8List.
Weaknesses
- Fuchsia is explicitly not supported.
- Requires proper native integration configurations.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 7
Add the dependency to pubspec.yaml; leverages native FFI and WebAssembly out of the box without complex manual linking steps for standard use.
void act() async {
final zstandard = Zstandard();
Uint8List original = Uint8List.fromList([...]);
Uint8List? compressed = await zstandard.compress(original);
final decompressed = compressed == null
? null
: await zstandard.decompress(compressed);
}Alternatives
Packages that do the same job and could replace zstandard.
- es_compression
Compression framework providing FFI implementations for Brotli, Lz4, and Zstd.
82Compare - gzip
A lightweight package for gzip compression and decompression.
50Compare - wasm_interop
Dart wrapper for the WebAssembly JavaScript API.
41Compare