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:
@@ -5,9 +5,13 @@ import '../core/utils/error_utils.dart';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:video_player/video_player.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../features/auth/services/auth_service.dart';
|
||||
import '../features/auth/providers/auth_provider.dart';
|
||||
import '../core/auth/auth_guard.dart';
|
||||
import 'home_screen.dart';
|
||||
import 'responsive_layout.dart';
|
||||
import 'home_desktop_screen.dart';
|
||||
|
||||
class LoginScreen extends StatefulWidget {
|
||||
const LoginScreen({Key? key}) : super(key: key);
|
||||
@@ -124,6 +128,27 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _performGoogleLogin() async {
|
||||
try {
|
||||
setState(() => _loading = true);
|
||||
await Provider.of<AuthProvider>(context, listen: false).googleLogin();
|
||||
if (mounted) {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(builder: (_) => ResponsiveLayout(mobile: HomeScreen(), desktop: const HomeDesktopScreen())),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(userFriendlyError(e))),
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
if (mounted) setState(() => _loading = false);
|
||||
}
|
||||
}
|
||||
|
||||
/// Glassmorphism pill-shaped input decoration
|
||||
InputDecoration _glassInputDecoration({
|
||||
required String hint,
|
||||
@@ -474,7 +499,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
color: Color(0xFF4285F4),
|
||||
),
|
||||
),
|
||||
onTap: _showComingSoon,
|
||||
onTap: _performGoogleLogin,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
_socialButton(
|
||||
|
||||
Reference in New Issue
Block a user