The generic part of the code:
enum Default<T extends Object> {
font<String>('roboto'),
size<double>(17.0),
weight<int>(400);
const Default(this.value);
final T value;
}
And I find that it works completely well with the following:
enum Default<T> {
font<String>('roboto'),
size<double>(17.0),
weight<int>(400);
const Default(this.value);
final T value;
}
What is the difference between enum Default<T extends Object>
and enum Default<T>
? I actually don’t find a valid reason why it needs to extends Object
.