toJson method

  1. @override
Map<String, dynamic> toJson()

Returns the stored information about this PolicySubject in a Map which could be directly used to creates a json entry.

Stores expiringTimestamp and type in the Map. The Map is empty if both fields are null.

Implementation

@override
Map<String, dynamic> toJson() {
  final Map<String, dynamic> newJson = <String, dynamic>{};
  if (expiringTimestamp != null)
    newJson[DittoKeys.expiry] = expiringTimestamp!.toIso8601String();
  if (type != null) newJson[DittoKeys.type] = type;
  return newJson;
}