Skip to content
pubscout

brotli

0.6.0, released 4 years ago by tiagohm.dev

Pure Dart Brotli decoder

WASM-ready
$ flutter pub add brotli
Source repository

What it does

Decodes Brotli compressed data into bytes or strings. Supports web, mobile, desktop and server platforms.

AI-written summary of version 0.6.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Decoding Brotli compressed assets bundled with the app
  • Handling Brotli compressed HTTP responses
  • Processing Brotli compressed files on the device

Skip it when

  • You need to encode data to Brotli
  • You require a native encoder for performance

Strengths

  • Pure Dart implementation, no native dependencies
  • Cross‑platform support (web, mobile, desktop)
  • Simple API with decodeToString and stream support

Weaknesses

  • No Brotli encoder available
  • Limited feature set compared to full Brotli libraries

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

Add brotli: ^0.6.0 to pubspec and import package:brotli/brotli.dart

import 'dart:io';
import 'package:brotli/brotli.dart';

void main() {
  final output = brotli.decodeToString(File("./brotli.br").readAsBytesSync());
  print(output);
}

Alternatives

Packages that do the same job and could replace brotli.

  • archive

    Encodes and decodes archive and compression formats such as zip, tar, gzip, and zlib.

  • loading_indicator

    A collection loading animations written in pure dart. Out of the box, no extra dependency.

  • es_compression

    Compression framework providing FFI implementations for Brotli, Lz4, and Zstd.

  • pqcrypto

    Pure Dart post-quantum cryptography package implementing ML-KEM, ML-DSA, and SLH-DSA.

Works with

Packages commonly used together with brotli: ones it builds on, ones built on it, and its own family.