SankethBK / diaryvault

A personal diary application written in Flutter

Home Page:https://play.google.com/store/apps/details?id=me.sankethbk.dairyapp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Customizable Sort order for notes in home page

SankethBK opened this issue · 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

@AliYar-Khan just adding more info, Home page app bar can be in 3 states

  1. Normal state in which search and settings icons are shown
  2. Search state: A textbox will be shown in middle, and cancel button towards right
  3. 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

@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