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

22: add timeline feature #85

Merged
merged 3 commits into from
Nov 22, 2023
Merged

22: add timeline feature #85

merged 3 commits into from
Nov 22, 2023

Conversation

shockbytes
Copy link
Owner

@shockbytes shockbytes commented Nov 14, 2023

Changelog

Added the timeline page. (and added a LottieView, which will make it easier for us to add lottie animations throughout the codebase)

The timeline page will adapt to smaller devices and will show smaller book images on phones.

I came up with a simplified UI version of the timeline, as I think it's more appropriate and a bigger book image is preferrable to the title of the book. Most people will recognize book images before looking at the book title. Furthermore, you can still click on the books, if you are really unsure about the book.

Screenshots

Desktop View

Bildschirmfoto 2023-11-14 um 08 02 15

Empty View Mobile

Screenshot_1699975502

@shockbytes shockbytes self-assigned this Nov 14, 2023
@shockbytes shockbytes force-pushed the 22-add-timeline-feature branch from ad650a6 to d2d7321 Compare November 14, 2023 07:19
@shockbytes shockbytes changed the title 22 add timeline feature 22: add timeline feature Nov 14, 2023
Copy link
Collaborator

@lockieRichter lockieRichter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good, couple of minor comments.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not part of your change, but can you add translations for the add_label_bottom_sheet entries at line 9?

),
body: LayoutBuilder(
builder: (context, constraints) {
return StreamBuilder<List<TimelineMonthGrouping>>(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can avoid using things like StreamBuilders and FutureBuilders using riverpod. What you want to do is create a provider like so

@riverpod
Stream<List<TimelineMonthGrouping>> getTimelineData(GetTimelineDataRef ref) =>
    ref.watch(timelineProvider).getTimelineData();

then in the wifget builder you can do a ref.watch(getTimelineDataProvider) and usewhen to get the loading, data and error states. This leads to cleaner code IMO and is what I've been doing for most of our components.
Check out the add_label_bottom_sheet file and the getBookLabels provider for an exmaple of this.

You don't have to make this change, but it will stay consistent with the rest of our code.

@shockbytes shockbytes merged commit bc42c48 into develop Nov 22, 2023
2 checks passed
@shockbytes shockbytes deleted the 22-add-timeline-feature branch November 22, 2023 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants