subida masiva implementado
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:energy_media/theme/theme.dart';
|
||||
import 'package:energy_media/helpers/globals.dart';
|
||||
import 'package:energy_media/widgets/premium_button.dart';
|
||||
import 'package:energy_media/pages/videos/widgets/premium_upload_dialog.dart';
|
||||
import 'package:energy_media/pages/videos/widgets/premium_batch_upload_dialog.dart';
|
||||
import 'package:energy_media/pages/videos/widgets/video_player_dialog.dart';
|
||||
import 'package:energy_media/pages/videos/widgets/gestor_videos_widgets/empty_state_widget.dart';
|
||||
import 'package:energy_media/pages/videos/widgets/gestor_videos_widgets/edit_video_dialog.dart';
|
||||
@@ -175,7 +176,7 @@ class _GestorVideosPageState extends State<GestorVideosPage> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (isMobile)
|
||||
if (isMobile) ...[
|
||||
// Vista móvil: solo botón centrado con diseño mejorado
|
||||
Center(
|
||||
child: Container(
|
||||
@@ -232,8 +233,67 @@ class _GestorVideosPageState extends State<GestorVideosPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
),
|
||||
const Gap(12),
|
||||
// Botón subida masiva móvil
|
||||
Center(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
constraints: const BoxConstraints(maxWidth: 300),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xFF6B2F8A),
|
||||
Color(0xFF4EC9F5),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color(0xFF6B2F8A).withOpacity(0.4),
|
||||
blurRadius: 12,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => _showBatchUploadDialog(provider),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
child: const Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.cloud_upload_outlined,
|
||||
color: Colors.white,
|
||||
size: 24,
|
||||
),
|
||||
Gap(12),
|
||||
Text(
|
||||
'Subida Masiva',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontFamily: 'Poppins',
|
||||
letterSpacing: 0.5,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (!isMobile)
|
||||
// Vista desktop: contador de videos y botón (sin título redundante)
|
||||
Row(
|
||||
children: [
|
||||
@@ -281,6 +341,13 @@ class _GestorVideosPageState extends State<GestorVideosPage> {
|
||||
icon: Icons.cloud_upload,
|
||||
onPressed: () => _showUploadDialog(provider),
|
||||
),
|
||||
const Gap(12),
|
||||
PremiumButton(
|
||||
text: 'Subida Masiva',
|
||||
icon: Icons.cloud_upload_outlined,
|
||||
onPressed: () => _showBatchUploadDialog(provider),
|
||||
backgroundColor: const Color(0xFF6B2F8A),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Gap(16),
|
||||
@@ -1271,6 +1338,19 @@ class _GestorVideosPageState extends State<GestorVideosPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _showBatchUploadDialog(VideosProvider provider) async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => PremiumBatchUploadDialog(
|
||||
provider: provider,
|
||||
onSuccess: () {
|
||||
_loadData();
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _playVideo(MediaFileModel video) {
|
||||
// Verificar que el video tenga URL
|
||||
if (video.fileUrl == null || video.fileUrl!.isEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user