fix: make Continue as Guest button visible, guard wishlist for guests

The guest button was nearly invisible (grey text, fontSize 13 on dark
background). Now uses white70, fontSize 15, TextButton with proper
tap padding. Also guards wishlist toggle on event detail page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 07:29:55 +05:30
parent 1c73fb8d9d
commit 9dd78be03e
2 changed files with 14 additions and 6 deletions

View File

@@ -10,6 +10,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import '../features/events/models/event_models.dart'; import '../features/events/models/event_models.dart';
import '../features/events/services/events_service.dart'; import '../features/events/services/events_service.dart';
import '../core/auth/auth_guard.dart';
class LearnMoreScreen extends StatefulWidget { class LearnMoreScreen extends StatefulWidget {
final int eventId; final int eventId;
@@ -345,7 +346,10 @@ class _LearnMoreScreenState extends State<LearnMoreScreen> {
_squareIconButton( _squareIconButton(
icon: _wishlisted ? Icons.favorite : Icons.favorite_border, icon: _wishlisted ? Icons.favorite : Icons.favorite_border,
iconColor: _wishlisted ? Colors.redAccent : Colors.white, iconColor: _wishlisted ? Colors.redAccent : Colors.white,
onTap: () => setState(() => _wishlisted = !_wishlisted), onTap: () {
if (!AuthGuard.requireLogin(context, reason: 'Sign in to save events to your wishlist.')) return;
setState(() => _wishlisted = !_wishlisted);
},
), ),
], ],
), ),

View File

@@ -515,21 +515,25 @@ class _LoginScreenState extends State<LoginScreen> {
// Continue as Guest // Continue as Guest
Center( Center(
child: GestureDetector( child: TextButton(
onTap: () { onPressed: () {
AuthGuard.setGuest(true); AuthGuard.setGuest(true);
Navigator.of(context).pushAndRemoveUntil( Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(builder: (_) => const HomeScreen()), MaterialPageRoute(builder: (_) => const HomeScreen()),
(route) => false, (route) => false,
); );
}, },
style: TextButton.styleFrom(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
),
child: const Text( child: const Text(
'Continue as Guest', 'Continue as Guest',
style: TextStyle( style: TextStyle(
color: _textMuted, color: Colors.white70,
fontSize: 13, fontSize: 15,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline, decoration: TextDecoration.underline,
decorationColor: _textMuted, decorationColor: Colors.white70,
), ),
), ),
), ),