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).
214 lines
7.3 KiB
Dart
214 lines
7.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../l10n/gen/app_localizations.dart';
|
|
import '../widgets/pluri_icon.dart';
|
|
import '../widgets/pluri_layout.dart';
|
|
import '../widgets/pluri_premium_widgets.dart';
|
|
import '../widgets/pluri_push_scaffold.dart';
|
|
import '../widgets/pluri_root_header.dart';
|
|
import '../widgets/pluri_sleep_timer_sheet.dart';
|
|
import 'ajustes/pantalla_ajustes_backup.dart';
|
|
import 'ajustes/pantalla_ajustes_ecualizador.dart';
|
|
import 'ajustes/pantalla_ajustes_emisora_preferida.dart';
|
|
import 'ajustes/pantalla_ajustes_emisoras_personalizadas.dart';
|
|
import 'ajustes/pantalla_ajustes_grupos_favoritos.dart';
|
|
import 'ajustes/pantalla_ajustes_idioma.dart';
|
|
import 'ajustes/pantalla_ajustes_info.dart';
|
|
import 'ajustes/pantalla_ajustes_musica_local.dart';
|
|
import 'ajustes/pantalla_ajustes_orden_listas.dart';
|
|
import 'ajustes/pantalla_ajustes_salida_audio.dart';
|
|
import 'ajustes/pantalla_ajustes_timer_sueno.dart';
|
|
import 'ajustes/widgets/fila_ajuste.dart';
|
|
import 'pantalla_grabaciones.dart';
|
|
|
|
class PantallaAjustes extends StatelessWidget {
|
|
const PantallaAjustes({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l10n = AppLocalizations.of(context);
|
|
|
|
return ListView(
|
|
padding: PluriLayout.pageListPadding,
|
|
children: [
|
|
// S1 (Tier 1 visual fidelity): the prototype has no global AppBar —
|
|
// this root now draws its own 56px title row instead of relying on
|
|
// app.dart's removed shared chrome (which is also where the
|
|
// sleep-timer action used to live).
|
|
PluriRootHeader(
|
|
title: l10n.settingsTitle,
|
|
onSleepTimer: () => showPluriSleepTimerSheet(context),
|
|
),
|
|
PluriScreenHeader(
|
|
title: l10n.settingsTitle,
|
|
subtitle: l10n.settingsSubtitle,
|
|
glyph: PluriIconGlyph.settings,
|
|
trailing: PluriStatusPill(
|
|
icon: Icons.security_rounded,
|
|
label: l10n.settingsSafeStatus,
|
|
),
|
|
),
|
|
const Padding(
|
|
padding: PluriLayout.pageContentPadding,
|
|
child: _AjustesContent(),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Design ADR-3: the Settings root is grouped nav rows only — each
|
|
/// [FilaAjuste] pushes its own detail screen via `PluriPushScaffold.push`,
|
|
/// carrying zero inline controls. All 12 sections are now decomposed across
|
|
/// WU3a (AUDIO, EMISORAS) and WU3b (GRABACIONES Y MÚSICA, APLICACIÓN); sleep
|
|
/// timer and backup/restore stay reachable throughout — nothing was dropped.
|
|
class _AjustesContent extends StatelessWidget {
|
|
const _AjustesContent();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l10n = AppLocalizations.of(context);
|
|
|
|
return Column(
|
|
children: [
|
|
GrupoAjustes(
|
|
titulo: l10n.settingsGroupAudioTitle,
|
|
filas: [
|
|
FilaAjuste(
|
|
icon: Icons.equalizer_rounded,
|
|
titulo: l10n.equalizerTitle,
|
|
onTap:
|
|
() => PluriPushScaffold.push(
|
|
context,
|
|
(_) => const PantallaAjustesEcualizador(),
|
|
),
|
|
),
|
|
FilaAjuste(
|
|
icon: Icons.devices_rounded,
|
|
titulo: l10n.advancedEqSectionTitle,
|
|
onTap:
|
|
() => PluriPushScaffold.push(
|
|
context,
|
|
(_) => const PantallaAjustesSalidaAudio(),
|
|
),
|
|
),
|
|
FilaAjuste(
|
|
icon: Icons.bedtime_rounded,
|
|
titulo: l10n.timerSectionTitle,
|
|
onTap:
|
|
() => PluriPushScaffold.push(
|
|
context,
|
|
(_) => const PantallaAjustesTimerSueno(),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 12),
|
|
GrupoAjustes(
|
|
titulo: l10n.settingsGroupStationsTitle,
|
|
filas: [
|
|
FilaAjuste(
|
|
icon: Icons.playlist_add_check_circle_rounded,
|
|
titulo: l10n.favoriteGroupsTitle,
|
|
onTap:
|
|
() => PluriPushScaffold.push(
|
|
context,
|
|
(_) => const PantallaAjustesGruposFavoritos(),
|
|
),
|
|
),
|
|
FilaAjuste(
|
|
icon: Icons.radio_rounded,
|
|
titulo: l10n.preferredStationTitle,
|
|
onTap:
|
|
() => PluriPushScaffold.push(
|
|
context,
|
|
(_) => const PantallaAjustesEmisoraPreferida(),
|
|
),
|
|
),
|
|
FilaAjuste(
|
|
icon: Icons.add_circle_outline_rounded,
|
|
titulo: l10n.customStationsTitle,
|
|
onTap:
|
|
() => PluriPushScaffold.push(
|
|
context,
|
|
(_) => const PantallaAjustesEmisorasPersonalizadas(),
|
|
),
|
|
),
|
|
FilaAjuste(
|
|
icon: Icons.sort_rounded,
|
|
titulo: l10n.stationOrderTitle,
|
|
onTap:
|
|
() => PluriPushScaffold.push(
|
|
context,
|
|
(_) => const PantallaAjustesOrdenListas(),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 12),
|
|
GrupoAjustes(
|
|
titulo: l10n.settingsGroupRecordingsTitle,
|
|
filas: [
|
|
FilaAjuste(
|
|
icon: Icons.radio_button_checked_rounded,
|
|
titulo: l10n.recordingsSectionTitle,
|
|
// WU15b: this row opens the recordings LIBRARY
|
|
// (PantallaGrabaciones), matching the approved mockup's
|
|
// "Ajustes > Grabaciones" screen. The folder/size settings
|
|
// form (PantallaAjustesGrabaciones) is still reachable, but
|
|
// now from within the library via its own settings action.
|
|
onTap:
|
|
() => PluriPushScaffold.push(
|
|
context,
|
|
(_) => const PantallaGrabaciones(),
|
|
),
|
|
),
|
|
FilaAjuste(
|
|
icon: Icons.library_music_outlined,
|
|
titulo: l10n.localMusicSectionTitle,
|
|
onTap:
|
|
() => PluriPushScaffold.push(
|
|
context,
|
|
(_) => const PantallaAjustesMusicaLocal(),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 12),
|
|
GrupoAjustes(
|
|
titulo: l10n.settingsGroupApplicationTitle,
|
|
filas: [
|
|
FilaAjuste(
|
|
icon: Icons.language_rounded,
|
|
titulo: l10n.languageSectionTitle,
|
|
onTap:
|
|
() => PluriPushScaffold.push(
|
|
context,
|
|
(_) => const PantallaAjustesIdioma(),
|
|
),
|
|
),
|
|
FilaAjuste(
|
|
icon: Icons.backup_outlined,
|
|
titulo: l10n.backupSectionTitle,
|
|
onTap:
|
|
() => PluriPushScaffold.push(
|
|
context,
|
|
(_) => const PantallaAjustesBackup(),
|
|
),
|
|
),
|
|
FilaAjuste(
|
|
icon: Icons.info_outline_rounded,
|
|
titulo: l10n.infoSectionTitle,
|
|
onTap:
|
|
() => PluriPushScaffold.push(
|
|
context,
|
|
(_) => const PantallaAjustesInfo(),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|