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,170 points
505 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,040 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
94 views
0 votes
1 answer

I am trying to run following command But I end up with an error :

Hii Nishant, You are running this command inside ...READ MORE

answered Apr 6, 2020 in Others by Niroj
• 82,580 points
307 views
0 votes
2 answers

How to get the URL of the current tab in Google Chrome?

Its so simple.... If you want to ...READ MORE

answered Aug 12, 2020 in Others by Steve
• 200 points
287 views
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,170 points
135 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,040 points
214 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,040 points
349 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,040 points
2,379 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 17, 2020 in Others by MD
• 95,040 points
407 views