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 '';
}
}