Comments (5)
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.
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.
@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.
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.
@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)
- SliverPinnedHeader and detecting overlapping (i.e. overlapsContent) HOT 1
- Is there any way I can listen when the header sticks to the top?
- Add SliverClip.clipBehavior HOT 1
- SliverPinnedHeader add offsetTop can not work correctly HOT 3
- issues with dynamic list data HOT 2
- AbstractNode is deprecated
- Error: A constant constructor can't call a non-constant super constructor. HOT 2
- Workaround for adding Sliver into an IndexedStack HOT 1
- Flutter 3.13 Compatibility HOT 2
- `SliverList` breaks alignment in `SliverStack` HOT 2
- Flutter build fails with error after new update! HOT 4
- Question: Trying to combine a SliverPinnedHeader with an SliverAppBar that has a bottom widget HOT 4
- Missing tag on GitHub HOT 2
- [Enhancement Request] SliverAnimationSwitcher with transitionBuilder HOT 1
- sliver_tools vs normal slivers HOT 1
- Please provide the full example code from the gif HOT 3
- Multiple SliverPinnedHeader overlapping HOT 2
- How to make it fit with custom ExpansionTile Widget ? HOT 1
- Add SliverSizeTransition HOT 6
- MultiSliver fails in a shrinkwrapped, unconstrained CustomScrollView HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sliver_tools.