Giter Site home page Giter Site logo

Comments (5)

Kavantix avatar Kavantix commented on August 15, 2024

Hi @papmodern thanks for opening an issue!
It would be helpful if you could provide a minimal example that reproduces the problem.

In 0.2.8 I fixed #56 which was also related to NestedScrollView, could you test with 0.2.7 to see if that’s what caused this?

from sliver_tools.

papmodern avatar papmodern commented on August 15, 2024

It is working fine with 0.2.7 too. The bugs is specified only to 0.2.8 version

This is a sample code to demonstrate the problem:

class SampleWidget extends StatelessWidget {
  const SampleWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: NestedScrollView(
          headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
            return <Widget>[
              SliverOverlapAbsorber(
                handle:
                    NestedScrollView.sliverOverlapAbsorberHandleFor(context),
                sliver: MultiSliver(
                  children: [
                    SliverAppBar(
                      pinned: true,
                      title: Text('First AppBar'),
                      expandedHeight: 100,
                      collapsedHeight: 60,
                    ),
                    SliverAppBar(
                      pinned: true,
                      title: Text('Second AppBar'),
                      expandedHeight: 200,
                      collapsedHeight: 60,
                      backgroundColor: Colors.red,
                    ),
                    SliverAppBar(
                      pinned: true,
                      title: Text('Third AppBar'),
                      expandedHeight: 200,
                      collapsedHeight: 60,
                      backgroundColor: Colors.yellow,
                    ),
                  ],
                ),
              ),
            ];
          },
          body: ListView.builder(
            itemBuilder: (c, i) => ListTile(
              title: Text('Item $i'),
            ),
          ),
        ),
      ),
    );
  }
}`

from sliver_tools.

Kavantix avatar Kavantix commented on August 15, 2024

@papmodern are you sure that the problem that existed in #56 is not occurring for you before 0.2.8 (because in my testing it does).
The underscroll bug is actually a bug in flutter itself: flutter/flutter#110937

Either way I would recommend not to use a NestedScrollView, you can implement the example above without it. Note that the behaviour there is also not what you would like to have.

class SampleWidget extends StatelessWidget {
  const SampleWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: CustomScrollView(
          slivers: [
            SliverAppBar(
              pinned: true,
              title: Text('First AppBar'),
              expandedHeight: 100,
              collapsedHeight: 60,
            ),
            SliverAppBar(
              pinned: true,
              title: Text('Second AppBar'),
              expandedHeight: 200,
              collapsedHeight: 60,
              backgroundColor: Colors.red,
            ),
            SliverAppBar(
              pinned: true,
              title: Text('Third AppBar'),
              expandedHeight: 200,
              collapsedHeight: 60,
              backgroundColor: Colors.yellow,
            ),
            SliverList(
              delegate: SliverChildBuilderDelegate(
                (c, i) => ListTile(
                  title: Text('Item $i'),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

from sliver_tools.

Kavantix avatar Kavantix commented on August 15, 2024

Also, SliverAppBar doesnt actually have any code to support multiple pinned ones that can collapse so I would suggest opening an issue in the flutter repo for that

from sliver_tools.

papmodern avatar papmodern commented on August 15, 2024

@Kavantix In the real app I faced the problem, I have tab bar and tab bar view and each tab has its own scrollview. So I have to use NestedScrollView. The code I wrote for you is only for demonstrating the problem. Even SliverOverlapAbsorber is not necessary here and if you remove just this one, everything works fine.
I tried several times and for me it only happens with 0.2.8. I check the version code from pubspec.lock to make sure which version is resolving.

from sliver_tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.