Clase de móviles del 28

parent e0ac6390
......@@ -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
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() {
......
......@@ -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();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment