feat(favoritos): replace stacked group panels with chip-filtered reorderable list
Replaces the stacked per-group panel layout with a single
chip-filtered flat list. Chips read "{name} · {count}" (new ARB keys
favoriteGroupsChipLabel/favoritesFilterAllLabel), one per group plus
an "All" chip. Rows drag-reorder via a leading handle
(ReorderableDragStartListener, buildDefaultDragHandles: false) using
the modern onReorderItem callback rather than the now-@Deprecated
onReorder (Flutter 3.44 marks it obsolete).
EstadoRadio additions: listaFavoritosManual (a new memoized getter
returning the stored order untouched by the global ordenListas
setting - listaFavoritos itself always re-sorts by
name/quality on every read, which would silently discard any
drag-to-reorder), reordenarFavorito (thin wrapper over the
already-existing ServicioFavoritos.reordenar, previously unused
outside its own service test), and ordenarFavoritos (applies an
existing OrdenEmisoras criterion via ordenarEmisoras() and persists
the result as the new manual order, so the swap_vert sort action's
result also survives a restart). listaFavoritos itself is untouched,
so Android Auto's tree and the future Escuchar grid (WU5) are
unaffected by Favoritos' own manual order.
Group management: an "Manage lists" action chip pushes the existing
PantallaAjustesGruposFavoritos screen (Settings' own screen, reused
rather than duplicated) - a second entry point to the same screen.
Custom-station CTA: a new dashed-bordered card opens the add-station
form directly; that form was renamed from private _FormularioEmisora
to public FormularioEmisoraPersonalizada in
pantalla_ajustes_emisoras_personalizadas.dart so both screens share
one implementation. New ARB keys: favoriteGroupsManage,
customStationsAddCta.
Tests: pantalla_favoritos_plural_test.dart (the file tasks.md named)
never imported PantallaFavoritos - it only covers stationCount's ARB
plural formatting, unrelated to this screen. Left it untouched and
added test/pantallas/pantalla_favoritos_test.dart instead: 3
state-layer tests for the new EstadoRadio surface plus 6 widget
scenarios (empty-state CTA, chip filter, drag-reorder persistence,
sort action, group management + chip reactivity, custom-station
CTA). 604 -> 614 tests (2 skipped, unchanged). flutter analyze
unchanged at 1 pre-existing info.
Recorded in tasks.md with the test-file correction and the
design decisions this WU had to make on its own (no ADR covers
Favoritos' manual-order persistence).
This commit is contained in:
@@ -11,7 +11,7 @@ import '../../widgets/pluri_layout.dart';
|
||||
import '../../widgets/pluri_push_scaffold.dart';
|
||||
|
||||
/// EMISORAS group · "Emisoras personalizadas" (design ADR-3). Body moved
|
||||
/// verbatim from the former `_SeccionEmisoras` + `_FormularioEmisora` in
|
||||
/// verbatim from the former `_SeccionEmisoras` + `FormularioEmisoraPersonalizada` in
|
||||
/// `pantalla_ajustes.dart` — the panel header's icon, title and spacer were
|
||||
/// removed (the pushed screen's title now carries them); the "Add" action,
|
||||
/// being a real capability rather than decorative chrome, stays in the body,
|
||||
@@ -110,19 +110,21 @@ class _CuerpoEmisorasPersonalizadas extends StatelessWidget {
|
||||
isScrollControlled: true,
|
||||
useSafeArea: true,
|
||||
showDragHandle: true,
|
||||
builder: (ctx) => const _FormularioEmisora(),
|
||||
builder: (ctx) => const FormularioEmisoraPersonalizada(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _FormularioEmisora extends StatefulWidget {
|
||||
const _FormularioEmisora();
|
||||
class FormularioEmisoraPersonalizada extends StatefulWidget {
|
||||
const FormularioEmisoraPersonalizada({super.key});
|
||||
|
||||
@override
|
||||
State<_FormularioEmisora> createState() => _FormularioEmisoraState();
|
||||
State<FormularioEmisoraPersonalizada> createState() =>
|
||||
FormularioEmisoraPersonalizadaState();
|
||||
}
|
||||
|
||||
class _FormularioEmisoraState extends State<_FormularioEmisora> {
|
||||
class FormularioEmisoraPersonalizadaState
|
||||
extends State<FormularioEmisoraPersonalizada> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
final _nombreCtrl = TextEditingController();
|
||||
final _urlCtrl = TextEditingController();
|
||||
|
||||
Reference in New Issue
Block a user