Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 tasks
Tracked by #224
SankethBK opened this issue Oct 2, 2024 · 3 comments
Open
4 tasks
Tracked by #224

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

SankethBK opened this issue Oct 2, 2024 · 3 comments
Assignees
Labels
new feature For new features ready for development There is a clear solution which can be implemented

Comments

@SankethBK
Copy link
Owner

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:

    • 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:

  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:

  • 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.
@SankethBK SankethBK added new feature For new features ready for development There is a clear solution which can be implemented labels Oct 2, 2024
@zdoryyk
Copy link
Contributor

zdoryyk commented Oct 3, 2024

Hi again @SankethBK I would like to try

@zdoryyk
Copy link
Contributor

zdoryyk commented Oct 4, 2024

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

@SankethBK
Copy link
Owner Author

Hi @zdoryyk , please raise the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature For new features ready for development There is a clear solution which can be implemented
Projects
None yet
Development

No branches or pull requests

2 participants