From 78327da7d6961f67711523115eb14420fe214921 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sat, 15 Aug 2026 15:26:55 +0200 Subject: [PATCH] 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) Claude-Session: https://claude.ai/code/session_01U4Rj3s7K2qzrLNgJqqPhno --- billsplit/lib/ui/people_screen.dart | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/billsplit/lib/ui/people_screen.dart b/billsplit/lib/ui/people_screen.dart index e8ad102..e1874bd 100644 --- a/billsplit/lib/ui/people_screen.dart +++ b/billsplit/lib/ui/people_screen.dart @@ -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;