Cloudinary Dart SDK

Build Status

About

The Cloudinary Dart SDK allows you to quickly and easily integrate your application with Cloudinary. Effortlessly optimize and transform your cloud's assets.

As Flutter is build on the Dart language, understanding the Dart SDK is essential for utilizing the capabilities of the Flutter SDK, as well. For more information about the Flutter SDK, see the Cloudinary Flutter documentation.

Note

This Readme provides basic installation and usage information.

Table of Contents

Key Features

Transform and optimize assets. Visit our documentation to learn more about media optimization and transformations.

Version Support

SDK Version Dart Version
1.6.0 > 1.0

Installation

To use this SDK, add cloudinary as a dependency in your pubspec.yaml file.

dependencies:
  cloudinary_url_gen: ^1.6.0

Usage

Setup

The Cloudinary class is the main entry point for using the library. Your cloud_name is required to create an instance of this class. Your api_key and api_secret are also needed to perform secure API calls to Cloudinary (e.g., image and video uploads). Setting the configuration parameters can be done either programmatically using an appropriate constructor of the Cloudinary class or globally using an environment variable. You can find your account-specific configuration parameters in the Dashboard page of your account console.

Here's an example of setting configuration parameters in your Dart application:

import 'package:cloudinary_dart/src/cloudinary.dart';

var cloudinary = Cloudinary.fromStringUrl('cloudinary://<your-api-key>:<your-api-secret>@<your-cloud-name>');

Transform and Optimize Assets

Generate a Cloudinary URL using the cloudinary.media helper method and pass this to your image or video view:

For example, to generate a URL for an image called sample:

String url = cloudinary.image('sample.jpg').toString();

To add a transformation to the URL that resizes an image:

String url = (cloudinary.image('sample.jpg')
  ..transformation(Transformation()
    ..resize(Resize.crop()
      ..width(100)
      ..height(150))))
        .toString();

Contributions

See contributing guidelines.

Get Help

If you run into an issue or have a question, you can either:

About Cloudinary

Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinary enables developers to efficiently manage, transform, optimize, and deliver images and videos through multiple CDNs. Ultimately, viewers enjoy responsive and personalized visual-media experiences—irrespective of the viewing device.

Additional Resources

Licence

Released under the MIT license.

Libraries

analytics/analytics
analytics/analytics_helper
asset/builders/general_asset_builder
asset/cld_asset
asset/cld_image
asset/cld_video
auth_token
cloudinary
config/api_config
config/cloud_config
config/cloudinary_config
config/url_config
transformation/adjust/adjust
transformation/background/background
transformation/background/blurred_background
transformation/background/border_background
transformation/background/border_gradient_background
transformation/background/color_background
transformation/background/predominant_background
transformation/border
transformation/color
transformation/coordinates/coordinates
transformation/delivery/delivery
transformation/delivery/delivery_actions
transformation/effect/effect
transformation/effect/effect_actions
transformation/effect/objects/foreground_object
transformation/extract/extract
transformation/flag
transformation/gravity/focus_on
transformation/gravity/gravity
transformation/layer/common
transformation/layer/position/base_layer_position
transformation/layer/position/blend_mode
transformation/layer/position/position
transformation/layer/position/timeline
transformation/named_transformation
transformation/region
transformation/reshape/reshape
transformation/reshape/reshape_actions
transformation/resize/crop
transformation/resize/fill
transformation/resize/fit
transformation/resize/pad
transformation/resize/resize
transformation/resize/scale
transformation/rotate
transformation/round_corners
transformation/source/image_source
transformation/source/source
transformation/transformation
transformation/transformation_utils
transformation/video_edit/transcode/transcode
transformation/video_edit/transcode/transcode_actions
transformation/video_edit/video_edit
transformation/video_edit/video_edit_actions
util/environment