I am writing a Dart package, and I would like to have a resources directory that Pub includes with the package. I want this directory to be accessible relative to the root file of the package. Is there a standard way of doing this with Pub?
Thanks!
I am writing a Dart package, and I would like to have a resources directory that Pub includes with the package. I want this directory to be accessible relative to the root file of the package. Is there a standard way of doing this with Pub?
Thanks!
In general only files within lib/**
can be used from other packages, therefore this is where you should put them.
Your question doesn't contain a lot of information what kind of package your want to create and what kind of resources you want to ship with the package or how the resources are supposed to be used by the user of the package. There are a few open bugs about other ways to make resources available to running applications.
Assets are available within the lib folder. Create a folder under lib called assets, i.e. /lib/assets
Then link it in pubspec.yaml:
assets: - assets/something.jpeg