I am following old tutorial, and I get an error on ImageUrl in last line of code:
"Future dynamic can't be assigned to argument type String".
How can I fix that?
class _MyAppState extends State<MyApp> {
static FirebaseStorage storage = FirebaseStorage(
storageBucket: 'gs://natapp-7d2db/storage/natapp-7d2db.appspot.com/files'
);
static StorageReference imageRef = storage.ref().child('cake.png');
final imageUrl = imageRef.getDownloadURL();
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(brightness: Brightness.dark),
home: Container(
child: Image.network(imageUrl),
),
);
}
}
EDIT: I used
child: Image.network(imageUrl.toString)