mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-17 04:09:03 +02:00
EPG — les trois chemins (backend /api/epg, XtreamService.getShortEpg et getShortEPG) n'utilisaient que get_epg et get_short_epg. Beaucoup de panneaux Xtream ne connaissent pas get_epg : ils répondent 200 avec le bloc d'authentification, sans epg_listings, ce qui produisait un guide vide indiscernable d'une chaîne sans programme. get_short_epg y renvoie epg_listings vide en permanence. - backend : get_simple_data_table en premier, get_short_epg en repli - client : bascule automatique et mémorisée vers le tableau complet dès qu'un panneau est muet sur l'action légère, pour ne pas doubler les requêtes sur chaque tuile de grille - dates dérivées des *_timestamp epoch et émises en ISO-8601 UTC : les champs texte sont dans le fuseau du panneau, sans indicateur de zone, et étaient relus comme de l'heure locale — le guide était décalé et les enregistrements planifiés depuis le guide l'étaient aussi - cache backend : la clé incluait seulement le channelId, deux playlists partageant un stream_id se servaient mutuellement leur guide UI — les deux halos d'ambiance du dashboard étaient restés de l'ancien thème : primary (#FFB68C) à 40 % posé sur le coin haut-gauche, donc pile derrière la sidebar, et info (#A3B8C4, bleu-gris) à 35 % dans une palette entièrement chaude. Ramenés à des braises ember à 8 % / 6 %. - fond via AppColors.backgroundGradient - onglet actif rempli en primaryContainer (surface) et non primary (teinte claire réservée au texte/icônes) - sidebar en niveau flottant : en niveau 1 son fond #181310 se confondait avec le haut du dégradé #1A1310 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
230 lines
7.9 KiB
Dart
230 lines
7.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import '../../../core/models/playlist_config.dart';
|
|
import '../../../core/theme/app_colors.dart';
|
|
import '../../../core/widgets/glass_container.dart';
|
|
import '../../../core/widgets/tv_focusable_card.dart';
|
|
import '../widgets/live_tv_tab.dart';
|
|
import '../widgets/movies_tab.dart';
|
|
import '../widgets/series_tab.dart';
|
|
import '../widgets/settings_tab.dart';
|
|
import '../widgets/recordings_tab.dart';
|
|
|
|
class DashboardScreen extends ConsumerStatefulWidget {
|
|
final PlaylistConfig playlist;
|
|
|
|
const DashboardScreen({
|
|
super.key,
|
|
required this.playlist,
|
|
});
|
|
|
|
@override
|
|
ConsumerState<DashboardScreen> createState() => _DashboardScreenState();
|
|
}
|
|
|
|
class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|
int _selectedIndex = 0;
|
|
final List<String> _tabs = [
|
|
'Live TV',
|
|
'Movies',
|
|
'Series',
|
|
'Recordings',
|
|
'Settings',
|
|
];
|
|
final List<IconData> _icons = [
|
|
Icons.live_tv_rounded,
|
|
Icons.movie_rounded,
|
|
Icons.tv_rounded,
|
|
Icons.video_library_rounded,
|
|
Icons.settings_rounded,
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: AppColors.background,
|
|
body: Stack(
|
|
fit: StackFit.expand,
|
|
children: [
|
|
// 1. Fond « salle de projection » — dégradé chaud du design system.
|
|
Positioned.fill(
|
|
child: Container(
|
|
decoration: const BoxDecoration(
|
|
gradient: AppColors.backgroundGradient,
|
|
),
|
|
),
|
|
),
|
|
|
|
// Faisceau du projecteur, en haut à gauche.
|
|
// Intensité volontairement basse (8 %) : au-delà, le halo délave la
|
|
// sidebar et les cartes en pêche et sort le rendu de la palette.
|
|
Positioned(
|
|
top: -300,
|
|
left: -300,
|
|
child: Container(
|
|
width: 800,
|
|
height: 800,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
gradient: RadialGradient(
|
|
colors: [
|
|
AppColors.glowPrimary(0.08),
|
|
AppColors.glowPrimary(0.03),
|
|
Colors.transparent,
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
|
|
// Braise résiduelle en bas à droite. L'ancien halo utilisait
|
|
// `AppColors.info` (bleu-gris) : une teinte froide dans une palette
|
|
// entièrement chaude, d'où le rendu grisâtre.
|
|
Positioned(
|
|
bottom: -250,
|
|
right: -250,
|
|
child: Container(
|
|
width: 700,
|
|
height: 700,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
gradient: RadialGradient(
|
|
colors: [
|
|
AppColors.glowPrimary(0.06),
|
|
AppColors.glowPrimary(0.02),
|
|
Colors.transparent,
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
|
|
// 2. Main Content Area
|
|
Positioned.fill(
|
|
left: 100, // Leave space for sidebar
|
|
child: IndexedStack(
|
|
index: _selectedIndex,
|
|
children: [
|
|
LiveTVTab(playlist: widget.playlist),
|
|
MoviesTab(playlist: widget.playlist),
|
|
SeriesTab(playlist: widget.playlist),
|
|
RecordingsTab(playlist: widget.playlist),
|
|
const SettingsTab(),
|
|
],
|
|
),
|
|
),
|
|
|
|
// 3. Vertical Glass Sidebar
|
|
Positioned(
|
|
left: 24,
|
|
top: 24,
|
|
bottom: 24,
|
|
width: 80,
|
|
// Niveau « flottant » : le niveau 1 (#181310) se confondait avec
|
|
// le haut du dégradé de fond (#1A1310) — la barre n'existait plus
|
|
// que par sa bordure. Le niveau 2 apporte l'arête ember et
|
|
// l'ombre profonde qui la détachent vraiment.
|
|
child: GlassContainer.floating(
|
|
borderRadius: 24,
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
// Logo Icon
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 24),
|
|
child: Container(
|
|
width: 40,
|
|
height: 40,
|
|
decoration: BoxDecoration(
|
|
gradient: AppColors.primaryGradient,
|
|
borderRadius: BorderRadius.circular(12),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: AppColors.glowPrimary(0.35),
|
|
blurRadius: 10,
|
|
offset: const Offset(0, 4),
|
|
),
|
|
],
|
|
),
|
|
child: const Icon(
|
|
Icons.play_arrow_rounded,
|
|
color: AppColors.onPrimary,
|
|
size: 28,
|
|
),
|
|
),
|
|
),
|
|
|
|
const Spacer(),
|
|
|
|
// Navigation Icons
|
|
...List.generate(_tabs.length, (index) {
|
|
final isSelected = _selectedIndex == index;
|
|
return Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
|
child: TvFocusableCard(
|
|
onTap: () => setState(() => _selectedIndex = index),
|
|
scaleFactor: 1.2,
|
|
borderRadius: 16,
|
|
focusColor: AppColors.primary,
|
|
child: AnimatedContainer(
|
|
duration: const Duration(milliseconds: 200),
|
|
width: 48,
|
|
height: 48,
|
|
decoration: BoxDecoration(
|
|
// Remplissage ember (`primaryContainer`) et non
|
|
// `primary` : cette dernière est la teinte claire
|
|
// réservée au texte/icône, pas aux surfaces.
|
|
color: isSelected
|
|
? AppColors.primaryContainer
|
|
.withValues(alpha: 0.20)
|
|
: Colors.transparent,
|
|
borderRadius: BorderRadius.circular(16),
|
|
border: isSelected
|
|
? Border.all(
|
|
color: AppColors.primary
|
|
.withValues(alpha: 0.55),
|
|
)
|
|
: null,
|
|
),
|
|
child: Icon(
|
|
_icons[index],
|
|
color: isSelected
|
|
? AppColors.primary
|
|
: AppColors.textTertiary,
|
|
size: 24,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}),
|
|
|
|
const Spacer(),
|
|
|
|
// Settings / Profile
|
|
Padding(
|
|
padding: const EdgeInsets.only(bottom: 24),
|
|
child: TvFocusableCard(
|
|
onTap: () {},
|
|
borderRadius: 50,
|
|
scaleFactor: 1.1,
|
|
child: const CircleAvatar(
|
|
radius: 20,
|
|
backgroundColor: AppColors.surfaceContainerHigh,
|
|
child: Icon(
|
|
Icons.person,
|
|
color: AppColors.textSecondary,
|
|
size: 20,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|