fluttercandies / extended_nested_scroll_view

extended nested scroll view to fix following issues. 1.pinned sliver header issue 2.inner scrollables in tabview sync issue 3.pull to refresh is not work. 4.do without ScrollController in NestedScrollView's body
MIT License
592 stars 119 forks source link

Reverse CustomScrollview inside a NestedScrollView does scroll in the wrong direction #13

Closed KorbinianMossandl closed 4 years ago

KorbinianMossandl commented 4 years ago

Steps to Reproduce

I did create a NestedScrollView with a SliverAppBar and a Tabview that consists of CustomScrollViews which are set to reverse = true. Everything works and looks as expected, except that the CustomScorllViews scroll in the opposite direction of the drag/swipe. The SliverAppBar is scrolling correctly. In other words the SliverAppBar and the CustomScrollViews do scroll in different directions.

Please consider this code snippet to reproduce the issue:

    return Scaffold(
      body: NestedScrollView(
        reverse: false,
        headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
          return <Widget>[
            SliverOverlapAbsorber(
              handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
              child: SliverAppBar(
                pinned: true,
                expandedHeight: 80,
                forceElevated: innerBoxIsScrolled,
                flexibleSpace: LayoutBuilder(builder:
                    (BuildContext context, BoxConstraints constraints) {
                  return FlexibleSpaceBar(
                    title: Text("Test"),
                  );
                }),
              ),
            ),
          ];
        },
        body: DefaultTabController(
          length: 3,
          child: TabBarView(
            children: [1, 2, 3].map((int index) {
              return SafeArea(
                top: false,
                bottom: false,
                child: Builder(
                  builder: (BuildContext context) {
                    return CustomScrollView(
                      reverse: true,
                      key: PageStorageKey<String>(index.toString()),
                      slivers: <Widget>[
                        SliverOverlapInjector(
                          handle:
                              NestedScrollView.sliverOverlapAbsorberHandleFor(
                                  context),
                        ),
                        SliverList(
                          delegate: SliverChildBuilderDelegate(
                            (BuildContext context, int index) {
                              return ListTile(title: Text("Item $index"));
                            },
                          ),
                        ),
                      ],
                    );
                  },
                ),
              );
            }).toList(),
          ),
        ),
      ),
    );

This bug also exists in the original NestedScrollView, but since google seems to ignore those issues i was hoping you could solve this problem in your extension?

zmtzawqlp commented 4 years ago

please tell your purpose to set reverse

ManojMMWWIndia commented 4 years ago

You may need to use it in chatting scenario. Where you want to show recent chat text at the bottom.