Skip to content

Commit d51cfc5

Browse files
committed
refactor(ui): replace back arrow with dismiss button in settings
Updated the AppBar on the SettingsPage to use a close icon (Icons.close) instead of the default back arrow. The onPressed action is simplified to context.pop(), which is appropriate for a modal dialog.
1 parent fed84bf commit d51cfc5

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

lib/settings/view/settings_page.dart

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,9 @@ class SettingsPage extends StatelessWidget {
2525
return Scaffold(
2626
appBar: AppBar(
2727
leading: IconButton(
28-
icon: const Icon(Icons.arrow_back),
28+
icon: const Icon(Icons.close),
2929
onPressed: () {
30-
if (context.canPop()) {
31-
context.pop();
32-
} else {
33-
// Fallback if it can't pop, perhaps go to account page directly
34-
context.goNamed(Routes.accountName);
35-
}
30+
context.pop();
3631
},
3732
),
3833
title: Text(l10n.settingsTitle),
@@ -84,21 +79,21 @@ class SettingsPage extends StatelessWidget {
8479
context: context,
8580
icon: Icons.language_outlined,
8681
title: l10n.settingsLanguageTitle,
87-
onTap: () => context.goNamed(Routes.settingsLanguageName),
82+
onTap: () => context.pushNamed(Routes.settingsLanguageName),
8883
),
8984
const Divider(indent: AppSpacing.lg, endIndent: AppSpacing.lg),
9085
_buildSettingsTile(
9186
context: context,
9287
icon: Icons.palette_outlined,
9388
title: l10n.settingsAppearanceTitle,
94-
onTap: () => context.goNamed(Routes.settingsAppearanceName),
89+
onTap: () => context.pushNamed(Routes.settingsAppearanceName),
9590
),
9691
const Divider(indent: AppSpacing.lg, endIndent: AppSpacing.lg),
9792
_buildSettingsTile(
9893
context: context,
9994
icon: Icons.feed_outlined,
10095
title: l10n.settingsFeedDisplayTitle,
101-
onTap: () => context.goNamed(Routes.settingsFeedName),
96+
onTap: () => context.pushNamed(Routes.settingsFeedName),
10297
),
10398
const Divider(indent: AppSpacing.lg, endIndent: AppSpacing.lg),
10499
// _buildSettingsTile(

0 commit comments

Comments
 (0)