Skip to main content

raptorq_flutter 0.1.1 copy "raptorq_flutter: ^0.1.1" to clipboard
raptorq_flutter: ^0.1.1 copied to clipboard

Thin Flutter wrapper around the raptorq Rust crate (RaptorQ, RFC 6330).

raptorq_flutter #

A thin Flutter wrapper around the raptorq Rust crate (RaptorQ, RFC 6330). It was made so the BlastQR app could use raptorq from Flutter, and exposes little more than the crate itself.

The Dart bindings are generated with flutter_rust_bridge, and the Rust code is built with Dart build hooks.

Supports Android, iOS, macOS, Linux and Windows. Not web.

Requirements #

The Rust code is compiled when your app builds, so you need Rust installed with rustup and Flutter 3.41 or newer.

Usage #

await RaptorQFlutter.init();

final encoder = await RaptorQEncoder.newInstance(data: bytes, mtu: 1280);
final oti = encoder.oti();
final packets = await encoder.getEncodedPackets(repairPacketsPerBlock: 10);

final decoder = await RaptorQDecoder.newInstance(oti: oti);
Uint8List? result;
for (final packet in packets) {
  result = await decoder.addPacket(packet: packet);
  if (result != null) break;
}

For streaming, sourcePackets and repairPackets return packets in ranges.

Input is not validated. Malformed packets, a mismatched ObjectTransmissionInfo, or repairPackets past maxRepairPackets() can throw a PanicException or give wrong output.

License #

MIT. raptorq is licensed under Apache-2.0.

0
likes
150
points
497
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Thin Flutter wrapper around the raptorq Rust crate (RaptorQ, RFC 6330).

Repository
View/report issues

Topics

#raptorq #fountain-code #forward-error-correction #ffi #rust

License

MIT (license)

Dependencies

code_assets, flutter, flutter_rust_bridge, hooks, native_toolchain_rust

More

Packages that depend on raptorq_flutter