toJson method
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<int>(id),
'updatedAt': serializer.toJson<DateTime>(updatedAt),
'lenderId': serializer.toJson<String>(lenderId),
'apiEndpoint': serializer.toJson<String>(apiEndpoint),
'apiKey': serializer.toJson<String>(apiKey),
'apiSecret': serializer.toJson<String>(apiSecret),
'appBundle': serializer.toJson<String>(appBundle),
'shouldSyncData': serializer.toJson<bool>(shouldSyncData),
'lastSync': serializer.toJson<DateTime?>(lastSync),
};
}