toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> resultMap = switch (type) {
    'QuestionnaireState' => {
        keyResult: (result as QuestionnaireState).toJson(),
      },
    'bool' => {keyResult: result},
    _ => throw ArgumentError('Unknown result type $type'),
  };
  return mergeMaps<String, dynamic>(_$ResultToJson(this), resultMap);
}