billsplit: use the shared SectionHeader instead of the local copy

`design_system`'s `SectionHeader` was built as the union of untools'
`_SectionHeading` and billsplit's `_SectionHeader` -- its `defaultPadding`
is `fromLTRB(md, md, md, xs)` specifically to reproduce billsplit's
`(16, 16, 16, 4)`. The shared widget shipped and untools' donor was
deleted, but billsplit's never was: the file has imported
`package:design_system/design_system.dart` since the migration while still
defining and using its own copy. That is a duplicate shipped rather than
removed, which is the failure the extraction phases exist to prevent.

Verified equivalent rather than assumed: padding `(16,16,16,4)`, glyph
origin `(16,16)`, line height 24.0 and type size 16.0 are all identical
to the retired widget. The one difference is that the shared version wraps
the title in `Row`/`Expanded` to leave room for its optional trailing
action, so the `Text` box fills the row instead of shrinking to content --
invisible for a left-aligned title with no action, but it does change
hit-test width, so it is worth stating rather than calling a pure no-op.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U4Rj3s7K2qzrLNgJqqPhno
This commit is contained in:
Krzysztof Rudnicki 2026-08-15 15:26:55 +02:00
parent 9f5400919e
commit 78327da7d6

View File

@ -17,7 +17,7 @@ class PeopleScreen extends StatelessWidget {
body: ListView(
padding: const EdgeInsets.only(bottom: 96),
children: [
const _SectionHeader('People'),
const SectionHeader('People', padding: SectionHeader.defaultPadding),
if (state.people.isEmpty)
const Padding(
padding: EdgeInsets.all(16),
@ -25,7 +25,7 @@ class PeopleScreen extends StatelessWidget {
),
for (final p in state.people) _PersonTile(person: p),
const Divider(height: 32),
const _SectionHeader('Groups'),
const SectionHeader('Groups', padding: SectionHeader.defaultPadding),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
@ -132,17 +132,6 @@ class PeopleScreen extends StatelessWidget {
}
}
class _SectionHeader extends StatelessWidget {
const _SectionHeader(this.text);
final String text;
@override
Widget build(BuildContext context) => Padding(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 4),
child: Text(text, style: Theme.of(context).textTheme.titleMedium),
);
}
class _PersonTile extends StatelessWidget {
const _PersonTile({required this.person});
final Person person;