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
+247 -119

No files matched your search

+30 -14
View File
@@ -43,8 +43,20 @@ 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(
decoration: const BoxDecoration(
gradient: RadialGradient(
center: Alignment.center,
radius: 1.5,
colors: [
Color(0xFF2C2C2E), // Dark Grey (Apple TV Surface)
Color(0xFF000000), // Pure Black
],
stops: [0.0, 1.0],
),
),
child: SafeArea(
child: Column( child: Column(
children: [ children: [
// Custom Glass Header // Custom Glass Header
@@ -57,12 +69,15 @@ class _AdminPanelState extends ConsumerState<AdminPanel>
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
showBorder: false, showBorder: false,
onTap: () => context.go('/playlists'), onTap: () => context.go('/playlists'),
child: const Icon(Icons.arrow_back, color: AppColors.textSecondary), child: const Icon(Icons.arrow_back, color: Colors.white70),
), ),
const SizedBox(width: 16), const SizedBox(width: 16),
Text( Text(
'Administration', 'Administration',
style: Theme.of(context).textTheme.headlineMedium, style: Theme.of(context).textTheme.headlineMedium?.copyWith(
color: Colors.white,
fontWeight: FontWeight.bold,
),
), ),
const Spacer(), const Spacer(),
// Custom Tab Bar Indicator // Custom Tab Bar Indicator
@@ -99,6 +114,7 @@ class _AdminPanelState extends ConsumerState<AdminPanel>
], ],
), ),
), ),
),
); );
} }
@@ -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,7 +49,19 @@ class PlaylistSelectionScreen extends ConsumerWidget {
), ),
], ],
), ),
body: playlistsAsync.when( body: Container(
decoration: const BoxDecoration(
gradient: RadialGradient(
center: Alignment.center,
radius: 1.5,
colors: [
Color(0xFF2C2C2E), // Dark Grey (Apple TV Surface)
Color(0xFF000000), // Pure Black
],
stops: [0.0, 1.0],
),
),
child: playlistsAsync.when(
loading: () => const Center(child: CircularProgressIndicator()), loading: () => const Center(child: CircularProgressIndicator()),
error: (error, stack) => Center( error: (error, stack) => Center(
child: Column( child: Column(
@@ -53,7 +69,7 @@ class PlaylistSelectionScreen extends ConsumerWidget {
children: [ children: [
Icon(Icons.error_outline, size: 64, color: Colors.red.shade400), Icon(Icons.error_outline, size: 64, color: Colors.red.shade400),
const SizedBox(height: 16), const SizedBox(height: 16),
Text('Error loading playlists', style: GoogleFonts.roboto(fontSize: 18)), Text('Error loading playlists', style: GoogleFonts.roboto(fontSize: 18, color: Colors.white70)),
const SizedBox(height: 8), const SizedBox(height: 8),
ElevatedButton( ElevatedButton(
onPressed: () => ref.refresh(playlistsProvider), onPressed: () => ref.refresh(playlistsProvider),
@@ -71,14 +87,14 @@ class PlaylistSelectionScreen extends ConsumerWidget {
Icon( Icon(
Icons.playlist_remove, Icons.playlist_remove,
size: 64, size: 64,
color: Colors.grey.shade400, color: Colors.white24,
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
Text( Text(
'No playlists available', 'No playlists available',
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
fontSize: 18, fontSize: 18,
color: Colors.grey.shade600, color: Colors.white60,
), ),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
@@ -88,7 +104,7 @@ class PlaylistSelectionScreen extends ConsumerWidget {
: 'Contact administrator', : 'Contact administrator',
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
fontSize: 14, fontSize: 14,
color: Colors.grey.shade500, color: Colors.white38,
), ),
), ),
], ],
@@ -97,11 +113,11 @@ class PlaylistSelectionScreen extends ConsumerWidget {
} }
return GridView.builder( return GridView.builder(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.fromLTRB(24, 100, 24, 24), // Top padding for transparent AppBar
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, crossAxisCount: 3,
crossAxisSpacing: 16, crossAxisSpacing: 24,
mainAxisSpacing: 16, mainAxisSpacing: 24,
childAspectRatio: 1.5, childAspectRatio: 1.5,
), ),
itemCount: playlists.length, itemCount: playlists.length,
@@ -117,11 +133,12 @@ class PlaylistSelectionScreen extends ConsumerWidget {
); );
}, },
), ),
),
); );
} }
} }
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,
), ),
const SizedBox(height: 12), child: const Icon(
Icons.playlist_play,
size: 32,
color: Colors.white, // White icon
),
),
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 {
); );
} }
} }
+109 -48
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,8 +121,12 @@ 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(
color: Colors.white.withOpacity(0.05),
borderRadius: BorderRadius.circular(16),
border: Border.all(color: Colors.white.withOpacity(0.1)),
),
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -119,7 +135,7 @@ class _SettingsTabState extends ConsumerState<SettingsTab> with SingleTickerProv
children: [ children: [
Icon( Icon(
Icons.dark_mode, Icons.dark_mode,
color: AppColors.primary, color: Colors.white,
), ),
const SizedBox(width: 12), const SizedBox(width: 12),
Text( Text(
@@ -127,6 +143,7 @@ class _SettingsTabState extends ConsumerState<SettingsTab> with SingleTickerProv
style: GoogleFonts.inter( style: GoogleFonts.inter(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.white,
), ),
), ),
], ],
@@ -163,28 +180,38 @@ class _SettingsTabState extends ConsumerState<SettingsTab> with SingleTickerProv
], ],
), ),
), ),
),
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,70 +466,82 @@ 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),
borderRadius: BorderRadius.circular(16),
border: Border.all(color: Colors.white.withOpacity(0.1)),
),
padding: const EdgeInsets.all(16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Icon(icon, size: 18, color: Colors.blue.shade700), Icon(icon, size: 18, color: Colors.blueAccent),
const SizedBox(width: 8), const SizedBox(width: 8),
Text( Text(
title, title,
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 13, fontSize: 13,
color: Colors.white,
), ),
), ),
], ],
), ),
const SizedBox(height: 8), const SizedBox(height: 12),
TextField( TextField(
controller: controller, controller: controller,
decoration: InputDecoration( decoration: InputDecoration(
hintText: 'Ex: FR,FRANCE,HD,SPORT', hintText: 'Ex: FR,FRANCE,HD,SPORT',
hintStyle: GoogleFonts.roboto(fontSize: 12), hintStyle: GoogleFonts.roboto(fontSize: 12, color: Colors.white30),
border: const OutlineInputBorder(), filled: true,
fillColor: Colors.black26,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide.none,
),
isDense: true, isDense: true,
contentPadding: const EdgeInsets.symmetric( contentPadding: const EdgeInsets.symmetric(
horizontal: 10, horizontal: 12,
vertical: 8, vertical: 12,
), ),
suffixIcon: controller.text.isNotEmpty suffixIcon: controller.text.isNotEmpty
? IconButton( ? IconButton(
icon: const Icon(Icons.clear, size: 16), icon: const Icon(Icons.clear, size: 16, color: Colors.white54),
onPressed: onClear, onPressed: onClear,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
constraints: const BoxConstraints(), constraints: const BoxConstraints(),
) )
: null, : null,
), ),
style: GoogleFonts.roboto(fontSize: 12), style: GoogleFonts.roboto(fontSize: 12, color: Colors.white),
onChanged: onChanged, onChanged: onChanged,
), ),
if (keywords.isNotEmpty) ...[ if (keywords.isNotEmpty) ...[
const SizedBox(height: 6), const SizedBox(height: 12),
Wrap( Wrap(
spacing: 4, spacing: 6,
runSpacing: 4, runSpacing: 6,
children: keywords.map((keyword) { children: keywords.map((keyword) {
return Chip( return Container(
label: Text( 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, keyword,
style: GoogleFonts.roboto(fontSize: 10), style: GoogleFonts.roboto(fontSize: 11, color: Colors.white),
), ),
padding: EdgeInsets.zero,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
visualDensity: VisualDensity.compact,
); );
}).toList(), }).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,
), ),
); );
} }