Skip to content

ContentChef/flutter-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Starter for ContentChef - Headless CMS

ContentChef is an Headless CMS designed to accelerate the development of modern,cross channel digital products.

This starter is a simple Flutter integrated with our Delivery API using the ContentChef Dart SDK

Requirements

In order to use make this starter work, you will need

  • An active ContentChef account (sign up for a 30-day free trial here)
  • Dart >=2.7.0 <3.0.0
  • Flutter >= 10.13 1.17.0

Clone & Installation

Clone the starter repo and install all the deps

    git clone https://github.com/ContentChef/flutter-starter.git
    cd flutter_starter
    pub get

Get your SpaceID, Online API Key from your dashboard home page.

ContentChef Dashboard - Home

Open ./lib/services/contentchef_client.dart and copy your data in the client configuration and use "example-ch" for your channel now.

class _ContentChefClient {
  Configuration _config = Configuration(spaceId: 'YOUR_SPACEID_GOES_HERE');
  Media _media;
  OnlineChannel _onlineChannel;

  _ContentChefClient() {
    this._media = Media();
    this._onlineChannel = ContentChef(configuration: _config).getOnlineChannel(apiKey: 'YOUR_APIKEY_GOES_HERE', publishingChannel: 'example-ch');
  }
  
  ...
}

You are now ready to start the flutter project:

Extras

Media

We have provided useful methods needed to retrieve images, videos and files from ContentChef

Images

  var mediaUtils = Media();
  var publicMediaUrl = mediaUtils.imageUrl(publicId: 'the-media-publicId', MediaTransformations(autoFormat: true));

Videos

  var mediaUtils = Media();
  var publicMediaUrl = mediaUtils.videoUrl(publicId: 'the-media-publicId', VideoTransformations(autoFormat: true, croppingMode: CroppingMode.fill));

Files

  var mediaUtils = Media();
  var publicMediaUrl = mediaUtils.rawUrl(publicId: 'the-media-publicId');

Enjoy!

To Learns More

About

ContentChef flutter starter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors