toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => {
      'kind': kind.name,
      if (title != null) 'title': title,
      if (choices.isNotEmpty)
        'choices': [
          for (final c in choices) {'text': c.text, 'id': c.id}
        ],
      if (texts.isNotEmpty) 'texts': texts.take(_maxTexts).toList(),
      if (owner != null) 'owner': owner,
    };