feat: rebuild desktop UI to match Figma + website, hero slider improvements

- Desktop sidebar (262px, blue gradient, white pill nav), topbar (search + bell + avatar), responsive shell rewritten
- Desktop homepage: immersive hero with Ken Burns animation, pill category chips, date badge cards matching mvnew.eventifyplus.com/home
- Desktop calendar: 60/40 two-column layout with white background
- Desktop profile: full-width banner + 3-column event grids
- Desktop learn more: hero image + about/venue columns + gallery strip
- Desktop settings/contribute: polished to match design system
- Mobile hero slider: RepaintBoundary, animated dots with 44px tap targets, 5s auto-scroll, 8s post-swipe delay, shimmer loading, dynamic event type badge, human-readable dates
- Guest access: requiresAuth false on read endpoints
- Location fix: show place names instead of lat/lng coordinates
- Version 1.6.1+17

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 13:28:19 +05:30
parent 9dd78be03e
commit bc6fde1b90
21 changed files with 2938 additions and 1285 deletions

View File

@@ -3,7 +3,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'login_screen.dart';
import 'desktop_login_screen.dart';
import '../core/theme_manager.dart';
import 'privacy_policy_screen.dart'; // new import
import 'privacy_policy_screen.dart';
import '../core/app_decoration.dart';
class SettingsScreen extends StatefulWidget {
@@ -15,7 +15,8 @@ class SettingsScreen extends StatefulWidget {
class _SettingsScreenState extends State<SettingsScreen> {
bool _notifications = true;
String _appVersion = '1.2(p)';
String _appVersion = '1.6(p)';
int _selectedSection = 0; // 0=Preferences, 1=Account, 2=About
@override
void initState() {
@@ -100,16 +101,209 @@ class _SettingsScreenState extends State<SettingsScreen> {
);
}
// ── Settings content sections ────────────────────────────────────────────
Widget _buildPreferencesSection() {
const primary = Color(0xFF0B63D6);
return SingleChildScrollView(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.fromLTRB(18, 0, 18, 24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 8),
Container(
margin: const EdgeInsets.symmetric(vertical: 6),
decoration: BoxDecoration(color: Theme.of(context).cardColor, borderRadius: BorderRadius.circular(12), boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 4))]),
child: SwitchListTile(
tileColor: Theme.of(context).cardColor,
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
value: _notifications,
onChanged: (v) => _saveNotifications(v),
title: const Text('Reminders'),
secondary: const Icon(Icons.notifications, color: primary),
),
),
const SizedBox(height: 8),
Container(
margin: const EdgeInsets.symmetric(vertical: 6),
decoration: BoxDecoration(color: Theme.of(context).cardColor, borderRadius: BorderRadius.circular(12), boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 4))]),
child: ValueListenableBuilder<ThemeMode>(
valueListenable: ThemeManager.themeMode,
builder: (context, mode, _) {
return SwitchListTile(
tileColor: Theme.of(context).cardColor,
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
value: mode == ThemeMode.dark,
onChanged: (v) => ThemeManager.setThemeMode(v ? ThemeMode.dark : ThemeMode.light),
title: const Text('Dark Mode'),
secondary: const Icon(Icons.dark_mode, color: primary),
);
},
),
),
],
),
);
}
Widget _buildAccountSection() {
return SingleChildScrollView(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.fromLTRB(18, 8, 18, 24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildTile(
icon: Icons.person,
title: 'Edit Profile',
subtitle: 'Change username, email or photo',
onTap: () => ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Open Profile tab'))),
),
const SizedBox(height: 24),
Center(
child: ElevatedButton(
onPressed: _confirmLogout,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.red.shade600,
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 14),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),
),
child: const Text('Logout', style: TextStyle(color: Colors.white)),
),
),
],
),
);
}
Widget _buildAboutSection() {
return SingleChildScrollView(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.fromLTRB(18, 8, 18, 24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildTile(icon: Icons.info_outline, title: 'App Version', subtitle: _appVersion, onTap: () {}),
const SizedBox(height: 12),
_buildTile(
icon: Icons.privacy_tip_outlined,
title: 'Privacy Policy',
onTap: () => Navigator.of(context).push(MaterialPageRoute(builder: (_) => const PrivacyPolicyScreen())),
),
],
),
);
}
Widget _buildActiveSection() {
switch (_selectedSection) {
case 1: return _buildAccountSection();
case 2: return _buildAboutSection();
default: return _buildPreferencesSection();
}
}
@override
Widget build(BuildContext context) {
const primary = Color(0xFF0B63D6);
final width = MediaQuery.of(context).size.width;
final isLandscape = width >= 820;
// ── LANDSCAPE layout ──────────────────────────────────────────────────
if (isLandscape) {
const navIcons = [Icons.tune, Icons.person_outline, Icons.info_outline];
const navLabels = ['Preferences', 'Account', 'About'];
return Row(
children: [
// Left: settings nav on gradient
Flexible(
flex: 1,
child: RepaintBoundary(
child: Container(
decoration: AppDecoration.blueGradient,
child: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const Padding(
padding: EdgeInsets.fromLTRB(20, 24, 20, 20),
child: Text('Settings', style: TextStyle(color: Colors.white, fontSize: 22, fontWeight: FontWeight.w700)),
),
...List.generate(navLabels.length, (i) {
final isActive = _selectedSection == i;
return MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () => setState(() => _selectedSection = i),
child: AnimatedContainer(
duration: const Duration(milliseconds: 200),
margin: const EdgeInsets.fromLTRB(16, 0, 16, 8),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
decoration: BoxDecoration(
color: isActive ? Colors.white : Colors.white.withOpacity(0.08),
borderRadius: BorderRadius.circular(12),
),
child: Row(children: [
Icon(navIcons[i], size: 20, color: isActive ? primary : Colors.white70),
const SizedBox(width: 12),
Text(navLabels[i], style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14, color: isActive ? primary : Colors.white)),
]),
),
),
);
}),
const Spacer(),
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 24),
child: OutlinedButton.icon(
onPressed: _confirmLogout,
icon: const Icon(Icons.logout, color: Colors.white70, size: 18),
label: const Text('Logout', style: TextStyle(color: Colors.white70)),
style: OutlinedButton.styleFrom(
side: const BorderSide(color: Colors.white24),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
padding: const EdgeInsets.symmetric(vertical: 12),
),
),
),
],
),
),
),
),
),
// Right: settings content
Flexible(
flex: 2,
child: RepaintBoundary(
child: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(24, 24, 24, 12),
child: Text(
navLabels[_selectedSection],
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
),
Expanded(child: _buildActiveSection()),
],
),
),
),
),
],
);
}
// ── MOBILE layout ─────────────────────────────────────────────────────
return Scaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SafeArea(
child: Column(
children: [
// Header
Container(
width: double.infinity,
padding: const EdgeInsets.fromLTRB(20, 18, 20, 18),
@@ -131,41 +325,27 @@ class _SettingsScreenState extends State<SettingsScreen> {
],
),
),
const SizedBox(height: 18),
// Content
Expanded(
child: SingleChildScrollView(
padding: const EdgeInsets.fromLTRB(18, 0, 18, 24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Account
const Text('Account', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
const SizedBox(height: 12),
_buildTile(
icon: Icons.person,
title: 'Edit Profile',
subtitle: 'Change username, email or photo',
onTap: () {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Open Profile tab (demo)')));
},
onTap: () => ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Open Profile tab (demo)'))),
),
const SizedBox(height: 12),
// Preferences
const Text('Preferences', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
const SizedBox(height: 12),
// Reminders switch wrapped in card-like container
Container(
margin: const EdgeInsets.symmetric(vertical: 6),
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.circular(12),
boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 4))],
),
decoration: BoxDecoration(color: Theme.of(context).cardColor, borderRadius: BorderRadius.circular(12), boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 4))]),
child: SwitchListTile(
tileColor: Theme.of(context).cardColor,
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
@@ -175,54 +355,34 @@ class _SettingsScreenState extends State<SettingsScreen> {
secondary: const Icon(Icons.notifications, color: primary),
),
),
const SizedBox(height: 8),
// Dark Mode switch wrapped in card-like container and hooked to ThemeManager
Container(
margin: const EdgeInsets.symmetric(vertical: 6),
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.circular(12),
boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 4))],
),
decoration: BoxDecoration(color: Theme.of(context).cardColor, borderRadius: BorderRadius.circular(12), boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 4))]),
child: ValueListenableBuilder<ThemeMode>(
valueListenable: ThemeManager.themeMode,
builder: (context, mode, _) {
final isDark = mode == ThemeMode.dark;
return SwitchListTile(
tileColor: Theme.of(context).cardColor,
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
value: isDark,
onChanged: (v) => ThemeManager.setThemeMode(v ? ThemeMode.dark : ThemeMode.light),
title: const Text('Dark Mode'),
secondary: const Icon(Icons.dark_mode, color: primary),
);
},
builder: (context, mode, _) => SwitchListTile(
tileColor: Theme.of(context).cardColor,
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
value: mode == ThemeMode.dark,
onChanged: (v) => ThemeManager.setThemeMode(v ? ThemeMode.dark : ThemeMode.light),
title: const Text('Dark Mode'),
secondary: const Icon(Icons.dark_mode, color: primary),
),
),
),
const SizedBox(height: 18),
// About
const Text('About', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
const SizedBox(height: 12),
_buildTile(icon: Icons.info_outline, title: 'App Version', subtitle: _appVersion, onTap: () {}),
const SizedBox(height: 12),
// Privacy Policy tile now navigates to PrivacyPolicyScreen
_buildTile(
icon: Icons.privacy_tip_outlined,
title: 'Privacy Policy',
subtitle: 'Demo app',
onTap: () {
Navigator.of(context).push(MaterialPageRoute(builder: (_) => const PrivacyPolicyScreen()));
},
onTap: () => Navigator.of(context).push(MaterialPageRoute(builder: (_) => const PrivacyPolicyScreen())),
),
const SizedBox(height: 24),
// Logout area
Center(
child: Column(
children: [
@@ -240,7 +400,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
],
),
),
const SizedBox(height: 32),
],
),