Skip to content
pubscout

cloudflare

11.0.1, released 7 days ago by dev.lamt.dev

Dart SDK and client for Cloudflare APIs including Images, Stream, Live Inputs, and R2 storage.

WASM-ready
$ flutter pub add cloudflare
Source repository

What it does

Provides a Dart client for interacting with Cloudflare services. It supports managing and uploading images, streaming videos, live inputs, and S3-compatible R2 object storage operations.

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

Use it when

  • You need to integrate Cloudflare Images, Stream, or Live Inputs into a Dart or Flutter application.
  • You are using Cloudflare R2 object storage and need an S3-compatible client implementation.
  • You need to perform direct or tus-protocol resumable video and image uploads.

Skip it when

  • You are looking for a general-purpose local database or device storage package.
  • You require backend services outside of what Cloudflare provides.

Strengths

  • Covers multiple major Cloudflare services (Images, Stream, Live Inputs, R2).
  • Supports direct and resumable uploads using the tus protocol.
  • Compatible with both server-side Dart and client-side Flutter applications.

Weaknesses

  • Exposing sensitive credentials directly in client-side applications requires careful use of direct upload flows.
  • Requires managing Cloudflare account IDs and API tokens or keys properly.

Setup

Kind
Pure Dart
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
14

Add the package to pubspec.yaml and initialize the Cloudflare client with your account ID and authentication tokens.

cloudflare = Cloudflare(
  accountId: accountId,
  token: token,
);

final response = await cloudflare.imageAPI.upload(
  contentFromFile: DataTransmit<XFile>(data: imageFile)
);

Works with

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