Add launch configuration, update API keys, and refactor UI components for better structure and performance

This commit is contained in:
Dayron
2025-10-06 14:17:30 +02:00
parent 29141ba8b2
commit 797f77cf69
16 changed files with 371 additions and 351 deletions

View File

@@ -9,68 +9,93 @@ class SettingsThemeContent extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Thème'),
title: const Text('Thème'),
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
),
body: Consumer<ThemeProvider>(
builder: (context, themeProvider, child) {
return ListView(
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
children: [
Text(
'Choisir le thème',
style: Theme.of(context).textTheme.headlineSmall,
),
SizedBox(height: 20),
const SizedBox(height: 20),
// Option Système
RadioListTile<ThemeMode>(
title: Text('Système'),
subtitle: Text('Suit les paramètres de votre appareil'),
value: ThemeMode.system,
groupValue: themeProvider.themeMode,
onChanged: (ThemeMode? value) {
if (value != null) {
themeProvider.setThemeMode(value);
}
},
secondary: Icon(Icons.brightness_auto),
Card(
child: ListTile(
leading: Icon(
themeProvider.themeMode == ThemeMode.system
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
color: themeProvider.themeMode == ThemeMode.system
? Theme.of(context).colorScheme.primary
: null,
),
title: const Text('Système'),
subtitle: const Text('Suit les paramètres de votre appareil'),
trailing: const Icon(Icons.brightness_auto),
selected: themeProvider.themeMode == ThemeMode.system,
onTap: () {
themeProvider.setThemeMode(ThemeMode.system);
},
),
),
const SizedBox(height: 8),
// Option Clair
RadioListTile<ThemeMode>(
title: Text('Clair'),
subtitle: Text('Thème clair en permanence'),
value: ThemeMode.light,
groupValue: themeProvider.themeMode,
onChanged: (ThemeMode? value) {
if (value != null) {
themeProvider.setThemeMode(value);
}
},
secondary: Icon(Icons.light_mode),
Card(
child: ListTile(
leading: Icon(
themeProvider.themeMode == ThemeMode.light
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
color: themeProvider.themeMode == ThemeMode.light
? Theme.of(context).colorScheme.primary
: null,
),
title: const Text('Clair'),
subtitle: const Text('Thème clair en permanence'),
trailing: const Icon(Icons.light_mode),
selected: themeProvider.themeMode == ThemeMode.light,
onTap: () {
themeProvider.setThemeMode(ThemeMode.light);
},
),
),
const SizedBox(height: 8),
// Option Sombre
RadioListTile<ThemeMode>(
title: Text('Sombre'),
subtitle: Text('Thème sombre en permanence'),
value: ThemeMode.dark,
groupValue: themeProvider.themeMode,
onChanged: (ThemeMode? value) {
if (value != null) {
themeProvider.setThemeMode(value);
}
},
secondary: Icon(Icons.dark_mode),
Card(
child: ListTile(
leading: Icon(
themeProvider.themeMode == ThemeMode.dark
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
color: themeProvider.themeMode == ThemeMode.dark
? Theme.of(context).colorScheme.primary
: null,
),
title: const Text('Sombre'),
subtitle: const Text('Thème sombre en permanence'),
trailing: const Icon(Icons.dark_mode),
selected: themeProvider.themeMode == ThemeMode.dark,
onTap: () {
themeProvider.setThemeMode(ThemeMode.dark);
},
),
),
SizedBox(height: 30),
const SizedBox(height: 30),
// Aperçu du thème actuel
Card(
child: Padding(
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -78,7 +103,7 @@ class SettingsThemeContent extends StatelessWidget {
'Aperçu',
style: Theme.of(context).textTheme.titleMedium,
),
SizedBox(height: 10),
const SizedBox(height: 10),
Row(
children: [
Icon(
@@ -87,7 +112,7 @@ class SettingsThemeContent extends StatelessWidget {
: Icons.light_mode,
color: Theme.of(context).colorScheme.primary,
),
SizedBox(width: 10),
const SizedBox(width: 10),
Text(
themeProvider.isDarkMode
? 'Mode sombre actif'