amplify_storage_s3 2.5.1 amplify_storage_s3: ^2.5.1 copied to clipboard
The Amplify Flutter Storage category plugin using the AWS S3 provider.
amplify_storage_s3 #
The Amplify Flutter Storage category plugin using the AWS S3 provider.
Category / Platform Support #
Category | Android | iOS | Web | Windows | MacOS | Linux |
---|---|---|---|---|---|---|
Analytics | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
API (REST) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
API (GraphQL) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Authentication | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
DataStore | ✅ | ✅ | 🔴 | 🔴 | 🔴 | 🔴 |
Storage | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Notifications | ✅ | ✅ | 🔴 | 🔴 | 🔴 | 🔴 |
Getting Started #
Visit our Web Site to learn more about AWS Amplify. #
Upgrade from v0 #
All Storage S3 plugin APIs now return an operation object rather than the result object. The operation object provides more control over the in-flight request, such as cancellation, pause, and resume capabilities (varies by API). The result Future
can be retrieved via the .result
property.
How to upgrade #
Upload example
See documentation for details API usage example.
// before
final result = await Amplify.Storage.uploadFile(
local: exampleFile,
key: 'ExampleKey',
);
print('Uploaded file key: ${result.key}')
// after
final result = await Amplify.Storage.uploadFile(
localFile: exampleFile,
key: 'ExampleKey',
).result;
print('Uploaded file key: ${result.uploadedItem.key}');
Download example
See documentation for details API usage example.
// before
final result = await Amplify.Storage.downloadFile(
key: 'ExampleKey',
local: file,
);
print('Downloaded local file path: ${result.file.path}')
// after
final result = await Amplify.Storage.downloadFile(
key: 'ExampleKey',
localFile: file,
).result;
print('Downloaded file key: ${result.downloadedItem.key}');
print('Downloaded local file path: ${result.localFile.path}');
List example
See documentation for details API usage example.
// before
final result = await Amplify.Storage.list();
print('Listed items: ${result.items}');
// after
final result = await Amplify.Storage.list().result;
print('Listed items: ${result.items}');
print('Are there more items can be listed? ${result.hasNextPage}');
print('List nextToken: ${result.nextToken}');
Remove example
See documentation for details API usage example.
// before
final result = await Amplify.Storage.remove(
key: key,
);
print('Removed file key: ${result.key}');
// after
final result = await Amplify.Storage.remove(
key: key,
).result;
print('Removed file key: ${result.removedItem.key}');
Get URL example
See documentation for details API usage example.
// before
final result = await Amplify.Storage.getUrl(key: 'ExampleKey');
print('Got url: ${result.url}');
// after
final result = await Amplify.Storage.getUrl(key: 'ExampleKey').result;
print('Got url: ${result.url.toString()}');