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,180 points
768 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,140 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
101 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,680 points
358 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
313 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,180 points
152 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,140 points
242 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,140 points
410 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,140 points
2,952 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,140 points
529 views