code_builder
code_builder copied to clipboard
A fluent API for generating valid Dart source code
See https://github.com/dart-lang/code_builder/blob/master/lib/src/matchers.dart#L5. This causes problems internally because it prevents `matcher` from being a testonly target, which it should be. It also means matcher is a transitive dep of anything that...
Hello! I am still reading the documentation of this package, so please point out if there way a piece of documentation I missed. My use case requires being able to...
It doesn't appear possible to do this with code_builder and the functionality within Flutter to do this is relatively new. In terms of an example: ```dart //... return EnumValue((builder) {...
AFAICT, the shortest way to add (foo) to your parameter list is `Parameter((b) => b..name = 'foo'`, feels like there could be something shorter? Maybe there is an I just...
Opts to rewrite `refer('Foo').newInstanceNamed('', [])` as `Foo` rather than `Foo.`. Two primary reasons 1. `Foo.` breaks compilation with bad error messages 2. [Analyzer's `ConstructorElement#name`](https://github.com/dart-lang/sdk/blob/e8939b0ff089a97297cf28626be46c3c75fe72e7/pkg/analyzer/lib/dart/element/element.dart#L466) is a non-nullable String, which pushes...
When building code for `TypeReference.newInstance/Named` and the type had `isNullable = true` the resulting code becomes `Foo?.namedConstructor()` which for my use case was not what I wanted. Here is my...
- remove the regular dependency on package:matcher - https://github.com/dart-lang/code_builder/issues/405 Creating as a draft PR - I'm trying to determine what would be impacted by this change. --- - [x] I’ve...
In `literalString`, if the EOL is CRLF it will cause incorrect code to be generated. I checked the source code and found that literalString only handles the `\n` LF case,...