Update default location to Thrissur and remove Whitefield, Bengaluru

This commit is contained in:
Rishad7594
2026-04-07 20:49:40 +05:30
parent 685c6755d8
commit 7bc396bdde
11 changed files with 944 additions and 284 deletions

View File

@@ -12,7 +12,7 @@ class GamificationProvider extends ChangeNotifier {
UserGamificationProfile? profile;
List<LeaderboardEntry> leaderboard = [];
List<ShopItem> shopItems = [];
List<AchievementBadge> achievements = [];
List<AchievementBadge> achievements = GamificationService.defaultBadges; // Initialize with defaults
List<SubmissionModel> submissions = [];
CurrentUserStats? currentUserStats;
int totalParticipants = 0;
@@ -60,10 +60,16 @@ class GamificationProvider extends ChangeNotifier {
shopItems = results[2] as List<ShopItem>;
// Prefer achievements from dashboard API; fall back to getAchievements()
// Prefer achievements from dashboard API; fall back to fetched or existing defaults
final dashAchievements = dashboard.achievements;
final fetchedAchievements = results[3] as List<AchievementBadge>;
achievements = dashAchievements.isNotEmpty ? dashAchievements : fetchedAchievements;
if (dashAchievements.isNotEmpty) {
achievements = dashAchievements;
} else if (fetchedAchievements.isNotEmpty) {
achievements = fetchedAchievements;
}
// Otherwise, keep current defaults
_lastLoadTime = DateTime.now();
} catch (e) {