The following assertion was thrown resolving an image codec Unable to load asset https raw githubusercontent com abc jpg

0 votes

Hi Guys,

I am trying to load one image from GitHub to my Flutter App. But it is showing me the below error.

The following assertion was thrown resolving an image codec:
Unable to load asset: https://raw.githubusercontent.com/

I am using the below code.

Container(
          decoration: BoxDecoration(
              image: DecorationImage(
                  image: AssetImage(
                     "https://raw.githubusercontent.com/")
                      .image,
                  fit: BoxFit.cover))
)
Sep 10, 2020 in Others by akhtar
• 38,260 points
5,138 views

1 answer to this question.

0 votes

Hi@akhtar,

You are using the wrong parameter. In your case, you are trying to load the image from the internet. So instead of AssetImage, you have to use Image.network keyword.

Container(
          decoration: BoxDecoration(
              image: DecorationImage(
                  image: Image.network(
                     "https://raw.githubusercontent.com/")
                      .image,
                  fit: BoxFit.cover))
)
answered Sep 10, 2020 by MD
• 95,460 points

Related Questions In Others

0 votes
0 answers

how to list the contents of a asset into an event

May 29, 2019 in Others by anonymous
613 views
0 votes
1 answer
0 votes
1 answer

What is the future of flutter?

Hi@MD, Flutter is a rather new cross-platform framework ...READ MORE

answered Jul 17, 2020 in Others by akhtar
• 38,260 points
1,066 views
0 votes
1 answer

What is Flutter?

Hi@akhtar, Flutter is an app SDK for building ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,460 points
1,317 views
0 votes
1 answer

How to install Flutter in Windows system?

Hi@akhtar, You can follow the below-given steps to ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,460 points
1,727 views
0 votes
1 answer

How to use BoxDecoration to a Container widget to draw an image?

Hi@akhtar, The BoxDecoration class provides a variety of ways ...READ MORE

answered Aug 9, 2020 in Others by MD
• 95,460 points
5,703 views
0 votes
1 answer

I would like to know the Steps involved to remove an Apache Solr from Windows 10 Computer

Hi@Ganapathy, There are several different possibilities for why ...READ MORE

answered Aug 18, 2020 in Others by MD
• 95,460 points
2,890 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP