Where to put Dart package assets

Issue

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!

Solution

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.

Answered By – Günter Zöchbauer

Answer Checked By – Mary Flores (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.