fix(chrome): drop the global AppBar, give each root its own title row
The prototype (t4) draws no global app bar anywhere: every root paints a plain ~56px title row inside its own content instead (Alarmas line 325, Ajustes line 511, Explorar line 641). app.dart wrapped every tab in PluriWaveScaffold(appBar: AppBar(title: Text(appTitle), ...)), adding 56dp of chrome and a "PluriWave" title the prototype never shows. Add PluriRootHeader, a shared 56px title-row widget reused by all 5 roots. Extract app.dart's old _mostrarTimerDialog (only reachable from the removed AppBar action) into a free function, showPluriSleepTimerSheet, so every root's header can open the same sheet directly and the sleep-timer feature stays reachable from every tab with no behaviour change. S1, Tier 1 visual-fidelity pass (audit id 2521).
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../l10n/gen/app_localizations.dart';
|
||||
import '../tema/pluriwave_theme.dart';
|
||||
|
||||
/// S1 (Tier 1 visual fidelity): the prototype (`t4`) draws no global
|
||||
/// `AppBar` — each root paints its own 56px title row inside its own
|
||||
/// content instead (e.g. Alarmas `height:56px;padding:0 12px 0 20px`,
|
||||
/// Ajustes `height:56px;padding:0 20px`, Explorar `height:56px`). This
|
||||
/// widget is that row, reused by all 5 roots so the sleep-timer action
|
||||
/// that used to live on `app.dart`'s single shared `AppBar` stays
|
||||
/// reachable from every tab.
|
||||
class PluriRootHeader extends StatelessWidget {
|
||||
const PluriRootHeader({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.onSleepTimer,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final VoidCallback onSleepTimer;
|
||||
|
||||
static const double height = 56;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final type = context.pluriType;
|
||||
final l10n = AppLocalizations.of(context);
|
||||
return SizedBox(
|
||||
height: height,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 0, 12, 0),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: type.sectionTitle,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.bedtime_outlined),
|
||||
tooltip: l10n.sleepTimer,
|
||||
onPressed: onSleepTimer,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user