fix(chrome): retire PluriScreenHeader, it has no equivalent in the prototype
PluriScreenHeader was a 38-radius glass hero: an aurora banner at 24%
opacity, a black-to-transparent scrim, two radial orbs, a 120px app-mark
watermark and a 56px tri-gradient glyph badge. None of it is in the
prototype (t4) -- every root's title is plain text in its own 56px
row, which PluriRootHeader (S1) already provides. Delete the class
(and its now-orphaned _Orb helper) and its four call sites (Buscar,
Favoritos x2, Alarmas, Ajustes landed with S8).
Two of those call sites carried the hero's only functional bit besides
the title, so PluriRootHeader gains an `actions` slot (rendered before
the shared bedtime button) to keep them reachable:
- Alarmas' create-alarm button (FilledButton.tonalIcon, unchanged
shape, just relocated)
- Buscar's filters entry point (the same tappable PluriStatusPill,
just relocated)
Every other retired trailing pill (Ajustes' "Secure" status,
Favoritos' collection-count badges, Alarmas' alarm-count badge) was
purely decorative and matches the prototype by simply disappearing.
S2, Tier 1 visual-fidelity pass (audit id 2521).
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pluriwave/l10n/gen/app_localizations.dart';
|
||||
import 'package:pluriwave/tema/pluriwave_theme.dart';
|
||||
import 'package:pluriwave/widgets/pluri_layout.dart';
|
||||
import 'package:pluriwave/widgets/pluri_root_header.dart';
|
||||
|
||||
/// S1 (Tier 1 visual fidelity): the prototype draws no global `AppBar` —
|
||||
@@ -34,6 +35,19 @@ void main() {
|
||||
expect(size.height, 56);
|
||||
});
|
||||
|
||||
testWidgets('S5: uses the title tier (20px) on the left, matching the '
|
||||
"prototype's own header padding (t4 e.g. Alarmas "
|
||||
'`padding:0 12px 0 20px`)', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
host(PluriRootHeader(title: 'Settings', onSleepTimer: () {})),
|
||||
);
|
||||
|
||||
final padding = tester.widget<Padding>(find.byType(Padding).first);
|
||||
final insets = padding.padding as EdgeInsets;
|
||||
expect(insets.left, PluriLayout.titleHorizontal);
|
||||
expect(insets.right, PluriLayout.rowHorizontal);
|
||||
});
|
||||
|
||||
testWidgets('exposes a bedtime action that invokes onSleepTimer when '
|
||||
'tapped', (tester) async {
|
||||
var tapped = false;
|
||||
@@ -55,4 +69,32 @@ void main() {
|
||||
|
||||
expect(find.byType(AppBar), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('S2: renders optional actions BEFORE the bedtime button — a few '
|
||||
"roots' single functional action (e.g. Alarmas' create-alarm button, "
|
||||
"Buscar's filters entry point) that used to live on the now-retired "
|
||||
'PluriScreenHeader', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
host(
|
||||
PluriRootHeader(
|
||||
title: 'Alarms',
|
||||
onSleepTimer: () {},
|
||||
actions: [
|
||||
IconButton(icon: const Icon(Icons.add_rounded), onPressed: () {}),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.byIcon(Icons.add_rounded), findsOneWidget);
|
||||
expect(find.byIcon(Icons.bedtime_outlined), findsOneWidget);
|
||||
|
||||
final actionRect = tester.getRect(find.byIcon(Icons.add_rounded));
|
||||
final bedtimeRect = tester.getRect(find.byIcon(Icons.bedtime_outlined));
|
||||
expect(
|
||||
actionRect.left,
|
||||
lessThan(bedtimeRect.left),
|
||||
reason: 'actions render before (to the left of) the bedtime button',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user