Flutter beginner here; I'm getting this error: type 'Future<dynamic>' is not a subtype of type 'String'
Function that fetch download url from firebase storage
_getImageUrl(var fileName) async {
print(fileName);
final StorageReference ref = FirebaseStorage.instance.ref().child('categories/' + fileName);
Uri downloadUrl = await ref.getDownloadURL();
var url = downloadUrl.toString();
return url;
}
where I called the function
child: Image(
image: AdvancedNetworkImage(
_getImageUrl(menuItem['image'].toString()),
timeoutDuration: Duration(minutes: 1),
useDiskCache: true,
cacheRule: CacheRule(maxAge: const Duration(days: 7)),
),
height: mediaQuery.size.width * 0.22,
width: mediaQuery.size.width * 0.22,
),