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),
'num': serializer.toJson<String>(num),
'login': serializer.toJson<String?>(login),
'name': serializer.toJson<String?>(name),
'bio': serializer.toJson<String?>(bio),
'hasPassword': serializer.toJson<bool>(hasPassword),
'emails': serializer.toJson<String>(emails),
'phones': serializer.toJson<String>(phones),
'chatDirectLink': serializer.toJson<String?>(chatDirectLink),
'unreadChatsCount': serializer.toJson<int>(unreadChatsCount),
'status': serializer.toJson<String?>(status),
'avatar': serializer.toJson<String?>(avatar),
'callCover': serializer.toJson<String?>(callCover),
'presenceIndex': serializer.toJson<int>(presenceIndex),
'online': serializer.toJson<bool>(online),
'muted': serializer.toJson<String?>(muted),
'blocklistCount': serializer.toJson<int?>(blocklistCount),
'lastSeenAt': serializer.toJson<PreciseDateTime?>(lastSeenAt),
'ver': serializer.toJson<String>(ver),
'welcomeMessage': serializer.toJson<String?>(welcomeMessage),
};
}