multiples mejoras añadidas, se retiró la categoría
This commit is contained in:
@@ -40,7 +40,6 @@ class _EditVideoDialogState extends State<EditVideoDialog> {
|
||||
late TextEditingController titleController;
|
||||
late TextEditingController descriptionController;
|
||||
late TextEditingController tagsController;
|
||||
MediaCategoryModel? selectedCategory;
|
||||
Uint8List? newPosterBytes;
|
||||
String? newPosterFileName;
|
||||
VideoPlayerController? _videoPlayerController;
|
||||
@@ -54,9 +53,6 @@ class _EditVideoDialogState extends State<EditVideoDialog> {
|
||||
descriptionController =
|
||||
TextEditingController(text: widget.video.fileDescription);
|
||||
tagsController = TextEditingController(text: widget.video.tags.join(', '));
|
||||
selectedCategory = widget.provider.categories
|
||||
.where((cat) => cat.mediaCategoriesId == widget.video.mediaCategoryFk)
|
||||
.firstOrNull;
|
||||
_initializeVideoPlayer();
|
||||
}
|
||||
|
||||
@@ -152,15 +148,6 @@ class _EditVideoDialogState extends State<EditVideoDialog> {
|
||||
);
|
||||
}
|
||||
|
||||
// Actualizar categoría
|
||||
if (selectedCategory != null &&
|
||||
selectedCategory!.mediaCategoriesId != widget.video.mediaCategoryFk) {
|
||||
await widget.provider.updateVideoCategory(
|
||||
widget.video.mediaFileId,
|
||||
selectedCategory!.mediaCategoriesId,
|
||||
);
|
||||
}
|
||||
|
||||
// Actualizar tags
|
||||
final newTags = tagsController.text
|
||||
.split(RegExp(r'[,\s]+'))
|
||||
@@ -346,10 +333,6 @@ class _EditVideoDialogState extends State<EditVideoDialog> {
|
||||
maxLines: 4,
|
||||
),
|
||||
const Gap(20),
|
||||
_buildLabel('Categoría'),
|
||||
const Gap(8),
|
||||
_buildCategoryDropdown(),
|
||||
const Gap(20),
|
||||
_buildLabel('Etiquetas (Tags)'),
|
||||
const Gap(4),
|
||||
Text(
|
||||
@@ -565,45 +548,6 @@ class _EditVideoDialogState extends State<EditVideoDialog> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCategoryDropdown() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppTheme.of(context).tertiaryBackground,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: AppTheme.of(context).primaryColor.withOpacity(0.1),
|
||||
),
|
||||
),
|
||||
child: DropdownButtonFormField<MediaCategoryModel>(
|
||||
value: selectedCategory,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Icon(
|
||||
Icons.category,
|
||||
color: AppTheme.of(context).primaryColor,
|
||||
),
|
||||
border: InputBorder.none,
|
||||
contentPadding: const EdgeInsets.all(16),
|
||||
),
|
||||
dropdownColor: AppTheme.of(context).secondaryBackground,
|
||||
items: widget.provider.categories.map((category) {
|
||||
return DropdownMenuItem(
|
||||
value: category,
|
||||
child: Text(
|
||||
category.categoryName,
|
||||
style: AppTheme.of(context).bodyText1.override(
|
||||
fontFamily: 'Poppins',
|
||||
color: AppTheme.of(context).primaryText,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
setState(() => selectedCategory = value);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildActions() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(24),
|
||||
|
||||
@@ -27,7 +27,6 @@ class _PremiumUploadDialogState extends State<PremiumUploadDialog> {
|
||||
final titleController = TextEditingController();
|
||||
final descriptionController = TextEditingController();
|
||||
final tagsController = TextEditingController();
|
||||
MediaCategoryModel? selectedCategory;
|
||||
Uint8List? selectedVideo;
|
||||
String? videoFileName;
|
||||
Uint8List? selectedPoster;
|
||||
@@ -133,7 +132,6 @@ class _PremiumUploadDialogState extends State<PremiumUploadDialog> {
|
||||
|
||||
Future<void> _uploadVideo() async {
|
||||
if (titleController.text.isEmpty ||
|
||||
selectedCategory == null ||
|
||||
selectedVideo == null ||
|
||||
videoFileName == null) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
@@ -165,7 +163,6 @@ class _PremiumUploadDialogState extends State<PremiumUploadDialog> {
|
||||
description: descriptionController.text.isEmpty
|
||||
? null
|
||||
: descriptionController.text,
|
||||
categoryId: selectedCategory!.mediaCategoriesId,
|
||||
tags: tags,
|
||||
);
|
||||
|
||||
@@ -359,10 +356,6 @@ class _PremiumUploadDialogState extends State<PremiumUploadDialog> {
|
||||
maxLines: 4,
|
||||
),
|
||||
const Gap(20),
|
||||
_buildLabel('Categoría *'),
|
||||
const Gap(8),
|
||||
_buildCategoryDropdown(),
|
||||
const Gap(20),
|
||||
_buildLabel('Etiquetas (Tags)'),
|
||||
const Gap(4),
|
||||
Text(
|
||||
@@ -446,52 +439,6 @@ class _PremiumUploadDialogState extends State<PremiumUploadDialog> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCategoryDropdown() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppTheme.of(context).tertiaryBackground,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: AppTheme.of(context).primaryColor.withOpacity(0.1),
|
||||
),
|
||||
),
|
||||
child: DropdownButtonFormField<MediaCategoryModel>(
|
||||
value: selectedCategory,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Icon(
|
||||
Icons.category,
|
||||
color: AppTheme.of(context).primaryColor,
|
||||
),
|
||||
border: InputBorder.none,
|
||||
contentPadding: const EdgeInsets.all(16),
|
||||
),
|
||||
hint: Text(
|
||||
'Selecciona una categoría',
|
||||
style: AppTheme.of(context).bodyText1.override(
|
||||
fontFamily: 'Poppins',
|
||||
color: AppTheme.of(context).tertiaryText,
|
||||
),
|
||||
),
|
||||
dropdownColor: AppTheme.of(context).secondaryBackground,
|
||||
items: widget.provider.categories.map((category) {
|
||||
return DropdownMenuItem(
|
||||
value: category,
|
||||
child: Text(
|
||||
category.categoryName,
|
||||
style: AppTheme.of(context).bodyText1.override(
|
||||
fontFamily: 'Poppins',
|
||||
color: AppTheme.of(context).primaryText,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
setState(() => selectedCategory = value);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildVideoSelector() {
|
||||
return GestureDetector(
|
||||
onTap: _selectVideo,
|
||||
|
||||
Reference in New Issue
Block a user