toJson method
- ValueSerializer? serializer,
override
Converts this object into a representation that can be encoded with
json
. The serializer
can be used to configure how individual values
will be encoded. By default, DriftRuntimeOptions.defaultSerializer will
be used. See ValueSerializer.defaults for details.
Implementation
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'chatId': serializer.toJson<String>(chatId),
'authorId': serializer.toJson<String>(authorId),
'at': serializer.toJson<PreciseDateTime>(at),
'status': serializer
.toJson<int>($ChatItemsTable.$converterstatus.toJson(status)),
'data': serializer.toJson<String>(data),
'cursor': serializer.toJson<String?>(cursor),
'ver': serializer.toJson<String>(ver),
};
}