| 123456789101112131415161718192021222324 |
- /// 统计数据模型
- class Stats {
- final int total;
- final Map<String, int> byQuestionType;
- final Map<String, int> byImportType;
- final Map<String, int> byChapter;
- Stats({
- this.total = 0,
- this.byQuestionType = const {},
- this.byImportType = const {},
- this.byChapter = const {},
- });
- factory Stats.fromJson(Map<String, dynamic> json) {
- return Stats(
- total: json['total'] ?? 0,
- byQuestionType: Map<String, int>.from(json['by_question_type'] ?? {}),
- byImportType: Map<String, int>.from(json['by_import_type'] ?? {}),
- byChapter: Map<String, int>.from(json['by_chapter'] ?? {}),
- );
- }
- }
|