Add launch configuration, update API keys, and refactor UI components for better structure and performance
This commit is contained in:
@@ -8,18 +8,18 @@ class SettingsContent extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
'Paramètres',
|
||||
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
const SizedBox(height: 20),
|
||||
|
||||
// Section Profil intégrée
|
||||
ProfileContent(),
|
||||
const ProfileContent(),
|
||||
|
||||
SizedBox(height: 20),
|
||||
const SizedBox(height: 20),
|
||||
|
||||
// Autres paramètres
|
||||
Text(
|
||||
@@ -30,39 +30,39 @@ class SettingsContent extends StatelessWidget {
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
ListTile(
|
||||
leading: Icon(Icons.palette),
|
||||
title: Text('Thème'),
|
||||
subtitle: Text('Clair, sombre ou système'),
|
||||
trailing: Icon(Icons.arrow_forward_ios),
|
||||
leading: const Icon(Icons.palette),
|
||||
title: const Text('Thème'),
|
||||
subtitle: const Text('Clair, sombre ou système'),
|
||||
trailing: const Icon(Icons.arrow_forward_ios),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => SettingsThemeContent()),
|
||||
MaterialPageRoute(builder: (context) => const SettingsThemeContent()),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
ListTile(
|
||||
leading: Icon(Icons.notifications),
|
||||
title: Text('Notifications'),
|
||||
trailing: Icon(Icons.arrow_forward_ios),
|
||||
leading: const Icon(Icons.notifications),
|
||||
title: const Text('Notifications'),
|
||||
trailing: const Icon(Icons.arrow_forward_ios),
|
||||
onTap: () {},
|
||||
),
|
||||
|
||||
ListTile(
|
||||
leading: Icon(Icons.language),
|
||||
title: Text('Langue'),
|
||||
trailing: Icon(Icons.arrow_forward_ios),
|
||||
leading: const Icon(Icons.language),
|
||||
title: const Text('Langue'),
|
||||
trailing: const Icon(Icons.arrow_forward_ios),
|
||||
onTap: () {},
|
||||
),
|
||||
|
||||
ListTile(
|
||||
leading: Icon(Icons.privacy_tip),
|
||||
title: Text('Confidentialité'),
|
||||
trailing: Icon(Icons.arrow_forward_ios),
|
||||
leading: const Icon(Icons.privacy_tip),
|
||||
title: const Text('Confidentialité'),
|
||||
trailing: const Icon(Icons.arrow_forward_ios),
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user