mirror of
https://github.com/kuhyx/testsAndMisc-archive.git
synced 2026-11-28 14:49:05 +01:00
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:
parent
9f5400919e
commit
78327da7d6
@ -17,7 +17,7 @@ class PeopleScreen extends StatelessWidget {
|
|||||||
body: ListView(
|
body: ListView(
|
||||||
padding: const EdgeInsets.only(bottom: 96),
|
padding: const EdgeInsets.only(bottom: 96),
|
||||||
children: [
|
children: [
|
||||||
const _SectionHeader('People'),
|
const SectionHeader('People', padding: SectionHeader.defaultPadding),
|
||||||
if (state.people.isEmpty)
|
if (state.people.isEmpty)
|
||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.all(16),
|
padding: EdgeInsets.all(16),
|
||||||
@ -25,7 +25,7 @@ class PeopleScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
for (final p in state.people) _PersonTile(person: p),
|
for (final p in state.people) _PersonTile(person: p),
|
||||||
const Divider(height: 32),
|
const Divider(height: 32),
|
||||||
const _SectionHeader('Groups'),
|
const SectionHeader('Groups', padding: SectionHeader.defaultPadding),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Text(
|
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 {
|
class _PersonTile extends StatelessWidget {
|
||||||
const _PersonTile({required this.person});
|
const _PersonTile({required this.person});
|
||||||
final Person person;
|
final Person person;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user