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.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// 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});
|
||||
@@ -18,12 +19,18 @@ class SettingsView extends StatelessWidget {
|
||||
'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),
|
||||
@@ -33,12 +40,18 @@ class SettingsView extends StatelessWidget {
|
||||
'Sincronizzazione',
|
||||
'Ultima: 5 min fa',
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const ThemeSettingsView(),
|
||||
),
|
||||
),
|
||||
_settingsTile(
|
||||
Icons.dark_mode,
|
||||
'Tema (FLUX Dark Active)',
|
||||
'Tema (FLUX Dark)',
|
||||
'Configurazione visiva',
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const ThemeSettingsView(),
|
||||
),
|
||||
),
|
||||
]),
|
||||
const SizedBox(height: 24),
|
||||
@@ -75,6 +88,7 @@ class SettingsView extends StatelessWidget {
|
||||
String title,
|
||||
String subtitle,
|
||||
BuildContext context,
|
||||
MaterialPageRoute route,
|
||||
) {
|
||||
return ListTile(
|
||||
leading: Icon(icon, color: FluxColors.primaryBlue),
|
||||
@@ -84,6 +98,7 @@ class SettingsView extends StatelessWidget {
|
||||
Icons.chevron_right,
|
||||
color: Theme.of(context).textTheme.bodyMedium?.color,
|
||||
),
|
||||
onTap: () => Navigator.of(context).push(route),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
35
lib/ui/settings/theme_settings_view.dart
Normal file
35
lib/ui/settings/theme_settings_view.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/data/enums.dart';
|
||||
import 'package:flux/theme/theme.dart';
|
||||
import 'package:flux/theme/theme_bloc.dart';
|
||||
|
||||
class ThemeSettingsView extends StatelessWidget {
|
||||
const ThemeSettingsView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Impostazioni Tema')),
|
||||
body: BlocBuilder<ThemeBloc, ThemeState>(
|
||||
builder: (context, state) => RadioGroup<AppThemeMode>(
|
||||
groupValue: state.currentTheme,
|
||||
onChanged: (newTheme) {
|
||||
if (newTheme != null) {
|
||||
context.read<ThemeBloc>().add(ChangeThemeEvent(newTheme));
|
||||
}
|
||||
},
|
||||
child: Column(
|
||||
children: AppThemeMode.values.map((theme) {
|
||||
return RadioListTile<AppThemeMode>(
|
||||
title: Text(theme.label),
|
||||
secondary: Icon(theme.icon, color: context.accent),
|
||||
value: theme,
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user