toJson<T> abstract method
Convenience method for when you want a JSON string and know the type
you're serializing. Specify the type by specifying its Serializer
class. Equivalent to calling serialize with a specifiedType
then
calling json.encode
.
Implementation
String toJson<T>(Serializer<T> serializer, T? object);