Last updated: May-03-2023
Cloudinary's Dart SDK provides simple, yet comprehensive image and video transformation, optimization, and delivery capabilities that you can implement using code that integrates seamlessly with your existing Dart application.
The Dart SDK allows you to transform and deliver assets that are already in your Cloudinary repository. See Dart image and video upload to upload using the
upload method of Cloudinary's Upload API.
- Uses Cloudinary's new SDK action based syntax with enhanced code autocomplete.
- Build dynamic URLs for delivering images and videos.
- Actions and transformations are immutable, for easier and safer code reuse.
Install and configure the SDK in your project to get started.
Add the Dart SDK dependency
To use this SDK, add Cloudinary as a dependency in your pubspec.yaml file.
Add your Cloudinary configuration
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_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 configuration credentials in the Programmable Media Dashboard of the Cloudinary Console.
To set configuration parameters in your Dart application, use
Cloudinary.fromStringUrl and pass your API environment variable:
Define optional configuration parameters by adding them to your configuration file. For example, set the
secure optional configuration parameter to
true in the configuration file named
Here's a simple example for generating a Cloudinary image URL, including a resize transformation, using the Dart SDK:
Here's a simple example for generating a Cloudinary video URL, including a resize transformation with boomerang and vignette effects, using the Dart SDK:
..generic()method of the Dart SDK.
For more information about the Dart SDK syntax, see Syntax overview.
- See all possible transformations in the Transformation URL API reference.
- See examples of powerful image and video transformations using Dart code
and see our image transformations and video transformations docs.
- Stay tuned for updates, tips and tutorials in Product Updates and Blog Posts.
- Take a look at our iOS and Android SDKs as alternatives for mobile development with Cloudinary.