パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.6.0

flutter_aws_s3_client

Dart用のシンプルで非公式なAWS S3クライアント。バケット内のオブジェクトのダウンロードとリスト表示をサポートしています。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
123
いいね数
35
Pub ポイント
100

パッケージをインストール

flutter pub add flutter_aws_s3_client

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

FlutterおよびDart用の軽量で公式ではないAWS S3クライアントであり、Amazon S3との簡単な操作を可能にします。オブジェクトのダウンロードやバケット内のコンテンツ一覧表示をサポートしており、S3から基本的なファイル取得とブラウジングが必要なアプリケーションに役立ちます。クロスプラットフォーム対応で、Android、iOS、macOS、Windows、Linuxで動作します。AWS公式によるメンテナンスではありませんが、重い依存関係なしにシンプルなアクセスを提供します。

用途

  • S3 バケットからファイルをダウンロードする
  • S3 バケット内のオブジェクトを一覧表示する
  • FlutterアプリへのS3ストレージの統合
  • クラウド環境におけるシンプルなファイル管理
  • クロスプラットフォームクラウドファイルアクセス

主な機能

  • S3 オブジェクトのダウンロードをサポート
  • バケット内のオブジェクトを一覧表示する
  • 軽量で依存関係が少ない
  • クロスプラットフォーム互換性
  • 公式のAWS SDKは不要です

適している対象

  • S3統合を使用してFlutterアプリを開発する開発者
  • 基本的なS3操作が必要なプロジェクト
  • AWS S3からファイルを取得する必要があるアプリ
  • プロトタイプまたは小規模なクラウドストレージのニーズ
  • シンプルなS3要件を持つエンタープライズ以外のアプリケーション

注意事項

  • 公式のAWS SDKではありません
  • ダウンロードおよびリスト操作に制限
  • アップロードや高度なS3機能なし
  • 認証の手動処理が必要になる場合があります
  • 非重要または実験的な用途に最適

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

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());
  }
}

カテゴリー

依存関係

依存関係一覧 5 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。