// GENERATED CODE - DO NOT MODIFY BY HAND part of 'learning_session_model.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** LearningSession _$LearningSessionFromJson(Map json) => LearningSession( id: LearningSession._idFromJson(json['id']), userId: LearningSession._userIdFromJson(json['user_id']), bookId: json['book_id'] as String, dailyGoal: (json['daily_goal'] as num).toInt(), newWordsCount: (json['new_words_count'] as num?)?.toInt() ?? 0, reviewCount: (json['review_count'] as num?)?.toInt() ?? 0, masteredCount: (json['mastered_count'] as num?)?.toInt() ?? 0, startedAt: DateTime.parse(json['started_at'] as String), completedAt: json['completed_at'] == null ? null : DateTime.parse(json['completed_at'] as String), ); Map _$LearningSessionToJson(LearningSession instance) => { 'id': instance.id, 'user_id': instance.userId, 'book_id': instance.bookId, 'daily_goal': instance.dailyGoal, 'new_words_count': instance.newWordsCount, 'review_count': instance.reviewCount, 'mastered_count': instance.masteredCount, 'started_at': instance.startedAt.toIso8601String(), 'completed_at': instance.completedAt?.toIso8601String(), }; DailyLearningTasks _$DailyLearningTasksFromJson(Map json) => DailyLearningTasks( newWords: (json['newWords'] as List) .map((e) => (e as num).toInt()) .toList(), reviewWords: DailyLearningTasks._reviewWordsFromJson(json['reviewWords']), masteredCount: (json['masteredCount'] as num).toInt(), totalWords: (json['totalWords'] as num).toInt(), progress: (json['progress'] as num).toDouble(), ); Map _$DailyLearningTasksToJson(DailyLearningTasks instance) => { 'newWords': instance.newWords, 'reviewWords': instance.reviewWords, 'masteredCount': instance.masteredCount, 'totalWords': instance.totalWords, 'progress': instance.progress, }; LearningStatistics _$LearningStatisticsFromJson(Map json) => LearningStatistics( todayNewWords: (json['todayNewWords'] as num).toInt(), todayReview: (json['todayReview'] as num).toInt(), todayMastered: (json['todayMastered'] as num).toInt(), totalLearned: (json['totalLearned'] as num).toInt(), totalMastered: (json['totalMastered'] as num).toInt(), avgProficiency: (json['avgProficiency'] as num).toDouble(), streakDays: (json['streakDays'] as num).toInt(), ); Map _$LearningStatisticsToJson(LearningStatistics instance) => { 'todayNewWords': instance.todayNewWords, 'todayReview': instance.todayReview, 'todayMastered': instance.todayMastered, 'totalLearned': instance.totalLearned, 'totalMastered': instance.totalMastered, 'avgProficiency': instance.avgProficiency, 'streakDays': instance.streakDays, }; StudyResult _$StudyResultFromJson(Map json) => StudyResult( wordId: json['wordId'] as String, difficulty: $enumDecode(_$StudyDifficultyEnumMap, json['difficulty']), studyTime: (json['studyTime'] as num).toInt(), ); Map _$StudyResultToJson(StudyResult instance) => { 'wordId': instance.wordId, 'difficulty': _$StudyDifficultyEnumMap[instance.difficulty]!, 'studyTime': instance.studyTime, }; const _$StudyDifficultyEnumMap = { StudyDifficulty.forgot: 'forgot', StudyDifficulty.hard: 'hard', StudyDifficulty.good: 'good', StudyDifficulty.easy: 'easy', StudyDifficulty.perfect: 'perfect', };