Skip to main content

Overview

This integration guide shows you how to how to update your existing project to:
  1. install the ButterCMS package
  2. instantiate ButterCMS
  3. create components to fetch and display each of the three ButterCMS content types: Pages, Collections, and Blog Posts.
In order for the snippets to work, you’ll need to setup your dashboard content schemas inside of ButterCMS first.

Installation

Add dependencies to pubspec.yaml:
Then run:

Initialize the client

Create a singleton client to reuse throughout the app:
Store your API token securely — for example using flutter_dotenv or a secrets manager — and pass it into ButterCMS(apiKey: ...) at startup.

Models

Pages

Collections

Dynamic components

Component renderer

Example component

Using in screens

Blog

Resources

Dart SDK

Full SDK reference and method documentation

iOS Guide

iOS-specific patterns

Android Guide

Android-specific patterns

Content API

REST API documentation