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
95f78b62
authored
Mar 13, 2025
by
Rafa Castillo Passols
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Todo listo para añadir la funcionalidad de escoger archivo
parent
8f8b1790
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
22 deletions
lib/widget/action_button.dart
lib/widget/convertex_fab_bar.dart
lib/widget/action_button.dart
View file @
95f78b62
import
'package:flutter/material.dart'
;
class
ActionButton
extends
StatelessWidget
{
final
a
ctionButtonTypes
tipoBoton
;
final
A
ctionButtonTypes
tipoBoton
;
final
VoidCallback
?
onPressed
;
const
ActionButton
({
super
.
key
,
required
this
.
onPressed
,
required
this
.
label
,
required
this
.
icon
});
ActionButton
({
super
.
key
,
required
this
.
tipoBoton
,
required
this
.
onPressed
});
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -14,24 +13,24 @@ class ActionButton extends StatelessWidget {
textDirection:
TextDirection
.
rtl
,
child:
FilledButton
.
icon
(
onPressed:
onPressed
,
label:
Text
(
label
,
textScaler:
const
TextScaler
.
linear
(
1.2
)),
icon:
icon
,
label:
Text
(
tipoBoton
.
label
,
textScaler:
const
TextScaler
.
linear
(
1.2
)),
icon:
tipoBoton
.
icon
,
),
);
}
}
enum
a
ctionButtonTypes
{
ARCHIVO
(
'Archivo'
,
Icon
(
Icons
.
description_outlined
)),
CARPETA
(
'Carpeta'
,
Icon
(
Icons
.
folder_outlined
)),
ENLACE
(
'Enlace'
,
Icon
(
Icons
.
link_outlined
)),
COPIAR
(
'Copiar'
,
Icon
(
Icons
.
copy
)),
COMPRIMIR
(
'Comprimir'
,
Icon
(
Icons
.
splitscreen_outlined
)),
REEMPLAZAR
(
'Reemplazar'
,
Icon
(
Icons
.
change_circle_outlined
));
enum
A
ctionButtonTypes
{
archivo
(
'Archivo'
,
Icon
(
Icons
.
description_outlined
)),
carpeta
(
'Carpeta'
,
Icon
(
Icons
.
folder_outlined
)),
enlace
(
'Enlace'
,
Icon
(
Icons
.
link_outlined
)),
copiar
(
'Copiar'
,
Icon
(
Icons
.
copy
)),
comprimir
(
'Comprimir'
,
Icon
(
Icons
.
splitscreen_outlined
)),
reemplazar
(
'Reemplazar'
,
Icon
(
Icons
.
change_circle_outlined
));
final
String
label
;
final
Icon
icon
;
const
a
ctionButtonTypes
(
this
.
label
,
this
.
icon
);
const
A
ctionButtonTypes
(
this
.
label
,
this
.
icon
);
}
\ No newline at end of file
lib/widget/convertex_fab_bar.dart
View file @
95f78b62
import
'package:file_picker/file_picker.dart'
;
import
'package:flutter/material.dart'
;
import
'./action_button.dart'
;
...
...
@@ -51,6 +52,24 @@ class _ConVertexFabBarState extends State<ConVertexFabBar> {
);
}
List
<
Widget
>
_loadConvertirActionButtons
(
BuildContext
context
)
{
final
buttons
=
<
Widget
>[
ActionButton
(
tipoBoton:
ActionButtonTypes
.
copiar
,
onPressed:
()
{},
),
ActionButton
(
tipoBoton:
ActionButtonTypes
.
reemplazar
,
onPressed:
()
{}
),
ActionButton
(
tipoBoton:
ActionButtonTypes
.
comprimir
,
onPressed:
()
{}
)
];
return
buttons
;
}
List
<
Widget
>
_buildFABs
()
{
final
toRet
=
<
Widget
>[];
...
...
@@ -83,13 +102,6 @@ class _ConVertexFabBarState extends State<ConVertexFabBar> {
],
));
List
<
Widget
>
_loadConvertirActionButtons
(
BuildContext
context
){
final
buttons
=
<
Widget
>[];
return
buttons
;
}
// FAB con las opciones para agregar archivos, carpetas, enlaces...
toRet
.
add
(
Stack
(
...
...
@@ -122,8 +134,27 @@ class _ConVertexFabBarState extends State<ConVertexFabBar> {
}
List
<
Widget
>
_loadAgregarActionButtons
(
BuildContext
context
){
final
buttons
=
<
Widget
>[];
final
buttons
=
<
Widget
>[
ActionButton
(
tipoBoton:
ActionButtonTypes
.
enlace
,
onPressed:
()
{}
),
ActionButton
(
tipoBoton:
ActionButtonTypes
.
carpeta
,
onPressed:
()
{}
),
ActionButton
(
tipoBoton:
ActionButtonTypes
.
archivo
,
onPressed:
()
async
{
FilePickerResult
?
result
=
await
FilePicker
.
platform
.
pickFiles
();
if
(
result
!=
null
)
{
String
filePath
=
result
.
files
.
single
.
path
!;
}
else
{
//
}
},
),
];
return
buttons
;
}
}
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