code_builder
code_builder copied to clipboard
A fluent API for generating valid Dart source code
When using `extension`s its possible to have a `property` that's defined in a different file. It would be nice if there was a way to generate the appropriate import.
I am upgrading my package (Kiwi) vanlooverenkoen/kiwi#51 But it seems that code_builder is not yet migrated to support nullsafety. Is there a timeline on when this could be added?
When using code_builder I noticed that if I use `assignFinal` with a nullable type, it doesn't output the question mark. Reproduction recipe: ```dart final statement = refer('foo') .assignFinal( 'bar', TypeReference((b)...
I'd love to be able to create structures like these: ```dart while (condition) { doThingies(); } ```
https://dart.dev/guides/language/language-tour#collection-operators Not sure of a better way to do this than using `Code` today.
See comments at https://github.com/dart-lang/code_builder/pull/275 for details.
A previous version had `.asIf()` for building statements like ``` if (something) { // ... } ``` As far as I know, the only way to do these with current...
Or is it completely up to the user to make sure to only use the supported constructs? Sometimes (the particular case I'm having at hand is required named arguments) it's...
Some libraries as freezed need private constructor to enable some features, could be good to add that option to class code_builder ```dart class Foo { const Foo._(); } ```
Named Required Parameters are expected to be passed as optionalParameters I had initially written my code to pass required named parameters into the requiredParameters array, that appears to be wrong....