encodeJsonTree method
Converts instance
to a JSON tree.
Before calling this method, you should call isInstance to check whether
instance
is an instance of T
.
Implementation
@override
String encodeJsonTree(T instance) {
final s = nameOf(instance);
if (s == null) {
throw StateError('Invalid value: $instance');
}
return s;
}