feat notes

This commit is contained in:
2026-05-22 10:12:56 +02:00
parent 23d3356e6b
commit 7b072a219d
3 changed files with 20 additions and 3 deletions

View File

@@ -50,7 +50,7 @@ class CustomerRepository {
''') ''')
.eq('company_id', companyId) .eq('company_id', companyId)
.eq('is_active', true) .eq('is_active', true)
.order('name'); .order('name', ascending: true);
return (response as List).map((c) => CustomerModel.fromMap(c)).toList(); return (response as List).map((c) => CustomerModel.fromMap(c)).toList();
} catch (e) { } catch (e) {

View File

@@ -109,6 +109,11 @@ class _NoteFormScreenState extends State<NoteFormScreen> {
} }
} }
void _deleteNote() {
_notesBloc.add(NoteDeletedRequested(widget.note.id!));
Navigator.pop(context);
}
void _exportNote() { void _exportNote() {
// La logica di export che abbiamo concordato ieri! // La logica di export che abbiamo concordato ieri!
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
@@ -298,6 +303,14 @@ class _NoteFormScreenState extends State<NoteFormScreen> {
const SizedBox(width: 16), const SizedBox(width: 16),
// Azioni spostate dentro la nota! // Azioni spostate dentro la nota!
IconButton(
icon: const Icon(
Icons.delete_outline,
color: Colors.black87,
),
tooltip: 'Elimina',
onPressed: _deleteNote,
),
IconButton( IconButton(
icon: Icon( icon: Icon(
_isPinned ? Icons.push_pin : Icons.push_pin_outlined, _isPinned ? Icons.push_pin : Icons.push_pin_outlined,

View File

@@ -56,7 +56,7 @@ class NotesListScreen extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor:
Colors.grey.shade50, // Sfondo neutro per far risaltare i post-it Colors.grey.shade900, // Sfondo neutro per far risaltare i post-it
appBar: AppBar( appBar: AppBar(
title: const Text( title: const Text(
'Bacheca Note', 'Bacheca Note',
@@ -157,7 +157,11 @@ class NotesListScreen extends StatelessWidget {
); );
return GestureDetector( return GestureDetector(
onTap: () => context.push('/notes/edit', extra: note), onTap: () => context.pushNamed(
Routes.noteForm,
pathParameters: {'id': note.id!},
extra: note,
),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: noteColor, color: noteColor,