Settings is scrollable

This commit is contained in:
2025-07-09 18:26:37 +02:00
parent 1b261c08bb
commit 51cc737ad8

View File

@ -28,97 +28,84 @@ class _SettingsPageState extends State<SettingsPage> {
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
l10n.languageSetting,
style: Theme.of(context).textTheme.headlineSmall,
),
const SizedBox(height: 10),
Card(
color: Theme.of(context).cardTheme.color,
child: Column(
children: [
ListTile(
title: Text(l10n.english, style: Theme.of(context).textTheme.titleMedium),
trailing: currentLocale.languageCode == 'en'
? Icon(Icons.check_circle, color: Theme.of(context).colorScheme.secondary)
: null,
onTap: () {
final localeProvider = Provider.of<LocaleProvider>(context, listen: false);
localeProvider.setLocale(const Locale('en', ''));
},
),
ListTile(
title: Text(l10n.french, style: Theme.of(context).textTheme.titleMedium),
trailing: currentLocale.languageCode == 'fr'
? Icon(Icons.check_circle, color: Theme.of(context).colorScheme.secondary)
: null,
onTap: () {
final localeProvider = Provider.of<LocaleProvider>(context, listen: false);
localeProvider.setLocale(const Locale('fr', ''));
},
),
],
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
l10n.languageSetting,
style: Theme.of(context).textTheme.headlineSmall,
),
),
const SizedBox(height: 30),
Text(
l10n.themeSetting,
style: Theme.of(context).textTheme.headlineSmall,
),
const SizedBox(height: 10),
Card(
color: Theme.of(context).cardTheme.color,
child: Column(
children: [
ListTile(
title: Text(l10n.themeSystem, style: Theme.of(context).textTheme.titleMedium),
trailing: themeProvider.themeMode == ThemeMode.system
? Icon(Icons.check_circle, color: Theme.of(context).colorScheme.secondary)
: null,
onTap: () {
themeProvider.setThemeMode(ThemeMode.system);
},
),
ListTile(
title: Text(l10n.themeLight, style: Theme.of(context).textTheme.titleMedium),
trailing: themeProvider.themeMode == ThemeMode.light
? Icon(Icons.check_circle, color: Theme.of(context).colorScheme.secondary)
: null,
onTap: () {
themeProvider.setThemeMode(ThemeMode.light);
},
),
ListTile(
title: Text(l10n.themeDark, style: Theme.of(context).textTheme.titleMedium),
trailing: themeProvider.themeMode == ThemeMode.dark
? Icon(Icons.check_circle, color: Theme.of(context).colorScheme.secondary)
: null,
onTap: () {
themeProvider.setThemeMode(ThemeMode.dark);
},
),
],
const SizedBox(height: 10),
Card(
color: Theme.of(context).cardTheme.color,
child: Column(
children: [
ListTile(
title: Text(l10n.english, style: Theme.of(context).textTheme.titleMedium),
trailing: currentLocale.languageCode == 'en'
? Icon(Icons.check_circle, color: Theme.of(context).colorScheme.secondary)
: null,
onTap: () {
final localeProvider = Provider.of<LocaleProvider>(context, listen: false);
localeProvider.setLocale(const Locale('en', ''));
},
),
ListTile(
title: Text(l10n.french, style: Theme.of(context).textTheme.titleMedium),
trailing: currentLocale.languageCode == 'fr'
? Icon(Icons.check_circle, color: Theme.of(context).colorScheme.secondary)
: null,
onTap: () {
final localeProvider = Provider.of<LocaleProvider>(context, listen: false);
localeProvider.setLocale(const Locale('fr', ''));
},
),
],
),
),
),
],
const SizedBox(height: 30),
Text(
l10n.themeSetting,
style: Theme.of(context).textTheme.headlineSmall,
),
const SizedBox(height: 10),
Card(
color: Theme.of(context).cardTheme.color,
child: Column(
children: [
ListTile(
title: Text(l10n.themeSystem, style: Theme.of(context).textTheme.titleMedium),
trailing: themeProvider.themeMode == ThemeMode.system
? Icon(Icons.check_circle, color: Theme.of(context).colorScheme.secondary)
: null,
onTap: () {
themeProvider.setThemeMode(ThemeMode.system);
},
),
ListTile(
title: Text(l10n.themeLight, style: Theme.of(context).textTheme.titleMedium),
trailing: themeProvider.themeMode == ThemeMode.light
? Icon(Icons.check_circle, color: Theme.of(context).colorScheme.secondary)
: null,
onTap: () {
themeProvider.setThemeMode(ThemeMode.light);
},
),
ListTile(
title: Text(l10n.themeDark, style: Theme.of(context).textTheme.titleMedium),
trailing: themeProvider.themeMode == ThemeMode.dark
? Icon(Icons.check_circle, color: Theme.of(context).colorScheme.secondary)
: null,
onTap: () {
themeProvider.setThemeMode(ThemeMode.dark);
},
),
],
),
),
],
),
),
),
);