...
This commit is contained in:
@@ -8,8 +8,17 @@ import '../models/math_quiz_difficulty.dart'; // 👈 MathQuizDifficulty 정의
|
||||
|
||||
class MathQuizController with ChangeNotifier {
|
||||
late final MathQuizDifficulty difficulty;
|
||||
late final String userId;
|
||||
late final String? userName;
|
||||
// 🔽 [수정] late final -> late (값 변경 또는 별도 초기화를 위해 final 제거)
|
||||
late String userId;
|
||||
late String? userName;
|
||||
|
||||
// ... (기존 멤버 변수들 유지) ...
|
||||
|
||||
// 🔽 [신규 추가] 유저 정보 설정 메서드
|
||||
void setUserInfo(String userId, String? userName) {
|
||||
this.userId = userId;
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
late MathQuizPuzzle puzzle;
|
||||
late List<String?> _userAnswers;
|
||||
@@ -71,10 +80,10 @@ class MathQuizController with ChangeNotifier {
|
||||
_timer?.cancel();
|
||||
}
|
||||
|
||||
void startNewGame(MathQuizDifficulty level, String userId, String? userName) {
|
||||
void startNewGame(MathQuizDifficulty level) {
|
||||
this.difficulty = level;
|
||||
this.userId = userId;
|
||||
this.userName = userName;
|
||||
// this.userId = userId;
|
||||
// this.userName = userName;
|
||||
_totalPuzzlesInLevel = level.puzzleCount;
|
||||
_currentPuzzleIndex = 0;
|
||||
_isGameCompleted = false;
|
||||
|
||||
Reference in New Issue
Block a user