fix: completar migracion i18n de literales visibles
This commit is contained in:
@@ -4,6 +4,8 @@ import 'package:provider/provider.dart';
|
||||
import 'package:shimmer/shimmer.dart' as shimmer;
|
||||
|
||||
import '../estado/estado_radio.dart';
|
||||
import '../l10n/app_localizations_ext.dart';
|
||||
import '../l10n/gen/app_localizations.dart';
|
||||
import '../widgets/pluri_glass_surface.dart';
|
||||
import '../widgets/pluri_icon.dart';
|
||||
import '../widgets/pluri_layout.dart';
|
||||
@@ -41,52 +43,61 @@ class _PantallaInicioState extends State<PantallaInicio> {
|
||||
Widget build(BuildContext context) {
|
||||
final estado = context.watch<EstadoRadio>();
|
||||
final theme = Theme.of(context);
|
||||
final l10n = AppLocalizations.of(context);
|
||||
|
||||
return RefreshIndicator(
|
||||
onRefresh: estado.cargarPopulares,
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
SliverToBoxAdapter(child: _heroHeader(context, estado)),
|
||||
SliverToBoxAdapter(child: _seccionCercanas(estado, theme)),
|
||||
SliverToBoxAdapter(child: _seccionTendencias(estado, theme)),
|
||||
SliverToBoxAdapter(child: _chipGeneros(context, theme)),
|
||||
SliverToBoxAdapter(child: _heroHeader(context, estado, l10n)),
|
||||
SliverToBoxAdapter(child: _seccionCercanas(estado, theme, l10n)),
|
||||
SliverToBoxAdapter(child: _seccionTendencias(estado, theme, l10n)),
|
||||
SliverToBoxAdapter(child: _chipGeneros(context, theme, l10n)),
|
||||
if (estado.error != null)
|
||||
SliverToBoxAdapter(child: _errorBanner(estado, theme)),
|
||||
SliverToBoxAdapter(child: _errorBanner(estado, theme, l10n)),
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.fromLTRB(PluriLayout.horizontal, 0, PluriLayout.horizontal, PluriLayout.bottomChromeInset),
|
||||
sliver: _gridEmisoras(estado),
|
||||
sliver: _gridEmisoras(estado, l10n),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _heroHeader(BuildContext context, EstadoRadio estado) {
|
||||
Widget _heroHeader(
|
||||
BuildContext context,
|
||||
EstadoRadio estado,
|
||||
AppLocalizations l10n,
|
||||
) {
|
||||
return PluriScreenHeader(
|
||||
title: 'PluriWave',
|
||||
subtitle: 'Radio global en vivo con senales limpias, favoritos inteligentes y una experiencia visual de concurso.',
|
||||
title: l10n.appTitle,
|
||||
subtitle: l10n.homeScreenSubtitle,
|
||||
glyph: PluriIconGlyph.home,
|
||||
primaryActionLabel: 'Explorar emisoras',
|
||||
primaryActionLabel: l10n.exploreStations,
|
||||
onPrimaryAction: estado.cargarPopulares,
|
||||
trailing: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
PluriStatusPill(
|
||||
icon: Icons.public_rounded,
|
||||
label: '${estado.emisorasInicio.length} radios',
|
||||
label: l10n.homeStationsCount(estado.emisorasInicio.length),
|
||||
accent: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const PluriStatusPill(
|
||||
PluriStatusPill(
|
||||
icon: Icons.hd_rounded,
|
||||
label: 'Calidad HD',
|
||||
label: l10n.qualityHd,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _seccionCercanas(EstadoRadio estado, ThemeData theme) {
|
||||
Widget _seccionCercanas(
|
||||
EstadoRadio estado,
|
||||
ThemeData theme,
|
||||
AppLocalizations l10n,
|
||||
) {
|
||||
final pais = estado.paisCercanoDetectado;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(PluriLayout.horizontal, 8, PluriLayout.horizontal, 0),
|
||||
@@ -99,7 +110,7 @@ class _PantallaInicioState extends State<PantallaInicio> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
pais == null ? 'Cerca de vos' : 'Cerca de vos ? $pais',
|
||||
pais == null ? l10n.nearYou : l10n.nearYouInCountry(pais),
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
@@ -116,7 +127,7 @@ class _PantallaInicioState extends State<PantallaInicio> {
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.my_location_rounded, size: 18),
|
||||
label: const Text('Detectar'),
|
||||
label: Text(l10n.detectAction),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -155,7 +166,11 @@ class _PantallaInicioState extends State<PantallaInicio> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _seccionTendencias(EstadoRadio estado, ThemeData theme) {
|
||||
Widget _seccionTendencias(
|
||||
EstadoRadio estado,
|
||||
ThemeData theme,
|
||||
AppLocalizations l10n,
|
||||
) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(PluriLayout.horizontal, 8, PluriLayout.horizontal, 0),
|
||||
child: PluriGlassSurface(
|
||||
@@ -163,7 +178,7 @@ class _PantallaInicioState extends State<PantallaInicio> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Radar en directo', style: theme.textTheme.titleMedium),
|
||||
Text(l10n.liveRadar, style: theme.textTheme.titleMedium),
|
||||
const SizedBox(height: 8),
|
||||
SizedBox(
|
||||
height: 56,
|
||||
@@ -199,7 +214,11 @@ class _PantallaInicioState extends State<PantallaInicio> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _chipGeneros(BuildContext context, ThemeData theme) {
|
||||
Widget _chipGeneros(
|
||||
BuildContext context,
|
||||
ThemeData theme,
|
||||
AppLocalizations l10n,
|
||||
) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(PluriLayout.horizontal, 16, PluriLayout.horizontal, 8),
|
||||
child: PluriGlassSurface(
|
||||
@@ -207,7 +226,7 @@ class _PantallaInicioState extends State<PantallaInicio> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Géneros', style: theme.textTheme.titleMedium),
|
||||
Text(l10n.genresTitle, style: theme.textTheme.titleMedium),
|
||||
const SizedBox(height: 8),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
@@ -216,7 +235,7 @@ class _PantallaInicioState extends State<PantallaInicio> {
|
||||
_generos.map((g) {
|
||||
final seleccionado = _generoSeleccionado == g;
|
||||
return FilterChip(
|
||||
label: Text(g),
|
||||
label: Text(l10n.genreName(g)),
|
||||
selected: seleccionado,
|
||||
onSelected: (_) {
|
||||
setState(() {
|
||||
@@ -237,7 +256,11 @@ class _PantallaInicioState extends State<PantallaInicio> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _errorBanner(EstadoRadio estado, ThemeData theme) {
|
||||
Widget _errorBanner(
|
||||
EstadoRadio estado,
|
||||
ThemeData theme,
|
||||
AppLocalizations l10n,
|
||||
) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: PluriGlassSurface(
|
||||
@@ -249,7 +272,7 @@ class _PantallaInicioState extends State<PantallaInicio> {
|
||||
Expanded(child: Text(estado.error!)),
|
||||
TextButton(
|
||||
onPressed: estado.cargarPopulares,
|
||||
child: const Text('Reintentar'),
|
||||
child: Text(l10n.retryAction),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -257,7 +280,7 @@ class _PantallaInicioState extends State<PantallaInicio> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _gridEmisoras(EstadoRadio estado) {
|
||||
Widget _gridEmisoras(EstadoRadio estado, AppLocalizations l10n) {
|
||||
final emisoras =
|
||||
_generoSeleccionado != null
|
||||
? estado.resultadosBusqueda
|
||||
@@ -282,11 +305,11 @@ class _PantallaInicioState extends State<PantallaInicio> {
|
||||
}
|
||||
|
||||
if (emisoras.isEmpty) {
|
||||
return const SliverFillRemaining(
|
||||
return SliverFillRemaining(
|
||||
child: PluriEmptyState(
|
||||
glyph: PluriIconGlyph.home,
|
||||
title: 'No hay emisoras disponibles',
|
||||
subtitle: 'Proba refrescar o elegir otro género para volver a capturar señal.',
|
||||
title: l10n.noStationsAvailable,
|
||||
subtitle: l10n.noStationsAvailableSubtitle,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user