contentful
3.0.5, released 5 years ago by timsmart.co
A Dart client for the Contentful Delivery API.
WASM-ready
What it does
Provides a thin wrapper around Contentful's Delivery REST API. It lets you fetch entries, assets and content types and map them to typed Dart models. Supports token‑based authentication and query parameters.
AI-written summary of version 3.0.5, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to integrate a Contentful CMS backend into a Dart/Flutter app
- You want typed models generated with json_serializable for Contentful entries
Skip it when
- You require offline caching or a full GraphQL client
- You need a backend‑agnostic HTTP client with advanced features
Strengths
- Simple, purpose‑built API for Contentful
- Works on all Dart platforms (mobile, web, desktop)
- Leverages familiar packages like http and json_annotation
Weaknesses
- Only works with Contentful, no other CMS support
- No built‑in caching or retry logic
- Limited to REST, no GraphQL support
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 5
import 'package:contentful/contentful.dart';
final client = Client(BearerTokenHTTPClient('YOUR_TOKEN'), spaceId: 'YOUR_SPACE');
final repo = EventRepository(client);
final event = await repo.findBySlug('myevent');
print('Title: ${event.fields.title}');Alternatives
Packages that do the same job and could replace contentful.
Works with
Packages commonly used together with contentful: ones it builds on, ones built on it, and its own family.
- json_annotationcontentful depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- equatablecontentful depends on itProvides value‑based equality for Dart objects without manual == and hashCode.
- dartzcontentful depends on itFunctional programming library with monads, immutable collections, and combinators for Dart