How to exclude files from pub publish for Dart packages?
You can add them in .gitignore
while publishing to pub.dev
and later remove from .gitignore
before pushing to GitHub
.
Referenced from dart documentation.
What files are published? All files in your package are included in the published package, with the following exceptions: Any packages directories. Your package’s lockfile. If you aren’t using Git, all hidden files (that is, files whose names begin with .). If you’re using Git, any files ignored by your .gitignore file. Be sure to delete any files you don’t want to include (or add them to .gitignore). pub publish lists all files that it’s going to publish before uploading your package, so examine the list carefully before completing your upload.