From 51cc737ad878d8c1f0ca53c2f2790b7641df9221 Mon Sep 17 00:00:00 2001 From: zeefaad Date: Wed, 9 Jul 2025 18:26:37 +0200 Subject: [PATCH] Settings is scrollable --- lib/pages/settings_page.dart | 165 ++++++++++++++++------------------- 1 file changed, 76 insertions(+), 89 deletions(-) diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index 9ac277e..7eef3fa 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -28,97 +28,84 @@ class _SettingsPageState extends State { ), 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(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(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(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(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); + }, + ), + ], + ), + ), + ], + ), ), ), );