Skip to main content

zstandard_windows 1.5.6 copy "zstandard_windows: ^1.5.6" to clipboard
zstandard_windows: ^1.5.6 copied to clipboard

PlatformWindows

Windows implementation of the Zstandard compression plugin for Flutter applications.

pub package

zstandard_windows #

The Windows implementation of the zstandard Flutter plugin. Uses FFI and the native Zstandard C library.

Installation #

Add the main plugin to your app; this package is included automatically via the federated plugin:

dependencies:
  zstandard: ^1.5.0

No extra setup is required for normal use.

Usage #

Use the main zstandard API; the Windows implementation is selected automatically on Windows:

import 'package:zstandard/zstandard.dart';

void main() async {
  final zstandard = Zstandard();
  final data = Uint8List.fromList([1, 2, 3, 4, 5]);

  final compressed = await zstandard.compress(data, 3);
  final decompressed = await zstandard.decompress(compressed ?? Uint8List(0));
}

Or use the extension methods:

final compressed = await data.compress(compressionLevel: 3);
final decompressed = await compressed?.decompress();

API #

  • ZstandardWindows() — Creates the Windows platform implementation.
  • compress(Uint8List data, int compressionLevel) — Compresses data (level 1–22). Returns compressed bytes or null.
  • decompressWithOptions(Uint8List data, {int maxOutputSize}) — Decompresses complete, concatenated, or unknown-size zstd frames with a bounded output (256 MiB by default). Invalid, truncated, or oversized input returns null.
  • getPlatformVersion() — Returns a platform identifier string.

Architecture #

This package uses Dart FFI to load zstandard_windows.dll; CMake builds it with the Flutter application. Public work runs in a worker isolate using Dart-owned bytes, and decompression enforces the configured output limit as it streams. Both x64 and arm64 are supported.

Testing #

From the package directory:

flutter test

Unit tests run only on Windows (skipped on other platforms). For integration tests, run the main zstandard example app on Windows.

Troubleshooting #

  • DLL not found: Build your app with flutter build windows or run from the Flutter Windows runner so the native library is built and placed next to the executable.
  • Wrong architecture: Build for the correct target (x64 or arm64).

See the documentation for more.

0
likes
160
points
49.6k
downloads

Documentation

API reference

Publisher

verified publishervyp.dev

Weekly Downloads

Windows implementation of the Zstandard compression plugin for Flutter applications.

Homepage
Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

ffi, flutter, zstandard_native, zstandard_platform_interface

More

Packages that depend on zstandard_windows

Packages that implement zstandard_windows