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>{
'userId': serializer.toJson<String>(userId),
'favoriteChatsListVersion':
serializer.toJson<String?>(favoriteChatsListVersion),
'favoriteChatsSynchronized':
serializer.toJson<bool?>(favoriteChatsSynchronized),
'chatContactsListVersion':
serializer.toJson<String?>(chatContactsListVersion),
'favoriteContactsSynchronized':
serializer.toJson<bool?>(favoriteContactsSynchronized),
'contactsSynchronized': serializer.toJson<bool?>(contactsSynchronized),
'blocklistSynchronized': serializer.toJson<bool?>(blocklistSynchronized),
'sessionsListVersion': serializer.toJson<String?>(sessionsListVersion),
'blocklistVersion': serializer.toJson<String?>(blocklistVersion),
'blocklistCount': serializer.toJson<int?>(blocklistCount),
};
}