Customizable Sort order for notes in home page
SankethBK opened this issue · 8 comments
Relevant widgets
Notes fetch cubit: lib/features/notes/presentation/bloc/notes_fetch
Home Page: lib/core/pages/home_page.dart
Home Page Appbar: lib/core/widgets/home_page_app_bar.dart
Define a sort_by
button in home page appbar. It should open a popup (use showCustomDialog
DropDown
) which shows three options
- Sort by latest first (sort by
created_at
, this is the default behaviour as of now) - Sort by last_modified (sort_by
last_modified
of notes) - Sort alphabetically
Define a new function sortNotes
in NotesFetchCubit
which sorts the notes which are already present in notePreviewList
and emits NotesFetchSuccessful
state with the newly sorted array
I will take care of this
Sure @AliYar-Khan , assigning this to you
On it
@AliYar-Khan just adding more info, Home page app bar can be in 3 states
- Normal state in which search and settings icons are shown
- Search state: A textbox will be shown in middle, and cancel button towards right
- Delete state: when we are deleting notes, there would be cancel button shown towards left and delete icon and delete count towards right.
In this case sort icon should be displayed only in normal state (adding rough prototype)
sort_by.webm
We can introduce new field preferredSortOrder
in UserConfigModel
to store the preferred sort order. Feel free to join our discord server if you need help with anything
Sure
@AliYar-Khan please confirm if you're working on this
Sorry I have not yet started ... busy in another project. Will start working in couple of days.
No problem, thanks for confirming