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
d4e46c2c
authored
Mar 28, 2025
by
Rafa Castillo Passols
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Clase de móviles del 28
parent
e0ac6390
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
18 deletions
lib/modelo/conversor.dart
lib/widgets/action_button.dart
lib/widgets/convertex_fab_bar.dart
lib/modelo/conversor.dart
View file @
d4e46c2c
...
...
@@ -18,4 +18,15 @@ abstract class Conversor {
ReturnCode
?
returnCode
=
await
session
.
getReturnCode
();
return
returnCode
;
}
static
void
getMetadata
(
Archivo
archivo
)
async
{
// ffmpeg -i INPUT -f ffmetadata metadata.ffmeta
String
comando
=
"-i
${archivo.file.path}
-f ffmetadata metadata.ffmeta"
;
// https://www.ffmpeg.org/ffmpeg-formats.html#ffmetadata
FFmpegSession
session
=
await
FFmpegKit
.
execute
(
comando
);
// session.getOutput()
}
}
\ No newline at end of file
lib/widgets/action_button.dart
View file @
d4e46c2c
import
'dart:io'
;
import
'package:ffmpeg_kit_flutter/return_code.dart'
;
import
'package:file_picker/file_picker.dart'
;
import
'package:flutter/material.dart'
;
import
'package:prueba_multimedia/modelo/modelo.dart'
;
...
...
@@ -7,7 +6,9 @@ import 'package:prueba_multimedia/modelo/modelo.dart';
class
ActionButton
extends
StatelessWidget
{
final
ActionButtonTypes
tipoBoton
;
final
ListaSeleccionables
manager
;
const
ActionButton
({
super
.
key
,
required
this
.
tipoBoton
,
required
this
.
manager
});
final
BuildContext
context
;
const
ActionButton
({
super
.
key
,
required
this
.
tipoBoton
,
required
this
.
manager
,
required
this
.
context
});
void
Function
()
getCallback
()
{
return
switch
(
tipoBoton
)
{
...
...
@@ -25,9 +26,11 @@ class ActionButton extends StatelessWidget {
return
Directionality
(
textDirection:
TextDirection
.
rtl
,
child:
FilledButton
.
icon
(
onPressed:
getCallback
(),
label:
Text
(
tipoBoton
.
label
,
textScaler:
const
TextScaler
.
linear
(
1.2
)),
icon:
tipoBoton
.
icon
,
onPressed:
getCallback
(),
label:
Text
(
tipoBoton
.
label
,
textScaler:
const
TextScaler
.
linear
(
1.2
)),
icon:
tipoBoton
.
icon
,
),
);
}
...
...
@@ -40,21 +43,30 @@ class ActionButton extends StatelessWidget {
manager
.
addArchivo
(
file
);
}
// Mensaje indicando que se seleccione un archivo
else
{
//
// Comprobar que el widget no ha sido destruido por ser asíncrono
if
(
context
.
mounted
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
SnackBar
(
content:
Text
(
"Selecciona una archivo"
))
);
}
}
}
void
carpetaAction
()
async
{
String
?
path
=
await
FilePicker
.
platform
.
getDirectoryPath
();
if
(
path
!=
null
)
{
var
directory
=
Directory
(
path
);
manager
.
addCarpeta
(
directory
);
}
// Mensaje indicando que se seleccione una carpeta
else
{
ScaffoldMessenger
.
of
().
showSnackBar
(
)
}
FilePicker
.
platform
.
getDirectoryPath
().
then
(
(
path
)
{
if
(
path
!=
null
)
{
var
directory
=
Directory
(
path
);
manager
.
addCarpeta
(
directory
);
}
// Mensaje indicando que se seleccione una carpeta
else
{
// Comprobar que el widget no ha sido destruido por ser asíncrono
if
(
context
.
mounted
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
SnackBar
(
content:
Text
(
"Selecciona una carpeta"
))
);
}
}
});
}
void
enlaceAction
()
{
...
...
lib/widgets/convertex_fab_bar.dart
View file @
d4e46c2c
...
...
@@ -72,7 +72,7 @@ class _ConVertexFabBarState extends State<ConVertexFabBar> {
ListaSeleccionables
manager
)
{
return
convertirButtonTypes
.
map
((
type
)
{
return
ActionButton
(
tipoBoton:
type
,
manager:
manager
);
return
ActionButton
(
tipoBoton:
type
,
manager:
manager
,
context:
context
,
);
}).
toList
();
}
...
...
@@ -143,7 +143,7 @@ class _ConVertexFabBarState extends State<ConVertexFabBar> {
ListaSeleccionables
manager
)
{
return
agregarButtonTypes
.
map
(
(
type
)
{
return
ActionButton
(
tipoBoton:
type
,
manager:
manager
);
return
ActionButton
(
tipoBoton:
type
,
manager:
manager
,
context:
context
,
);
}).
toList
();
}
}
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