Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Rafa Castillo Passols
/
Prototipo-Multimedia
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
273ffcf1
authored
Mar 14, 2025
by
Diego Pérez Peña
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Página de metadatos terminada y arreglos menores
parent
b21bc6fd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
157 additions
and
42 deletions
lib/paginas/pagina_configuracion.dart
lib/paginas/pagina_conversion.dart
lib/paginas/pagina_fotograma.dart
lib/paginas/pagina_metadatos.dart
lib/paginas/pagina_configuracion.dart
View file @
273ffcf1
...
@@ -4,6 +4,7 @@ import 'package:prueba_multimedia/modelo/elemento_seleccionable.dart';
...
@@ -4,6 +4,7 @@ import 'package:prueba_multimedia/modelo/elemento_seleccionable.dart';
import
'package:prueba_multimedia/modelo/carpeta.dart'
;
import
'package:prueba_multimedia/modelo/carpeta.dart'
;
import
'package:prueba_multimedia/modelo/enlace.dart'
;
import
'package:prueba_multimedia/modelo/enlace.dart'
;
import
'package:prueba_multimedia/paginas/pagina_conversion.dart'
;
import
'package:prueba_multimedia/paginas/pagina_conversion.dart'
;
import
'package:prueba_multimedia/paginas/pagina_fotograma.dart'
;
import
'package:prueba_multimedia/paginas/pagina_metadatos.dart'
;
import
'package:prueba_multimedia/paginas/pagina_metadatos.dart'
;
class
PaginaConfiguracion
extends
StatefulWidget
{
class
PaginaConfiguracion
extends
StatefulWidget
{
...
@@ -77,7 +78,13 @@ class _PaginaConfiguracionState extends State<PaginaConfiguracion> {
...
@@ -77,7 +78,13 @@ class _PaginaConfiguracionState extends State<PaginaConfiguracion> {
if
(
_categoriaActiva
==
0
){
if
(
_categoriaActiva
==
0
){
return
PaginaConversion
(
formatoOriginal:
arch
.
formatoActual
);
return
PaginaConversion
(
formatoOriginal:
arch
.
formatoActual
);
}
}
else
if
(
_categoriaActiva
==
2
){
return
PaginaMetadatos
(
formato:
arch
.
formatoActual
.
claseFormato
);
}
else
{
else
{
if
(
arch
.
formatoActual
.
isVideo
){
return
PaginaFotograma
();
}
// Página de metadatos
// Página de metadatos
return
PaginaMetadatos
(
formato:
arch
.
formatoActual
.
claseFormato
);
return
PaginaMetadatos
(
formato:
arch
.
formatoActual
.
claseFormato
);
}
}
...
@@ -95,19 +102,43 @@ class _PaginaConfiguracionState extends State<PaginaConfiguracion> {
...
@@ -95,19 +102,43 @@ class _PaginaConfiguracionState extends State<PaginaConfiguracion> {
_categoriaActiva
=
indice
;
_categoriaActiva
=
indice
;
});
});
},
},
items:
<
BottomNavigationBarItem
>[
items:
_construirElementosBarraNavegacion
()
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
sync
),
label:
'Formato de conversión'
),
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
format_list_bulleted
),
label:
'Metadatos'
)
]
);
);
}
}
return
null
;
return
null
;
}
}
List
<
BottomNavigationBarItem
>
_construirElementosBarraNavegacion
(){
final
toRet
=
<
BottomNavigationBarItem
>[];
bool
isVideo
=
false
;
if
(
widget
.
_elementoAsociado
is
ArchivoIndividual
){
final
arch
=
widget
.
_elementoAsociado
as
ArchivoIndividual
;
if
(
arch
.
formatoActual
.
isVideo
){
isVideo
=
true
;
}
}
// Página de selección de conversión
toRet
.
add
(
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
sync
),
label:
isVideo
?
'Conversión'
:
'Formato de Conversión'
));
// Página de selección de fotograma
if
(
isVideo
){
toRet
.
add
(
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
local_movies
),
label:
'Fotograma'
));
}
// Página de edición de metadatos
toRet
.
add
(
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
format_list_bulleted
),
label:
'Metadatos'
));
return
toRet
;
}
}
}
lib/paginas/pagina_conversion.dart
View file @
273ffcf1
...
@@ -273,7 +273,9 @@ class _PaginaConversionState extends State<PaginaConversion>
...
@@ -273,7 +273,9 @@ class _PaginaConversionState extends State<PaginaConversion>
color:
(
_formatoConvertido
?.
claseFormato
==
elemento
)?
color:
(
_formatoConvertido
?.
claseFormato
==
elemento
)?
Theme
.
of
(
context
).
disabledColor
:
Theme
.
of
(
context
).
cardColor
,
Theme
.
of
(
context
).
disabledColor
:
Theme
.
of
(
context
).
cardColor
,
child:
InkWell
(
child:
InkWell
(
onTap:
(
_formatoConvertido
?.
claseFormato
==
elemento
)?
null
:
()
{
onTap:
(
_formatoConvertido
?.
claseFormato
==
elemento
)?
()
{
setState
(()
{
_formatoConvertido
=
null
;
});
}
:
()
{
setState
(()
{
setState
(()
{
if
(
_formatoConvertido
==
null
){
if
(
_formatoConvertido
==
null
){
_formatoConvertido
=
Formato
(
extension:
elemento
,
calidad:
Calidad
.
Media
);
_formatoConvertido
=
Formato
(
extension:
elemento
,
calidad:
Calidad
.
Media
);
...
...
lib/paginas/pagina_fotograma.dart
0 → 100644
View file @
273ffcf1
import
'package:flutter/material.dart'
;
class
PaginaFotograma
extends
StatefulWidget
{
const
PaginaFotograma
({
super
.
key
});
@override
State
<
PaginaFotograma
>
createState
()
=>
_PaginaFotogramaState
();
}
class
_PaginaFotogramaState
extends
State
<
PaginaFotograma
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
const
Placeholder
();
}
}
lib/paginas/pagina_metadatos.dart
View file @
273ffcf1
...
@@ -22,10 +22,24 @@ class _PaginaMetadatosState extends State<PaginaMetadatos> {
...
@@ -22,10 +22,24 @@ class _PaginaMetadatosState extends State<PaginaMetadatos> {
for
(
int
i
=
0
;
i
<
_metadatos
.
length
;
i
++){
for
(
int
i
=
0
;
i
<
_metadatos
.
length
;
i
++){
_valoresElegidos
.
add
(
''
);
_valoresElegidos
.
add
(
''
);
_controladores
.
add
(
TextEditingController
());
_controladores
.
add
(
TextEditingController
());
_controladores
[
i
].
addListener
(
()
{
if
(
_metadatos
[
i
].
numerico
){
_controladores
[
i
].
addListener
(()
{
setState
(()
{
String
texto
=
_controladores
[
i
].
value
.
text
;
if
(
texto
.
isEmpty
||
RegExp
(
r'^[0-9]+$'
).
hasMatch
(
texto
)){
_valoresElegidos
[
i
]
=
_controladores
[
i
].
text
;
}
else
{
_controladores
[
i
].
text
=
_valoresElegidos
[
i
];
}
});
});
}
else
{
_controladores
[
i
].
addListener
(()
{
setState
(()
{
_valoresElegidos
[
i
]
=
_controladores
[
i
].
text
;
});
setState
(()
{
_valoresElegidos
[
i
]
=
_controladores
[
i
].
text
;
});
}
}
);
);
}
}
}
}
}
...
@@ -40,45 +54,98 @@ class _PaginaMetadatosState extends State<PaginaMetadatos> {
...
@@ -40,45 +54,98 @@ class _PaginaMetadatosState extends State<PaginaMetadatos> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
SingleChildScrollView
(
if
(
_metadatos
.
length
>
0
){
child:
Padding
(
return
SingleChildScrollView
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
15.0
),
child:
Column
(
children:
_buildTextFields
()
),
),
);
}
else
{
final
sb
=
StringBuffer
();
sb
.
write
(
'El formato seleccionado (.'
);
sb
.
write
(
widget
.
_formato
.
extension
);
sb
.
write
(
') no admite metadatos.'
);
return
Padding
(
padding:
const
EdgeInsets
.
all
(
15.0
),
padding:
const
EdgeInsets
.
all
(
15.0
),
child:
Column
(
child:
SafeArea
(
children:
_buildTextFields
()
child:
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
sb
.
toString
(),
style:
Theme
.
of
(
context
).
textTheme
.
titleLarge
,
textAlign:
TextAlign
.
center
,
),
)
),
),
)
,
)
;
);
}
}
}
List
<
Widget
>
_buildTextFields
(){
List
<
Widget
>
_buildTextFields
(){
final
toRet
=
<
Widget
>[];
final
toRet
=
<
Widget
>[];
for
(
int
i
=
0
;
i
<
_metadatos
.
length
;
i
++){
for
(
int
i
=
0
;
i
<
_metadatos
.
length
&&
i
<
4
;
i
++){
toRet
.
add
(
Text
(
toRet
.
add
(
_buildTextFieldLabel
(
i
));
_metadatos
[
i
].
nombreMostrado
,
toRet
.
add
(
_buildTextField
(
i
));
style:
Theme
.
of
(
context
).
textTheme
.
titleMedium
));
toRet
.
add
(
InputDecorator
(
decoration:
const
InputDecoration
(
border:
OutlineInputBorder
()
),
child:
TextField
(
controller:
_controladores
[
i
],
decoration:
InputDecoration
(
hintText:
'
${_metadatos[i].nombreMostrado}
...'
),
keyboardType:
(
_metadatos
[
i
].
numerico
)?
const
TextInputType
.
numberWithOptions
(
signed:
true
,
decimal:
false
):
null
,
),
));
if
(
i
<
_metadatos
.
length
-
1
)
toRet
.
add
(
const
SizedBox
(
height:
16.0
));
if
(
i
<
_metadatos
.
length
-
1
)
toRet
.
add
(
const
SizedBox
(
height:
16.0
));
}
}
if
(
_metadatos
.
length
>
4
){
final
sublist
=
<
Widget
>[];
sublist
.
add
(
const
SizedBox
(
height:
16.0
));
for
(
int
i
=
4
;
i
<
_metadatos
.
length
;
i
++){
sublist
.
add
(
_buildTextFieldLabel
(
i
));
sublist
.
add
(
_buildTextField
(
i
));
if
(
i
<
_metadatos
.
length
-
1
)
sublist
.
add
(
const
SizedBox
(
height:
16.0
));
}
toRet
.
add
(
ExpansionTile
(
collapsedBackgroundColor:
Theme
.
of
(
context
).
colorScheme
.
inversePrimary
,
backgroundColor:
Theme
.
of
(
context
).
colorScheme
.
inversePrimary
,
title:
Center
(
child:
Text
(
'Mostrar más metadatos'
)),
children:
[
Container
(
color:
Theme
.
of
(
context
).
scaffoldBackgroundColor
,
child:
Column
(
children:
sublist
,
),
)]
));
}
return
toRet
;
return
toRet
;
}
}
Widget
_buildTextFieldLabel
(
int
index
){
return
Text
(
_metadatos
[
index
].
nombreMostrado
,
style:
Theme
.
of
(
context
).
textTheme
.
titleMedium
);
}
Widget
_buildTextField
(
int
index
){
return
InputDecorator
(
decoration:
const
InputDecoration
(
border:
OutlineInputBorder
(),
),
child:
TextField
(
controller:
_controladores
[
index
],
decoration:
InputDecoration
(
hintText:
'
${_metadatos[index].nombreMostrado}
...'
),
keyboardType:
(
_metadatos
[
index
].
numerico
)?
const
TextInputType
.
numberWithOptions
(
signed:
true
,
decimal:
false
):
null
,
),
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment