'How do I get image url from amplify storage and show on the display in flutter?
I am trying to get the image URL from amplify storage and display on the user interface. But as the getting the image URL takes some time, the display is constantly showing failure to visualize the image. How would I be able to implement this in flutter? This is the implementation of getting the image url
Future<String> getImageUrl(String key) async {
try {
final result = await Amplify.Storage.getUrl(key: key);
print('Storage successful');
return result.url;
} on StorageException catch (storeError) {
print('Storage failed - $storeError');
return '';
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
