This is a sample app that uses Amplify Storage to upload images to AWS S3
Installand configure Amplify CLI- A Flutter application targeting Flutter SDK >= 2.10.0 (stable version).
- An iOS configuration targeting at least iOS 11.0
- An Android configuration targeting at least Android API level 21 (Android 5.0) or above
- Clone the application.
git clone https://github.com/offlineprogrammer/amplify_storage_app- Create your amplify environment for this app
amplify init- Install dependencies
flutter pub get- Build all your local backend resources and provision it in the cloud.
amplify push- Run the app and try uploading images.
The code of the app implements clean architecture to separate the app layers with a feature-first approach for folder structure. I used Riverpod for state management and Freezed for the storage file model
lib
├── features
│ ├── storage_file
│ │ ├── controller
│ │ ├── models
│ │ ├── services
│ │ └── ui
│ │ └── storage_file_list
├── main.dart
├── storage_gallery_app.dart
└── utils.dart
main.dartfile has Amplify initialization & configuration code and wraps the rootStorageGalleryAppwith aProviderScopestorage_gallery_app.darthas the rootMaterialAppwrapped in the Amplify Authenticator to add complete authentication flows to the App.- The
features/storage_filefolder contains code for displaying/uploading storage fileui/storage_file_listcontain the implementation to display the storage files gallery & the storage upload indicatorservicesis the app services layerstorage_service.dartis the service & provider to use Amplify Storage for files listing & uploading
modelsis the storage_file model generated using Freezedcontrolleris an abstract layer that used by the ui for the buisness logic
