feat notes
This commit is contained in:
@@ -50,7 +50,7 @@ class CustomerRepository {
|
||||
''')
|
||||
.eq('company_id', companyId)
|
||||
.eq('is_active', true)
|
||||
.order('name');
|
||||
.order('name', ascending: true);
|
||||
|
||||
return (response as List).map((c) => CustomerModel.fromMap(c)).toList();
|
||||
} catch (e) {
|
||||
|
||||
@@ -109,6 +109,11 @@ class _NoteFormScreenState extends State<NoteFormScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
void _deleteNote() {
|
||||
_notesBloc.add(NoteDeletedRequested(widget.note.id!));
|
||||
Navigator.pop(context);
|
||||
}
|
||||
|
||||
void _exportNote() {
|
||||
// La logica di export che abbiamo concordato ieri!
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
@@ -298,6 +303,14 @@ class _NoteFormScreenState extends State<NoteFormScreen> {
|
||||
const SizedBox(width: 16),
|
||||
|
||||
// Azioni spostate dentro la nota!
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.delete_outline,
|
||||
color: Colors.black87,
|
||||
),
|
||||
tooltip: 'Elimina',
|
||||
onPressed: _deleteNote,
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
_isPinned ? Icons.push_pin : Icons.push_pin_outlined,
|
||||
|
||||
@@ -56,7 +56,7 @@ class NotesListScreen extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
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(
|
||||
title: const Text(
|
||||
'Bacheca Note',
|
||||
@@ -157,7 +157,11 @@ class NotesListScreen extends StatelessWidget {
|
||||
);
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => context.push('/notes/edit', extra: note),
|
||||
onTap: () => context.pushNamed(
|
||||
Routes.noteForm,
|
||||
pathParameters: {'id': note.id!},
|
||||
extra: note,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: noteColor,
|
||||
|
||||
Reference in New Issue
Block a user