SankethBK / diaryvault

A personal diary application written in Flutter
https://play.google.com/store/apps/details?id=me.sankethbk.dairyapp
MIT License
95 stars 66 forks source link

Support for Swipe Navigation in Notes Read-Only Page #217

Open SankethBK opened 4 days ago

SankethBK commented 4 days ago

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.

Proposed Solution:

  1. Utilize PageView:

    • Use Flutter's PageView widget to enable swipe navigation between notes.
  2. 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.
  3. 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:

zdoryyk commented 3 days ago

Hi again @SankethBK I would like to try

zdoryyk commented 3 days ago

@SankethBK Hi again, i have done this task, can I add?

SankethBK commented 3 days ago

Hi @zdoryyk , please raise the PR