import 'package:flutter/material.dart'; import 'package:relationship_saver/core/config/app_config.dart'; import 'package:relationship_saver/core/config/app_theme.dart'; import 'package:relationship_saver/features/shared/frosted_card.dart'; class SettingsView extends StatelessWidget { const SettingsView({super.key}); @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.fromLTRB(28, 24, 28, 28), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('Settings', style: Theme.of(context).textTheme.headlineMedium), const SizedBox(height: 6), Text( 'Environment and integration configuration for this build.', style: Theme.of( context, ).textTheme.bodyLarge?.copyWith(color: AppTheme.textSecondary), ), const SizedBox(height: 16), FrostedCard( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ _SettingRow( label: 'Gateway mode', value: AppConfig.useFakeBackend ? 'Fake (offline-safe)' : 'REST', ), const SizedBox(height: 12), _SettingRow(label: 'Base URL', value: AppConfig.backendBaseUrl), const SizedBox(height: 12), const _SettingRow( label: 'Realtime', value: 'Planned later (SSE/WebSocket)', ), ], ), ), const SizedBox(height: 16), FrostedCard( child: Text( 'Run options\n• Fake mode: flutter run --dart-define=USE_FAKE_BACKEND=true\n• REST mode: flutter run --dart-define=USE_FAKE_BACKEND=false --dart-define=BACKEND_BASE_URL=https://your-api', style: Theme.of(context).textTheme.bodyLarge, ), ), ], ), ); } } class _SettingRow extends StatelessWidget { const _SettingRow({required this.label, required this.value}); final String label; final String value; @override Widget build(BuildContext context) { return Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( width: 140, child: Text( label, style: Theme.of( context, ).textTheme.titleMedium?.copyWith(color: AppTheme.textSecondary), ), ), Expanded( child: Text(value, style: Theme.of(context).textTheme.bodyLarge), ), ], ); } }