I have function to fetch image like
dynamic imgBinary = _repository.fetchImage(productId);
And I want to add this into List of Image
List<NetworkImage> listImages = new List<NetworkImage>();
So like
dynamic imgBinary = _repository.fetchImage(productId);
listImages.add(imgBinary);
How to cast this?
Ok , So you Can Try
.thenmethod.As
_repository.fetchImage(productId);is Future.so you can try -
or
Directly:
To get the Value from Future - we can either use :
OR you can use the
then()method to register a callback. This callback fires when the Future completes.For more info