fix: show thumbnail instantly when jumping to top of the page (#22163)

* fix: show thumbnail instantly when jumping to top of the page

* pr feedback
This commit is contained in:
Alex 2025-09-18 00:26:39 -05:00 committed by GitHub
parent 532ec10d5f
commit 28e9892ed3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -129,7 +129,11 @@ class _SliverTimelineState extends ConsumerState<_SliverTimeline> {
void _onEvent(Event event) {
switch (event) {
case ScrollToTopEvent():
_scrollController.animateTo(0, duration: const Duration(milliseconds: 250), curve: Curves.easeInOut);
ref.read(timelineStateProvider.notifier).setScrubbing(true);
_scrollController
.animateTo(0, duration: const Duration(milliseconds: 250), curve: Curves.easeInOut)
.whenComplete(() => ref.read(timelineStateProvider.notifier).setScrubbing(false));
case ScrollToDateEvent scrollToDateEvent:
_scrollToDate(scrollToDateEvent.date);
case TimelineReloadEvent():