refactor: Remove category handling from note editor and simplify note card options
This commit is contained in:
+38
-25
@@ -49,7 +49,7 @@ class NoteCard extends StatelessWidget {
|
||||
highlightColor:
|
||||
Colors.transparent, // Desactiva el brillo al mantener pulsado
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -75,38 +75,51 @@ class NoteCard extends StatelessWidget {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: palette.textSecondary,
|
||||
fontSize: 13,
|
||||
fontSize: 14,
|
||||
height: 1.2,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
PopupMenuButton<String>(
|
||||
tooltip: 'Más opciones',
|
||||
icon: Icon(Icons.more_vert, color: palette.textSecondary),
|
||||
onOpened: () {},
|
||||
onSelected: (String value) {
|
||||
switch (value) {
|
||||
case 'delete':
|
||||
onDelete?.call();
|
||||
return;
|
||||
case 'category':
|
||||
onChangeCategory?.call(context);
|
||||
return;
|
||||
}
|
||||
Builder(
|
||||
builder: (BuildContext buttonContext) {
|
||||
return PopupMenuButton<String>(
|
||||
icon: Icon(Icons.more_vert, color: palette.textSecondary),
|
||||
onSelected: (String value) {
|
||||
switch (value) {
|
||||
case 'category':
|
||||
onChangeCategory?.call(buttonContext);
|
||||
return;
|
||||
case 'delete':
|
||||
onDelete?.call();
|
||||
return;
|
||||
}
|
||||
},
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry<String>>[
|
||||
const PopupMenuItem<String>(
|
||||
value: 'category',
|
||||
child: Text('Modificar categoría'),
|
||||
),
|
||||
PopupMenuItem<String>(
|
||||
value: 'delete',
|
||||
child: Row(
|
||||
children: const [
|
||||
Icon(Icons.delete_outline, color: Colors.red),
|
||||
SizedBox(width: 10),
|
||||
Text(
|
||||
'Eliminar',
|
||||
style: TextStyle(color: Colors.red),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
|
||||
const PopupMenuItem<String>(
|
||||
value: 'delete',
|
||||
child: Text('Eliminar nota'),
|
||||
),
|
||||
const PopupMenuItem<String>(
|
||||
value: 'category',
|
||||
child: Text('Cambiar categoría'),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user