Dart SDK
Last updated: Dec-01-2025
The Cloudinary 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.
How would you like to learn?
| Resource | Description |
|---|---|
| Dart quick start | Get up and running in five minutes with a walk through of installation, configuration, upload, management and transformations. |
| Cloudinary Dart SDK GitHub repo | Explore the source code and see the CHANGELOG for details on all new features and fixes from previous versions. |
| Dart reference | See all Dart transformation actions and qualifiers in the SDK reference documentation. |
Install
To use this SDK, add Cloudinary as a dependency in your pubspec.yaml file.
Configure
Include Cloudinary's Dart classes in your code:
Set required configuration parameters
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). You can find your configuration credentials in the API Keys page of the Cloudinary Console Settings.
To set configuration parameters in your Dart application, use Cloudinary.fromStringUrl and pass your API environment variable:
- When writing your own applications, follow your organization's policy on storing secrets and don't expose your API secret.
- If you use a method that involves writing your environment variable to a file, exclude the file from your version control system, so as not to expose it publicly.
Set additional configuration parameters
In addition to the required configuration parameters, you can define a number of optional configuration parameters if relevant.
For example, set the secure optional configuration parameter to true:
urlAnalytics configuration option. Learn more.
Use
Once you've installed and configured the Dart SDK, you can use it for:
- Uploading files to your product environment: You can upload any files, not only images and videos, set your own naming conventions and overwrite policies, moderate and tag your assets on upload, and much more. See example
- Transforming and optimizing images and videos: Keeping your original assets intact in your product environment, you can deliver different versions of your media - different sizes, formats, with effects and overlays, customized for your needs. See example
Quick example: File upload
The following Dart code uploads the dog.mp4 video using the public_id, my_dog. The video overwrites the existing my_dog video if it exists. When the video upload finishes, the specified notification URL receives details about the uploaded media asset.
- Read the Upload guide to learn more about customizing uploads, using upload presets and more.
- See more examples of image and video upload using the Cloudinary Dart SDK.
- Explore the Upload API reference to see all available methods and options.
Quick example: Transform and optimize
Take a look at the following transformation code and the image it delivers:
This relatively simple code performs all of the following on the original front_face.jpg image before delivering it:
- Crop to a 150x150 thumbnail using face-detection gravity to automatically determine the location for the crop
- Round the corners with a 20 pixel radius
- Apply a sepia effect
- Overlay the Cloudinary logo on the southeast corner of the image (with a slight offset). Scale the logo overlay down to a 50 pixel width, with increased brightness and partial transparency (opacity = 60%).
- Rotate the resulting image (including the overlay) by 10 degrees
- Optimize the image to reduce the size of the image without impacting visual quality.
- Convert and deliver the image in PNG format (the originally uploaded image was a JPG)
And here's the URL that's automatically generated from the above code:
In a similar way, you can transform a video.
..addTransformation() method of the Dart SDK.For more information about the Dart SDK syntax, see Syntax overview.
- Read the Transform and customize assets guide to learn about the different ways to transform your assets.
- See examples of powerful image and video transformations using Dart code, and see our image transformations and video transformations docs.
- See all possible transformations in the Transformation URL API reference.
- See all Dart transformation actions and qualifiers in the Dart reference.
- Learn more about uploading images and videos using the Dart SDK.
- See examples of powerful image and video transformations using Dart code, and see our image transformations and video transformation docs.
- Stay tuned for updates by following the Release Notes and the Cloudinary Blog.
- Take a look at our iOS and Android SDKs as alternatives for mobile development with Cloudinary.