Energymedia content manager base creada
This commit is contained in:
@@ -79,11 +79,10 @@ class _LoginPageState extends State<LoginPage> with TickerProviderStateMixin {
|
|||||||
begin: Alignment.topLeft,
|
begin: Alignment.topLeft,
|
||||||
end: Alignment.bottomRight,
|
end: Alignment.bottomRight,
|
||||||
colors: [
|
colors: [
|
||||||
Color(
|
Color(0xFF0B0B0D), // Negro oscuro principal
|
||||||
0xFF0F172A), // Azul muy oscuro (más oscuro para móvil)
|
Color(0xFF1A1A1D), // Gris muy oscuro
|
||||||
Color(0xFF1E293B), // Azul oscuro
|
Color(0xFF6B2F8A), // Purple
|
||||||
Color(0xFF075985), // Azul medio oscuro
|
Color(0xFF4EC9F5), // Cyan
|
||||||
Color(0xFF059669), // Verde más oscuro
|
|
||||||
],
|
],
|
||||||
stops: [0.0, 0.3, 0.7, 1.0],
|
stops: [0.0, 0.3, 0.7, 1.0],
|
||||||
),
|
),
|
||||||
@@ -159,7 +158,7 @@ class _LoginPageState extends State<LoginPage> with TickerProviderStateMixin {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
const Text(
|
const Text(
|
||||||
'NetHive',
|
'EnergyMedia',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 38,
|
fontSize: 38,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -176,7 +175,7 @@ class _LoginPageState extends State<LoginPage> with TickerProviderStateMixin {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
const Text(
|
const Text(
|
||||||
'Infrastructure Management',
|
'Content Manager',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: Colors.white70,
|
color: Colors.white70,
|
||||||
@@ -279,11 +278,11 @@ class _LoginPageState extends State<LoginPage> with TickerProviderStateMixin {
|
|||||||
begin: Alignment.topLeft,
|
begin: Alignment.topLeft,
|
||||||
end: Alignment.bottomRight,
|
end: Alignment.bottomRight,
|
||||||
colors: [
|
colors: [
|
||||||
Color(0xFF1E40AF), // Azul profundo
|
Color(0xFF4EC9F5), // Cyan principal
|
||||||
Color(0xFF3B82F6), // Azul brillante
|
Color(0xFFFFB733), // Yellow
|
||||||
Color(0xFF10B981), // Verde esmeralda
|
Color(0xFF6B2F8A), // Purple
|
||||||
Color(0xFF059669), // Verde intenso
|
Color(0xFFFF7A3D), // Orange
|
||||||
Color(0xFF7C3AED), // Púrpura
|
Color(0xFF4EC9F5), // Cyan de vuelta
|
||||||
],
|
],
|
||||||
stops: [0.0, 0.25, 0.5, 0.75, 1.0],
|
stops: [0.0, 0.25, 0.5, 0.75, 1.0],
|
||||||
),
|
),
|
||||||
@@ -341,7 +340,7 @@ class _LoginPageState extends State<LoginPage> with TickerProviderStateMixin {
|
|||||||
FadeTransition(
|
FadeTransition(
|
||||||
opacity: _fadeAnimation,
|
opacity: _fadeAnimation,
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'NetHive',
|
'EnergyMedia',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 52,
|
fontSize: 52,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -361,7 +360,7 @@ class _LoginPageState extends State<LoginPage> with TickerProviderStateMixin {
|
|||||||
FadeTransition(
|
FadeTransition(
|
||||||
opacity: _fadeAnimation,
|
opacity: _fadeAnimation,
|
||||||
child: Text(
|
child: Text(
|
||||||
'Infrastructure Management',
|
'Content Manager',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
color: Colors.white.withOpacity(0.8),
|
color: Colors.white.withOpacity(0.8),
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ class _LoginFormState extends State<LoginForm> with TickerProviderStateMixin {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Logo NetHive para formulario (solo en desktop)
|
// Logo EnergyMedia para formulario (solo en desktop)
|
||||||
MediaQuery.of(context).size.width >= 768
|
MediaQuery.of(context).size.width >= 768
|
||||||
? Container(
|
? Container(
|
||||||
margin: const EdgeInsets.only(bottom: 50),
|
margin: const EdgeInsets.only(bottom: 50),
|
||||||
@@ -367,7 +367,7 @@ class _LoginFormState extends State<LoginForm> with TickerProviderStateMixin {
|
|||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
color: Color(0xFF10B981),
|
color: Color(0xFF4EC9F5),
|
||||||
width: 2,
|
width: 2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -415,11 +415,7 @@ class _LoginFormState extends State<LoginForm> with TickerProviderStateMixin {
|
|||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: isMobile
|
color: const Color(0xFF4EC9F5).withOpacity(0.4),
|
||||||
? const Color(0xFF0369A1)
|
|
||||||
.withOpacity(0.6) // Azul en móvil
|
|
||||||
: const Color(0xFF10B981)
|
|
||||||
.withOpacity(0.4), // Verde en desktop
|
|
||||||
blurRadius: 20,
|
blurRadius: 20,
|
||||||
offset: const Offset(0, 8),
|
offset: const Offset(0, 8),
|
||||||
),
|
),
|
||||||
@@ -435,10 +431,7 @@ class _LoginFormState extends State<LoginForm> with TickerProviderStateMixin {
|
|||||||
await login();
|
await login();
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: isMobile
|
backgroundColor: const Color(0xFF4EC9F5), // Cyan principal
|
||||||
? const Color(
|
|
||||||
0xFF0369A1) // Azul más contrastante en móvil
|
|
||||||
: const Color(0xFF10B981), // Verde en desktop
|
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
),
|
),
|
||||||
@@ -477,7 +470,7 @@ class _LoginFormState extends State<LoginForm> with TickerProviderStateMixin {
|
|||||||
children: [
|
children: [
|
||||||
const Icon(
|
const Icon(
|
||||||
Icons.lock_outline,
|
Icons.lock_outline,
|
||||||
color: Color(0xFF10B981),
|
color: Color(0xFF4EC9F5),
|
||||||
size: 16,
|
size: 16,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
@@ -536,14 +529,15 @@ class _LoginFormState extends State<LoginForm> with TickerProviderStateMixin {
|
|||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
_buildFeatureItem('Gestión completa de infraestructura',
|
|
||||||
Icons.dashboard_outlined),
|
|
||||||
_buildFeatureItem(
|
_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(
|
_buildFeatureItem(
|
||||||
'Reportes avanzados', Icons.assessment_outlined),
|
'Dashboard con analytics', Icons.bar_chart_outlined),
|
||||||
_buildFeatureItem(
|
|
||||||
'Dashboard intuitivo', Icons.widgets_outlined),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -565,12 +559,12 @@ class _LoginFormState extends State<LoginForm> with TickerProviderStateMixin {
|
|||||||
width: 32,
|
width: 32,
|
||||||
height: 32,
|
height: 32,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: const Color(0xFF10B981).withOpacity(0.1),
|
color: const Color(0xFF4EC9F5).withOpacity(0.1),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
icon,
|
icon,
|
||||||
color: const Color(0xFF10B981),
|
color: const Color(0xFF4EC9F5),
|
||||||
size: 16,
|
size: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:nethive_neo/providers/visual_state_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/premium_dashboard_page.dart';
|
||||||
import 'package:nethive_neo/pages/videos/gestor_videos_page.dart';
|
import 'package:nethive_neo/pages/videos/gestor_videos_page.dart';
|
||||||
import 'package:nethive_neo/theme/theme.dart';
|
import 'package:nethive_neo/theme/theme.dart';
|
||||||
|
import 'package:nethive_neo/helpers/globals.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
class VideosLayout extends StatefulWidget {
|
class VideosLayout extends StatefulWidget {
|
||||||
const VideosLayout({Key? key}) : super(key: key);
|
const VideosLayout({Key? key}) : super(key: key);
|
||||||
@@ -224,6 +227,12 @@ class _VideosLayoutState extends State<VideosLayout> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// Botón de Logout
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.fromLTRB(16, 8, 16, 16),
|
||||||
|
child: _buildLogoutButton(),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -496,6 +505,12 @@ class _VideosLayoutState extends State<VideosLayout> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// 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<VideosLayout> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildLogoutButton() {
|
||||||
|
return MouseRegion(
|
||||||
|
cursor: SystemMouseCursors.click,
|
||||||
|
child: Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
final userState = Provider.of<UserState>(context, listen: false);
|
||||||
|
|
||||||
|
// Mostrar diálogo de confirmación
|
||||||
|
final confirm = await showDialog<bool>(
|
||||||
|
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 {
|
class MenuItem {
|
||||||
|
|||||||
Reference in New Issue
Block a user