read method
Attempts to create an instance of T with information read from
the constant obj.
Should throw ErrorOf with type argument Decoder with type argument
T if an instance of T cannot be read from obj.
Implementation
@override
double read(DartObject obj) => switch (obj.toDoubleValue()) {
double value => value,
_ => throw readError(obj),
};