How to correctly organize multiple examples on a dart package

306 views Asked by At

Given a dart package organized as follow

/example
|_______/foo
|________________/pubspec.yaml (and stuff)
|________________/main.dart
|_______/baz
|________________/pubspec.yaml (and stuff)
|________________/main.dart
/lib
|_______/foo
|________________/foo.dart
|_______/baz
|________________/baz.dart
/test
|_______/foo
|________________/foo_test.dart
|_______/baz
|________________/baz_test.dart

but pub.dev gives me

0/10 points: Package has an example
> No example found.
See package layout guidelines on how to add an example.

but I didn't find the documentation very helpful concerning my case

which brings me to the question in the title:

How to correctly organize multiple examples on a dart package?

1

There are 1 answers

3
Jean Lucas On BEST ANSWER

You can add a README.md file inside your example folder, as flutter_mobx package.

look: https://pub.dev/packages/flutter_mobx/example