diff --git a/apps/mobile/packages/features/client/reports/analysis_output.txt b/apps/mobile/packages/features/client/reports/analysis_output.txt deleted file mode 100644 index e9cdc382..00000000 Binary files a/apps/mobile/packages/features/client/reports/analysis_output.txt and /dev/null differ diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/pages/language_selection_page.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/pages/language_selection_page.dart index 95ec18b1..01b902c5 100644 --- a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/pages/language_selection_page.dart +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/pages/language_selection_page.dart @@ -9,19 +9,23 @@ import 'package:flutter_modular/flutter_modular.dart'; /// Displays available languages and allows the user to select their preferred /// language. Changes are applied immediately via [LocaleBloc] and persisted. /// Shows a snackbar when the language is successfully changed. -class LanguageSelectionPage extends StatefulWidget { +class LanguageSelectionPage extends StatelessWidget { /// Creates a [LanguageSelectionPage]. const LanguageSelectionPage({super.key}); - @override - State createState() => _LanguageSelectionPageState(); -} + String _getLocalizedLanguageName(AppLocale locale) { + switch (locale) { + case AppLocale.en: + return 'English'; + case AppLocale.es: + return 'Español'; + } + } -class _LanguageSelectionPageState extends State { - void _showLanguageChangedSnackbar(String languageName) { + void _showLanguageChangedSnackbar(BuildContext context, String languageName) { UiSnackbar.show( context, - message: 'Language changed to $languageName', + message: '${t.settings.change_language}: $languageName', type: UiSnackbarType.success, ); @@ -33,7 +37,7 @@ class _LanguageSelectionPageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: UiAppBar( - title: 'Select Language', + title: t.settings.change_language, showBackButton: true, bottom: PreferredSize( preferredSize: const Size.fromHeight(1.0), @@ -46,17 +50,9 @@ class _LanguageSelectionPageState extends State { return ListView( padding: const EdgeInsets.all(UiConstants.space5), children: [ - _buildLanguageOption( - context, - label: 'English', - locale: AppLocale.en, - ), + _buildLanguageOption(context, locale: AppLocale.en), const SizedBox(height: UiConstants.space4), - _buildLanguageOption( - context, - label: 'Español', - locale: AppLocale.es, - ), + _buildLanguageOption(context, locale: AppLocale.es), ], ); }, @@ -67,9 +63,9 @@ class _LanguageSelectionPageState extends State { Widget _buildLanguageOption( BuildContext context, { - required String label, required AppLocale locale, }) { + final String label = _getLocalizedLanguageName(locale); // Check if this option is currently selected. final AppLocale currentLocale = LocaleSettings.currentLocale; final bool isSelected = currentLocale == locale; @@ -79,7 +75,7 @@ class _LanguageSelectionPageState extends State { // Only proceed if selecting a different language if (currentLocale != locale) { Modular.get().add(ChangeLocale(locale.flutterLocale)); - _showLanguageChangedSnackbar(label); + _showLanguageChangedSnackbar(context, label); } }, borderRadius: BorderRadius.circular(UiConstants.radiusMdValue),