Files
flux/lib/ui/settings/settings_view.dart
Mark M2 Macbook c6c61f1a31 Enhance theme management and UI settings
- Updated AppThemeMode enum to include icons and added fromValue method for easier theme retrieval.
- Modified ThemeBloc to manage currentTheme instead of themeMode.
- Enhanced ThemeState to reflect currentTheme and updated copyWith method.
- Added ThemeSettingsView for user-friendly theme selection in settings.
- Improved fluxLightTheme and fluxDarkTheme with new listTileTheme and color settings.
- Updated settings view to navigate to ThemeSettingsView.
- Added entitlements for network client permissions in Debug and Release profiles.
- Introduced Podfile.lock for dependency management.
- Added devtools_options.yaml for Dart & Flutter DevTools configuration.
2026-04-06 08:48:10 +02:00

105 lines
2.9 KiB
Dart

// lib/ui/impostazioni/impostazioni_view.dart
import 'package:flutter/material.dart';
import 'package:flux/theme/theme.dart';
import 'package:flux/ui/settings/theme_settings_view.dart';
class SettingsView extends StatelessWidget {
const SettingsView({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Impostazioni')),
body: ListView(
padding: const EdgeInsets.all(16),
children: [
_settingsSection('Account', [
_settingsTile(
Icons.person,
'Profilo Utente',
'Configura i tuoi dati',
context,
MaterialPageRoute(
builder: (context) => const ThemeSettingsView(),
),
),
_settingsTile(
Icons.store,
'Mio Negozio',
'Piacenza Centro',
context,
MaterialPageRoute(
builder: (context) => const ThemeSettingsView(),
),
),
]),
const SizedBox(height: 16),
_settingsSection('Applicazione', [
_settingsTile(
Icons.sync,
'Sincronizzazione',
'Ultima: 5 min fa',
context,
MaterialPageRoute(
builder: (context) => const ThemeSettingsView(),
),
),
_settingsTile(
Icons.dark_mode,
'Tema (FLUX Dark)',
'Configurazione visiva',
context,
MaterialPageRoute(
builder: (context) => const ThemeSettingsView(),
),
),
]),
const SizedBox(height: 24),
TextButton.icon(
onPressed: () {},
icon: const Icon(Icons.exit_to_app, color: Colors.red),
label: const Text('Logout', style: TextStyle(color: Colors.red)),
),
],
),
);
}
Widget _settingsSection(String title, List<Widget> tiles) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title.toUpperCase(),
style: const TextStyle(
color: FluxColors.accentTurquoise,
fontWeight: FontWeight.bold,
letterSpacing: 1,
),
),
const SizedBox(height: 8),
Card(child: Column(children: tiles)),
],
);
}
Widget _settingsTile(
IconData icon,
String title,
String subtitle,
BuildContext context,
MaterialPageRoute route,
) {
return ListTile(
leading: Icon(icon, color: FluxColors.primaryBlue),
title: Text(title, style: Theme.of(context).textTheme.titleLarge),
subtitle: Text(subtitle),
trailing: Icon(
Icons.chevron_right,
color: Theme.of(context).textTheme.bodyMedium?.color,
),
onTap: () => Navigator.of(context).push(route),
);
}
}