Skip to content
pubscout

fetch_client

1.2.1, released 8 months ago by null.moe

HTTP client using Fetch API with WASM support, cancelable and streamable requests

WASM-ready
$ flutter pub add fetch_client
Source repository

What it does

Provides a drop‑in replacement for the http package that uses the Fetch API under the hood. It supports request cancellation, streaming responses, and WASM‑ready internals for web extensions.

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

Use it when

  • Web or Flutter web projects needing cancelable HTTP requests
  • Applications that require streaming request bodies or responses
  • Projects targeting Manifest V3 Chrome extensions

Skip it when

  • Non‑web Dart or Flutter mobile projects
  • Environments that do not support WASM or Fetch API
  • Projects that already use a fully featured HTTP client like dio

Strengths

  • Cancelable requests via Abortable
  • Streaming support for responses and request bodies
  • WASM‑ready for web extensions
  • Access to redirect URLs and status codes

Weaknesses

  • Only works on web (requires Dart 3.4+ and Chromium 105+ for streaming)
  • Limited to Fetch API features, not a full HTTP client replacement
  • Requires newer Dart SDK

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2
import 'package:fetch_client/fetch_client.dart';

final client = FetchClient();
final response = await client.get(Uri.parse('https://example.com'));
print(response.body);

Alternatives

Packages that do the same job and could replace fetch_client.

  • cronet_http

    An Android Flutter plugin providing access to the Cronet HTTP client.

  • native_dio_adapter

    A Dio HTTP client adapter that uses native platform HTTP stacks via cupertino_http and cronet_http.

  • http2

    An HTTP/2 implementation in Dart for low-level transport and pooled HTTP/2 requests.

  • dio

    A powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.

Works with

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