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

NestedScrollView flutter_gallery Tabs Sample the Scroll state is not right when tab the tabbar #21868

Closed
zmtzawqlp opened this issue Sep 14, 2018 · 28 comments
Labels
customer: crowd Affects or could affect many people, though not necessarily a specific customer. f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. found in release: 1.21 Found to occur in 1.21 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list team Infra upgrades, team productivity, code health, technical debt. See also team: labels.

Comments

@zmtzawqlp
Copy link
Contributor

please run flutter_gallery sample and open sample in Material - Tabs.
issue can be reproduced in dev/master branch, beta branch has no this issue but has crash issue.

Steps to Reproduce

  1. tap APPAREL and scroll to bottom(Blush Sweats)
  2. tap HOME and scroll the list up or down
  3. tap APPAREL the Ginger Scarf will disapper in Screen bottom

and i made a demo based on NestedScrollView. it also has this issue.
i notice that SliverOverlapAbsorber can only used for SliverAppBar, no such thing for SliverPersistentHeader. i think it also effect the scroll behaviour.
more detail please see the gif and my demo code. it's kind of you can have a look for this issue.
thanks.
demo_code.txt
19d422db240762562ac0254626ecf887

@zmtzawqlp zmtzawqlp changed the title flutter_gallery Tabs Sample the Scroll state is right when tab the tabbar flutter_gallery Tabs Sample the Scroll state is not right when tab the tabbar Sep 14, 2018
@zoechi zoechi added the customer: gallery Relating to flutter/gallery repository. Please transfer non-framework issues there. label Sep 14, 2018
@zoechi zoechi added this to the Goals milestone Sep 14, 2018
@zmtzawqlp
Copy link
Contributor Author

zmtzawqlp commented Nov 15, 2018

i have done some things to solve this thing, may be you have better solution 。please check it when you have the time.
i notice innerscrollcontrol is sync the cache scrollpostion, that the problem here.
may be we should only Focus on the active one
https://github.com/fluttercandies/extended_nested_scroll_view

@zoechi zoechi added the team Infra upgrades, team productivity, code health, technical debt. See also team: labels. label Dec 18, 2018
@zmtzawqlp zmtzawqlp changed the title flutter_gallery Tabs Sample the Scroll state is not right when tab the tabbar NestedScrollView flutter_gallery Tabs Sample the Scroll state is not right when tab the tabbar Dec 20, 2018
@KingWu
Copy link

KingWu commented Jun 28, 2019

@zmtzawqlp Awesome. i try your project. Fix the official NestedScrollView issue

@firatcetiner
Copy link

@zmtzawqlp I can't use your plugin. The instructions are unclear for me, but thanks anyway.

@zmtzawqlp
Copy link
Contributor Author

@firatcetiner do as demo show

@Hixie Hixie added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Nov 26, 2019
@Cae2
Copy link

Cae2 commented Jan 3, 2020

@zmtzawqlp I can't use your plugin. The instructions are unclear for me, but thanks anyway.

I didn't understand either how to use it...

Did you found another solution?

@Piinks Piinks added the f: scrolling Viewports, list views, slivers, etc. label Jan 23, 2020
@AlexV525
Copy link
Member

AlexV525 commented Mar 4, 2020

@firatcetiner @Cae2 Feel free to ask about the usage for this plugin at the repository. We don't discuss about the usage here.

@AlexV525
Copy link
Member

AlexV525 commented Mar 4, 2020

This issue also happened when there's multiple scroll view provided, not just TabBarView.
@zoechi @Piinks Is there anyone can handle this case? Almost two year passed.

@VladyslavBondarenko VladyslavBondarenko added customer: crowd Affects or could affect many people, though not necessarily a specific customer. has reproducible steps The issue has been confirmed reproducible and is ready to work on labels Mar 31, 2020
@BrutalCoding
Copy link

BrutalCoding commented May 16, 2020

Encountered the same issues on my end, this feature is quite trivial for more complex apps. How come this hasn't been fixed yet? Tried on latest Master & Beta channels as of today but these issues are still the case for me:

Scaffold with as body -> NestedScrollView, which contains the following:

  • (HeaderSliverBuilder) SliverAppBar overlapping (part of the) content of the tabview body
  • (Body) TabView with 3 CustomScrollViews that are scrolling in sync for some reason, even if they all got their own controller.

@zinwalin
Copy link

same here. it's a big issue, actually.

@kf6gpe kf6gpe added the P2 Important issues not at the top of the work list label May 29, 2020
@VladyslavBondarenko
Copy link

Persists with current master 1.21.0-6.0.pre.129

flutter doctor -v
[✓] Flutter (Channel master, 1.21.0-6.0.pre.129, on Mac OS X 10.15.6 19G73, locale en-GB)
    • Flutter version 1.21.0-6.0.pre.129 at /Users/nevercode/dev/flutter
    • Framework revision 30aef0a3b9 (14 hours ago), 2020-07-30 14:20:21 -0700
    • Engine revision a9910e409c
    • Dart version 2.10.0 (build 2.10.0-1.0.dev 24c7666def)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/nevercode/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.47.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.12.2

[✓] Connected device (6 available)
    • Redmi Note 7 (mobile)       • 6345c469                                 • android-arm64  • Android 9 (API 28)
    • Nevercode’s iPhone (mobile) • b668e524315069f3db3661ac11ff1f66afafebdb • ios            • iOS 13.6
    • iPhone 11 Pro Max (mobile)  • 55C8466B-5367-492B-8EFE-EC45D980571F     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)
    • macOS (desktop)             • macos                                    • darwin-x64     • Mac OS X 10.15.6 19G73
    • Web Server (web)            • web-server                               • web-javascript • Flutter Tools
    • Chrome (web)                • chrome                                   • web-javascript • Google Chrome 84.0.4147.105

• No issues found!

@VladyslavBondarenko VladyslavBondarenko added the found in release: 1.21 Found to occur in 1.21 label Jul 31, 2020
@Hixie Hixie removed this from the None. milestone Aug 17, 2020
@Michael24884
Copy link

Bump. Issue still persists. Using TabView within a NestedScrollView

@mqhamdam
Copy link

did anyone found the solution? exteneded_nested_scroll_view documentation is not clear. and there is not full code.

@pedrohsampaioo
Copy link

I found the same problem. 😐

@zhaopingfu
Copy link

I found the same problem. 😐

@pedrohsampaioo
Copy link

I found the same problem. 😐

@zhaopingfu I found a solution in this video https://www.youtube.com/watch?v=ht76lDzPgUQ that they were adding a PageStorageKey to each ListView or GridView inside the tabs and to avoid using KeepAlive because it doesn't allow scrolling to be undone and redone when changing the page.

zmtzawqlp added a commit to fluttercandies/extended_nested_scroll_view that referenced this issue Jul 30, 2021
* Breaking change:
  1. refactor [ExtendedNestedScrollView].
  2. add [ExtendedNestedScrollView.onlyOneScrollInBody] to solve scroll sync issues(flutter/flutter#21868).
  3. remove [ExtendedNestedScrollView.innerScrollPositionKeyBuilder] and [NestedScrollViewInnerScrollPositionKeyWidget].
zmtzawqlp added a commit to fluttercandies/extended_nested_scroll_view that referenced this issue Jul 30, 2021
* Breaking change:
  1. refactor [ExtendedNestedScrollView].
  2. add [ExtendedNestedScrollView.onlyOneScrollInBody] to solve scroll sync issues(flutter/flutter#21868).
  3. remove [ExtendedNestedScrollView.innerScrollPositionKeyBuilder] and [NestedScrollViewInnerScrollPositionKeyWidget].
@DFelten
Copy link

DFelten commented Nov 11, 2021

Same issue here.

I found the same problem. 😐

@zhaopingfu I found a solution in this video https://www.youtube.com/watch?v=ht76lDzPgUQ that they were adding a PageStorageKey to each ListView or GridView inside the tabs and to avoid using KeepAlive because it doesn't allow scrolling to be undone and redone when changing the page.

Unfortunately when using a PageStorageKey there is an other bug for tabs within a nested scroll view.
When I scroll up the scroll position is lost if floating is true: #81619 (comment)

@iloveq
Copy link

iloveq commented Dec 16, 2021

innerScrollController.addListener(() { outerScrollerController.jumpTo(innerScrollController.offset); });

solved ,do this

@hmTest6
Copy link

hmTest6 commented Jan 11, 2022

innerScrollController.addListener(() { outerScrollerController.jumpTo(innerScrollController.offset); });

solved ,do this

请问i这个代码写在哪里解决这个问题的

@vbuberen
Copy link

Can confirm that issue still exists in 2.8.1

The library suggested above (https://github.com/fluttercandies/extended_nested_scroll_view) helped to solve the problem.

@wangyujie1207
Copy link

Why does this problem still exist

@mrverdant13
Copy link

The issue is still present on version 3.0.4

@bugrevealingbme
Copy link

3.3.10 still ++

@tanlianghao
Copy link

is there a solution to the problem

@iloveq
Copy link

iloveq commented Jan 10, 2023

@greyovo
Copy link

greyovo commented Feb 3, 2023

i have done some things to solve this thing, may be you have better solution 。please check it when you have the time. i notice innerscrollcontrol is sync the cache scrollpostion, that the problem here. may be we should only Focus on the active one https://github.com/fluttercandies/extended_nested_scroll_view

Saved my life thx bro <3

@greyovo
Copy link

greyovo commented Feb 3, 2023

is there a solution to the problem

@tanlianghao check this https://github.com/fluttercandies/extended_nested_scroll_view

@guidezpl guidezpl removed the customer: gallery Relating to flutter/gallery repository. Please transfer non-framework issues there. label Feb 13, 2023
@Piinks
Copy link
Contributor

Piinks commented May 30, 2023

I think this is another case of #40740. I have been scanning the issue tracker looking to consolidate all of these so we can see about a proper solution. I am going to close this since #40740 has the most upvotes, let's follow up there. :)

Thanks for providing test cases, updates and work arounds!

@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 Jun 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer: crowd Affects or could affect many people, though not necessarily a specific customer. f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. found in release: 1.21 Found to occur in 1.21 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list team Infra upgrades, team productivity, code health, technical debt. See also team: labels.
Projects
None yet
Development

No branches or pull requests