From 1a1049b653053ce695937cb241d3205dff333b68 Mon Sep 17 00:00:00 2001 From: Abraham Date: Sat, 10 Jan 2026 21:49:15 -0800 Subject: [PATCH] Energymedia content manager base creada --- lib/pages/login_page/login_page.dart | 27 ++-- lib/pages/login_page/widgets/login_form.dart | 34 ++--- lib/pages/videos/videos_layout.dart | 132 +++++++++++++++++++ 3 files changed, 159 insertions(+), 34 deletions(-) diff --git a/lib/pages/login_page/login_page.dart b/lib/pages/login_page/login_page.dart index 38cdc87..98a5ee2 100644 --- a/lib/pages/login_page/login_page.dart +++ b/lib/pages/login_page/login_page.dart @@ -79,11 +79,10 @@ class _LoginPageState extends State with TickerProviderStateMixin { begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - Color( - 0xFF0F172A), // Azul muy oscuro (más oscuro para móvil) - Color(0xFF1E293B), // Azul oscuro - Color(0xFF075985), // Azul medio oscuro - Color(0xFF059669), // Verde más oscuro + Color(0xFF0B0B0D), // Negro oscuro principal + Color(0xFF1A1A1D), // Gris muy oscuro + Color(0xFF6B2F8A), // Purple + Color(0xFF4EC9F5), // Cyan ], stops: [0.0, 0.3, 0.7, 1.0], ), @@ -159,7 +158,7 @@ class _LoginPageState extends State with TickerProviderStateMixin { ), const SizedBox(height: 24), const Text( - 'NetHive', + 'EnergyMedia', style: TextStyle( fontSize: 38, fontWeight: FontWeight.bold, @@ -176,7 +175,7 @@ class _LoginPageState extends State with TickerProviderStateMixin { ), const SizedBox(height: 8), const Text( - 'Infrastructure Management', + 'Content Manager', style: TextStyle( fontSize: 16, color: Colors.white70, @@ -279,11 +278,11 @@ class _LoginPageState extends State with TickerProviderStateMixin { begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - Color(0xFF1E40AF), // Azul profundo - Color(0xFF3B82F6), // Azul brillante - Color(0xFF10B981), // Verde esmeralda - Color(0xFF059669), // Verde intenso - Color(0xFF7C3AED), // Púrpura + Color(0xFF4EC9F5), // Cyan principal + Color(0xFFFFB733), // Yellow + Color(0xFF6B2F8A), // Purple + Color(0xFFFF7A3D), // Orange + Color(0xFF4EC9F5), // Cyan de vuelta ], stops: [0.0, 0.25, 0.5, 0.75, 1.0], ), @@ -341,7 +340,7 @@ class _LoginPageState extends State with TickerProviderStateMixin { FadeTransition( opacity: _fadeAnimation, child: const Text( - 'NetHive', + 'EnergyMedia', style: TextStyle( fontSize: 52, fontWeight: FontWeight.bold, @@ -361,7 +360,7 @@ class _LoginPageState extends State with TickerProviderStateMixin { FadeTransition( opacity: _fadeAnimation, child: Text( - 'Infrastructure Management', + 'Content Manager', style: TextStyle( fontSize: 20, color: Colors.white.withOpacity(0.8), diff --git a/lib/pages/login_page/widgets/login_form.dart b/lib/pages/login_page/widgets/login_form.dart index b10c2b5..bbea5d4 100644 --- a/lib/pages/login_page/widgets/login_form.dart +++ b/lib/pages/login_page/widgets/login_form.dart @@ -139,7 +139,7 @@ class _LoginFormState extends State with TickerProviderStateMixin { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // Logo NetHive para formulario (solo en desktop) + // Logo EnergyMedia para formulario (solo en desktop) MediaQuery.of(context).size.width >= 768 ? Container( margin: const EdgeInsets.only(bottom: 50), @@ -367,7 +367,7 @@ class _LoginFormState extends State with TickerProviderStateMixin { focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(12), borderSide: const BorderSide( - color: Color(0xFF10B981), + color: Color(0xFF4EC9F5), width: 2, ), ), @@ -415,11 +415,7 @@ class _LoginFormState extends State with TickerProviderStateMixin { borderRadius: BorderRadius.circular(12), boxShadow: [ BoxShadow( - color: isMobile - ? const Color(0xFF0369A1) - .withOpacity(0.6) // Azul en móvil - : const Color(0xFF10B981) - .withOpacity(0.4), // Verde en desktop + color: const Color(0xFF4EC9F5).withOpacity(0.4), blurRadius: 20, offset: const Offset(0, 8), ), @@ -435,10 +431,7 @@ class _LoginFormState extends State with TickerProviderStateMixin { await login(); }, style: ElevatedButton.styleFrom( - backgroundColor: isMobile - ? const Color( - 0xFF0369A1) // Azul más contrastante en móvil - : const Color(0xFF10B981), // Verde en desktop + backgroundColor: const Color(0xFF4EC9F5), // Cyan principal shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), @@ -477,7 +470,7 @@ class _LoginFormState extends State with TickerProviderStateMixin { children: [ const Icon( Icons.lock_outline, - color: Color(0xFF10B981), + color: Color(0xFF4EC9F5), size: 16, ), const SizedBox(width: 8), @@ -536,14 +529,15 @@ class _LoginFormState extends State with TickerProviderStateMixin { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - _buildFeatureItem('Gestión completa de infraestructura', - Icons.dashboard_outlined), _buildFeatureItem( - 'Monitoreo en tiempo real', Icons.analytics_outlined), + 'Gestión completa de contenido multimedia', + Icons.video_library_outlined), + _buildFeatureItem('Reproducción en tiempo real', + Icons.play_circle_outline), + _buildFeatureItem('Organización por categorías', + Icons.category_outlined), _buildFeatureItem( - 'Reportes avanzados', Icons.assessment_outlined), - _buildFeatureItem( - 'Dashboard intuitivo', Icons.widgets_outlined), + 'Dashboard con analytics', Icons.bar_chart_outlined), ], ), ], @@ -565,12 +559,12 @@ class _LoginFormState extends State with TickerProviderStateMixin { width: 32, height: 32, decoration: BoxDecoration( - color: const Color(0xFF10B981).withOpacity(0.1), + color: const Color(0xFF4EC9F5).withOpacity(0.1), borderRadius: BorderRadius.circular(8), ), child: Icon( icon, - color: const Color(0xFF10B981), + color: const Color(0xFF4EC9F5), size: 16, ), ), diff --git a/lib/pages/videos/videos_layout.dart b/lib/pages/videos/videos_layout.dart index 6736136..d79c567 100644 --- a/lib/pages/videos/videos_layout.dart +++ b/lib/pages/videos/videos_layout.dart @@ -1,10 +1,13 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:nethive_neo/providers/visual_state_provider.dart'; +import 'package:nethive_neo/providers/user_provider.dart'; import 'package:nethive_neo/pages/videos/premium_dashboard_page.dart'; import 'package:nethive_neo/pages/videos/gestor_videos_page.dart'; import 'package:nethive_neo/theme/theme.dart'; +import 'package:nethive_neo/helpers/globals.dart'; import 'package:gap/gap.dart'; +import 'package:go_router/go_router.dart'; class VideosLayout extends StatefulWidget { const VideosLayout({Key? key}) : super(key: key); @@ -224,6 +227,12 @@ class _VideosLayoutState extends State { }, ), ), + + // Botón de Logout + Container( + padding: const EdgeInsets.fromLTRB(16, 8, 16, 16), + child: _buildLogoutButton(), + ), ], ), ); @@ -496,6 +505,12 @@ class _VideosLayoutState extends State { }, ), ), + + // Botón de Logout en drawer + Container( + padding: const EdgeInsets.fromLTRB(16, 8, 16, 16), + child: _buildLogoutButton(), + ), ], ), ); @@ -545,6 +560,123 @@ class _VideosLayoutState extends State { ), ); } + + Widget _buildLogoutButton() { + return MouseRegion( + cursor: SystemMouseCursors.click, + child: Material( + color: Colors.transparent, + child: InkWell( + onTap: () async { + final userState = Provider.of(context, listen: false); + + // Mostrar diálogo de confirmación + final confirm = await showDialog( + context: context, + builder: (context) => AlertDialog( + backgroundColor: AppTheme.of(context).secondaryBackground, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + title: Text( + '¿Cerrar Sesión?', + style: AppTheme.of(context).title3.override( + fontFamily: 'Poppins', + color: AppTheme.of(context).primaryText, + fontWeight: FontWeight.bold, + ), + ), + content: Text( + '¿Estás seguro de que deseas cerrar sesión?', + style: AppTheme.of(context).bodyText1.override( + fontFamily: 'Poppins', + color: AppTheme.of(context).secondaryText, + ), + ), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(false), + child: Text( + 'Cancelar', + style: TextStyle( + color: AppTheme.of(context).secondaryText, + fontFamily: 'Poppins', + ), + ), + ), + Container( + decoration: BoxDecoration( + gradient: const LinearGradient( + colors: [ + Color(0xFFFF2D2D), + Color(0xFFFF7A3D), + ], + ), + borderRadius: BorderRadius.circular(8), + ), + child: TextButton( + onPressed: () => Navigator.of(context).pop(true), + child: const Text( + 'Cerrar Sesión', + style: TextStyle( + color: Colors.white, + fontFamily: 'Poppins', + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ], + ), + ); + + if (confirm == true) { + // Cerrar sesión + await supabase.auth.signOut(); + userState.logout(); + + // Navegar al login + if (mounted) { + context.go('/login'); + } + } + }, + borderRadius: BorderRadius.circular(12), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16), + decoration: BoxDecoration( + color: AppTheme.of(context).error.withOpacity(0.1), + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: AppTheme.of(context).error.withOpacity(0.3), + width: 1, + ), + ), + child: Row( + children: [ + Icon( + Icons.logout, + color: AppTheme.of(context).error, + size: 24, + ), + const Gap(16), + Expanded( + child: Text( + 'Cerrar Sesión', + style: AppTheme.of(context).bodyText1.override( + fontFamily: 'Poppins', + color: AppTheme.of(context).error, + fontWeight: FontWeight.w500, + ), + ), + ), + ], + ), + ), + ), + ), + ); + } } class MenuItem {