refactor: Update Note and Category models to use 'id' instead of 'uuid', and adjust related database operations
- Changed 'uuid' to 'id' in Note and Category models for consistency. - Updated database operations in NoteRepository to reflect the new 'id' field. - Modified sync models to accommodate changes in Note and Category structures. - Adjusted the handling of notes and categories during synchronization. - Refactored the note editor and home screen to use the new 'id' field. - Ensured that the 'isDirty' flag is properly set and utilized across models.
This commit is contained in:
@@ -154,9 +154,9 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
// Don't let DB errors cause the app to reset the vault automatically.
|
||||
debugPrint('Failed to move note: $e\n$st');
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Error al reordenar la nota: $e')),
|
||||
);
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('Error al reordenar la nota: $e')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,9 +385,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: NoteCard(
|
||||
key: ValueKey<int>(
|
||||
filteredNotes[index].id ??
|
||||
filteredNotes[index].index,
|
||||
key: ValueKey<String>(
|
||||
filteredNotes[index].id,
|
||||
),
|
||||
note: filteredNotes[index],
|
||||
onTap: () =>
|
||||
@@ -510,9 +509,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: NoteCard(
|
||||
key: ValueKey<int>(
|
||||
filteredNotes[index].id ??
|
||||
filteredNotes[index].index,
|
||||
key: ValueKey<String>(
|
||||
filteredNotes[index].id,
|
||||
),
|
||||
note: filteredNotes[index],
|
||||
onTap: () =>
|
||||
|
||||
Reference in New Issue
Block a user