refactor: reduce duplication and improve readability of settings page
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
調査の方向性
lib/app/modules/settings/views/ から始め、設定ページと、一覧にある4つのtoggle trailingファイルを読みます。共有のSettingsGroup、言語名getter、抽出したdelete-tasksタイルを計画する前に、SupportedLanguageとインラインのタスク削除確認をたどります。完了とは、繰り返されているセクションとtoggleのロジックが統合され、言語名のソースが1つになり、ダイアログが抽出され、取り込まれた5つのファイルが削除されている状態です。
索引モデルが issue の本文から書いたものです。
説明
The settings page (lib/app/modules/settings/views/) has significant code duplication and readability
issues:
- Repeated section boilerplate - _buildSectionHeader() and _buildSettingsCard() are called manually for
every settings group with the same styling logic. - Near-identical toggle widgets - 4 separate files (settings_page_on_task_start_list_tile_trailing.dart,
settings_page_on_task_create_list_tile_trailing.dart, settings_page_highlist_task_list_tile_trailing.dart,
settings_page_enable_24hr_format_list_tile_trailing.dart) each containing ~30 lines that all do the same
thing: Obx(() => Switch(...)). - Hardcoded language names - _getLanguageName() duplicates what should be part of the SupportedLanguage enum, requiring updates in multiple places when a language is added.
- Large inline widgets - The delete-tasks confirmation dialog (~80 lines) is inlined directly in the body,
hurting readability.
Proposed Changes
- Introduce SettingsGroup widget + SettingsItemConfig sealed class
A single reusable widget that accepts title, icon, and a List and handles section
header, card styling, and dividers internally. Three item types:
- SettingsToggleItem - title, subtitle, RxBool value, optional prefsKey (auto-saves to SharedPreferences),
optional onChanged for extra side effects - SettingsDropdownItem - title, subtitle, Rx value, options list, labelBuilder, onChanged
- SettingsCustomItem wraps any custom widget
-
Add nativeName getter to SupportedLanguage
Centralizes display names so Dart's exhaustive switch enforces updates when new languages are added. -
Extract delete-tasks tile into SettingsPageDeleteTasksTile
Moves the FutureBuilder + confirmation dialog into its own widget file. -
Delete absorbed files
Remove the 5 single-purpose trailing widget files whose logic is now handled by SettingsGroup.
- 主要言語
- Dart
- スター
- 244
- フォーク
- 179
- 平均マージ
- 12時間 42分
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CCExtractor/taskwarrior-flutter のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CCExtractor/taskwarrior-flutter#639 · コメント 2 件 ·
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
CCExtractor/taskwarrior-flutter#647 · リアクション 1 件 ·
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
CCExtractor/taskwarrior-flutter#645 · コメント 1 件 ·
CCExtractor/taskwarrior-flutter の issue をすべて見る
似ている issue
-
[Super Editor][Chat] - Floating editor scaffold does not reset panel height after closing panel オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
status: needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
a2ui-project/a2ui#2763 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
AOSSIE-Org/Ell-ena#332 ·
-
ui/ux
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
HemantKArya/BloomeeTunes#489 ·