Buckets:
| enum Type { multiple, boolean } | |
| enum Difficulty { easy, medium, hard } | |
| class Question { | |
| final String? categoryName; | |
| final Type? type; | |
| final Difficulty? difficulty; | |
| final String? question; | |
| final String? correctAnswer; | |
| final List<dynamic>? incorrectAnswers; | |
| Question( | |
| {this.categoryName, | |
| this.type, | |
| this.difficulty, | |
| this.question, | |
| this.correctAnswer, | |
| this.incorrectAnswers}); | |
| Question.fromMap(Map<String, dynamic> data) | |
| : categoryName = data["category"], | |
| type = data["type"] == "multiple" ? Type.multiple : Type.boolean, | |
| difficulty = data["difficulty"] == "easy" | |
| ? Difficulty.easy | |
| : data["difficulty"] == "medium" | |
| ? Difficulty.medium | |
| : Difficulty.hard, | |
| question = data["question"], | |
| correctAnswer = data["correct_answer"], | |
| incorrectAnswers = data["incorrect_answers"]; | |
| static List<Question> fromData(List<Map<String, dynamic>> data) { | |
| return data.map((question) => Question.fromMap(question)).toList(); | |
| } | |
| } | |
Xet Storage Details
- Size:
- 1.07 kB
- Xet hash:
- ae5f8f245d235754e2784da2d74bf12d5c89c18bd73961ac33efb465d8ee02e3
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.