refactor(todo,meditate,train): a title with its question mark is halkyon_ui's ExplainedTitle

Three forks of the 3 Nov review each wrote the same widget (Todo's and
Meditate's TitleWithHelp, Train's HelpTitle); halkyon_ui's ExplainedTitle,
from Learn's, takes their place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-03 23:18:11 +01:00
commit 9dcb0dbdc3
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
3 changed files with 26 additions and 81 deletions

View file

@ -1,19 +0,0 @@
import 'package:halkyon_ui/halkyon_ui.dart';
import 'package:material_ui/material_ui.dart';
/// A setting's [title] with the question mark that explains it ([help],
/// halkyon_ui's [HelpButton]) beside it, rather than the explanation always
/// below (the developer's review, 3 Nov 2026).
class const TitleWithHelp(
final String title,
final String help, {
super.key,
}) extends StatelessWidget {
@override
Widget build(BuildContext context) => Row(
children: [
Flexible(child: Text(title)),
HelpButton(help, title: title),
],
);
}

View file

@ -1,6 +1,5 @@
import 'package:clock/clock.dart';
import 'package:halkyon_todo_flutter/l10n/app_localizations.dart';
import 'package:halkyon_todo_flutter/src/core/widget/title_with_help.dart';
import 'package:halkyon_todo_flutter/src/feature/task/model/repeat.dart';
import 'package:halkyon_todo_flutter/src/feature/task/model/task.dart';
import 'package:halkyon_todo_flutter/src/feature/task/widget/task_texts.dart';
@ -353,9 +352,9 @@ class _RepeatEditorState() extends State<_RepeatEditor> {
),
),
SwitchListTile(
title: TitleWithHelp(
title: ExplainedTitle(
l10n.repeatCountFromCompletion,
l10n.repeatCountFromCompletionHint,
help: l10n.repeatCountFromCompletionHint,
),
value: _fromCompletion,
onChanged: (on) => setState(() => _fromCompletion = on),

View file

@ -3,7 +3,6 @@ import 'package:halkyon_app/halkyon_app.dart';
import 'package:halkyon_todo_flutter/l10n/app_localizations.dart';
import 'package:halkyon_todo_flutter/src/app/todo_dependencies.dart';
import 'package:halkyon_todo_flutter/src/core/privacy/todo_keys.dart';
import 'package:halkyon_todo_flutter/src/core/widget/title_with_help.dart';
import 'package:halkyon_todo_flutter/src/feature/reminder/model/snooze.dart';
import 'package:halkyon_todo_flutter/src/feature/reminder/widget/reminder_picker.dart';
import 'package:halkyon_todo_flutter/src/feature/settings/model/todo_settings.dart';
@ -63,9 +62,9 @@ class const TaskSettingsCard({super.key}) extends StatelessWidget {
),
SwitchListTile(
secondary: const Icon(LucideIcons.listRestart),
title: TitleWithHelp(
title: ExplainedTitle(
l10n.resetSubTasksTitle,
l10n.resetSubTasksHint,
help: l10n.resetSubTasksHint,
),
value: tasks.resetSubTasks,
onChanged: (on) => _write(
@ -97,9 +96,9 @@ class const ReminderSettingsCard({super.key}) extends StatelessWidget {
children: [
ListTile(
leading: const Icon(LucideIcons.alarmClockPlus),
title: TitleWithHelp(
title: ExplainedTitle(
l10n.automaticReminderTitle,
l10n.automaticReminderHint,
help: l10n.automaticReminderHint,
),
subtitle: Text(automatic(reminders.automatic)),
onTap: () async {