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

Scroll optimize #162

Closed
wants to merge 15 commits into from
Closed

Scroll optimize #162

wants to merge 15 commits into from

Conversation

singularity-s0
Copy link
Collaborator

@singularity-s0 singularity-s0 commented Jun 24, 2022

Still need to:

  • fix scroll controller

@w568w w568w self-requested a review June 24, 2022 11:09
lib/page/home_page.dart Outdated Show resolved Hide resolved
@w568w
Copy link
Member

w568w commented Jun 26, 2022

Until we figure out a fix to all broken features (i.e. ScrollBar cannot scroll, double tap on title cannot jump to the top), this PR should not be merged.

w568w and others added 3 commits June 30, 2022 15:18
…formance since keframe is removed to prevent locating issues

Note:
1. ScrollBar still meets with error after entering hole_detail with locating to certain posts. Also, its performance on iOS is not tested;

2. TopController should be replaced with TopPositionedController in pages with PagedListView now.
@w568w w568w linked an issue Jun 30, 2022 that may be closed by this pull request
@w568w
Copy link
Member

w568w commented Jun 30, 2022

Also PTAL at issue #95. If we use a paging method like TieBa, there should be pretty less problems and bugs.

(In fact, this PR works at cross purposes against that.)

@w568w
Copy link
Member

w568w commented Jul 2, 2022

There are some problems preventing this merge:

  • On iOS, after using scroll-to-bottom in hole_detail, double tapping on the notification bar (which triggers a scroll in PrimaryScrollController) weirdly makes the list scroll to the bottom again, rather than to the top.
  • If entering hole_detail with a floor located (e.g. from search results or other's references), the ScrollBar on the page looks good but cannot be dragged, throwing an exception indicating that there is no ScrollPosition attached to the PrimaryScrollController controlled by the scroll bar.
  • scrollable_positioned_list's bug: if item's size changes during scrolling by index, list will scroll to an incorrect position. See [scrollable_positioned_list] If an image loads during scroll, list scrolls to incorrect position google/flutter.widgets#330. It seems that the repository is out of maintenance, so we won't expect an official fix for the issue in the short term. (It is NOT a big problem if we drop usage of keframe, because our item widgets' height will not change without it.)

However, removing keframe will bring pros and cons. It does have some issues, like slowing down the normal loading speed even under low render pressure, i.e. user is scrolling the list slowly, but still seeing the following items' transformation from blank to a normal widget. But it really optimizes the frame lag caused by rapid scrolling, giving users a better experience when scrolling.

What do you think towards these problems? @singularity-s0

p.s. I think that Flutter is really doing a bad job with scrolling things. We have struggled with ListView, ScrollBar, PrimaryScrollController for many many times.

@singularity-s0
Copy link
Collaborator Author

Is it possible to use Scrollable.ensureVisible() for locating items instead?

@w568w
Copy link
Member

w568w commented Jul 2, 2022

Is it possible to use Scrollable.ensureVisible() for locating items instead?

Looks hopeful. You can start a new branch and do some tests on it.

@singularity-s0
Copy link
Collaborator Author

Is it possible to use Scrollable.ensureVisible() for locating items instead?

Looks hopeful. You can start a new branch and do some tests on it.

Tests complete. You may revert to the previous implementation and merge these branches.

@w568w
Copy link
Member

w568w commented Jul 2, 2022

The PR and the branch is verified as unworkable. Close it.

@w568w w568w closed this Jul 2, 2022
@w568w w568w deleted the scroll-optimize branch July 6, 2022 05:31
@w568w w568w restored the scroll-optimize branch July 6, 2022 05:31
@w568w w568w deleted the scroll-optimize branch July 30, 2023 11:28
@w568w
Copy link
Member

w568w commented Feb 25, 2024

Shall we have a try on https://github.com/superlistapp/super_sliver_list? It looks promising.

Edit: also see https://github.com/fzyzcjy/flutter_smooth.

@ivanfei-1 ivanfei-1 restored the scroll-optimize branch March 8, 2024 17:44
@ivanfei-1 ivanfei-1 deleted the scroll-optimize branch March 8, 2024 17:44
@ivanfei-1 ivanfei-1 mentioned this pull request Mar 8, 2024
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.

[BUG] 旦夕在浏览某些帖子时崩溃
2 participants