Sumon
Sumon

Reputation: 1

How can I show the firebase storage image in flutter web. I have the image URL. show the URL not image. but another side image link is done perfectly

already I have the image URL. but when I try to fetch into my browser. the container show the URL not image. but another side image link is done perfectly. Please response about it.

the debug console show this error:

Failed to decode image data. Image source: http://localhost:5982/

'For upload and retrieve'

String imageUrl = '';


    final  String downloadUrl = Uri.parse(await snapshot.ref.getDownloadURL()).toString();
    setState(() {
      imageUrl = downloadUrl;
    });

For display image

 Stack(
                    alignment: Alignment.bottomRight,
                    children: [
                      Container(
                        child: Image.network(imageUrl),
                      ),
                      IconButton(
                          onPressed: () => uploadToStorage(dataProvider),
                          icon:
                              Icon(Icons.camera_alt, color: Colors.black54))
                    ],
                  ),'

Error into debug console:

Failed to decode image data.

Image source: http://localhost:5982/

Upvotes: 0

Views: 769

Answers (1)

nilsmagnus
nilsmagnus

Reputation: 2322

I think you are looking for Image.network(urlForMyImage).

Ref. docs

Upvotes: -1

Related Questions