From ec5c62a64ba0cccbfea8dee2b98b86c677d99e4a Mon Sep 17 00:00:00 2001 From: Abraham Date: Thu, 15 Jan 2026 20:56:31 -0800 Subject: [PATCH] posibles fiexes --- lib/pages/login_page/login_page.dart | 8 +- lib/pages/videos/gestor_videos_page.dart | 3 + lib/pages/videos/premium_dashboard_page.dart | 128 ------------------ lib/pages/videos/videos_layout.dart | 4 - .../empty_state_widget.dart | 2 - .../videos/widgets/premium_upload_dialog.dart | 8 +- lib/providers/videos_provider.dart | 3 + pubspec.yaml | 2 +- 8 files changed, 15 insertions(+), 143 deletions(-) diff --git a/lib/pages/login_page/login_page.dart b/lib/pages/login_page/login_page.dart index 0989a84..d624234 100644 --- a/lib/pages/login_page/login_page.dart +++ b/lib/pages/login_page/login_page.dart @@ -425,10 +425,10 @@ class _LoginPageState extends State with TickerProviderStateMixin { animation: _fadeController, builder: (context, child) { return Positioned( - top: circle['top'] as double?, - bottom: circle['bottom'] as double?, - left: circle['left'] as double?, - right: circle['right'] as double?, + top: circle['top'], + bottom: circle['bottom'], + left: circle['left'], + right: circle['right'], child: Transform.scale( scale: 0.5 + (_fadeAnimation.value * 0.5), child: Container( diff --git a/lib/pages/videos/gestor_videos_page.dart b/lib/pages/videos/gestor_videos_page.dart index c8cb1d7..739e085 100644 --- a/lib/pages/videos/gestor_videos_page.dart +++ b/lib/pages/videos/gestor_videos_page.dart @@ -682,6 +682,7 @@ class _GestorVideosPageState extends State { ]; return PlutoGrid( + key: ValueKey('pluto_grid_${provider.gridRebuildKey}'), columns: columns, rows: provider.videosRows, onLoaded: (PlutoGridOnLoadedEvent event) { @@ -690,6 +691,8 @@ class _GestorVideosPageState extends State { // Configurar paginación dinámica según resolución final pageSize = _calculatePageSize(context); _stateManager!.setPageSize(pageSize, notify: true); + // Conectar stateManager al provider para actualizaciones directas + provider.stateManager = _stateManager; }, createFooter: (stateManager) { return PlutoPagination(stateManager); diff --git a/lib/pages/videos/premium_dashboard_page.dart b/lib/pages/videos/premium_dashboard_page.dart index e8690cb..3cac461 100644 --- a/lib/pages/videos/premium_dashboard_page.dart +++ b/lib/pages/videos/premium_dashboard_page.dart @@ -109,72 +109,6 @@ class _PremiumDashboardPageState extends State ); } - Widget _buildWelcomeHeader() { - return Container( - padding: const EdgeInsets.all(32), - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - const Color(0xFF4EC9F5), - const Color(0xFFFFB733), - ], - ), - borderRadius: BorderRadius.circular(24), - boxShadow: [ - BoxShadow( - color: AppTheme.of(context).primaryColor.withOpacity(0.3), - blurRadius: 20, - offset: const Offset(0, 8), - ), - ], - ), - child: Row( - children: [ - Container( - padding: const EdgeInsets.all(16), - decoration: BoxDecoration( - color: Colors.white.withOpacity(0.2), - borderRadius: BorderRadius.circular(16), - ), - child: const Icon( - Icons.dashboard, - size: 40, - color: Color(0xFF0B0B0D), - ), - ), - const Gap(20), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '¡Bienvenido al Dashboard!', - style: AppTheme.of(context).title1.override( - fontFamily: 'Poppins', - color: const Color(0xFF0B0B0D), - fontWeight: FontWeight.bold, - fontSize: 28, - ), - ), - const Gap(8), - Text( - 'Visualiza el rendimiento de tu contenido en tiempo real', - style: AppTheme.of(context).bodyText1.override( - fontFamily: 'Poppins', - color: const Color(0xFF0B0B0D).withOpacity(0.8), - fontSize: 15, - ), - ), - ], - ), - ), - ], - ), - ); - } - Widget _buildStatsCards(bool isMobile) { if (isLoading) { return _buildLoadingSkeleton(isMobile); @@ -718,68 +652,6 @@ class _PremiumDashboardPageState extends State ); } - Widget _buildChartSkeleton(String title) { - return Container( - padding: const EdgeInsets.all(28), - decoration: BoxDecoration( - color: AppTheme.of(context).secondaryBackground, - borderRadius: BorderRadius.circular(20), - border: Border.all( - color: AppTheme.of(context).primaryColor.withOpacity(0.1), - width: 1, - ), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title, - style: AppTheme.of(context).title3.override( - fontFamily: 'Poppins', - color: AppTheme.of(context).primaryText, - fontWeight: FontWeight.bold, - ), - ), - const Gap(24), - Shimmer.fromColors( - baseColor: AppTheme.of(context).tertiaryBackground, - highlightColor: AppTheme.of(context).secondaryBackground, - child: Container( - height: 300, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12), - ), - ), - ), - ], - ), - ); - } - - Widget _buildEmptyChart(String message) { - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon( - Icons.pie_chart_outline, - size: 64, - color: AppTheme.of(context).tertiaryText, - ), - const Gap(16), - Text( - message, - style: AppTheme.of(context).bodyText1.override( - fontFamily: 'Poppins', - color: AppTheme.of(context).tertiaryText, - ), - ), - ], - ), - ); - } - String _formatNumber(int number) { if (number >= 1000000) { return '${(number / 1000000).toStringAsFixed(1)}M'; diff --git a/lib/pages/videos/videos_layout.dart b/lib/pages/videos/videos_layout.dart index e0bbf61..753c4c7 100644 --- a/lib/pages/videos/videos_layout.dart +++ b/lib/pages/videos/videos_layout.dart @@ -2,8 +2,6 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:energy_media/providers/visual_state_provider.dart'; import 'package:energy_media/providers/user_provider.dart'; -import 'package:energy_media/pages/videos/premium_dashboard_page.dart'; -import 'package:energy_media/pages/videos/gestor_videos_page.dart'; import 'package:energy_media/theme/theme.dart'; import 'package:energy_media/helpers/globals.dart'; import 'package:gap/gap.dart'; @@ -67,8 +65,6 @@ class _VideosLayoutState extends State { } Widget _buildHeader(bool isMobile) { - final isDark = AppTheme.themeMode == ThemeMode.dark; - final isLightBackground = !isDark; final currentLocation = GoRouterState.of(context).matchedLocation; final currentMenuItem = _menuItems.firstWhere( (item) => item.route == currentLocation, diff --git a/lib/pages/videos/widgets/gestor_videos_widgets/empty_state_widget.dart b/lib/pages/videos/widgets/gestor_videos_widgets/empty_state_widget.dart index 8dc4861..a841165 100644 --- a/lib/pages/videos/widgets/gestor_videos_widgets/empty_state_widget.dart +++ b/lib/pages/videos/widgets/gestor_videos_widgets/empty_state_widget.dart @@ -1,8 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import 'package:gap/gap.dart'; import 'package:energy_media/theme/theme.dart'; -import 'package:energy_media/providers/videos_provider.dart'; class EmptyStateWidget extends StatelessWidget { final VoidCallback onUploadPressed; diff --git a/lib/pages/videos/widgets/premium_upload_dialog.dart b/lib/pages/videos/widgets/premium_upload_dialog.dart index 31892d3..d2819ca 100644 --- a/lib/pages/videos/widgets/premium_upload_dialog.dart +++ b/lib/pages/videos/widgets/premium_upload_dialog.dart @@ -250,16 +250,16 @@ class _PremiumUploadDialogState extends State { Widget _buildHeader() { return Container( padding: const EdgeInsets.all(24), - decoration: BoxDecoration( + decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - const Color(0xFF4EC9F5), - const Color(0xFFFFB733), + Color(0xFF4EC9F5), + Color(0xFFFFB733), ], ), - borderRadius: const BorderRadius.only( + borderRadius: BorderRadius.only( topLeft: Radius.circular(24), topRight: Radius.circular(24), ), diff --git a/lib/providers/videos_provider.dart b/lib/providers/videos_provider.dart index 1960b38..867cb0d 100644 --- a/lib/providers/videos_provider.dart +++ b/lib/providers/videos_provider.dart @@ -14,6 +14,7 @@ class VideosProvider extends ChangeNotifier { // ========== STATE MANAGEMENT ========== PlutoGridStateManager? stateManager; List videosRows = []; + int gridRebuildKey = 0; // Key for forcing PlutoGrid rebuild // ========== DATA LISTS ========== List mediaFiles = []; @@ -755,6 +756,7 @@ class VideosProvider extends ChangeNotifier { void searchVideos(String query) { if (query.isEmpty) { _buildPlutoRows(); + gridRebuildKey++; notifyListeners(); return; } @@ -789,6 +791,7 @@ class VideosProvider extends ChangeNotifier { ); } + gridRebuildKey++; notifyListeners(); } diff --git a/pubspec.yaml b/pubspec.yaml index a26b2b5..ec91cf7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -103,4 +103,4 @@ flutter: fonts: - asset: assets/fonts/Poppins-Regular.ttf - asset: assets/fonts/Poppins-Bold.ttf - weight: 700 + weight: 700 \ No newline at end of file