encodeJson method
Encodes this element into a JSON string.
Any DateTime
objects contained are encoded using encodeTime
if
provided, or otherwise using DateTime.toIso8601String()
method.
Implementation
@override
String encodeJson({Object Function(DateTime time)? encodeTime}) =>
json.encode(
toJson(),
toEncodable: encodeTime != null
? (dynamic object) =>
encodeJsonObject(object, encodeTime: encodeTime)
: encodeJsonObject,
);