Convert an Attribute to a JSON object.
Map<String, dynamic> toJson() { return { 'key': key, 'value': value, }; }