5

I published a plugin on pub.dev and also on GitHub, I have 2 screenshots displaying in README.md from Github link. These are fine on Github but are broken on pub.dev. I tried all approaches but still the same.

Screenshot# 01             |  Screenshot# 02
:-------------------------:|:-------------------------:
<img src="https://github.com/shahzadakram67/flutter_tex/blob/master/screenshots/Screenshot_1.png"/> | <img src="https://github.com/shahzadakram67/flutter_tex/blob/master/screenshots/Screenshot_2.png"/> 

Github: https://github.com/shah-xad/flutter_tex

pub.dev: https://pub.dev/packages/flutter_tex

Shahzad Akram
  • 4,586
  • 6
  • 32
  • 65
  • Found https://stackoverflow.com/questions/62017182/adding-images-to-readme-of-plugin-in-pub-dev with a similar solution. I would really like to find a way to use relative paths to the repository instead of absolute URLs though if anyone has an idea. – Almund Aug 19 '21 at 10:47

2 Answers2

6

The actual URL, to be used in pub.dev, should be:

 https://raw.githubusercontent.com/shah-xad/flutter_tex/master/screenshots/Screenshot_1.png
 NOT:
 https://github.com/shahzadakram67/flutter_tex/blob/master/screenshots/Screenshot_1.png
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Another way is to change the /blob/ to /raw/ in your Github url, so in this case would be something like:

"https://github.com/shahzadakram67/flutter_tex/blob/master/screenshots/Screenshot_1.png"
change to
"https://github.com/shahzadakram67/flutter_tex/raw/master/screenshots/Screenshot_1.png"
Sunn
  • 766
  • 9
  • 17