Closed flappyBug closed 4 years ago
Unfortunately you cannot use non-const values in annotations.
const DataField('scanResult', <String>[].runtimeType); # throws an error
We're working on adding support for this. The update should be out by tomorrow.
Is it possible to add the same functionality also for BuiltList<Foo>
?
@superEnum
class _Event {
@Data(fields: [
DataField('foo', BuiltList<int>)
])
Foo,
}
Added in #33
I have trouble using a specific type of generic type in DataField. Let's take
List<int>
for example.The above code won't compile, with following error message:
Seems like dart compiler takes
<>
as two separate part. With some hard trying, I changed the code toThat was much better, with the following error message though:
BTW, the following code do compile without using super_enum: