Skip to content

refactor(client): SettingsListTile widget to dedupe settings-row pattern#1110

Open
NC1107 wants to merge 1 commit into
mainfrom
refactor/settings-tile-component
Open

refactor(client): SettingsListTile widget to dedupe settings-row pattern#1110
NC1107 wants to merge 1 commit into
mainfrom
refactor/settings-tile-component

Conversation

@NC1107
Copy link
Copy Markdown
Owner

@NC1107 NC1107 commented May 22, 2026

Summary

Adds `SettingsListTile` — a thin wrapper over Material's `ListTile` that bakes in the standard settings-row defaults (`contentPadding: EdgeInsets.zero`, muted icon at size 22, theme-aware title and subtitle text, and a chevron trailing when `onTap` is set). Migrates 5 of the highest-impact call sites in `about_section.dart` and `data_storage_section.dart`.

Test plan

  • `flutter test test/widgets/settings_screen_test.dart` — 9/9 pass
  • `flutter analyze` clean on all three touched files
  • `dart format` clean

Why this and not the existing CardRow?

`CardRow` is the badge-style row used by the Settings home list (colored icon badge, no subtitle). `SettingsListTile` is the plainer settings-detail row (no badge, with subtitle line). Different visual treatment, complementary widgets.

Behind the scenes

  • New widget: `apps/client/lib/src/widgets/settings/settings_list_tile.dart`
  • Migrated: `about_section.dart` (Add server, Debug Logs, Send feedback, Privacy) and `data_storage_section.dart` (Message Cache)
  • 89 LOC removed at call sites, 70 LOC added in the widget — net +20 lines that absorb future tile additions for free
  • Devices section and the Export My Data tile keep their bespoke trailing widgets / stack-based leading and stay raw `ListTile`s; responsive: 5 screens missing mobile layout forks #1098 tracks the remaining migration sweep.

Continues the 2026-05-22 componentization pass (#1098).

Centralises the standard settings-row shape (icon + title + optional subtitle
+ chevron-or-custom-trailing) so each section stops re-declaring
contentPadding: EdgeInsets.zero, the muted-icon size, theme-aware text styles,
and the chevron trailing. Migrates 4 sites in about_section and 1 in
data_storage_section. Other callsites with bespoke trailing widgets or
stack-based leading remain untouched for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant