Conversation
The data model class to use level instead of stage. Any code that references the old stage field to use level instead. Accepts answers that are 'close enough' to the correct answer (based on the Levenshtein edit distance) Shows the user their input along with the correct spelling in the success dialog Visually differentiates between exact matches and close-enough matches Still gives the user points for answers that are close enough Removes the dashboard related codes since there is home
Reviewer's Guide by SourceryThis pull request introduces the Hibboo language learning game to QubeeGames. It includes the game logic, UI, state management, and data persistence. The game presents word-based puzzles in a question-answer format, provides hints, and tracks user progress with a visual tree evolution. The implementation follows a clean architecture pattern and uses Provider for state management. Sequence diagram for solving a Hibboo puzzlesequenceDiagram
participant User
participant HibbooPlayingPage
participant HibbooProvider
participant Hibboo
User->>HibbooPlayingPage: Enters answer and submits
HibbooPlayingPage->>HibbooProvider: checkAnswer(userAnswer)
HibbooProvider->>Hibboo: get correctAnswer
alt userAnswer == correctAnswer
HibbooProvider->>HibbooProvider: _growthPoints += 10, _correctAnswers += 1
HibbooProvider->>HibbooProvider: _currentIndex++
HibbooProvider-->>HibbooPlayingPage: isCorrect = true
HibbooPlayingPage->>User: Show success dialog
else userAnswer is close enough to correctAnswer
HibbooProvider->>HibbooProvider: _growthPoints += 10, _correctAnswers += 1
HibbooProvider->>HibbooProvider: _currentIndex++
HibbooProvider-->>HibbooPlayingPage: isCorrect = false, isCloseEnough = true
HibbooPlayingPage->>User: Show success dialog with correct spelling
else
HibbooProvider-->>HibbooPlayingPage: isCorrect = false
HibbooPlayingPage->>User: Show error effect
end
Updated class diagram for Hibboo gameclassDiagram
class Hibboo {
String text
String answer
int level
}
class HibbooModel {
String text
String answer
int level
+fromJson(Map data) HibbooModel
+toJson() Map
}
class HibbooDatasource {
+getHibbooList() Future<List<HibbooModel>>
}
class HibbooRepositoryImpl {
+getHibbooList() Future<List<Hibboo>>
}
class GetHibbooList {
+call() Future<List<Hibboo>>
}
class HibbooProvider {
List<Hibboo> hibbooList
int currentIndex
int growthPoints
int correctAnswers
+loadHibbooList() Future<void>
+solveAndAdvance() Hibboo
+getHibboosByLevel(int level) List<Hibboo>
+resetAchievement() void
}
Hibboo <.. HibbooModel : maps to
HibbooRepositoryImpl ..> HibbooDatasource : uses
GetHibbooList ..> HibbooRepositoryImpl : uses
HibbooProvider ..> GetHibbooList : uses
note for HibbooProvider "Manages the state of the Hibboo game"
note for Hibboo "Represents a Hibboo puzzle"
note for HibbooModel "Data model for Hibboo puzzle"
note for HibbooDatasource "Fetches Hibboo data from a data source"
note for HibbooRepositoryImpl "Implements the Hibboo repository interface"
note for GetHibbooList "Use case for getting the list of Hibboo puzzles"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @venopyX - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a navigation bar to the bottom of the home page for easier access to different sections of the app.
- The tree widget could be made more generic by allowing the user to pass in custom trunk and leaf colors.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| int get growthPoints => _growthPoints; | ||
| int get correctAnswers => _correctAnswers; // Getter for correct answers | ||
| bool get isLoading => _hibbooList.isEmpty; | ||
| bool get hasAchievement => _correctAnswers >= 65; // Achievement unlocked at 85+ correct answers |
There was a problem hiding this comment.
suggestion (bug_risk): Inconsistent achievement threshold value.
The getter returns true when _correctAnswers is 65 or more, yet other parts of the UI and text indicate a requirement of 85 correct answers. Consider aligning this threshold to avoid user confusion.
| bool get hasAchievement => _correctAnswers >= 65; // Achievement unlocked at 85+ correct answers | |
| bool get hasAchievement => _correctAnswers >= 85; // Achievement unlocked at 85+ correct answers |
| ), | ||
| ), | ||
|
|
||
| if (widget.showSparkles) |
There was a problem hiding this comment.
suggestion (bug_risk): Sparkle animation controller is not started.
The _sparkleController is instantiated but never started (e.g., via forward() or repeat()), so the FadeTransition may not animate as expected. Consider triggering the animation in initState or when showSparkles is true.
Suggested implementation:
@override
void initState() {
super.initState();
_sparkleController = AnimationController(vsync: this, duration: const Duration(milliseconds: 800));
if (widget.showSparkles) {
_sparkleController.repeat(reverse: true);
}
@override
void didUpdateWidget(covariant TreeWidget oldWidget) {
super.didUpdateWidget(oldWidget);
if (widget.showSparkles && !oldWidget.showSparkles) {
_sparkleController.repeat(reverse: true);
} else if (!widget.showSparkles && oldWidget.showSparkles) {
_sparkleController.stop();
}
}
Make sure that _sparkleController is disposed in the dispose() method if not already implemented:
@OverRide
void dispose() {
_sparkleController.dispose();
super.dispose();
}
Adjust the AnimationController duration or behavior if necessary to match the desired animation effect.
Feature: Hibboo Language Learning Game
Overview
This PR adds the new Hibboo language learning mini-game to QubeeGames, expanding my educational offerings with an interactive traditional Oromo word-based puzzle experience that combines learning with visual growth progression.
Feature Details
🎮 Hibboo Game Mechanics
📈 Progress & Achievement System
🌱 Visual Growth Representation
🧠 Educational Approach
Implementation Notes
Testing
This feature expands QubeeGames' educational value by introducing a new way for users to learn vocabulary while enjoying visual progress feedback, complementing our existing game collection.
PR by: venopyX
Date: 2025-03-06 13:39:51 UTC
Summary by Sourcery
Adds a Hibboo language learning mini-game to QubeeGames, featuring word-based puzzles, a visual growth progression system, and achievement tracking.
New Features:
Tests: