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
This commit is contained in:
@@ -20,6 +20,8 @@ import 'package:geocoding/geocoding.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../features/gamification/providers/gamification_provider.dart';
|
||||
import '../features/notifications/widgets/notification_bell.dart';
|
||||
import '../features/notifications/providers/notification_provider.dart';
|
||||
|
||||
class HomeScreen extends StatefulWidget {
|
||||
const HomeScreen({Key? key}) : super(key: key);
|
||||
@@ -126,6 +128,11 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(userFriendlyError(e))));
|
||||
}
|
||||
}
|
||||
|
||||
// Refresh notification badge count (fire-and-forget)
|
||||
if (mounted) {
|
||||
context.read<NotificationProvider>().refreshUnreadCount();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _reverseGeocodeAndSave(double lat, double lng, SharedPreferences prefs) async {
|
||||
@@ -438,12 +445,7 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
|
||||
children: [
|
||||
RepaintBoundary(child: _buildHomeContent()), // index 0
|
||||
const RepaintBoundary(child: CalendarScreen()), // index 1
|
||||
RepaintBoundary(
|
||||
child: ChangeNotifierProvider(
|
||||
create: (_) => GamificationProvider(),
|
||||
child: const ContributeScreen(),
|
||||
),
|
||||
), // index 2 (full page, scrollable)
|
||||
const RepaintBoundary(child: ContributeScreen()), // index 2 (full page, scrollable)
|
||||
const RepaintBoundary(child: ProfileScreen()), // index 3
|
||||
],
|
||||
),
|
||||
@@ -1221,18 +1223,25 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: _openEventSearch,
|
||||
child: Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.15),
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: Colors.white.withOpacity(0.2)),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const NotificationBell(),
|
||||
const SizedBox(width: 8),
|
||||
GestureDetector(
|
||||
onTap: _openEventSearch,
|
||||
child: Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.15),
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: Colors.white.withOpacity(0.2)),
|
||||
),
|
||||
child: const Icon(Icons.search, color: Colors.white, size: 24),
|
||||
),
|
||||
),
|
||||
child: const Icon(Icons.search, color: Colors.white, size: 24),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user