Moves the AUDIO group (Ecualizador, Salida de audio, Temporizador de
sueno) and the EMISORAS group (Grupos de favoritos, Emisora preferida,
Emisoras personalizadas, Orden de listas) out of pantalla_ajustes.dart
into 7 new lib/pantallas/ajustes/*.dart screens, each wrapped in
PluriPushScaffold. The root now reaches them through FilaAjuste rows
under two new GrupoAjustes cards (lib/pantallas/ajustes/widgets/
fila_ajuste.dart), per design ADR-3.
Verbatim-move rule applied throughout: only each section's panel header
(icon + title, sometimes a status chip) was removed, since the pushed
screen's own 56px header now carries the title. Two sections whose
header row carried a real action (Temporizador de sueno's "Add",
Grupos de favoritos' "Add list", Emisoras personalizadas' "Add") kept
that action in the body instead of dropping it.
size:exception (move-only diff, pre-recorded at design/tasks time):
34 files, ~4250 changed lines excluding the 13 auto-regenerated l10n
files (~90 more lines there) - higher than the 800-1000 estimate
because that estimate covered the 7 production screens but not the
matching 7 new test files (task 3a.2), one of which relocates ~10
pre-existing device-management test cases verbatim. Business logic is
untouched; app.dart's import of pantalla_ajustes.dart is unchanged.
Correction to tasks.md 3a.1/3a.8: those two lines describe the combined
WU3a+WU3b end state ("4 grouped nav lists", "<400 lines"), matching
design ADR-3's own aggregate blast-radius note - not a WU3a-only claim.
This commit converts only the 2 groups that are WU3a's job; the root
is 788 lines with 5 sections (Grabaciones, Musica local, Idioma,
Backup, Info) still inline, reachable, and unchanged, pending WU3b.
Two new ARB keys (settingsGroupAudioTitle, settingsGroupStationsTitle),
en/es only per the WU1 precedent - all 7 detail-screen titles reuse
existing keys. Discovered and worked around, without touching app
code: Directory.systemTemp hangs real dart:io writes in this sandbox,
and pumpAndSettle() cannot settle while a screen shows an indeterminate
CircularProgressIndicator - both are test-only concerns, documented
inline where hit.
Tests: 560 -> 579 (32 in this commit's scope, net +19 after retiring
13 relocated cases from the old combined pantalla_ajustes_test.dart).
flutter analyze: unchanged at 1 pre-existing info. git diff is empty
for navegacion_auto.dart, servicio_ecualizador.dart and
servicio_audio.dart; pantalla_alarma_sonando_dismiss_guard_test.dart
untouched.
97 lines
3.6 KiB
Dart
97 lines
3.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import '../../estado/estado_ecualizador.dart';
|
|
import '../../estado/estado_radio.dart';
|
|
import '../../l10n/gen/app_localizations.dart';
|
|
import '../../widgets/ecualizador_widget.dart';
|
|
import '../../widgets/pluri_glass_surface.dart';
|
|
import '../../widgets/pluri_layout.dart';
|
|
import '../../widgets/pluri_push_scaffold.dart';
|
|
|
|
/// AUDIO group · "Ecualizador" (design ADR-3). Body moved verbatim from the
|
|
/// former `_SeccionEcualizador` in `pantalla_ajustes.dart` — only the panel
|
|
/// header row (icon + title + status chip) was removed, since
|
|
/// [PluriPushScaffold] now carries the title and the very next row already
|
|
/// shows the same active/disabled state.
|
|
///
|
|
/// This body is a placeholder pending WU13's restyle (ADR-3's own component
|
|
/// inventory: "body rewritten by WU13").
|
|
class PantallaAjustesEcualizador extends StatelessWidget {
|
|
const PantallaAjustesEcualizador({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) => PluriPushScaffold(
|
|
title: AppLocalizations.of(context).equalizerTitle,
|
|
body: ListView(
|
|
padding: PluriLayout.pageContentPadding,
|
|
children: const [_CuerpoEcualizador()],
|
|
),
|
|
);
|
|
}
|
|
|
|
class _CuerpoEcualizador extends StatelessWidget {
|
|
const _CuerpoEcualizador();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// EQ state comes from EstadoEcualizador (S4-R1/S4-R5); EstadoRadio is
|
|
// only consulted for the current station + favorite flag.
|
|
return Consumer2<EstadoRadio, EstadoEcualizador>(
|
|
builder: (ctx, estado, eq, _) {
|
|
final disponible = eq.disponible;
|
|
final l10n = AppLocalizations.of(ctx);
|
|
final emisoraActual = estado.emisoraActual;
|
|
final mostrarModoPorEmisora =
|
|
emisoraActual != null && estado.emisoraActualEsFavorita;
|
|
final usandoEqPropio = eq.emisoraActualTienePresetPropio;
|
|
|
|
return PluriGlassSurface(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
SwitchListTile.adaptive(
|
|
contentPadding: EdgeInsets.zero,
|
|
title: Text(l10n.equalizerEnable),
|
|
subtitle: Text(
|
|
disponible
|
|
? l10n.equalizerRealtimeSubtitle
|
|
: l10n.equalizerPendingSubtitle,
|
|
),
|
|
value: eq.activo,
|
|
onChanged: eq.cambiarActivo,
|
|
),
|
|
if (mostrarModoPorEmisora) ...[
|
|
const SizedBox(height: 8),
|
|
SwitchListTile.adaptive(
|
|
contentPadding: EdgeInsets.zero,
|
|
title: Text(l10n.equalizerPerStationTitle),
|
|
subtitle: Text(
|
|
usandoEqPropio
|
|
? l10n.equalizerPerStationActive(emisoraActual.nombre)
|
|
: l10n.equalizerPerStationMain(emisoraActual.nombre),
|
|
),
|
|
value: usandoEqPropio,
|
|
onChanged:
|
|
(usarPropio) =>
|
|
eq.cambiarModoEmisoraActual(usarPropio: usarPropio),
|
|
),
|
|
],
|
|
const SizedBox(height: 8),
|
|
PresetsEcualizadorWidget(
|
|
presetActual: eq.presetActual,
|
|
onSeleccionar: (p) => eq.cambiarPreset(p),
|
|
),
|
|
const SizedBox(height: 12),
|
|
EcualizadorWidget(
|
|
preset: eq.presetActual,
|
|
onCambio: (p) => eq.cambiarPreset(p),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|