···
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
3
+
import 'package:provider/provider.dart';
4
+
import '../../providers/auth_provider.dart';
import '../../widgets/primary_button.dart';
class FeedScreen extends StatelessWidget {
···
Widget build(BuildContext context) {
12
-
onPopInvokedWithResult: (didPop, result) {
12
+
final authProvider = Provider.of<AuthProvider>(context);
13
+
final isAuthenticated = authProvider.isAuthenticated;
backgroundColor: const Color(0xFF0B0F14),
backgroundColor: const Color(0xFF0B0F14),
foregroundColor: Colors.white,
22
-
title: const Text('Feed'),
23
-
leading: IconButton(
24
-
icon: const Icon(Icons.arrow_back),
25
-
onPressed: () => context.go('/'),
20
+
title: Text(isAuthenticated ? 'Feed' : 'Explore'),
21
+
automaticallyImplyLeading: !isAuthenticated,
22
+
leading: !isAuthenticated
24
+
icon: const Icon(Icons.arrow_back),
25
+
onPressed: () => context.go('/'),
28
+
actions: isAuthenticated
31
+
icon: const Icon(Icons.person),
33
+
// TODO: Navigate to profile screen
···
mainAxisAlignment: MainAxisAlignment.center,
48
+
color: Color(0xFFFF6B35),
50
+
const SizedBox(height: 24),
52
+
isAuthenticated ? 'Welcome to Coves!' : 'Explore Coves',
53
+
style: const TextStyle(
fontWeight: FontWeight.bold,
const SizedBox(height: 16),
44
-
'Browse communities without signing in',
60
+
if (isAuthenticated && authProvider.did != null) ...[
65
+
color: Colors.white.withValues(alpha: 0.6),
68
+
const SizedBox(height: 4),
71
+
style: const TextStyle(
73
+
color: Color(0xFFB6C2D2),
74
+
fontFamily: 'monospace',
76
+
textAlign: TextAlign.center,
79
+
const SizedBox(height: 32),
82
+
? 'Your personalized feed will appear here'
83
+
: 'Browse communities and discover conversations',
84
+
style: const TextStyle(
color: Color(0xFFB6C2D2),
textAlign: TextAlign.center,
51
-
const SizedBox(height: 32),
53
-
title: 'Back to Home',
57
-
variant: ButtonVariant.outline,
90
+
const SizedBox(height: 48),
91
+
if (isAuthenticated) ...[
94
+
onPressed: () async {
95
+
await authProvider.signOut();
96
+
// Explicitly redirect to landing screen after sign out
97
+
if (context.mounted) {
101
+
variant: ButtonVariant.outline,
106
+
onPressed: () => context.go('/login'),
107
+
variant: ButtonVariant.solid,
109
+
const SizedBox(height: 12),
111
+
title: 'Create account',
112
+
onPressed: () => context.go('/login'),
113
+
variant: ButtonVariant.outline,