[REQ] [Dart] Avoid using part and create mini libraries instead
Created by: nickmeinhold
Is your feature request related to a problem? Please describe.
I had to refactor the templates from using part
to creating mini libraries because having models as parts caused problems. That was for my case but more generally, I think it might be a better and is the recommended approach.
Describe the solution you'd like
Refactor the templates to avoid using part
Describe alternatives you've considered
I think there are arguments to be made both ways. The official line is to avoid using part and create mini libraries instead
Using part
does makes life easier in creating/editing generators as a set of part
files are like one big file, but that does lose the potential benefits of having 'library private' access between files and can mean less control over what is ultimately exposed.
Also, using part
for models and apis also can limit having an extra step with dart codegen that uses part
(although that may be less of a concern for most people)
Additional context
https://dart.dev/guides/libraries/create-library-packages https://stackoverflow.com/a/27764138/1992736