Pub-dev: Wrong link to example file

Created on 31 Jan 2020  路  3Comments  路  Source: dart-lang/pub-dev

Hello!
example link on https://pub.dev/packages/flutter_bloc#-example-tab-

example/lib/main.dart is points to

https://github.com/felangel/bloc/blob/master/example/lib/main.dart

but it's wrong and it should be changed to

https://github.com/felangel/bloc/blob/master/packages/flutter_bloc/example/lib/main.dart

To Reproduce
Steps to reproduce the behavior:

Go to 'https://pub.dev/packages/flutter_bloc#-example-tab-'
Click on 'example/lib/main.dart'
See 404 error

Most helpful comment

You can use a link to the subdirectory of the github repo on the homepage field of the pubspec.yaml, if the project is hosted as a part of a mono-repo.

For example the camera package has this in it's pubspec:

  homepage: https://github.com/flutter/plugins/tree/master/packages/camera

Pub.dev recognizes this and makes the links work out.
This only works for github and gitlab-hosted repos I believe.

All 3 comments

You can use a link to the subdirectory of the github repo on the homepage field of the pubspec.yaml, if the project is hosted as a part of a mono-repo.

For example the camera package has this in it's pubspec:

  homepage: https://github.com/flutter/plugins/tree/master/packages/camera

Pub.dev recognizes this and makes the links work out.
This only works for github and gitlab-hosted repos I believe.

@sigurdm thanks for the tip! Shouldn't this be repository instead though? We have a collection of packages and want to link to the same homepage. I would much rather update the repository url than homepage url since we have a dedicated docs website as the homepage url.

@felangel: If you have a repository url, it will take priority over homepage for such cases, and you can have both the homepage and the git repo URLs in your pubspec.yaml. However, the repository url was meant to specify the top-level of the git repo, and while we currently support it as deep links, it may change in the future.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brianegan picture brianegan  路  4Comments

jonataslaw picture jonataslaw  路  4Comments

prasant10050 picture prasant10050  路  4Comments

erickzanardo picture erickzanardo  路  5Comments

jimboyeah picture jimboyeah  路  5Comments