Map<String, Object?> toJson() { final stateKey = this.stateKey; return { 'content': content, if (stateKey != null) 'state_key': stateKey, 'type': type, }; }