Last updated: May 29, 2024

<span aria-hidden="true" id="transloadits-flutter-sdk-beta-cross-platform-app-support"></span>

# Transloadit's Flutter SDK beta: cross-platform app support

![Joseph Grabski](/assets/images/teammates/joseph2.png?dpl=dpl_P3jgmY3Xa6fahEJTKAHNjzo3jEsY)

**Joseph Grabski**

Content Lead · Rochester, United Kingdom · Show bio

[](https://x.com/joe%5Fgrabski)[](https://github.com/Missing-Tech)

It's time again to welcome a new SDK! This time around, it's for the powerful cross-platform development framework Flutter. From the launch of `0.2.0`, every aspect of the Transloadit API is supported, including resumable file uploads using the Tus protocol. The SDK is still in beta, so it is not currently production ready. However, more users testing the SDK and looking for bugs, will help to make it more stable over time.

Check out the package on [pub.dev⁠](https://pub.dev/packages/transloadit).

![Flutter logo](/_next/static/immutable/media/opengraph-image.0ifyromqhy5gm.png)

<span aria-hidden="true" id="installation"></span>

## Installation

You can install the SDK into your Flutter project with a simple command:

```shell
flutter pub add transloadit

```

Or alternatively by including the package within your `pubspec.yaml`:

```yaml
dependencies:
  transloadit: ^1.0.0

```

Afterwards, run `flutter pub get`, for the package (and all its dependencies) to automatically be installed into your project.

You can then import the SDK into a Dart file to access its methods and classes.

```dart
import 'package:transloadit/transloadit.dart';

```

<span aria-hidden="true" id="using-the-sdk"></span>

## Using the SDK

Our first step in interacting with the Transloadit API through Flutter is creating a client. The client contains our API key and secret, and we'll be creating Assemblies using it.

```dart
Transloadit client = Transloadit(
        authKey: 'KEY',
        authSecret: 'SECRET');

```

Every endpoint of the Transloadit API is abstracted through the client, removing the need for you to manually specify the HTTP requests.

<span aria-hidden="true" id="creating-an-assembly"></span>

### Creating an Assembly

To create an Assembly, we first need to create the Assembly object. We'll assign files and Steps to the Assembly object which we'll later pass on to the API. We'll use the client's `newAssembly` method to do this.

```dart
TransloaditAssembly assembly = client.newAssembly();

```

We'll then attach a sample file to the Assembly object.

```dart
final imagePath = 'cat.jpg';
File cat = File(imagePath);
assembly.addFile(file: cat);

```

Let's also add a resize Step, so our image will be 400px wide.

```dart
assembly.addStep('resize', '/image/resize', {'width': 400});

```

Finally, we can use the Assembly object's `createAssembly` method to pass ourAssembly Instructions and file onto the API to be processed.

We'll also be using `onProgress` and `onComplete` callbacks here. You can use these callbacks to track the progress of the Tus upload, and to provide some feedback to your users on their file uploads. I'm using the callbacks to trigger a state update whenever the upload progresses or completes.

```dart
TransloaditResponse response = await assembly.createAssembly(
        onProgress: (progressValue) => setState(() => progress = progressValue);
        onComplete: () => setState(() => uploadComplete = true),
      );

print(response['ok']) // "ASSEMBLY_COMPLETED"

```

<span aria-hidden="true" id="what-next"></span>

## What next?

To see a full example app made with this SDK, take a look at the[Transloadit recipe app](/blog/2021/09/transloadit-recipes-part-1.md).

However, that's all for this blog. It's as easy as that to start using the Transloadit Flutter SDK. Feel free to get in contact with us on support if you run into any troubles. Also make sure to report bugs on the [GitHub repo⁠](https://github.com/Missing-Tech/transloadit-flutter-sdk), and we'll fix them 🔧

[#integrations](/blog/tags/integrations.md)[#flutter-sdk](/blog/tags/flutter-sdk.md)

### 👩‍💻 Join 20k+ developers

Sign up for our [monthly newsletter](/newsletters.md) to receive direct links to 3 exclusive tech — and 2 product updates. No less, no more.

Your email:

Get access

## File uploading and encoding. Made simple.

Transloadit streamlines file handling for developers, trusted by brands like Coursera and The New York Times. We’re known for a reliable API, top-notch support, and a strong commitment to open source, with projects like [Uppy⁠](https://uppy.io) and [Tus⁠](https://tus.io) setting standards in file processing.

[Sign up](/c/)[Book a Demo](https://survey.typeform.com/to/kRg47Xi5)

No credit card needed · 5 GB included in the free plan

Cancel anytime
