toJson<T> abstract method

String toJson<T>(
  1. Serializer<T> serializer,
  2. T? object
)

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);