feat: Phase 1 critical gaps — gamification API, Razorpay checkout, Google OAuth, notifications
- Fix gamification endpoints to use Node.js server (app.eventifyplus.com) - Replace 6 mock gamification methods with real API calls (dashboard, leaderboard, shop, redeem, submit) - Add booking models, service, payment service (Razorpay), checkout provider - Add 3-step CheckoutScreen with Razorpay native modal integration - Add Google OAuth login (Flutter + Django backend) - Add full notifications system (Django model + 3 endpoints + Flutter UI) - Register CheckoutProvider, NotificationProvider in main.dart MultiProvider - Wire notification bell in HomeScreen app bar - Add razorpay_flutter ^1.3.7 and google_sign_in ^6.2.2 packages Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,9 @@ class GamificationProvider extends ChangeNotifier {
|
||||
List<LeaderboardEntry> leaderboard = [];
|
||||
List<ShopItem> shopItems = [];
|
||||
List<AchievementBadge> achievements = [];
|
||||
List<SubmissionModel> submissions = [];
|
||||
CurrentUserStats? currentUserStats;
|
||||
int totalParticipants = 0;
|
||||
|
||||
// Leaderboard filters — matches web version
|
||||
String leaderboardDistrict = 'Overall Kerala';
|
||||
@@ -31,15 +34,22 @@ class GamificationProvider extends ChangeNotifier {
|
||||
|
||||
try {
|
||||
final results = await Future.wait([
|
||||
_service.getProfile(),
|
||||
_service.getDashboard(),
|
||||
_service.getLeaderboard(district: leaderboardDistrict, timePeriod: leaderboardTimePeriod),
|
||||
_service.getShopItems(),
|
||||
_service.getAchievements(),
|
||||
]);
|
||||
|
||||
profile = results[0] as UserGamificationProfile;
|
||||
leaderboard = results[1] as List<LeaderboardEntry>;
|
||||
shopItems = results[2] as List<ShopItem>;
|
||||
final dashboard = results[0] as DashboardResponse;
|
||||
profile = dashboard.profile;
|
||||
submissions = dashboard.submissions;
|
||||
|
||||
final lbResponse = results[1] as LeaderboardResponse;
|
||||
leaderboard = lbResponse.entries;
|
||||
currentUserStats = lbResponse.currentUser;
|
||||
totalParticipants = lbResponse.totalParticipants;
|
||||
|
||||
shopItems = results[2] as List<ShopItem>;
|
||||
achievements = results[3] as List<AchievementBadge>;
|
||||
} catch (e) {
|
||||
error = userFriendlyError(e);
|
||||
@@ -57,7 +67,10 @@ class GamificationProvider extends ChangeNotifier {
|
||||
leaderboardDistrict = district;
|
||||
notifyListeners();
|
||||
try {
|
||||
leaderboard = await _service.getLeaderboard(district: district, timePeriod: leaderboardTimePeriod);
|
||||
final response = await _service.getLeaderboard(district: district, timePeriod: leaderboardTimePeriod);
|
||||
leaderboard = response.entries;
|
||||
currentUserStats = response.currentUser;
|
||||
totalParticipants = response.totalParticipants;
|
||||
} catch (e) {
|
||||
error = userFriendlyError(e);
|
||||
}
|
||||
@@ -72,7 +85,10 @@ class GamificationProvider extends ChangeNotifier {
|
||||
leaderboardTimePeriod = period;
|
||||
notifyListeners();
|
||||
try {
|
||||
leaderboard = await _service.getLeaderboard(district: leaderboardDistrict, timePeriod: period);
|
||||
final response = await _service.getLeaderboard(district: leaderboardDistrict, timePeriod: period);
|
||||
leaderboard = response.entries;
|
||||
currentUserStats = response.currentUser;
|
||||
totalParticipants = response.totalParticipants;
|
||||
} catch (e) {
|
||||
error = userFriendlyError(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user