google / google/built_value.dart
Generate onSet for non-instantiable Built Value
- Dominant language
- Dart
- Stars
- 886
- Forks
- 195
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 4
Description
I am not sure if this is a legit request but onSet field can be generated for non-instantiable Built Value classes.
I tried to something like the following:
```dart
@BuiltValue(generateBuilderOnSetField: true, instantiable: false)
abstract class Thing extends Object {
Thing rebuild(void Function(ThingBuilder) updates);
ThingBuilder toBuilder();
@nullable
String get thingName;
}
```
This does not work:
```dart
thingController = StreamController();
thingStream = Stream(thingController.stream);
thingBuilder = thing.toBuilder();
thingBuilder.onSet = thingController.add as void Function(); // this does not work. onSet isn't defined.
```
Contributor guide
Assessment
This issue has not been assessed yet.