Proposal: File organization and class exposure #614
Locked
renancaraujo
started this conversation in
General
Replies: 3 comments
-
I can see some very specific use case for people wanting to use |
Beta Was this translation helpful? Give feedback.
0 replies
-
The fork button is there for those cases. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Locking since it was fixed on #621 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a proposal to organize the files inside the package following the dart's Package layout conventions.
Current way
Currently out internal directory organization is like:
Examples:
flame.dart
file exposes elements of the Util class located in theutil
file. This brings ambiguity in the API since the util functions can be used via importing eitherflame/flame.dart
orflame/util.dart
.GameRenderBox
should not be part of the public api, but nothing stops the user from importingflame/game/game_render_box.dart
The idea
By following the convention, the file organization can become more like:
Top-level files can be like the ones in the Flutters package, only exposing what should be exposed. These export files can be separated by features, sections. They can be faced as "sub" packages
Advantages of adopting the convention:
Things like:
can become like:
Not all files in the package contain elements that should be exposed as a package API. Files under src/ are warned to not be imported in dart compatible editors.
Beta Was this translation helpful? Give feedback.
All reactions