You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement swipe navigation in the notes read-only page, similar to how apps like Gmail allow users to swipe left or right to navigate to the next or previous email. In DiaryVault, this feature should enable users to swipe between notes in read-only mode. Diaryault supports read mode and write mode for a note, we do not want this feature in the write mode to prevent potential data loss if unsaved changes are present when navigating away from a note.
The NotesReadOnlyPage widget currently takes a note.id as a parameter and loads the corresponding note from the database.
The NotesFetchState holds the list of notes fetched from the database to display on the home page.
Proposed Solution:
Utilize PageView:
Use Flutter's PageView widget to enable swipe navigation between notes.
Pass Additional Parameters:
Pass Listview'sindex as parameter to NotePreviewCard widget from home screen. Index Represents the position of current note from the list.
Modify the NotesReadOnlyPage to accept an additional route parameter index, representing the position of the current note in the list. Actual logic for swipe natigation will be in NotesReadOnlyPage.
Access Next and Previous Notes:
Use the NotesFetchState to access the list of note IDs.
During a swipe event, determine the next or previous note by incrementing or decrementing the index.
Tasks:
Modify NotePreviewCard to accept an index parameter from home screen's Listview.
Modify NotesReadOnlyPage to accept indexas route parameter and pass index from NotePreviewCard which will serve as initial index for swipe navigation.
Implement a PageView in NotesReadOnlyPage that allows swiping between notes in read-only mode.
Ensure that the notes load correctly when swiped left or right.
The text was updated successfully, but these errors were encountered:
Implement swipe navigation in the notes read-only page, similar to how apps like Gmail allow users to swipe left or right to navigate to the next or previous email. In DiaryVault, this feature should enable users to swipe between notes in read-only mode. Diaryault supports read mode and write mode for a note, we do not want this feature in the write mode to prevent potential data loss if unsaved changes are present when navigating away from a note.
Widget Involved:
lib/features/notes/presentation/pages/note_read_only_page.dart
lib/features/notes/presentation/widgets/note_preview_card.dart
lib/core/pages/home_page.dart
Current Setup:
NotesReadOnlyPage
widget currently takes anote.id
as a parameter and loads the corresponding note from the database.NotesFetchState
holds the list of notes fetched from the database to display on the home page.Proposed Solution:
Utilize
PageView
:PageView
widget to enable swipe navigation between notes.Pass Additional Parameters:
index
as parameter toNotePreviewCard
widget from home screen. Index Represents the position of current note from the list.NotesReadOnlyPage
to accept an additional route parameterindex
, representing the position of the current note in the list. Actual logic for swipe natigation will be inNotesReadOnlyPage
.Access Next and Previous Notes:
NotesFetchState
to access the list of note IDs.index
.Tasks:
NotePreviewCard
to accept anindex
parameter from home screen's Listview.NotesReadOnlyPage
to acceptindex
as route parameter and passindex
fromNotePreviewCard
which will serve as initial index for swipe navigation.PageView
inNotesReadOnlyPage
that allows swiping between notes in read-only mode.The text was updated successfully, but these errors were encountered: