Skip to content

scrollOffset keep growing #5742

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

Closed
lequem opened this issue Sep 5, 2016 · 4 comments
Closed

scrollOffset keep growing #5742

lequem opened this issue Sep 5, 2016 · 4 comments
Labels
framework flutter/packages/flutter repository. See also f: labels.

Comments

@lequem
Copy link
Contributor

lequem commented Sep 5, 2016

Hello,

I am using the LazyBlock widget to display a list with different size children.
I have put a ScrollListener on it.

When I scroll to the bottom and then I keep scrolling down, the list do not move because I have reached the end of the list but the scrollOffet value keep growing.
When I want to scroll to the top, the list start moving when I have reached the limit of the bottom.

To workaround the problem, I have set a listener on the scrollEnd Event and set max value of the bottom when the scrollOffset is over this limit.

Do not hesitate if you need further informations,

Vincent

@eseidelGoogle eseidelGoogle added the framework flutter/packages/flutter repository. See also f: labels. label Sep 5, 2016
@eseidelGoogle
Copy link
Contributor

CC @HansMuller @Hixie

@HansMuller
Copy link
Contributor

Scrollable responds to a press-drag-release gesture by updating the scrollOffset, even if that causes overscrolling. By default, when the release event occurs the scrollOffset is animated back to the scrollable's beginning or end. This behavior is defined by an inherited widget called ScrollConfiguration.

Widgets like OverScrollIndicator (the Android overscroll "glow") and RefreshIndicator depend on overscrolling.

If you really don't want the LazyBlock to overscroll, you can wrap it in a custom ScrollConfiguration. Roughly like this:

class MyScrollConfigurationDelegate extends ScrollConfigurationDelegate {
  @override
  TargetPlatform get platform => defaultTargetPlatform;

  // Default is OverscrollWhenScrollableBehavior
  @override
  ExtentScrollBehavior createScrollBehavior() => new BoundedBehavior(platform: platform);

  @override
  bool updateShouldNotify(ScrollConfigurationDelegate old) => false;
}

  new ScrollConfiguration(
    delegate: new MyScrollConfigurationDelegate(),
    child: new LazyBlock(
     ...
    )
  )

@Hixie Hixie modified the milestone: Flutter 1.0 Sep 12, 2016
@lequem
Copy link
Contributor Author

lequem commented Sep 15, 2016

Ok, thank you for your answer!

@lequem lequem closed this as completed Sep 15, 2016
liyuqian added a commit to liyuqian/flutter that referenced this issue Jul 13, 2018
e1cf837 Add ClipMode to ClipPath/ClipRRect and PhysicalShape layers (flutter#5647)
3eb8c04 fix typo in interop code (flutter#5743)
2daa0aa Roll src/third_party/skia 4a17501f5bbd..0df21136e3dc (7 commits) (flutter#5742)
672e587 Background Execution Implementation for iOS (flutter#5539)
500f91b Return a failure exit code in flutter_tester if an uncaught error occurs in a microtask (flutter#5736)
4d49027 gitignore intellij generated folder (flutter#5729)
b11a752 Roll src/third_party/skia 04aa393045c6..4a17501f5bbd (14 commits) (flutter#5741)
75802de Retain the original image's color type when encoding in raw unmodified format (flutter#5735)
eaffe81 Roll src/third_party/skia 5551a94b9e0f..04aa393045c6 (11 commits) (flutter#5731)
f0db204 Roll src/third_party/skia 20326e34b90d..5551a94b9e0f (10 commits) (flutter#5730)
a0f1968 Roll src/third_party/skia f09f6090c87c..20326e34b90d (6 commits) (flutter#5727)
f963e52 Roll src/third_party/skia 4d6a844365e7..f09f6090c87c (1 commits) (flutter#5726)
883aa19 Roll src/third_party/skia 2c312c4f58f9..4d6a844365e7 (2 commits) (flutter#5725)
36238bf Roll src/third_party/skia fcc10da18eb5..2c312c4f58f9 (7 commits) (flutter#5724)
a312733 Roll src/third_party/skia 238069b3f58d..fcc10da18eb5 (3 commits) (flutter#5723)
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

4 participants