Skip to content

Commit

Permalink
fix: add explicit toJson for abstract classed
Browse files Browse the repository at this point in the history
  • Loading branch information
Numoy committed Nov 3, 2023
1 parent cd38246 commit 1e69bca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/src/model/answer/answer_format.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,10 @@ abstract class AnswerFormat {
throw Exception('Unknown type: $type');
}
}

Map<String, dynamic> toJson() {
return {
'type': answerType,
};
}
}
7 changes: 7 additions & 0 deletions lib/src/model/content/content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,12 @@ abstract class Content {
}
}

Map<String, dynamic> toJson() {
return {
'id': id,
'type': contentType,
};
}

Widget createWidget();
}

0 comments on commit 1e69bca

Please sign in to comment.