Search packages, repositories and app categories

Package detailsv0.3.2

simple_s3

An advanced yet simple to use AWS S3 plugin for upload and delete ANY file in Android and iOS.

AndroidiOS
30-day downloads
108
Likes
41
Pub points
140

Install package

flutter pub add simple_s3

Package Overview

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

simple_s3 is a Flutter plugin that simplifies uploading and deleting files on AWS S3 for Android and iOS. Designed with ease of use in mind, it abstracts complex AWS SDK interactions into straightforward methods, enabling developers to manage file storage without deep AWS knowledge. The package supports any file type and integrates seamlessly into mobile apps requiring cloud-based file handling. It leverages AWS's secure authentication mechanisms while maintaining a lightweight, developer-friendly API.

Use cases

  • Uploading images and documents to AWS S3
  • Deleting files from S3 buckets
  • Integrating cloud storage in mobile apps
  • Handling user-generated content storage
  • Enabling backup and sync features

Key features

  • Simple upload and delete APIs
  • Support for all file types
  • Secure AWS S3 integration
  • Cross-platform compatibility (Android & iOS)
  • Minimal setup and configuration

Suitable for

  • Mobile app developers using AWS S3
  • Projects needing file upload/delete functionality
  • Apps requiring secure cloud file management
  • Developers seeking a lightweight S3 solution

Considerations

  • Requires AWS credentials and proper bucket policies
  • Limited to Android and iOS platforms
  • Depends on external AWS SDK behavior
  • No built-in file listing or metadata management

Original README

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

simple_s3

An advance yet simple to use AWS S3 plugin for upload and deletion.

Simple S3 uses AWS Native SDKs for iOS and Android

Getting started

Add dependency in pubspec.yaml

simple_s3: 0.3.2

Follow @ab_hi_j on Twitter

Features

Feature Description
Null Safe :white_check_mark:
Upload Percentage :white_check_mark:
Supports all files SimpleS3 auto detects content type of file by looking into extension
Set Access Type Allows you to set access type of file ex. PublicRead, Private etc
Default is Public Read
Timestamp Turned off by default if turned on allows you to append timestamp in file name.
Location of timestamp can be changed to either prefix or suffix
Default is prefix
Custom File Name Allows to change name of file about to upload.
Note : File name must contain extension.
Custom S3 folder path Allows to upload file to specific folder in S3
Sub Region Support Allows upload/delete operations on S3 having sub regions
Delete Object Allows deletion of file object
Auto Generates URL URL pointing to S3 file is auto generated.


Not working in Android Release mode ?

If your Android app is not working in release mode please check this section


Usage Examples

Simple File Upload

// returns url pointing to S3 file

SimpleS3 _simpleS3 = SimpleS3();
String result = await _simpleS3.uploadFile(
				file, <--------------- Selected File
				bucketName, <--------- Your Bucket Name
				poolID, <------------- Your POOL ID
				AWSRegions.apSouth1 <- S3 server region
				);

Delete

// returns bool

bool result = await SimpleS3.delete(
				filePath, <---------------- S3 File Path
				bucketName, <-------------- Your Bucket Name
				poolID, <------------------ Your POOL ID
				AWSRegions.apSouth1, <----- S3 server region
				);

// delete also supports sub-regions

File Upload with Percentage

// returns url pointing to S3 file

SimpleS3 _simpleS3 = SimpleS3();
//Upload function
String result = await _simpleS3.uploadFile(
				file, <--------------- Selected File
				bucketName, <--------- Your Bucket Name
				poolID, <------------- Your POOL ID
				AWSRegions.apSouth1 <- S3 server region
				);

//Widget
child: StreamBuilder<dynamic>(  
    stream: _simpleS3.getUploadPercentage,  
    builder: (context, snapshot) {  
      return new Text(  
        snapshot.data != null ? "Uploaded: ${snapshot.data}" : "Simple S3",  
    );  
  }),

Custom File Name

// returns url pointing to S3 file

SimpleS3 _simpleS3 = SimpleS3();
String result = await _simpleS3.uploadFile(
				file, <------------------------------ Selected File
				bucketName, <------------------------ Your Bucket Name
				poolID, <---------------------------- Your POOL ID
				AWSRegions.apSouth1, <--------------- S3 server region
				fileName: "Dennis_ritchie.jpeg", <--- Custom file name
				);

Custom S3 Path

// returns url pointing to S3 file

SimpleS3 _simpleS3 = SimpleS3();
String result = await _simpleS3.uploadFile(
				file, <-------------------------------- Selected File
				bucketName, <--------------------------- Your Bucket Name
				poolID, <------------------------------- Your POOL ID
				AWSRegions.apSouth1, <------------------ S3 server region
				s3FolderPath: "users/profile_pics", <--- Custom S3 path
				);

// final path will be  "bucketName/users/profile_pics"

Setting Access Control

// returns url pointing to S3 file

SimpleS3 _simpleS3 = SimpleS3();
String result = await _simpleS3.uploadFile(
				file, <------------------------------------- Selected File
				bucketName, <------------------------------- Your Bucket Name
				poolID, <----------------------------------- Your POOL ID
				AWSRegions.apSouth1, <---------------------- S3 server region
				accessControl: S3AccessControl.private, <--- Setting access of uploaded file **private**
				);

// S3AccessControl have more types of AccessControl ex. .publicRead, .publicReadWrite etc...

Using Timestamp

// returns url pointing to S3 file

SimpleS3 _simpleS3 = SimpleS3();
String result = await _simpleS3.uploadFile(
				file, <------------------------------------- Selected File
				bucketName, <------------------------------- Your Bucket Name
				poolID, <----------------------------------- Your POOL ID
				AWSRegions.apSouth1, <---------------------- S3 server region
				useTimeStamp: true, <----------------------- Enable Timestamp
				);

// default location of timestamp is prefix
// if original file name = "Dennis_ritchie.jpeg"
// then the result will be = "1591705658_Dennis_ritchie.jpeg"


// Change Timestamp Location



SimpleS3 _simpleS3 = SimpleS3();
String result = await _simpleS3.uploadFile(
				file, <--------------------------------------- Selected File
				bucketName, <--------------------------------- Your Bucket Name
				poolID, <------------------------------------- Your POOL ID
				AWSRegions.apSouth1, <------------------------ S3 server region
				useTimeStamp: true, <------------------------- Enable Timestamp
				timeStampLocation: TimestampLocation.suffix,<- Changes timestamp location to suffix
				);
// if original file name = "Dennis_ritchie.jpeg"
// then the result will be = "Dennis_ritchie_1591705658.jpeg"

Using Sub-Region

// returns url pointing to S3 file

SimpleS3 _simpleS3 = SimpleS3();
String result = await _simpleS3.uploadFile(
				file, <------------------------------------- Selected File
				bucketName, <------------------------------- Your Bucket Name
				poolID, <----------------------------------- Your POOL ID
				AWSRegions.apSouth1, <---------------------- S3 server region
				subRegion: AWSRegions.apNorthEast1 <-------- Sub region
				);

Debug mode

// for security reasons plugin uses less logs, to enable full logs -

SimpleS3 _simpleS3 = SimpleS3();
String result = await _simpleS3.uploadFile(
				file, <--------------- Selected File
				bucketName, <--------- Your Bucket Name
				poolID, <------------- Your POOL ID
				AWSRegions.apSouth1 <- S3 server region
				debugLog: true, <----- Enable full logs
				);

Android Proguard settings for release mode


// add these lines in your app/build.gradle

		minifyEnabled true  
		useProguard true  
		proguardFiles getDefaultProguardFile('proguard-android.txt'),  
		        'proguard-aws-2.1.5.pro'

//EXAMPLE
		buildTypes {  
		  release {  
		  signingConfig signingConfigs.release  
		  minifyEnabled true  
		  useProguard true  
		  proguardFiles getDefaultProguardFile('proguard-android.txt'),  
		                'proguard-aws-2.1.5.pro'  
		  }  
		}

Now copy contents of this file proguard-aws-2.1.5.pro Create a new file with name "proguard-aws-2.1.5.pro" at the same location as app/build.gradle and paste the copied contents into this file.

Your release mode APK should work now.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.