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
c322e542
authored
Mar 20, 2025
by
Rafa Castillo Passols
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Creada una versión super básica del conversor
parent
9d1ad18c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
5 deletions
lib/modelo/conversor.dart
lib/modelo/modelo.dart
lib/widgets/convertex_fab_bar.dart
lib/modelo/conversor.dart
0 → 100644
View file @
c322e542
import
'package:ffmpeg_kit_flutter/ffmpeg_kit.dart'
;
import
'package:ffmpeg_kit_flutter/ffmpeg_session.dart'
;
import
'package:ffmpeg_kit_flutter/return_code.dart'
;
import
'package:prueba_multimedia/modelo/modelo.dart'
;
// TODO: TERMINAR
abstract
class
Conversor
{
/// Se llama una vez el usuario pulsa convertir
static
Future
<
ReturnCode
?>
convertir
(
Archivo
archivo
)
async
{
archivo
.
formatoDestino
=
Formato
.
jpg
;
String
path
=
archivo
.
file
.
path
;
String
nuevoPath
=
"/storage/emulated/0/Documents/
${archivo.nombre}
.
${archivo.formatoDestino!.name}
"
;
String
comando
=
"-i
$path
$nuevoPath
"
;
FFmpegSession
session
=
await
FFmpegKit
.
execute
(
comando
);
ReturnCode
?
returnCode
=
await
session
.
getReturnCode
();
return
returnCode
;
}
}
\ No newline at end of file
lib/modelo/modelo.dart
View file @
c322e542
...
...
@@ -5,4 +5,5 @@ export 'elemento_seleccionable.dart';
export
'enlace.dart'
;
export
'formato.dart'
;
export
'lista_seleccionables.dart'
;
export
'perfil.dart'
;
\ No newline at end of file
export
'perfil.dart'
;
export
'conversor.dart'
;
\ No newline at end of file
lib/widgets/convertex_fab_bar.dart
View file @
c322e542
import
'dart:io'
;
import
'package:ffmpeg_kit_flutter/return_code.dart'
;
import
'package:flutter/material.dart'
;
import
'package:file_picker/file_picker.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -55,11 +56,20 @@ class _ConVertexFabBarState extends State<ConVertexFabBar> {
);
}
List
<
Widget
>
_loadConvertirActionButtons
(
BuildContext
context
)
{
List
<
Widget
>
_loadConvertirActionButtons
(
BuildContext
context
,
ListaSeleccionables
manager
)
{
final
buttons
=
<
Widget
>[
ActionButton
(
tipoBoton:
ActionButtonTypes
.
copiar
,
onPressed:
()
{},
onPressed:
()
{
List
<
Archivo
>
archivos
=
manager
.
seleccionables
.
whereType
<
Archivo
>().
toList
();
var
results
=
<
Future
<
ReturnCode
?>>[];
for
(
var
archivo
in
archivos
)
{
results
.
add
(
Conversor
.
convertir
(
archivo
));
}
}
),
ActionButton
(
tipoBoton:
ActionButtonTypes
.
reemplazar
,
...
...
@@ -86,7 +96,7 @@ class _ConVertexFabBarState extends State<ConVertexFabBar> {
icon:
Icon
(
Icons
.
label_important_outline
),
label:
'Convertir'
,
key:
_convertirKey
,
children:
_loadConvertirActionButtons
(
context
)
children:
_loadConvertirActionButtons
(
context
,
manager
)
),
SizedBox
(
width:
130
,
...
...
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