Merge pull request #65 from R0m1k3/antigravity

feat: add IPTV playlist selection screen, settings tabs, and admin panel
This commit is contained in:
LogiFlow authored and GitHub committed 2025-12-07 00:52:37 +01:00
commit cf2c2e69d8
4 files changed
+437 -309

No files matched your search

+76 -60
View File
@@ -43,60 +43,76 @@ class _AdminPanelState extends ConsumerState<AdminPanel>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: AppColors.background, extendBodyBehindAppBar: true,
body: SafeArea( body: Container(
child: Column( decoration: const BoxDecoration(
children: [ gradient: RadialGradient(
// Custom Glass Header center: Alignment.center,
Container( radius: 1.5,
padding: const EdgeInsets.all(24), colors: [
child: Row( Color(0xFF2C2C2E), // Dark Grey (Apple TV Surface)
children: [ Color(0xFF000000), // Pure Black
GlassCard( ],
borderRadius: 12, stops: [0.0, 1.0],
padding: const EdgeInsets.all(8), ),
showBorder: false, ),
onTap: () => context.go('/playlists'), child: SafeArea(
child: const Icon(Icons.arrow_back, color: AppColors.textSecondary), child: Column(
), children: [
const SizedBox(width: 16), // Custom Glass Header
Text( Container(
'Administration', padding: const EdgeInsets.all(24),
style: Theme.of(context).textTheme.headlineMedium, child: Row(
), children: [
const Spacer(), GlassCard(
// Custom Tab Bar Indicator borderRadius: 12,
Container( padding: const EdgeInsets.all(8),
padding: const EdgeInsets.all(4), showBorder: false,
decoration: BoxDecoration( onTap: () => context.go('/playlists'),
color: AppColors.surface, child: const Icon(Icons.arrow_back, color: Colors.white70),
borderRadius: BorderRadius.circular(50),
), ),
child: Row( const SizedBox(width: 16),
mainAxisSize: MainAxisSize.min, Text(
children: [ 'Administration',
_buildTabButton(0, 'Playlists', Icons.playlist_play), style: Theme.of(context).textTheme.headlineMedium?.copyWith(
const SizedBox(width: 4), color: Colors.white,
_buildTabButton(1, 'Users', Icons.people), fontWeight: FontWeight.bold,
], ),
), ),
), const Spacer(),
], // Custom Tab Bar Indicator
Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: AppColors.surface,
borderRadius: BorderRadius.circular(50),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
_buildTabButton(0, 'Playlists', Icons.playlist_play),
const SizedBox(width: 4),
_buildTabButton(1, 'Users', Icons.people),
],
),
),
],
),
), ),
),
// Content
// Content Expanded(
Expanded( child: TabBarView(
child: TabBarView( controller: _tabController,
controller: _tabController, physics: const NeverScrollableScrollPhysics(), // Custom tabs handle ref
physics: const NeverScrollableScrollPhysics(), // Custom tabs handle ref children: const [
children: const [ _PlaylistsTab(),
_PlaylistsTab(), _UsersTab(),
_UsersTab(), ],
], ),
), ),
), ],
], ),
), ),
), ),
); );
@@ -121,7 +137,7 @@ class _AdminPanelState extends ConsumerState<AdminPanel>
Icon( Icon(
icon, icon,
size: 18, size: 18,
color: isSelected ? Colors.black : AppColors.textSecondary, color: isSelected ? Colors.black : Colors.white70,
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
Text( Text(
@@ -129,7 +145,7 @@ class _AdminPanelState extends ConsumerState<AdminPanel>
style: GoogleFonts.inter( style: GoogleFonts.inter(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
color: isSelected ? Colors.black : AppColors.textSecondary, color: isSelected ? Colors.black : Colors.white70,
), ),
), ),
], ],
@@ -156,7 +172,7 @@ class _PlaylistsTab extends ConsumerWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text('${playlistsAsync.asData?.value.length ?? 0} Playlists', style: Theme.of(context).textTheme.bodyLarge), Text('${playlistsAsync.asData?.value.length ?? 0} Playlists', style: Theme.of(context).textTheme.bodyLarge?.copyWith(color: Colors.white70)),
GradientButton( GradientButton(
label: 'Add Playlist', label: 'Add Playlist',
icon: Icons.add, icon: Icons.add,
@@ -212,9 +228,9 @@ class _PlaylistsTab extends ConsumerWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(playlist.name, style: Theme.of(context).textTheme.titleMedium), Text(playlist.name, style: Theme.of(context).textTheme.titleMedium?.copyWith(color: Colors.white)),
const SizedBox(height: 4), const SizedBox(height: 4),
Text(playlist.dns, style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: AppColors.textTertiary)), Text(playlist.dns, style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: Colors.white60)),
], ],
), ),
), ),
@@ -222,7 +238,7 @@ class _PlaylistsTab extends ConsumerWidget {
children: [ children: [
IconButton( IconButton(
icon: const Icon(Icons.edit_outlined, size: 20), icon: const Icon(Icons.edit_outlined, size: 20),
color: AppColors.textSecondary, color: Colors.white70,
onPressed: () => _showPlaylistDialog(context, ref, playlist), onPressed: () => _showPlaylistDialog(context, ref, playlist),
tooltip: 'Edit', tooltip: 'Edit',
), ),
@@ -337,7 +353,7 @@ class _UsersTab extends ConsumerWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text('${usersAsync.asData?.value.length ?? 0} Users', style: Theme.of(context).textTheme.bodyLarge), Text('${usersAsync.asData?.value.length ?? 0} Users', style: Theme.of(context).textTheme.bodyLarge?.copyWith(color: Colors.white70)),
GradientButton( GradientButton(
label: 'Create User', label: 'Create User',
icon: Icons.person_add, icon: Icons.person_add,
@@ -394,7 +410,7 @@ class _UsersTab extends ConsumerWidget {
children: [ children: [
Row( Row(
children: [ children: [
Text(user.username, style: Theme.of(context).textTheme.titleMedium), Text(user.username, style: Theme.of(context).textTheme.titleMedium?.copyWith(color: Colors.white)),
if (user.isAdmin) ...[ if (user.isAdmin) ...[
const SizedBox(width: 8), const SizedBox(width: 8),
Container( Container(
@@ -409,12 +425,12 @@ class _UsersTab extends ConsumerWidget {
], ],
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
Text('ID: ${user.id}', style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: AppColors.textTertiary)), Text('ID: ${user.id}', style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: Colors.white60)),
], ],
), ),
), ),
PopupMenuButton<String>( PopupMenuButton<String>(
icon: const Icon(Icons.more_vert, color: AppColors.textSecondary), icon: const Icon(Icons.more_vert, color: Colors.white70),
color: AppColors.surface, color: AppColors.surface,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
onSelected: (value) { onSelected: (value) {
@@ -15,26 +15,30 @@ final playlistsProvider = FutureProvider<List<PlaylistConfig>>((ref) async {
class PlaylistSelectionScreen extends ConsumerWidget { class PlaylistSelectionScreen extends ConsumerWidget {
const PlaylistSelectionScreen({super.key}); const PlaylistSelectionScreen({super.key});
@override
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final currentUser = ref.watch(authProvider).currentUser; final currentUser = ref.watch(authProvider).currentUser;
final playlistsAsync = ref.watch(playlistsProvider); final playlistsAsync = ref.watch(playlistsProvider);
return Scaffold( return Scaffold(
extendBodyBehindAppBar: true,
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
'Select Playlist', 'Select Playlist',
style: GoogleFonts.roboto(fontWeight: FontWeight.w600), style: GoogleFonts.roboto(fontWeight: FontWeight.w600, color: Colors.white),
), ),
backgroundColor: Colors.transparent,
elevation: 0,
actions: [ actions: [
if (currentUser?.isAdmin ?? false) if (currentUser?.isAdmin ?? false)
IconButton( IconButton(
icon: const Icon(Icons.admin_panel_settings), icon: const Icon(Icons.admin_panel_settings, color: Colors.white70),
onPressed: () => context.go('/admin'), onPressed: () => context.go('/admin'),
tooltip: 'Admin Panel', tooltip: 'Admin Panel',
), ),
IconButton( IconButton(
icon: const Icon(Icons.logout), icon: const Icon(Icons.logout, color: Colors.white70),
onPressed: () async { onPressed: () async {
await ref.read(authProvider.notifier).logout(); await ref.read(authProvider.notifier).logout();
if (context.mounted) { if (context.mounted) {
@@ -45,83 +49,96 @@ class PlaylistSelectionScreen extends ConsumerWidget {
), ),
], ],
), ),
body: playlistsAsync.when( body: Container(
loading: () => const Center(child: CircularProgressIndicator()), decoration: const BoxDecoration(
error: (error, stack) => Center( gradient: RadialGradient(
child: Column( center: Alignment.center,
mainAxisAlignment: MainAxisAlignment.center, radius: 1.5,
children: [ colors: [
Icon(Icons.error_outline, size: 64, color: Colors.red.shade400), Color(0xFF2C2C2E), // Dark Grey (Apple TV Surface)
const SizedBox(height: 16), Color(0xFF000000), // Pure Black
Text('Error loading playlists', style: GoogleFonts.roboto(fontSize: 18)),
const SizedBox(height: 8),
ElevatedButton(
onPressed: () => ref.refresh(playlistsProvider),
child: const Text('Retry'),
),
], ],
stops: [0.0, 1.0],
), ),
), ),
data: (playlists) { child: playlistsAsync.when(
if (playlists.isEmpty) { loading: () => const Center(child: CircularProgressIndicator()),
return Center( error: (error, stack) => Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Icon( Icon(Icons.error_outline, size: 64, color: Colors.red.shade400),
Icons.playlist_remove, const SizedBox(height: 16),
size: 64, Text('Error loading playlists', style: GoogleFonts.roboto(fontSize: 18, color: Colors.white70)),
color: Colors.grey.shade400, const SizedBox(height: 8),
), ElevatedButton(
const SizedBox(height: 16), onPressed: () => ref.refresh(playlistsProvider),
Text( child: const Text('Retry'),
'No playlists available', ),
style: GoogleFonts.roboto( ],
fontSize: 18,
color: Colors.grey.shade600,
),
),
const SizedBox(height: 8),
Text(
currentUser?.isAdmin ?? false
? 'Add playlists in Admin Panel'
: 'Contact administrator',
style: GoogleFonts.roboto(
fontSize: 14,
color: Colors.grey.shade500,
),
),
],
),
);
}
return GridView.builder(
padding: const EdgeInsets.all(16),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 16,
mainAxisSpacing: 16,
childAspectRatio: 1.5,
), ),
itemCount: playlists.length, ),
itemBuilder: (context, index) { data: (playlists) {
final playlist = playlists[index]; if (playlists.isEmpty) {
return _PlaylistCard( return Center(
playlist: playlist, child: Column(
onTap: () { mainAxisAlignment: MainAxisAlignment.center,
context.go('/dashboard', extra: playlist); children: [
}, Icon(
Icons.playlist_remove,
size: 64,
color: Colors.white24,
),
const SizedBox(height: 16),
Text(
'No playlists available',
style: GoogleFonts.roboto(
fontSize: 18,
color: Colors.white60,
),
),
const SizedBox(height: 8),
Text(
currentUser?.isAdmin ?? false
? 'Add playlists in Admin Panel'
: 'Contact administrator',
style: GoogleFonts.roboto(
fontSize: 14,
color: Colors.white38,
),
),
],
),
); );
}, }
);
}, return GridView.builder(
padding: const EdgeInsets.fromLTRB(24, 100, 24, 24), // Top padding for transparent AppBar
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 24,
mainAxisSpacing: 24,
childAspectRatio: 1.5,
),
itemCount: playlists.length,
itemBuilder: (context, index) {
final playlist = playlists[index];
return _PlaylistCard(
playlist: playlist,
onTap: () {
context.go('/dashboard', extra: playlist);
},
);
},
);
},
),
), ),
); );
} }
} }
class _PlaylistCard extends StatelessWidget { class _PlaylistCard extends StatefulWidget {
final PlaylistConfig playlist; final PlaylistConfig playlist;
final VoidCallback onTap; final VoidCallback onTap;
@@ -130,54 +147,77 @@ class _PlaylistCard extends StatelessWidget {
required this.onTap, required this.onTap,
}); });
@override
State<_PlaylistCard> createState() => _PlaylistCardState();
}
class _PlaylistCardState extends State<_PlaylistCard> {
bool _isHovered = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Card( return MouseRegion(
elevation: 4, onEnter: (_) => setState(() => _isHovered = true),
clipBehavior: Clip.antiAlias, onExit: (_) => setState(() => _isHovered = false),
shape: RoundedRectangleBorder( cursor: SystemMouseCursors.click,
borderRadius: BorderRadius.circular(12), child: GestureDetector(
), onTap: widget.onTap,
child: InkWell( child: AnimatedContainer(
onTap: onTap, duration: const Duration(milliseconds: 200),
child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( color: _isHovered
begin: Alignment.topLeft, ? Colors.white.withOpacity(0.15)
end: Alignment.bottomRight, : Colors.white.withOpacity(0.05), // Glass effect
colors: [ borderRadius: BorderRadius.circular(16),
Colors.blue.shade700, border: Border.all(
Colors.blue.shade900, color: _isHovered
], ? Colors.white.withOpacity(0.5)
: Colors.white.withOpacity(0.1),
width: 1.5,
), ),
boxShadow: _isHovered ? [
BoxShadow(
color: Colors.black.withOpacity(0.3),
blurRadius: 20,
offset: const Offset(0, 10),
)
] : [],
), ),
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(24),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Icon( Container(
Icons.playlist_play, width: 56,
size: 48, height: 56,
color: Colors.white.withOpacity(0.9), decoration: BoxDecoration(
color: Colors.blue.withOpacity(0.2), // Accent color tint
shape: BoxShape.circle,
),
child: const Icon(
Icons.playlist_play,
size: 32,
color: Colors.white, // White icon
),
), ),
const SizedBox(height: 12), const SizedBox(height: 16),
Text( Text(
playlist.name, widget.playlist.name,
style: GoogleFonts.roboto( style: GoogleFonts.outfit( // Using Outfit for modern look
fontSize: 18, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,
), ),
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
const SizedBox(height: 4), const SizedBox(height: 6),
Text( Text(
Uri.tryParse(playlist.dns)?.host ?? playlist.dns, Uri.tryParse(widget.playlist.dns)?.host ?? widget.playlist.dns,
style: GoogleFonts.roboto( style: GoogleFonts.inter(
fontSize: 12, fontSize: 13,
color: Colors.white.withOpacity(0.7), color: Colors.white54,
), ),
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
@@ -189,3 +229,4 @@ class _PlaylistCard extends StatelessWidget {
); );
} }
} }
+195 -134
View File
@@ -68,9 +68,21 @@ class _SettingsTabState extends ConsumerState<SettingsTab> with SingleTickerProv
children: [ children: [
// TabBar // TabBar
Container( Container(
color: Theme.of(context).colorScheme.surface, margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.05),
borderRadius: BorderRadius.circular(50),
),
child: TabBar( child: TabBar(
controller: _tabController, controller: _tabController,
indicator: BoxDecoration(
color: Colors.white.withOpacity(0.1),
borderRadius: BorderRadius.circular(50),
),
labelColor: Colors.white,
unselectedLabelColor: Colors.white54,
dividerColor: Colors.transparent,
overlayColor: MaterialStateProperty.all(Colors.transparent),
tabs: const [ tabs: const [
Tab(icon: Icon(Icons.filter_list), text: 'Filtres'), Tab(icon: Icon(Icons.filter_list), text: 'Filtres'),
Tab(icon: Icon(Icons.stream), text: 'Streaming'), Tab(icon: Icon(Icons.stream), text: 'Streaming'),
@@ -109,82 +121,97 @@ class _SettingsTabState extends ConsumerState<SettingsTab> with SingleTickerProv
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
children: [ children: [
// Theme selection card // Theme selection card
Card( Container(
child: Padding( decoration: BoxDecoration(
padding: const EdgeInsets.all(16), color: Colors.white.withOpacity(0.05),
child: Column( borderRadius: BorderRadius.circular(16),
crossAxisAlignment: CrossAxisAlignment.start, border: Border.all(color: Colors.white.withOpacity(0.1)),
children: [ ),
Row( padding: const EdgeInsets.all(16),
children: [ child: Column(
Icon( crossAxisAlignment: CrossAxisAlignment.start,
Icons.dark_mode, children: [
color: AppColors.primary, Row(
children: [
Icon(
Icons.dark_mode,
color: Colors.white,
),
const SizedBox(width: 12),
Text(
'Thème',
style: GoogleFonts.inter(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Colors.white,
), ),
const SizedBox(width: 12), ),
Text( ],
'Thème', ),
style: GoogleFonts.inter( const SizedBox(height: 16),
fontSize: 18,
fontWeight: FontWeight.w600, // Theme options
), _buildThemeOption(
), context: context,
], title: 'Système',
), subtitle: 'Suivre les paramètres du système',
const SizedBox(height: 16), icon: Icons.settings_suggest,
isSelected: themeState.appThemeMode == AppThemeMode.system,
// Theme options onTap: () => themeNotifier.setThemeMode(AppThemeMode.system),
_buildThemeOption( ),
context: context, const SizedBox(height: 8),
title: 'Système', _buildThemeOption(
subtitle: 'Suivre les paramètres du système', context: context,
icon: Icons.settings_suggest, title: 'Sombre',
isSelected: themeState.appThemeMode == AppThemeMode.system, subtitle: 'Interface sombre premium',
onTap: () => themeNotifier.setThemeMode(AppThemeMode.system), icon: Icons.dark_mode,
), isSelected: themeState.appThemeMode == AppThemeMode.dark,
const SizedBox(height: 8), onTap: () => themeNotifier.setThemeMode(AppThemeMode.dark),
_buildThemeOption( ),
context: context, const SizedBox(height: 8),
title: 'Sombre', _buildThemeOption(
subtitle: 'Interface sombre premium', context: context,
icon: Icons.dark_mode, title: 'Clair',
isSelected: themeState.appThemeMode == AppThemeMode.dark, subtitle: 'Interface claire et lumineuse',
onTap: () => themeNotifier.setThemeMode(AppThemeMode.dark), icon: Icons.light_mode,
), isSelected: themeState.appThemeMode == AppThemeMode.light,
const SizedBox(height: 8), onTap: () => themeNotifier.setThemeMode(AppThemeMode.light),
_buildThemeOption( ),
context: context, ],
title: 'Clair',
subtitle: 'Interface claire et lumineuse',
icon: Icons.light_mode,
isSelected: themeState.appThemeMode == AppThemeMode.light,
onTap: () => themeNotifier.setThemeMode(AppThemeMode.light),
),
],
),
), ),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
// Quick toggle card // Quick toggle card
Card( Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.05),
borderRadius: BorderRadius.circular(16),
border: Border.all(color: Colors.white.withOpacity(0.1)),
),
child: ListTile( child: ListTile(
leading: Icon( leading: Icon(
isDark ? Icons.dark_mode : Icons.light_mode, isDark ? Icons.dark_mode : Icons.light_mode,
color: AppColors.primary, color: Colors.white,
), ),
title: Text( title: Text(
'Mode actuel', 'Mode actuel',
style: GoogleFonts.inter(fontWeight: FontWeight.w500), style: GoogleFonts.inter(fontWeight: FontWeight.w500, color: Colors.white),
), ),
subtitle: Text( subtitle: Text(
isDark ? 'Thème sombre actif' : 'Thème clair actif', isDark ? 'Thème sombre actif' : 'Thème clair actif',
style: TextStyle(color: Colors.white70),
), ),
trailing: Switch( trailing: Switch(
value: isDark, value: isDark,
onChanged: (_) => themeNotifier.toggleTheme(), onChanged: (_) => themeNotifier.toggleTheme(),
activeColor: AppColors.primary, activeColor: AppColors.primary,
trackColor: MaterialStateProperty.resolveWith(
(states) => states.contains(MaterialState.selected)
? AppColors.primary.withOpacity(0.5)
: Colors.grey.shade800,
),
), ),
), ),
), ),
@@ -268,21 +295,27 @@ class _SettingsTabState extends ConsumerState<SettingsTab> with SingleTickerProv
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
children: [ children: [
// User info card // User info card
Card( Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.05),
borderRadius: BorderRadius.circular(16),
border: Border.all(color: Colors.white.withOpacity(0.1)),
),
padding: const EdgeInsets.all(4),
child: ListTile( child: ListTile(
leading: const Icon(Icons.person), leading: const Icon(Icons.person, color: Colors.white),
title: Text( title: Text(
'Connecté en tant que', 'Connecté en tant que',
style: GoogleFonts.roboto(fontSize: 12, color: Colors.grey), style: GoogleFonts.roboto(fontSize: 12, color: Colors.white70),
), ),
subtitle: Text( subtitle: Text(
currentUser?.username ?? 'Unknown', currentUser?.username ?? 'Unknown',
style: GoogleFonts.roboto(fontWeight: FontWeight.w600), style: GoogleFonts.roboto(fontWeight: FontWeight.w600, color: Colors.white),
), ),
trailing: currentUser?.isAdmin ?? false trailing: currentUser?.isAdmin ?? false
? Chip( ? Chip(
label: Text('Admin', style: GoogleFonts.roboto(fontSize: 11)), label: Text('Admin', style: GoogleFonts.roboto(fontSize: 11, color: Colors.black)),
backgroundColor: Colors.blue.shade100, backgroundColor: Colors.white,
) )
: null, : null,
), ),
@@ -295,6 +328,7 @@ class _SettingsTabState extends ConsumerState<SettingsTab> with SingleTickerProv
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
color: Colors.white,
), ),
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
@@ -302,7 +336,7 @@ class _SettingsTabState extends ConsumerState<SettingsTab> with SingleTickerProv
'Seules les catégories contenant un de ces mots-clés seront affichées. Séparez par des virgules.', 'Seules les catégories contenant un de ces mots-clés seront affichées. Séparez par des virgules.',
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
fontSize: 12, fontSize: 12,
color: Colors.grey.shade600, color: Colors.white54,
), ),
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
@@ -357,11 +391,16 @@ class _SettingsTabState extends ConsumerState<SettingsTab> with SingleTickerProv
// Admin panel // Admin panel
if (currentUser?.isAdmin ?? false) ...[ if (currentUser?.isAdmin ?? false) ...[
Card( Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.05),
borderRadius: BorderRadius.circular(16),
border: Border.all(color: Colors.white.withOpacity(0.1)),
),
child: ListTile( child: ListTile(
leading: const Icon(Icons.admin_panel_settings), leading: const Icon(Icons.admin_panel_settings, color: Colors.white),
title: Text('Panneau Admin', style: GoogleFonts.roboto()), title: Text('Panneau Admin', style: GoogleFonts.roboto(color: Colors.white)),
trailing: const Icon(Icons.chevron_right), trailing: const Icon(Icons.chevron_right, color: Colors.white54),
onTap: () => context.go('/admin'), onTap: () => context.go('/admin'),
), ),
), ),
@@ -369,24 +408,34 @@ class _SettingsTabState extends ConsumerState<SettingsTab> with SingleTickerProv
], ],
// Change playlist // Change playlist
Card( Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.05),
borderRadius: BorderRadius.circular(16),
border: Border.all(color: Colors.white.withOpacity(0.1)),
),
child: ListTile( child: ListTile(
leading: const Icon(Icons.playlist_play), leading: const Icon(Icons.playlist_play, color: Colors.white),
title: Text('Changer de Playlist', style: GoogleFonts.roboto()), title: Text('Changer de Playlist', style: GoogleFonts.roboto(color: Colors.white)),
trailing: const Icon(Icons.chevron_right), trailing: const Icon(Icons.chevron_right, color: Colors.white54),
onTap: () => context.go('/playlists'), onTap: () => context.go('/playlists'),
), ),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
// About // About
Card( Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.05),
borderRadius: BorderRadius.circular(16),
border: Border.all(color: Colors.white.withOpacity(0.1)),
),
child: ListTile( child: ListTile(
leading: const Icon(Icons.info_outline), leading: const Icon(Icons.info_outline, color: Colors.white),
title: Text('À propos', style: GoogleFonts.roboto()), title: Text('À propos', style: GoogleFonts.roboto(color: Colors.white)),
subtitle: Text( subtitle: Text(
'XtremFlow IPTV v1.0.0', 'XtremFlow IPTV v1.0.0',
style: GoogleFonts.roboto(fontSize: 12), style: GoogleFonts.roboto(fontSize: 12, color: Colors.white54),
), ),
), ),
), ),
@@ -417,69 +466,81 @@ class _SettingsTabState extends ConsumerState<SettingsTab> with SingleTickerProv
required ValueChanged<String> onChanged, required ValueChanged<String> onChanged,
required VoidCallback onClear, required VoidCallback onClear,
}) { }) {
return Card( return Container(
child: Padding( decoration: BoxDecoration(
padding: const EdgeInsets.all(12), color: Colors.white.withOpacity(0.05),
child: Column( borderRadius: BorderRadius.circular(16),
crossAxisAlignment: CrossAxisAlignment.start, border: Border.all(color: Colors.white.withOpacity(0.1)),
children: [ ),
Row( padding: const EdgeInsets.all(16),
children: [ child: Column(
Icon(icon, size: 18, color: Colors.blue.shade700), crossAxisAlignment: CrossAxisAlignment.start,
const SizedBox(width: 8), children: [
Text( Row(
title, children: [
style: GoogleFonts.roboto( Icon(icon, size: 18, color: Colors.blueAccent),
fontWeight: FontWeight.w600, const SizedBox(width: 8),
fontSize: 13, Text(
), title,
style: GoogleFonts.roboto(
fontWeight: FontWeight.w600,
fontSize: 13,
color: Colors.white,
), ),
],
),
const SizedBox(height: 8),
TextField(
controller: controller,
decoration: InputDecoration(
hintText: 'Ex: FR,FRANCE,HD,SPORT',
hintStyle: GoogleFonts.roboto(fontSize: 12),
border: const OutlineInputBorder(),
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
suffixIcon: controller.text.isNotEmpty
? IconButton(
icon: const Icon(Icons.clear, size: 16),
onPressed: onClear,
padding: EdgeInsets.zero,
constraints: const BoxConstraints(),
)
: null,
),
style: GoogleFonts.roboto(fontSize: 12),
onChanged: onChanged,
),
if (keywords.isNotEmpty) ...[
const SizedBox(height: 6),
Wrap(
spacing: 4,
runSpacing: 4,
children: keywords.map((keyword) {
return Chip(
label: Text(
keyword,
style: GoogleFonts.roboto(fontSize: 10),
),
padding: EdgeInsets.zero,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
visualDensity: VisualDensity.compact,
);
}).toList(),
), ),
], ],
),
const SizedBox(height: 12),
TextField(
controller: controller,
decoration: InputDecoration(
hintText: 'Ex: FR,FRANCE,HD,SPORT',
hintStyle: GoogleFonts.roboto(fontSize: 12, color: Colors.white30),
filled: true,
fillColor: Colors.black26,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide.none,
),
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 12,
vertical: 12,
),
suffixIcon: controller.text.isNotEmpty
? IconButton(
icon: const Icon(Icons.clear, size: 16, color: Colors.white54),
onPressed: onClear,
padding: EdgeInsets.zero,
constraints: const BoxConstraints(),
)
: null,
),
style: GoogleFonts.roboto(fontSize: 12, color: Colors.white),
onChanged: onChanged,
),
if (keywords.isNotEmpty) ...[
const SizedBox(height: 12),
Wrap(
spacing: 6,
runSpacing: 6,
children: keywords.map((keyword) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
decoration: BoxDecoration(
color: Colors.blueAccent.withOpacity(0.2),
borderRadius: BorderRadius.circular(50),
border: Border.all(color: Colors.blueAccent.withOpacity(0.5)),
),
child: Text(
keyword,
style: GoogleFonts.roboto(fontSize: 11, color: Colors.white),
),
);
}).toList(),
),
], ],
), ],
), ),
); );
} }
@@ -21,6 +21,7 @@ class StreamingSettingsTab extends ConsumerWidget {
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white,
), ),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
@@ -28,7 +29,7 @@ class StreamingSettingsTab extends ConsumerWidget {
'Ces paramètres s\'appliquent uniquement aux flux TV en direct.', 'Ces paramètres s\'appliquent uniquement aux flux TV en direct.',
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
fontSize: 12, fontSize: 12,
color: Colors.grey, color: Colors.white54,
), ),
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
@@ -95,17 +96,18 @@ class StreamingSettingsTab extends ConsumerWidget {
ConnectionTimeout.long => 'Long (60s)', ConnectionTimeout.long => 'Long (60s)',
}, },
), ),
const Divider(height: 1), Divider(height: 1, color: Colors.white.withOpacity(0.1)),
SwitchListTile( SwitchListTile(
title: Text( title: Text(
'Reconnexion automatique', 'Reconnexion automatique',
style: GoogleFonts.roboto(fontSize: 14), style: GoogleFonts.roboto(fontSize: 14, color: Colors.white),
), ),
subtitle: Text( subtitle: Text(
'Se reconnecter en cas de coupure', 'Se reconnecter en cas de coupure',
style: GoogleFonts.roboto(fontSize: 12, color: Colors.grey), style: GoogleFonts.roboto(fontSize: 12, color: Colors.white54),
), ),
value: settings.autoReconnect, value: settings.autoReconnect,
activeColor: Colors.blueAccent,
onChanged: (v) => notifier.setAutoReconnect(v), onChanged: (v) => notifier.setAutoReconnect(v),
), ),
], ],
@@ -130,17 +132,18 @@ class StreamingSettingsTab extends ConsumerWidget {
TranscodingMode.disabled => 'Désactivé (direct)', TranscodingMode.disabled => 'Désactivé (direct)',
}, },
), ),
const Divider(height: 1), Divider(height: 1, color: Colors.white.withOpacity(0.1)),
SwitchListTile( SwitchListTile(
title: Text( title: Text(
'Préférer lecture directe', 'Préférer lecture directe',
style: GoogleFonts.roboto(fontSize: 14), style: GoogleFonts.roboto(fontSize: 14, color: Colors.white),
), ),
subtitle: Text( subtitle: Text(
'Utiliser le flux original si compatible', 'Utiliser le flux original si compatible',
style: GoogleFonts.roboto(fontSize: 12, color: Colors.grey), style: GoogleFonts.roboto(fontSize: 12, color: Colors.white54),
), ),
value: settings.preferDirectPlay, value: settings.preferDirectPlay,
activeColor: Colors.blueAccent,
onChanged: (v) => notifier.setPreferDirectPlay(v), onChanged: (v) => notifier.setPreferDirectPlay(v),
), ),
], ],
@@ -203,9 +206,12 @@ class StreamingSettingsTab extends ConsumerWidget {
required IconData icon, required IconData icon,
required List<Widget> children, required List<Widget> children,
}) { }) {
return Card( return Container(
elevation: 2, decoration: BoxDecoration(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), color: Colors.white.withOpacity(0.05),
borderRadius: BorderRadius.circular(16),
border: Border.all(color: Colors.white.withOpacity(0.1)),
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@@ -213,19 +219,20 @@ class StreamingSettingsTab extends ConsumerWidget {
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: Row( child: Row(
children: [ children: [
Icon(icon, size: 20, color: Theme.of(context).colorScheme.primary), Icon(icon, size: 20, color: Colors.blueAccent),
const SizedBox(width: 8), const SizedBox(width: 8),
Text( Text(
title, title,
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.white,
), ),
), ),
], ],
), ),
), ),
const Divider(height: 1), Divider(height: 1, color: Colors.white.withOpacity(0.1)),
...children, ...children,
], ],
), ),
@@ -241,21 +248,24 @@ class StreamingSettingsTab extends ConsumerWidget {
required String Function(T) labelBuilder, required String Function(T) labelBuilder,
}) { }) {
return ListTile( return ListTile(
title: Text(title, style: GoogleFonts.roboto(fontSize: 14)), title: Text(title, style: GoogleFonts.roboto(fontSize: 14, color: Colors.white)),
subtitle: Text(subtitle, style: GoogleFonts.roboto(fontSize: 12, color: Colors.grey)), subtitle: Text(subtitle, style: GoogleFonts.roboto(fontSize: 12, color: Colors.white54)),
trailing: DropdownButton<T>( trailing: DropdownButton<T>(
value: value, value: value,
underline: const SizedBox(), underline: const SizedBox(),
dropdownColor: const Color(0xFF1C1C1E), // Dark background for dropdown
items: items.map((item) { items: items.map((item) {
return DropdownMenuItem<T>( return DropdownMenuItem<T>(
value: item, value: item,
child: Text( child: Text(
labelBuilder(item), labelBuilder(item),
style: GoogleFonts.roboto(fontSize: 13), style: GoogleFonts.roboto(fontSize: 13, color: Colors.white),
), ),
); );
}).toList(), }).toList(),
onChanged: onChanged, onChanged: onChanged,
style: GoogleFonts.roboto(color: Colors.white),
iconEnabledColor: Colors.white70,
), ),
); );
} }