Search packages, repositories and app categories

Package detailsv0.6.0

flutter_aws_s3_client

A simple, unofficial AWS S3 client in dart. Supports downloading objects and listing objects in a bucket.

AndroidiOSmacOSWindowsLinux
30-day downloads
123
Likes
35
Pub points
100

Install package

flutter pub add flutter_aws_s3_client

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A lightweight, unofficial AWS S3 client for Flutter and Dart that enables simple interaction with Amazon S3. It supports downloading objects and listing contents within a bucket, making it useful for apps needing basic file retrieval and browsing from S3. Built for cross-platform use, it works on Android, iOS, macOS, Windows, and Linux. The package is not officially maintained by AWS but provides straightforward access without heavy dependencies.

Use cases

  • Downloading files from S3 buckets
  • Listing objects in an S3 bucket
  • Integrating S3 storage into Flutter apps
  • Simple file management in cloud environments
  • Cross-platform cloud file access

Key features

  • Supports S3 object downloads
  • Lists objects in a bucket
  • Lightweight and minimal dependency
  • Cross-platform compatibility
  • No official AWS SDK required

Suitable for

  • Developers building Flutter apps with S3 integration
  • Projects needing basic S3 operations
  • Apps requiring file retrieval from AWS S3
  • Prototypes or small-scale cloud storage needs
  • Non-enterprise applications with simple S3 requirements

Considerations

  • Not an official AWS SDK
  • Limited to download and list operations
  • No upload or advanced S3 features
  • May require manual handling of authentication
  • Best suited for non-critical or experimental use cases

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Pub Package

DEPRECATED

Since there is now an official package for accessing AWS services, I decided to not longer support this package. please migrate to https://github.com/aws-amplify/amplify-flutter / https://pub.dev/packages/amplify_storage_s3/example

flutter_aws_s3_client

Supports downloading objects and listing objects in a bucket.

The heavy lifting was done by Amazon Cognito Identity SDK for Dart, this project contains just convenience methods for common use cases.

if you need more requests, you can use this instead to build what you need. If you implement more methods, feel free to open a pull request.

Usage

Build the client
  const region = "eu-central-1";
  const bucketId = "yourBucketId";
  final AwsS3Client s3client = AwsS3Client(
      region: region,
      host: "s3.$region.amazonaws.com",
      bucketId: bucketId,
      accessKey: "<your access key>",
      secretKey: "<your secret key>");

Get an object
final response = await s3client.getObject("your/object/key"); 
List objects of the bucket
ListBucketResult listBucketResult =
  await s3client.listObjects(prefix: "dir1/dir2/", delimiter: "/");
print(listBucketResult.toString());

If you want to use a custom http client, use the method buildSignedGetParams. This method returns an object containing the URL and the Authorization headers, which can be used to build the request with your preferred http client.

Download a large object to a file without keeping everything in-memory (streaming)

Use the buildSignedGetParams method.

Example code (with ETag support):


Future download(String key, File file, [String etag = null]) async {

  final signedParams = awsS3Client.buildSignedGetParams(key: key);

  final request = await HttpClient().getUrl(signedParams.uri);

  for (final header in (signedParams.headers ?? const {}).entries) {
    request.headers.add(header.key, header.value);
  }
  if(eTag != null){
    request.headers.add(HttpHeaders.ifNoneMatchHeader, eTag);
  }
  final response = response = await request.close();
  if(response.statusCode != HttpStatus.ok){
     //handle error  
  }else{
     return response.pipe(file.openWrite());
  }
}

Categories

Dependencies

Dependency list 5 items

Source repository

Projects using this package

No data available yet.