toJson method
Implementation
@override
Object toJson() => {
if (text case final text?) 'text': text.toJson(),
if (type.isNotDefault) 'type': type.toJson(),
if (sentiment case final sentiment?) 'sentiment': sentiment.toJson(),
if (probability.isNotDefault) 'probability': encodeDouble(probability),
};