google / google/built_value.dart
Auto add builder factories for nested built_collection classes
- Dominant language
- Dart
- Stars
- 886
- Forks
- 195
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 4
Description
When using BuiltMap nesting, is it not automatically created?
```
abstract class Calendar implements Built {
...
@BuiltValueField(wireName: 'calendar')
BuiltMap>>? get calendar;
...
}
```
automatically generated below
```
..addBuilderFactory(
const FullType(BuiltMap, const [
const FullType(String),
const FullType(BuiltMap, const [
const FullType(String),
const FullType(
BuiltList, const [const FullType(DayDTO)])
])
]),
() => new MapBuilder>>())
```
however, the below needs to be added manually.
```
..addBuilderFactory(
const FullType(BuiltMap, const [
const FullType(String),
const FullType(
BuiltList, const [const FullType(DayDTO)])
]),
() => new MapBuilder>())
..addBuilderFactory(
const FullType(
BuiltList, const [const FullType(DayDTO)]),
() => new ListBuilder())
```
It won't work unless you add it manually in the code above. So you have to add it manually, but it works.
Is there a way to automatically generate it?
Contributor guide
Assessment
This issue has not been assessed yet.